Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[vm] Fix data race in Function::unoptimized_code (#61800) #61823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Hassnaa9 wants to merge 2 commits into dart-lang:main
base: main
Choose a base branch
Loading
from Hassnaa9:fix-unoptimized-code-data-race
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion runtime/vm/object.cc
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -8546,7 +8546,7 @@ void Function::set_unoptimized_code(const Code& value) const {
#else
DEBUG_ASSERT(IsMutatorOrAtDeoptSafepoint());
ASSERT(value.IsNull() || !value.is_optimized());
untag()->set_unoptimized_code(value.ptr());
untag()->set_unoptimized_code<std::memory_order_release>(value.ptr());
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion runtime/vm/object.h
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -3250,7 +3250,7 @@ class Function : public Object {
#if defined(DART_PRECOMPILED_RUNTIME)
return static_cast<CodePtr>(Object::null());
#else
return untag()->unoptimized_code();
return untag()->unoptimized_code<std::memory_order_acquire>();
#endif
}
void set_unoptimized_code(const Code& value) const;
Expand Down
1 change: 0 additions & 1 deletion runtime/vm/parser.cc
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ namespace dart {
ParsedFunction::ParsedFunction(Thread* thread, const Function& function)
: thread_(thread),
function_(function),
code_(Code::Handle(zone(), function.unoptimized_code())),
scope_(nullptr),
regexp_compile_data_(nullptr),
function_type_arguments_(nullptr),
Expand Down
2 changes: 0 additions & 2 deletions runtime/vm/parser.h
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ class ParsedFunction : public ZoneAllocated {
ParsedFunction(Thread* thread, const Function& function);

const Function& function() const { return function_; }
const Code& code() const { return code_; }

LocalScope* scope() const { return scope_; }
void set_scope(LocalScope* scope) {
Expand Down Expand Up @@ -294,7 +293,6 @@ class ParsedFunction : public ZoneAllocated {
private:
Thread* thread_;
const Function& function_;
Code& code_;
LocalScope* scope_;
RegExpCompileData* regexp_compile_data_;
LocalVariable* function_type_arguments_;
Expand Down

AltStyle によって変換されたページ (->オリジナル) /