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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 Environment* current = deopt_env_; | 84 Environment* current = deopt_env_; |
85 | 85 |
86 // Emit all kMaterializeObject instructions describing objects to be | 86 // Emit all kMaterializeObject instructions describing objects to be |
87 // materialized on the deoptimization as a prefix to the deoptimization info. | 87 // materialized on the deoptimization as a prefix to the deoptimization info. |
88 EmitMaterializations(deopt_env_, builder); | 88 EmitMaterializations(deopt_env_, builder); |
89 | 89 |
90 // The real frame starts here. | 90 // The real frame starts here. |
91 builder->MarkFrameStart(); | 91 builder->MarkFrameStart(); |
92 | 92 |
93 // Current PP, FP, and PC. | 93 // Current PP, FP, and PC. |
94 builder->AddPp(current->code(), slot_ix++); | 94 builder->AddPp(Function::Handle(current->code().function()), slot_ix++); |
95 builder->AddPcMarker(Code::Handle(), slot_ix++); | 95 builder->AddPcMarker(Function::Handle(), slot_ix++); |
96 builder->AddCallerFp(slot_ix++); | 96 builder->AddCallerFp(slot_ix++); |
97 builder->AddReturnAddress(current->code(), deopt_id(), slot_ix++); | 97 builder->AddReturnAddress(Function::Handle(current->code().function()), |
| 98 deopt_id(), |
| 99 slot_ix++); |
98 | 100 |
99 // Emit all values that are needed for materialization as a part of the | 101 // Emit all values that are needed for materialization as a part of the |
100 // expression stack for the bottom-most frame. This guarantees that GC | 102 // expression stack for the bottom-most frame. This guarantees that GC |
101 // will be able to find them during materialization. | 103 // will be able to find them during materialization. |
102 slot_ix = builder->EmitMaterializationArguments(slot_ix); | 104 slot_ix = builder->EmitMaterializationArguments(slot_ix); |
103 | 105 |
104 // For the innermost environment, set outgoing arguments and the locals. | 106 // For the innermost environment, set outgoing arguments and the locals. |
105 for (intptr_t i = current->Length() - 1; | 107 for (intptr_t i = current->Length() - 1; |
106 i >= current->fixed_parameter_count(); | 108 i >= current->fixed_parameter_count(); |
107 i--) { | 109 i--) { |
108 builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++); | 110 builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++); |
109 } | 111 } |
110 | 112 |
111 Environment* previous = current; | 113 Environment* previous = current; |
112 current = current->outer(); | 114 current = current->outer(); |
113 while (current != NULL) { | 115 while (current != NULL) { |
114 // PP, FP, and PC. | 116 // PP, FP, and PC. |
115 builder->AddPp(current->code(), slot_ix++); | 117 builder->AddPp(Function::Handle(current->code().function()), slot_ix++); |
116 builder->AddPcMarker(previous->code(), slot_ix++); | 118 builder->AddPcMarker(Function::Handle(previous->code().function()), |
| 119 slot_ix++); |
117 builder->AddCallerFp(slot_ix++); | 120 builder->AddCallerFp(slot_ix++); |
118 | 121 |
119 // For any outer environment the deopt id is that of the call instruction | 122 // For any outer environment the deopt id is that of the call instruction |
120 // which is recorded in the outer environment. | 123 // which is recorded in the outer environment. |
121 builder->AddReturnAddress(current->code(), | 124 builder->AddReturnAddress(Function::Handle(current->code().function()), |
122 Isolate::ToDeoptAfter(current->deopt_id()), | 125 Isolate::ToDeoptAfter(current->deopt_id()), |
123 slot_ix++); | 126 slot_ix++); |
124 | 127 |
125 // The values of outgoing arguments can be changed from the inlined call so | 128 // The values of outgoing arguments can be changed from the inlined call so |
126 // we must read them from the previous environment. | 129 // we must read them from the previous environment. |
127 for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) { | 130 for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) { |
128 builder->AddCopy(previous->ValueAt(i), | 131 builder->AddCopy(previous->ValueAt(i), |
129 previous->LocationAt(i), | 132 previous->LocationAt(i), |
130 slot_ix++); | 133 slot_ix++); |
131 } | 134 } |
(...skipping 10 matching lines...) Expand all Loading... |
142 // Iterate on the outer environment. | 145 // Iterate on the outer environment. |
143 previous = current; | 146 previous = current; |
144 current = current->outer(); | 147 current = current->outer(); |
145 } | 148 } |
146 // The previous pointer is now the outermost environment. | 149 // The previous pointer is now the outermost environment. |
147 ASSERT(previous != NULL); | 150 ASSERT(previous != NULL); |
148 | 151 |
149 // For the outermost environment, set caller PC, caller PP, and caller FP. | 152 // For the outermost environment, set caller PC, caller PP, and caller FP. |
150 builder->AddCallerPp(slot_ix++); | 153 builder->AddCallerPp(slot_ix++); |
151 // PC marker. | 154 // PC marker. |
152 builder->AddPcMarker(previous->code(), slot_ix++); | 155 builder->AddPcMarker(Function::Handle(previous->code().function()), |
| 156 slot_ix++); |
153 builder->AddCallerFp(slot_ix++); | 157 builder->AddCallerFp(slot_ix++); |
154 builder->AddCallerPc(slot_ix++); | 158 builder->AddCallerPc(slot_ix++); |
155 | 159 |
156 // For the outermost environment, set the incoming arguments. | 160 // For the outermost environment, set the incoming arguments. |
157 for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) { | 161 for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) { |
158 builder->AddCopy(previous->ValueAt(i), previous->LocationAt(i), slot_ix++); | 162 builder->AddCopy(previous->ValueAt(i), previous->LocationAt(i), slot_ix++); |
159 } | 163 } |
160 | 164 |
161 return builder->CreateDeoptInfo(deopt_table); | 165 return builder->CreateDeoptInfo(deopt_table); |
162 } | 166 } |
(...skipping 1664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1827 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { | 1831 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { |
1828 __ PopDouble(reg); | 1832 __ PopDouble(reg); |
1829 } | 1833 } |
1830 | 1834 |
1831 | 1835 |
1832 #undef __ | 1836 #undef __ |
1833 | 1837 |
1834 } // namespace dart | 1838 } // namespace dart |
1835 | 1839 |
1836 #endif // defined TARGET_ARCH_ARM64 | 1840 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |