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

Unified Diff: runtime/vm/object.cc

Issue 2416963009: Minor cleanup: use handle when setting instructions in code object. (Closed)
Patch Set: Created 4 years, 2 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/precompiler.cc » ('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 c9d92c23b8bc7a29475194c4bf5cc9722de0694b..df5a0be1d384e91eb2f21732882522ace6db37b2 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -14293,8 +14293,8 @@ RawCode* Code::FinalizeCode(const char* name,
}
// Hook up Code and Instructions objects.
- code.SetActiveInstructions(instrs.raw());
- code.set_instructions(instrs.raw());
+ code.SetActiveInstructions(instrs);
+ code.set_instructions(instrs);
code.set_is_alive(true);
// Set object pool in Instructions object.
@@ -14506,7 +14506,7 @@ void Code::DisableDartCode() const {
ASSERT(instructions() == active_instructions());
const Code& new_code =
Code::Handle(StubCode::FixCallersTarget_entry()->code());
- SetActiveInstructions(new_code.instructions());
+ SetActiveInstructions(Instructions::Handle(new_code.instructions()));
}
@@ -14517,7 +14517,7 @@ void Code::DisableStubCode() const {
ASSERT(instructions() == active_instructions());
const Code& new_code =
Code::Handle(StubCode::FixAllocationStubTarget_entry()->code());
- SetActiveInstructions(new_code.instructions());
+ SetActiveInstructions(Instructions::Handle(new_code.instructions()));
#else
// DBC does not use allocation stubs.
UNIMPLEMENTED();
@@ -14525,18 +14525,18 @@ void Code::DisableStubCode() const {
}
-void Code::SetActiveInstructions(RawInstructions* instructions) const {
+void Code::SetActiveInstructions(const Instructions& instructions) const {
#if defined(DART_PRECOMPILED_RUNTIME)
UNREACHABLE();
#else
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);
+ StorePointer(&raw_ptr()->active_instructions_, instructions.raw());
StoreNonPointer(&raw_ptr()->entry_point_,
- Instructions::UncheckedEntryPoint(instructions));
+ Instructions::UncheckedEntryPoint(instructions.raw()));
StoreNonPointer(&raw_ptr()->checked_entry_point_,
- Instructions::CheckedEntryPoint(instructions));
+ Instructions::CheckedEntryPoint(instructions.raw()));
#endif
}
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/precompiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698