Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1101)

Unified Diff: runtime/vm/object.cc

Issue 1820333002: Reapply "Remove Code::active_instructions_." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 8922db4430cc2d38d1b74fb170ef72f52ebda201..d76324660d3ac9400b7bb7762eb411d226da3cc0 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -13500,9 +13500,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());
}
@@ -13510,9 +13511,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());
}
@@ -13521,7 +13523,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());
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698