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

Unified Diff: runtime/vm/raw_object.cc

Issue 1343373003: Revert "VM: New calling convention for generated code." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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/raw_object.h ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object.cc
diff --git a/runtime/vm/raw_object.cc b/runtime/vm/raw_object.cc
index 74013a6d5474f84e74143baf56aa710b0022a27f..47e9306c47c11bb85cdb82a4d55fe9622e866df2 100644
--- a/runtime/vm/raw_object.cc
+++ b/runtime/vm/raw_object.cc
@@ -439,9 +439,9 @@ intptr_t RawFunction::VisitFunctionPointers(RawFunction* raw_obj,
}
visitor->VisitPointers(raw_obj->from(), raw_obj->to_no_code());
- if (ShouldVisitCode(raw_obj->ptr()->code_)) {
+ if (ShouldVisitCode(raw_obj->ptr()->instructions_->ptr()->code_)) {
visitor->VisitPointer(
- reinterpret_cast<RawObject**>(&raw_obj->ptr()->code_));
+ reinterpret_cast<RawObject**>(&raw_obj->ptr()->instructions_));
} else {
visitor->add_skipped_code_function(raw_obj);
}
@@ -505,16 +505,6 @@ intptr_t RawNamespace::VisitNamespacePointers(
}
-bool RawCode::ContainsPC(RawObject* raw_obj, uword pc) {
- uword tags = raw_obj->ptr()->tags_;
- if (RawObject::ClassIdTag::decode(tags) == kCodeCid) {
- RawCode* raw_code = reinterpret_cast<RawCode*>(raw_obj);
- return RawInstructions::ContainsPC(raw_code->ptr()->instructions_, pc);
- }
- return false;
-}
-
-
intptr_t RawCode::VisitCodePointers(RawCode* raw_obj,
ObjectPointerVisitor* visitor) {
visitor->VisitPointers(raw_obj->from(), raw_obj->to());
@@ -556,16 +546,24 @@ intptr_t RawObjectPool::VisitObjectPoolPointers(
intptr_t RawInstructions::VisitInstructionsPointers(
RawInstructions* raw_obj, ObjectPointerVisitor* visitor) {
RawInstructions* obj = raw_obj->ptr();
+ visitor->VisitPointers(raw_obj->from(), raw_obj->to());
return Instructions::InstanceSize(obj->size_);
}
-bool RawInstructions::ContainsPC(RawInstructions* raw_instr, uword pc) {
- uword start_pc =
- reinterpret_cast<uword>(raw_instr->ptr()) + Instructions::HeaderSize();
- uword end_pc = start_pc + raw_instr->ptr()->size_;
- ASSERT(end_pc > start_pc);
- return (pc >= start_pc) && (pc < end_pc);
+bool RawInstructions::ContainsPC(RawObject* raw_obj, uword pc) {
+ uword tags = raw_obj->ptr()->tags_;
+ if (RawObject::ClassIdTag::decode(tags) == kInstructionsCid) {
+ RawInstructions* raw_instr = reinterpret_cast<RawInstructions*>(raw_obj);
+ uword start_pc =
+ reinterpret_cast<uword>(raw_instr->ptr()) + Instructions::HeaderSize();
+ uword end_pc = start_pc + raw_instr->ptr()->size_;
+ ASSERT(end_pc > start_pc);
+ if ((pc >= start_pc) && (pc < end_pc)) {
+ return true;
+ }
+ }
+ return false;
}
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698