| 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 "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 #include "vm/deopt_instructions.h" | 8 #include "vm/deopt_instructions.h" |
| 9 #include "vm/isolate.h" | 9 #include "vm/isolate.h" |
| 10 #include "vm/object.h" | 10 #include "vm/object.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 if (!code.IsNull()) { | 92 if (!code.IsNull()) { |
| 93 // Visit the code object. | 93 // Visit the code object. |
| 94 RawObject* raw_code = code.raw(); | 94 RawObject* raw_code = code.raw(); |
| 95 visitor->VisitPointer(&raw_code); | 95 visitor->VisitPointer(&raw_code); |
| 96 | 96 |
| 97 // Optimized frames have a stack map. We need to visit the frame based | 97 // Optimized frames have a stack map. We need to visit the frame based |
| 98 // on the stack map. | 98 // on the stack map. |
| 99 Array maps; | 99 Array maps; |
| 100 maps = Array::null(); | 100 maps = Array::null(); |
| 101 Stackmap map; | 101 Stackmap map; |
| 102 map = code.GetStackmap(pc(), &maps, &map); | 102 const uword entry = reinterpret_cast<uword>(code.instructions()->ptr()) + |
| 103 Instructions::HeaderSize(); |
| 104 map = code.GetStackmap(pc() - entry, &maps, &map); |
| 103 if (!map.IsNull()) { | 105 if (!map.IsNull()) { |
| 104 RawObject** first = reinterpret_cast<RawObject**>(sp()); | 106 RawObject** first = reinterpret_cast<RawObject**>(sp()); |
| 105 RawObject** last = reinterpret_cast<RawObject**>( | 107 RawObject** last = reinterpret_cast<RawObject**>( |
| 106 fp() + (kFirstLocalSlotFromFp * kWordSize)); | 108 fp() + (kFirstLocalSlotFromFp * kWordSize)); |
| 107 | 109 |
| 108 // A stack map is present in the code object, use the stack map to | 110 // A stack map is present in the code object, use the stack map to |
| 109 // visit frame slots which are marked as having objects. | 111 // visit frame slots which are marked as having objects. |
| 110 // | 112 // |
| 111 // The layout of the frame is (lower addresses to the right): | 113 // The layout of the frame is (lower addresses to the right): |
| 112 // | spill slots | outgoing arguments | saved registers | | 114 // | spill slots | outgoing arguments | saved registers | |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 if (deopt_instr->kind() == DeoptInstr::kCallerFp) { | 484 if (deopt_instr->kind() == DeoptInstr::kCallerFp) { |
| 483 return (index - num_materializations_); | 485 return (index - num_materializations_); |
| 484 } | 486 } |
| 485 } | 487 } |
| 486 UNREACHABLE(); | 488 UNREACHABLE(); |
| 487 return 0; | 489 return 0; |
| 488 } | 490 } |
| 489 | 491 |
| 490 | 492 |
| 491 } // namespace dart | 493 } // namespace dart |
| OLD | NEW |