| Index: runtime/vm/stack_frame.cc
|
| diff --git a/runtime/vm/stack_frame.cc b/runtime/vm/stack_frame.cc
|
| index a8ceedf53a7d678b0a839b688e3a5719b05925a7..7e687e49645a07b2ad537d98ee89ca8ba01901a9 100644
|
| --- a/runtime/vm/stack_frame.cc
|
| +++ b/runtime/vm/stack_frame.cc
|
| @@ -22,9 +22,7 @@ namespace dart {
|
|
|
| bool StackFrame::IsStubFrame() const {
|
| ASSERT(!(IsEntryFrame() || IsExitFrame()));
|
| - uword saved_pc =
|
| - *(reinterpret_cast<uword*>(fp() + (kPcMarkerSlotFromFp * kWordSize)));
|
| - return (saved_pc == 0);
|
| + return (LookupDartCode() == Code::null());
|
| }
|
|
|
|
|
| @@ -175,8 +173,11 @@ RawCode* StackFrame::LookupDartCode() const {
|
| // that the code is called while a GC is in progress, that is ok.
|
| NoSafepointScope no_safepoint;
|
| RawCode* code = GetCodeObject();
|
| - ASSERT(code == Code::null() || code->ptr()->owner_ != Function::null());
|
| - return code;
|
| + if ((code != Code::null()) &&
|
| + (code->ptr()->owner_->GetClassId() == kFunctionCid)) {
|
| + return code;
|
| + }
|
| + return Code::null();
|
| }
|
|
|
|
|
| @@ -188,12 +189,12 @@ RawCode* StackFrame::GetCodeObject() const {
|
| const uword pc_marker =
|
| *(reinterpret_cast<uword*>(fp() + (kPcMarkerSlotFromFp * kWordSize)));
|
| 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_;
|
| - }
|
| +#if defined(TARGET_ARCH_X64)
|
| + ASSERT(reinterpret_cast<RawObject*>(pc_marker)->GetClassId() == kCodeCid);
|
| + return reinterpret_cast<RawCode*>(pc_marker);
|
| +#else
|
| + UNIMPLEMENTED();
|
| +#endif
|
| }
|
| return Code::null();
|
| }
|
|
|