| 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" |
| 11 #include "vm/object.h" | 11 #include "vm/object.h" |
| 12 #include "vm/object_store.h" | 12 #include "vm/object_store.h" |
| 13 #include "vm/os.h" | 13 #include "vm/os.h" |
| 14 #include "vm/parser.h" | 14 #include "vm/parser.h" |
| 15 #include "vm/raw_object.h" | 15 #include "vm/raw_object.h" |
| 16 #include "vm/reusable_handles.h" | 16 #include "vm/reusable_handles.h" |
| 17 #include "vm/stub_code.h" | 17 #include "vm/stub_code.h" |
| 18 #include "vm/visitor.h" | 18 #include "vm/visitor.h" |
| 19 | 19 |
| 20 namespace dart { | 20 namespace dart { |
| 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(HOST_OS_WINDOWS) | 25 #if !defined(HOST_OS_WINDOWS) && !defined(HOST_OS_FUCHSIA) |
| 26 // On Windows, the profiler calls this from a separate thread where | 26 // On Windows and Fuchsia, the profiler calls this from a separate thread |
| 27 // Thread::Current() is NULL, so we cannot create a NoSafepointScope. | 27 // where 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 ASSERT(code != Object::null()); | 31 ASSERT(code != Object::null()); |
| 32 const intptr_t cid = code->ptr()->owner_->GetClassId(); | 32 const intptr_t cid = code->ptr()->owner_->GetClassId(); |
| 33 ASSERT(cid == kNullCid || cid == kClassCid || cid == kFunctionCid); | 33 ASSERT(cid == kNullCid || cid == kClassCid || cid == kFunctionCid); |
| 34 return cid == kNullCid || cid == kClassCid; | 34 return cid == kNullCid || cid == kClassCid; |
| 35 } | 35 } |
| 36 | 36 |
| 37 | 37 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 return code.function(); | 211 return code.function(); |
| 212 } | 212 } |
| 213 return Function::null(); | 213 return Function::null(); |
| 214 } | 214 } |
| 215 | 215 |
| 216 | 216 |
| 217 RawCode* StackFrame::LookupDartCode() const { | 217 RawCode* StackFrame::LookupDartCode() const { |
| 218 // We add a no gc scope to ensure that the code below does not trigger | 218 // We add a no gc scope to ensure that the code below does not trigger |
| 219 // a GC as we are handling raw object references here. It is possible | 219 // a GC as we are handling raw object references here. It is possible |
| 220 // that the code is called while a GC is in progress, that is ok. | 220 // that the code is called while a GC is in progress, that is ok. |
| 221 #if !defined(HOST_OS_WINDOWS) | 221 #if !defined(HOST_OS_WINDOWS) && !defined(HOST_OS_FUCHSIA) |
| 222 // On Windows, the profiler calls this from a separate thread where | 222 // On Windows and Fuchsia, the profiler calls this from a separate thread |
| 223 // Thread::Current() is NULL, so we cannot create a NoSafepointScope. | 223 // where Thread::Current() is NULL, so we cannot create a NoSafepointScope. |
| 224 NoSafepointScope no_safepoint; | 224 NoSafepointScope no_safepoint; |
| 225 #endif | 225 #endif |
| 226 RawCode* code = GetCodeObject(); | 226 RawCode* code = GetCodeObject(); |
| 227 if ((code != Code::null()) && | 227 if ((code != Code::null()) && |
| 228 (code->ptr()->owner_->GetClassId() == kFunctionCid)) { | 228 (code->ptr()->owner_->GetClassId() == kFunctionCid)) { |
| 229 return code; | 229 return code; |
| 230 } | 230 } |
| 231 return Code::null(); | 231 return Code::null(); |
| 232 } | 232 } |
| 233 | 233 |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 StackFrameIterator::kNoCrossThreadIteration); | 584 StackFrameIterator::kNoCrossThreadIteration); |
| 585 StackFrame* frame = frames.NextFrame(); | 585 StackFrame* frame = frames.NextFrame(); |
| 586 while (frame != NULL) { | 586 while (frame != NULL) { |
| 587 frame = frames.NextFrame(); | 587 frame = frames.NextFrame(); |
| 588 } | 588 } |
| 589 } | 589 } |
| 590 #endif | 590 #endif |
| 591 | 591 |
| 592 | 592 |
| 593 } // namespace dart | 593 } // namespace dart |
| OLD | NEW |