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

Unified Diff: runtime/vm/stack_frame.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/stack_frame.h ('k') | runtime/vm/stack_frame_arm.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stack_frame.cc
diff --git a/runtime/vm/stack_frame.cc b/runtime/vm/stack_frame.cc
index c0fe354839bfcf4e5b90169692ccb3b0508a9dd4..bf5a05d4bdf51e2896b2415bbeaab9117691771e 100644
--- a/runtime/vm/stack_frame.cc
+++ b/runtime/vm/stack_frame.cc
@@ -22,7 +22,9 @@ namespace dart {
bool StackFrame::IsStubFrame() const {
ASSERT(!(IsEntryFrame() || IsExitFrame()));
- return (LookupDartCode() == Code::null());
+ uword saved_pc =
+ *(reinterpret_cast<uword*>(fp() + (kPcMarkerSlotFromFp * kWordSize)));
+ return (saved_pc == 0);
}
@@ -173,11 +175,8 @@ RawCode* StackFrame::LookupDartCode() const {
// that the code is called while a GC is in progress, that is ok.
NoSafepointScope no_safepoint;
RawCode* code = GetCodeObject();
- if ((code != Code::null()) &&
- (code->ptr()->owner_->GetClassId() == kFunctionCid)) {
- return code;
- }
- return Code::null();
+ ASSERT(code == Code::null() || code->ptr()->owner_ != Function::null());
+ return code;
}
@@ -188,10 +187,15 @@ RawCode* StackFrame::GetCodeObject() const {
NoSafepointScope no_safepoint;
const uword pc_marker =
*(reinterpret_cast<uword*>(fp() + (kPcMarkerSlotFromFp * kWordSize)));
- ASSERT(pc_marker != 0);
- ASSERT(reinterpret_cast<RawObject*>(pc_marker)->GetClassId() == kCodeCid ||
- reinterpret_cast<RawObject*>(pc_marker) == Object::null());
- return reinterpret_cast<RawCode*>(pc_marker);
+ if (pc_marker != 0) {
+ const uword entry_point =
+ (pc_marker - Assembler::EntryPointToPcMarkerOffset());
+ RawInstructions* instr = Instructions::FromEntryPoint(entry_point);
+ if (instr != Instructions::null()) {
+ return instr->ptr()->code_;
+ }
+ }
+ return Code::null();
}
« no previous file with comments | « runtime/vm/stack_frame.h ('k') | runtime/vm/stack_frame_arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698