mirror of
https://github.com/dart-lang/sdk
synced 2024-09-15 23:09:48 +00:00
Ensure deoptimizing frames have a valid pc marker before deferred materialization.
BUG=http://dartbug.com/26131 R=fschneider@google.com Review URL: https://codereview.chromium.org/1847623002 .
This commit is contained in:
parent
868a5c582c
commit
ba608694b7
|
@ -1793,6 +1793,17 @@ END_LEAF_RUNTIME_ENTRY
|
|||
// materialization phase.
|
||||
DEFINE_RUNTIME_ENTRY(DeoptimizeMaterialize, 0) {
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
#if defined(DEBUG)
|
||||
{
|
||||
// We may rendezvous for a safepoint at entry or GC from the allocations
|
||||
// below. Check the stack is walkable.
|
||||
StackFrameIterator frames_iterator(StackFrameIterator::kValidateFrames);
|
||||
StackFrame* frame = frames_iterator.NextFrame();
|
||||
while (frame != NULL) {
|
||||
frame = frames_iterator.NextFrame();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
DeoptContext* deopt_context = isolate->deopt_context();
|
||||
intptr_t deopt_arg_count = deopt_context->MaterializeDeferredObjects();
|
||||
isolate->set_deopt_context(NULL);
|
||||
|
|
|
@ -666,9 +666,14 @@ class DeoptPcMarkerInstr : public DeoptInstr {
|
|||
return;
|
||||
}
|
||||
|
||||
*dest_addr = reinterpret_cast<intptr_t>(Object::null());
|
||||
deopt_context->DeferPcMarkerMaterialization(
|
||||
object_table_index_, dest_addr);
|
||||
// We don't always have the Code object for the frame's corresponding
|
||||
// unoptimized code as it may have been collected. Use a stub as the pc
|
||||
// marker until we can recreate that Code object during deferred
|
||||
// materialization to maintain the invariant that Dart frames always have
|
||||
// a pc marker.
|
||||
*reinterpret_cast<RawObject**>(dest_addr) =
|
||||
StubCode::FrameAwaitingMaterialization_entry()->code();
|
||||
deopt_context->DeferPcMarkerMaterialization(object_table_index_, dest_addr);
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
@ -63,6 +63,7 @@ class SnapshotWriter;
|
|||
V(Subtype2TestCache) \
|
||||
V(Subtype3TestCache) \
|
||||
V(CallClosureNoSuchMethod) \
|
||||
V(FrameAwaitingMaterialization) \
|
||||
|
||||
// Is it permitted for the stubs above to refer to Object::null(), which is
|
||||
// allocated in the VM isolate and shared across all isolates.
|
||||
|
|
|
@ -2179,6 +2179,11 @@ void StubCode::GenerateICLookupThroughCodeStub(Assembler* assembler) {
|
|||
__ Ret();
|
||||
}
|
||||
|
||||
|
||||
void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) {
|
||||
__ bkpt(0);
|
||||
}
|
||||
|
||||
} // namespace dart
|
||||
|
||||
#endif // defined TARGET_ARCH_ARM
|
||||
|
|
|
@ -2232,6 +2232,11 @@ void StubCode::GenerateICLookupThroughCodeStub(Assembler* assembler) {
|
|||
__ ret();
|
||||
}
|
||||
|
||||
|
||||
void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) {
|
||||
__ brk(0);
|
||||
}
|
||||
|
||||
} // namespace dart
|
||||
|
||||
#endif // defined TARGET_ARCH_ARM64
|
||||
|
|
|
@ -2093,6 +2093,12 @@ void StubCode::GenerateICLookupThroughCodeStub(Assembler* assembler) {
|
|||
__ int3();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) {
|
||||
__ int3();
|
||||
}
|
||||
|
||||
} // namespace dart
|
||||
|
||||
#endif // defined TARGET_ARCH_IA32
|
||||
|
|
|
@ -2345,6 +2345,11 @@ void StubCode::GenerateICLookupThroughCodeStub(Assembler* assembler) {
|
|||
__ Ret();
|
||||
}
|
||||
|
||||
|
||||
void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) {
|
||||
__ break_(0);
|
||||
}
|
||||
|
||||
} // namespace dart
|
||||
|
||||
#endif // defined TARGET_ARCH_MIPS
|
||||
|
|
|
@ -2220,6 +2220,11 @@ void StubCode::GenerateICLookupThroughCodeStub(Assembler* assembler) {
|
|||
__ ret();
|
||||
}
|
||||
|
||||
|
||||
void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) {
|
||||
__ int3();
|
||||
}
|
||||
|
||||
} // namespace dart
|
||||
|
||||
#endif // defined TARGET_ARCH_X64
|
||||
|
|
Loading…
Reference in a new issue