Index: runtime/vm/object.cc |
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
index 145791fdc209d4d1beda8287491bc1fc5c2bff52..878afc112edf033a4ceb3e29be345d6841afc8f2 100644 |
--- a/runtime/vm/object.cc |
+++ b/runtime/vm/object.cc |
@@ -13518,26 +13518,6 @@ void Code::set_static_calls_target_table(const Array& value) const { |
} |
-uword Code::EntryPoint() const { |
- RawObject* instr = instructions(); |
- if (!instr->IsHeapObject()) { |
- return active_entry_point(); |
- } else { |
- return Instructions::EntryPoint(instructions()); |
- } |
-} |
- |
- |
-intptr_t Code::Size() const { |
- RawObject* instr = instructions(); |
- if (!instr->IsHeapObject()) { |
- return Smi::Value(raw_ptr()->precompiled_instructions_size_); |
- } else { |
- return instructions()->ptr()->size_; |
- } |
-} |
- |
- |
bool Code::HasBreakpoint() const { |
if (!FLAG_support_debugger) { |
return false; |
@@ -13883,13 +13863,10 @@ RawCode* Code::FinalizeCode(const char* name, |
} |
// Hook up Code and Instructions objects. |
- code.set_instructions(instrs.raw()); |
code.SetActiveInstructions(instrs.raw()); |
+ code.set_instructions(instrs.raw()); |
code.set_is_alive(true); |
- ASSERT(code.EntryPoint() == instrs.EntryPoint()); |
- ASSERT(code.Size() == instrs.size()); |
- |
// Set object pool in Instructions object. |
INC_STAT(Thread::Current(), |
total_code_size, object_pool.Length() * sizeof(uintptr_t)); |
@@ -14092,10 +14069,9 @@ bool Code::IsFunctionCode() const { |
void Code::DisableDartCode() const { |
DEBUG_ASSERT(IsMutatorOrAtSafepoint()); |
ASSERT(IsFunctionCode()); |
- ASSERT(!IsDisabled()); |
+ ASSERT(instructions() == active_instructions()); |
const Code& new_code = |
Code::Handle(StubCode::FixCallersTarget_entry()->code()); |
- ASSERT(new_code.instructions()->IsVMHeapObject()); |
SetActiveInstructions(new_code.instructions()); |
} |
@@ -14104,10 +14080,9 @@ void Code::DisableStubCode() const { |
#if !defined(TARGET_ARCH_DBC) |
ASSERT(Thread::Current()->IsMutatorThread()); |
ASSERT(IsAllocationStubCode()); |
- ASSERT(!IsDisabled()); |
+ ASSERT(instructions() == active_instructions()); |
const Code& new_code = |
Code::Handle(StubCode::FixAllocationStubTarget_entry()->code()); |
- ASSERT(new_code.instructions()->IsVMHeapObject()); |
SetActiveInstructions(new_code.instructions()); |
#else |
// DBC does not use allocation stubs. |
@@ -14120,6 +14095,7 @@ 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()); |