Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/stack_frame.h" | 5 #include "vm/stack_frame.h" |
| 6 | 6 |
| 7 #include "platform/memory_sanitizer.h" | 7 #include "platform/memory_sanitizer.h" |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/deopt_instructions.h" | 9 #include "vm/deopt_instructions.h" |
| 10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 | 21 |
| 22 | 22 |
| 23 bool StackFrame::IsStubFrame() const { | 23 bool StackFrame::IsStubFrame() const { |
| 24 ASSERT(!(IsEntryFrame() || IsExitFrame())); | 24 ASSERT(!(IsEntryFrame() || IsExitFrame())); |
| 25 #if !defined(TARGET_OS_WINDOWS) | 25 #if !defined(TARGET_OS_WINDOWS) |
| 26 // On Windows, the profiler calls this from a separate thread where | 26 // On Windows, the profiler calls this from a separate thread where |
| 27 // Thread::Current() is NULL, so we cannot create a NoSafepointScope. | 27 // Thread::Current() is NULL, so we cannot create a NoSafepointScope. |
| 28 NoSafepointScope no_safepoint; | 28 NoSafepointScope no_safepoint; |
| 29 #endif | 29 #endif |
| 30 RawCode* code = GetCodeObject(); | 30 RawCode* code = GetCodeObject(); |
| 31 intptr_t cid = code->ptr()->owner_->GetClassId(); | 31 if (code == Code::null()) { |
| 32 // Frame not yet set up properly (e.g,deoptimization). | |
| 33 // This is slow, but rare. | |
| 34 const Code& code = Code::Handle(Code::LookupCode(pc())); | |
| 35 return code.IsStubCode(); | |
|
rmacnak
2016/03/23 19:44:19
assert code not null
srdjan
2016/03/23 19:48:22
Done.
| |
| 36 } | |
| 37 const intptr_t cid = code->ptr()->owner_->GetClassId(); | |
| 32 ASSERT(cid == kNullCid || cid == kClassCid || cid == kFunctionCid); | 38 ASSERT(cid == kNullCid || cid == kClassCid || cid == kFunctionCid); |
| 33 return cid == kNullCid || cid == kClassCid; | 39 return cid == kNullCid || cid == kClassCid; |
| 34 } | 40 } |
| 35 | 41 |
| 36 | 42 |
| 37 const char* StackFrame::ToCString() const { | 43 const char* StackFrame::ToCString() const { |
| 38 ASSERT(thread_ == Thread::Current()); | 44 ASSERT(thread_ == Thread::Current()); |
| 39 Zone* zone = Thread::Current()->zone(); | 45 Zone* zone = Thread::Current()->zone(); |
| 40 if (IsDartFrame()) { | 46 if (IsDartFrame()) { |
| 41 const Code& code = Code::Handle(LookupDartCode()); | 47 const Code& code = Code::Handle(LookupDartCode()); |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 490 if (deopt_instr->kind() == DeoptInstr::kCallerFp) { | 496 if (deopt_instr->kind() == DeoptInstr::kCallerFp) { |
| 491 return (index - num_materializations_); | 497 return (index - num_materializations_); |
| 492 } | 498 } |
| 493 } | 499 } |
| 494 UNREACHABLE(); | 500 UNREACHABLE(); |
| 495 return 0; | 501 return 0; |
| 496 } | 502 } |
| 497 | 503 |
| 498 | 504 |
| 499 } // namespace dart | 505 } // namespace dart |
| OLD | NEW |