mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
[vm, bytecode] Fix Interpreter::Current when called for the first time outside of kThreadInGenerated state.
Fixes vm/cc/FunctionWithBreakpointNotInlined. Change-Id: Ie1e7616559c0d758477494c26f03e6ffde0b5e43 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107683 Reviewed-by: Alexander Markov <alexmarkov@google.com> Reviewed-by: Régis Crelier <regis@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
parent
f91375405e
commit
55370b8b17
|
@ -404,9 +404,9 @@ Interpreter* Interpreter::Current() {
|
|||
Thread* thread = Thread::Current();
|
||||
Interpreter* interpreter = thread->interpreter();
|
||||
if (interpreter == nullptr) {
|
||||
TransitionGeneratedToVM transition(thread);
|
||||
NoSafepointScope no_safepoint;
|
||||
interpreter = new Interpreter();
|
||||
Thread::Current()->set_interpreter(interpreter);
|
||||
thread->set_interpreter(interpreter);
|
||||
}
|
||||
return interpreter;
|
||||
}
|
||||
|
|
|
@ -829,10 +829,12 @@ uword Simulator::FunctionForRedirect(uword redirect) {
|
|||
|
||||
// Get the active Simulator for the current isolate.
|
||||
Simulator* Simulator::Current() {
|
||||
Simulator* simulator = Isolate::Current()->simulator();
|
||||
Isolate* isolate = Isolate::Current();
|
||||
Simulator* simulator = isolate->simulator();
|
||||
if (simulator == NULL) {
|
||||
NoSafepointScope no_safepoint;
|
||||
simulator = new Simulator();
|
||||
Isolate::Current()->set_simulator(simulator);
|
||||
isolate->set_simulator(simulator);
|
||||
}
|
||||
return simulator;
|
||||
}
|
||||
|
|
|
@ -869,10 +869,12 @@ uword Simulator::FunctionForRedirect(uword redirect) {
|
|||
|
||||
// Get the active Simulator for the current isolate.
|
||||
Simulator* Simulator::Current() {
|
||||
Simulator* simulator = Isolate::Current()->simulator();
|
||||
Isolate* isolate = Isolate::Current();
|
||||
Simulator* simulator = isolate->simulator();
|
||||
if (simulator == NULL) {
|
||||
NoSafepointScope no_safepoint;
|
||||
simulator = new Simulator();
|
||||
Isolate::Current()->set_simulator(simulator);
|
||||
isolate->set_simulator(simulator);
|
||||
}
|
||||
return simulator;
|
||||
}
|
||||
|
|
|
@ -584,10 +584,12 @@ Simulator::~Simulator() {
|
|||
|
||||
// Get the active Simulator for the current isolate.
|
||||
Simulator* Simulator::Current() {
|
||||
Simulator* simulator = Isolate::Current()->simulator();
|
||||
Isolate* isolate = Isolate::Current();
|
||||
Simulator* simulator = isolate->simulator();
|
||||
if (simulator == NULL) {
|
||||
NoSafepointScope no_safepoint;
|
||||
simulator = new Simulator();
|
||||
Isolate::Current()->set_simulator(simulator);
|
||||
isolate->set_simulator(simulator);
|
||||
}
|
||||
return simulator;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue