| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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/globals.h" // Needed here to get TARGET_ARCH_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
| 6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
| 7 | 7 |
| 8 #include "vm/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
| 9 | 9 |
| 10 #include "vm/ast_printer.h" | 10 #include "vm/ast_printer.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // Emit all kMaterializeObject instructions describing objects to be | 91 // Emit all kMaterializeObject instructions describing objects to be |
| 92 // materialized on the deoptimization as a prefix to the deoptimization info. | 92 // materialized on the deoptimization as a prefix to the deoptimization info. |
| 93 EmitMaterializations(deopt_env_, builder); | 93 EmitMaterializations(deopt_env_, builder); |
| 94 | 94 |
| 95 // The real frame starts here. | 95 // The real frame starts here. |
| 96 builder->MarkFrameStart(); | 96 builder->MarkFrameStart(); |
| 97 | 97 |
| 98 Zone* zone = compiler->zone(); | 98 Zone* zone = compiler->zone(); |
| 99 | 99 |
| 100 // Current PP, FP, and PC. | 100 // Current PP, FP, and PC. |
| 101 builder->AddPp(Function::Handle(zone, current->code().function()), slot_ix++); | 101 builder->AddPp(current->function(), slot_ix++); |
| 102 builder->AddPcMarker(Function::Handle(zone), slot_ix++); | 102 builder->AddPcMarker(Function::Handle(zone), slot_ix++); |
| 103 builder->AddCallerFp(slot_ix++); | 103 builder->AddCallerFp(slot_ix++); |
| 104 builder->AddReturnAddress(Function::Handle(zone, current->code().function()), | 104 builder->AddReturnAddress(current->function(), deopt_id(), slot_ix++); |
| 105 deopt_id(), | |
| 106 slot_ix++); | |
| 107 | 105 |
| 108 // Emit all values that are needed for materialization as a part of the | 106 // Emit all values that are needed for materialization as a part of the |
| 109 // expression stack for the bottom-most frame. This guarantees that GC | 107 // expression stack for the bottom-most frame. This guarantees that GC |
| 110 // will be able to find them during materialization. | 108 // will be able to find them during materialization. |
| 111 slot_ix = builder->EmitMaterializationArguments(slot_ix); | 109 slot_ix = builder->EmitMaterializationArguments(slot_ix); |
| 112 | 110 |
| 113 // For the innermost environment, set outgoing arguments and the locals. | 111 // For the innermost environment, set outgoing arguments and the locals. |
| 114 for (intptr_t i = current->Length() - 1; | 112 for (intptr_t i = current->Length() - 1; |
| 115 i >= current->fixed_parameter_count(); | 113 i >= current->fixed_parameter_count(); |
| 116 i--) { | 114 i--) { |
| 117 builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++); | 115 builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++); |
| 118 } | 116 } |
| 119 | 117 |
| 120 Environment* previous = current; | 118 Environment* previous = current; |
| 121 current = current->outer(); | 119 current = current->outer(); |
| 122 while (current != NULL) { | 120 while (current != NULL) { |
| 123 // PP, FP, and PC. | 121 // PP, FP, and PC. |
| 124 builder->AddPp(Function::Handle( | 122 builder->AddPp(current->function(), slot_ix++); |
| 125 zone, current->code().function()), slot_ix++); | 123 builder->AddPcMarker(previous->function(), slot_ix++); |
| 126 builder->AddPcMarker(Function::Handle(zone, previous->code().function()), | |
| 127 slot_ix++); | |
| 128 builder->AddCallerFp(slot_ix++); | 124 builder->AddCallerFp(slot_ix++); |
| 129 | 125 |
| 130 // For any outer environment the deopt id is that of the call instruction | 126 // For any outer environment the deopt id is that of the call instruction |
| 131 // which is recorded in the outer environment. | 127 // which is recorded in the outer environment. |
| 132 builder->AddReturnAddress( | 128 builder->AddReturnAddress( |
| 133 Function::Handle(zone, current->code().function()), | 129 current->function(), |
| 134 Isolate::ToDeoptAfter(current->deopt_id()), | 130 Isolate::ToDeoptAfter(current->deopt_id()), |
| 135 slot_ix++); | 131 slot_ix++); |
| 136 | 132 |
| 137 // The values of outgoing arguments can be changed from the inlined call so | 133 // The values of outgoing arguments can be changed from the inlined call so |
| 138 // we must read them from the previous environment. | 134 // we must read them from the previous environment. |
| 139 for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) { | 135 for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) { |
| 140 builder->AddCopy(previous->ValueAt(i), | 136 builder->AddCopy(previous->ValueAt(i), |
| 141 previous->LocationAt(i), | 137 previous->LocationAt(i), |
| 142 slot_ix++); | 138 slot_ix++); |
| 143 } | 139 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 154 // Iterate on the outer environment. | 150 // Iterate on the outer environment. |
| 155 previous = current; | 151 previous = current; |
| 156 current = current->outer(); | 152 current = current->outer(); |
| 157 } | 153 } |
| 158 // The previous pointer is now the outermost environment. | 154 // The previous pointer is now the outermost environment. |
| 159 ASSERT(previous != NULL); | 155 ASSERT(previous != NULL); |
| 160 | 156 |
| 161 // For the outermost environment, set caller PC, caller PP, and caller FP. | 157 // For the outermost environment, set caller PC, caller PP, and caller FP. |
| 162 builder->AddCallerPp(slot_ix++); | 158 builder->AddCallerPp(slot_ix++); |
| 163 // PC marker. | 159 // PC marker. |
| 164 builder->AddPcMarker(Function::Handle(zone, previous->code().function()), | 160 builder->AddPcMarker(previous->function(), slot_ix++); |
| 165 slot_ix++); | |
| 166 builder->AddCallerFp(slot_ix++); | 161 builder->AddCallerFp(slot_ix++); |
| 167 builder->AddCallerPc(slot_ix++); | 162 builder->AddCallerPc(slot_ix++); |
| 168 | 163 |
| 169 // For the outermost environment, set the incoming arguments. | 164 // For the outermost environment, set the incoming arguments. |
| 170 for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) { | 165 for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) { |
| 171 builder->AddCopy(previous->ValueAt(i), previous->LocationAt(i), slot_ix++); | 166 builder->AddCopy(previous->ValueAt(i), previous->LocationAt(i), slot_ix++); |
| 172 } | 167 } |
| 173 | 168 |
| 174 return builder->CreateDeoptInfo(deopt_table); | 169 return builder->CreateDeoptInfo(deopt_table); |
| 175 } | 170 } |
| (...skipping 1662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1838 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { | 1833 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { |
| 1839 __ PopDouble(reg); | 1834 __ PopDouble(reg); |
| 1840 } | 1835 } |
| 1841 | 1836 |
| 1842 | 1837 |
| 1843 #undef __ | 1838 #undef __ |
| 1844 | 1839 |
| 1845 } // namespace dart | 1840 } // namespace dart |
| 1846 | 1841 |
| 1847 #endif // defined TARGET_ARCH_ARM64 | 1842 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |