Skip to content

Commit

Permalink
[vm/concurrency] Allow code to be already installed when arriving in …
Browse files Browse the repository at this point in the history
…CompileFunction runtime entry

Issue dart-lang/sdk#36097

TEST=Tests using --enable-isolate-groups with JIT sharing.

Change-Id: I155eef4731312f55f6c14a81aa0333cb84b70131
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175300
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
  • Loading branch information
mkustermann authored and commit-bot@chromium.org committed Dec 8, 2020
1 parent f03d4bc commit c549ecf
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions runtime/vm/compiler/jit/compiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -211,17 +211,15 @@ CompilationPipeline* CompilationPipeline::New(Zone* zone,
DEFINE_RUNTIME_ENTRY(CompileFunction, 1) {
ASSERT(thread->IsMutatorThread());
const Function& function = Function::CheckedHandle(zone, arguments.ArgAt(0));
Object& result = Object::Handle(zone);
ASSERT(!function.HasCode());

result = Compiler::CompileFunction(thread, function);
if (result.IsError()) {
if (result.IsLanguageError()) {
Exceptions::ThrowCompileTimeError(LanguageError::Cast(result));
UNREACHABLE();
}
Exceptions::PropagateError(Error::Cast(result));
}
// In single-isolate scenarios the lazy compile stub is only invoked if
// there's no existing code. In multi-isolate scenarios with shared JITed code
// we can end up in the lazy compile runtime entry here with code being
// installed.
ASSERT(!function.HasCode() || FLAG_enable_isolate_groups);

// Will throw if compilation failed (e.g. with compile-time error).
function.EnsureHasCode();
}

bool Compiler::CanOptimizeFunction(Thread* thread, const Function& function) {
Expand Down

0 comments on commit c549ecf

Please sign in to comment.