| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 | 64 |
| 65 | 65 |
| 66 void ExitFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) { | 66 void ExitFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) { |
| 67 // There are no objects to visit in this frame. | 67 // There are no objects to visit in this frame. |
| 68 } | 68 } |
| 69 | 69 |
| 70 | 70 |
| 71 void EntryFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) { | 71 void EntryFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) { |
| 72 #if !defined(TARGET_ARCH_DBC) | |
| 73 ASSERT(thread() == Thread::Current()); | 72 ASSERT(thread() == Thread::Current()); |
| 74 // Visit objects between SP and (FP - callee_save_area). | 73 // Visit objects between SP and (FP - callee_save_area). |
| 75 ASSERT(visitor != NULL); | 74 ASSERT(visitor != NULL); |
| 75 #if !defined(TARGET_ARCH_DBC) |
| 76 RawObject** first = reinterpret_cast<RawObject**>(sp()); | 76 RawObject** first = reinterpret_cast<RawObject**>(sp()); |
| 77 RawObject** last = reinterpret_cast<RawObject**>( | 77 RawObject** last = reinterpret_cast<RawObject**>( |
| 78 fp() + (kExitLinkSlotFromEntryFp - 1) * kWordSize); | 78 fp() + (kExitLinkSlotFromEntryFp - 1) * kWordSize); |
| 79 visitor->VisitPointers(first, last); | 79 visitor->VisitPointers(first, last); |
| 80 #else | 80 #else |
| 81 // On DBC stack is growing upwards which implies fp() <= sp(). | 81 // On DBC stack is growing upwards which implies fp() <= sp(). |
| 82 RawObject** first = reinterpret_cast<RawObject**>(fp()); | 82 RawObject** first = reinterpret_cast<RawObject**>(fp()); |
| 83 RawObject** last = reinterpret_cast<RawObject**>(sp()); | 83 RawObject** last = reinterpret_cast<RawObject**>(sp()); |
| 84 visitor->VisitPointers(first, last); | 84 visitor->VisitPointers(first, last); |
| 85 #endif | 85 #endif |
| 86 } | 86 } |
| 87 | 87 |
| 88 | 88 |
| 89 void StackFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) { | 89 void StackFrame::VisitObjectPointers(ObjectPointerVisitor* visitor) { |
| 90 ASSERT(thread() == Thread::Current()); |
| 91 ASSERT(visitor != NULL); |
| 90 #if !defined(TARGET_ARCH_DBC) | 92 #if !defined(TARGET_ARCH_DBC) |
| 91 // NOTE: This code runs while GC is in progress and runs within | 93 // NOTE: This code runs while GC is in progress and runs within |
| 92 // a NoHandleScope block. Hence it is not ok to use regular Zone or | 94 // a NoHandleScope block. Hence it is not ok to use regular Zone or |
| 93 // Scope handles. We use direct stack handles, the raw pointers in | 95 // Scope handles. We use direct stack handles, the raw pointers in |
| 94 // these handles are not traversed. The use of handles is mainly to | 96 // these handles are not traversed. The use of handles is mainly to |
| 95 // be able to reuse the handle based code and avoid having to add | 97 // be able to reuse the handle based code and avoid having to add |
| 96 // helper functions to the raw object interface. | 98 // helper functions to the raw object interface. |
| 97 ASSERT(thread() == Thread::Current()); | |
| 98 ASSERT(visitor != NULL); | |
| 99 NoSafepointScope no_safepoint; | 99 NoSafepointScope no_safepoint; |
| 100 Code code; | 100 Code code; |
| 101 code = LookupDartCode(); | 101 code = LookupDartCode(); |
| 102 if (!code.IsNull()) { | 102 if (!code.IsNull()) { |
| 103 // Visit the code object. | 103 // Visit the code object. |
| 104 RawObject* raw_code = code.raw(); | 104 RawObject* raw_code = code.raw(); |
| 105 visitor->VisitPointer(&raw_code); | 105 visitor->VisitPointer(&raw_code); |
| 106 | 106 |
| 107 // Optimized frames have a stack map. We need to visit the frame based | 107 // Optimized frames have a stack map. We need to visit the frame based |
| 108 // on the stack map. | 108 // on the stack map. |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 if (deopt_instr->kind() == DeoptInstr::kCallerFp) { | 516 if (deopt_instr->kind() == DeoptInstr::kCallerFp) { |
| 517 return (index - num_materializations_); | 517 return (index - num_materializations_); |
| 518 } | 518 } |
| 519 } | 519 } |
| 520 UNREACHABLE(); | 520 UNREACHABLE(); |
| 521 return 0; | 521 return 0; |
| 522 } | 522 } |
| 523 | 523 |
| 524 | 524 |
| 525 } // namespace dart | 525 } // namespace dart |
| OLD | NEW |