Index: runtime/vm/object.cc |
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
index 2f81276c2f353ddda04425c8e472b76665f76d51..498db3a4d8cc01cd96347af4096286a642aee4fd 100644 |
--- a/runtime/vm/object.cc |
+++ b/runtime/vm/object.cc |
@@ -13478,9 +13478,10 @@ bool Code::IsFunctionCode() const { |
void Code::DisableDartCode() const { |
DEBUG_ASSERT(IsMutatorOrAtSafepoint()); |
ASSERT(IsFunctionCode()); |
- ASSERT(instructions() == active_instructions()); |
+ ASSERT(!IsDisabled()); |
const Code& new_code = |
Code::Handle(StubCode::FixCallersTarget_entry()->code()); |
+ ASSERT(new_code.instructions()->IsVMHeapObject()); |
SetActiveInstructions(new_code.instructions()); |
} |
@@ -13488,9 +13489,10 @@ void Code::DisableDartCode() const { |
void Code::DisableStubCode() const { |
ASSERT(Thread::Current()->IsMutatorThread()); |
ASSERT(IsAllocationStubCode()); |
- ASSERT(instructions() == active_instructions()); |
+ ASSERT(!IsDisabled()); |
const Code& new_code = |
Code::Handle(StubCode::FixAllocationStubTarget_entry()->code()); |
+ ASSERT(new_code.instructions()->IsVMHeapObject()); |
SetActiveInstructions(new_code.instructions()); |
} |
@@ -13499,7 +13501,6 @@ void Code::SetActiveInstructions(RawInstructions* instructions) const { |
DEBUG_ASSERT(IsMutatorOrAtSafepoint() || !is_alive()); |
// RawInstructions are never allocated in New space and hence a |
// store buffer update is not needed here. |
- StorePointer(&raw_ptr()->active_instructions_, instructions); |
StoreNonPointer(&raw_ptr()->entry_point_, |
reinterpret_cast<uword>(instructions->ptr()) + |
Instructions::HeaderSize()); |