Skip to content

Commit b916392

Browse files
rmacnak-googleCommit Queue
authored andcommitted
[vm] Move handle check after barrier in CompileFunction runtime entry.
Remove redundant AOT runtime guard against compilation. TEST=tsan Bug: #53718 Change-Id: I1f1b5b0f01cfa08c13b3d3b7695297fac02c9cce Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431300 Reviewed-by: Alexander Aprelev <[email protected]> Commit-Queue: Ryan Macnak <[email protected]>
1 parent 18aa7d3 commit b916392

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

runtime/vm/compiler/jit/compiler.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,20 +1215,20 @@ bool Compiler::CanOptimizeFunction(Thread* thread, const Function& function) {
12151215
}
12161216

12171217
ObjectPtr Compiler::CompileFunction(Thread* thread, const Function& function) {
1218-
FATAL("Attempt to compile function %s", function.ToCString());
1218+
FATAL("Attempt to compile function %s", function.ToFullyQualifiedCString());
12191219
return Error::null();
12201220
}
12211221

12221222
ErrorPtr Compiler::EnsureUnoptimizedCode(Thread* thread,
12231223
const Function& function) {
1224-
FATAL("Attempt to compile function %s", function.ToCString());
1224+
FATAL("Attempt to compile function %s", function.ToFullyQualifiedCString());
12251225
return Error::null();
12261226
}
12271227

12281228
ObjectPtr Compiler::CompileOptimizedFunction(Thread* thread,
12291229
const Function& function,
12301230
intptr_t osr_id) {
1231-
FATAL("Attempt to compile function %s", function.ToCString());
1231+
FATAL("Attempt to compile function %s", function.ToFullyQualifiedCString());
12321232
return Error::null();
12331233
}
12341234

runtime/vm/runtime_entry.cc

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3569,14 +3569,7 @@ DEFINE_RUNTIME_ENTRY(TraceICCall, 2) {
35693569
// Arg0: function object.
35703570
DEFINE_RUNTIME_ENTRY(CompileFunction, 1) {
35713571
ASSERT(thread->IsDartMutatorThread());
3572-
const Function& function = Function::CheckedHandle(zone, arguments.ArgAt(0));
35733572

3574-
#if defined(DART_PRECOMPILED_RUNTIME)
3575-
FATAL("Precompilation missed function %s (%s, %s)\n",
3576-
function.ToLibNamePrefixedQualifiedCString(),
3577-
function.token_pos().ToCString(),
3578-
Function::KindToCString(function.kind()));
3579-
#else
35803573
{
35813574
// Another isolate's mutator thread may have created [function] and
35823575
// published it via an ICData, MegamorphicCache etc. Entering the lock below
@@ -3586,9 +3579,11 @@ DEFINE_RUNTIME_ENTRY(CompileFunction, 1) {
35863579
SafepointReadRwLocker ml(thread, thread->isolate_group()->program_lock());
35873580
}
35883581

3582+
// After the barrier, since this will read the object's header.
3583+
const Function& function = Function::CheckedHandle(zone, arguments.ArgAt(0));
3584+
35893585
// Will throw if compilation failed (e.g. with compile-time error).
35903586
function.EnsureHasCode();
3591-
#endif
35923587
}
35933588

35943589
// This is called from function that needs to be optimized.

0 commit comments

Comments
 (0)