| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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. |
| 109 Array maps; | 109 Array maps; |
| 110 maps = Array::null(); | 110 maps = Array::null(); |
| 111 Stackmap map; | 111 Stackmap map; |
| 112 const uword entry = code.EntryPoint(); | 112 const uword entry = reinterpret_cast<uword>(code.instructions()->ptr()) + |
| 113 Instructions::HeaderSize(); |
| 113 map = code.GetStackmap(pc() - entry, &maps, &map); | 114 map = code.GetStackmap(pc() - entry, &maps, &map); |
| 114 if (!map.IsNull()) { | 115 if (!map.IsNull()) { |
| 115 RawObject** first = reinterpret_cast<RawObject**>(sp()); | 116 RawObject** first = reinterpret_cast<RawObject**>(sp()); |
| 116 RawObject** last = reinterpret_cast<RawObject**>( | 117 RawObject** last = reinterpret_cast<RawObject**>( |
| 117 fp() + (kFirstLocalSlotFromFp * kWordSize)); | 118 fp() + (kFirstLocalSlotFromFp * kWordSize)); |
| 118 | 119 |
| 119 // A stack map is present in the code object, use the stack map to | 120 // A stack map is present in the code object, use the stack map to |
| 120 // visit frame slots which are marked as having objects. | 121 // visit frame slots which are marked as having objects. |
| 121 // | 122 // |
| 122 // The layout of the frame is (lower addresses to the right): | 123 // The layout of the frame is (lower addresses to the right): |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 if (deopt_instr->kind() == DeoptInstr::kCallerFp) { | 517 if (deopt_instr->kind() == DeoptInstr::kCallerFp) { |
| 517 return (index - num_materializations_); | 518 return (index - num_materializations_); |
| 518 } | 519 } |
| 519 } | 520 } |
| 520 UNREACHABLE(); | 521 UNREACHABLE(); |
| 521 return 0; | 522 return 0; |
| 522 } | 523 } |
| 523 | 524 |
| 524 | 525 |
| 525 } // namespace dart | 526 } // namespace dart |
| OLD | NEW |