OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 Environment* current = deopt_env_; | 88 Environment* current = deopt_env_; |
89 | 89 |
90 // Emit all kMaterializeObject instructions describing objects to be | 90 // Emit all kMaterializeObject instructions describing objects to be |
91 // materialized on the deoptimization as a prefix to the deoptimization info. | 91 // materialized on the deoptimization as a prefix to the deoptimization info. |
92 EmitMaterializations(deopt_env_, builder); | 92 EmitMaterializations(deopt_env_, builder); |
93 | 93 |
94 // The real frame starts here. | 94 // The real frame starts here. |
95 builder->MarkFrameStart(); | 95 builder->MarkFrameStart(); |
96 | 96 |
97 // Current PP, FP, and PC. | 97 // Current PP, FP, and PC. |
98 builder->AddPp(current->code(), slot_ix++); | 98 builder->AddPp(Function::Handle(current->code().function()), slot_ix++); |
99 builder->AddCallerFp(slot_ix++); | 99 builder->AddCallerFp(slot_ix++); |
100 builder->AddReturnAddress(current->code(), deopt_id(), slot_ix++); | 100 builder->AddReturnAddress(Function::Handle(current->code().function()), |
| 101 deopt_id(), |
| 102 slot_ix++); |
101 | 103 |
102 // Callee's PC marker is not used anymore. Pass Function::null() to set to 0. | 104 // Callee's PC marker is not used anymore. Pass Function::null() to set to 0. |
103 builder->AddPcMarker(Code::Handle(), slot_ix++); | 105 builder->AddPcMarker(Function::Handle(), slot_ix++); |
104 | 106 |
105 // Emit all values that are needed for materialization as a part of the | 107 // Emit all values that are needed for materialization as a part of the |
106 // expression stack for the bottom-most frame. This guarantees that GC | 108 // expression stack for the bottom-most frame. This guarantees that GC |
107 // will be able to find them during materialization. | 109 // will be able to find them during materialization. |
108 slot_ix = builder->EmitMaterializationArguments(slot_ix); | 110 slot_ix = builder->EmitMaterializationArguments(slot_ix); |
109 | 111 |
110 // For the innermost environment, set outgoing arguments and the locals. | 112 // For the innermost environment, set outgoing arguments and the locals. |
111 for (intptr_t i = current->Length() - 1; | 113 for (intptr_t i = current->Length() - 1; |
112 i >= current->fixed_parameter_count(); | 114 i >= current->fixed_parameter_count(); |
113 i--) { | 115 i--) { |
114 builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++); | 116 builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++); |
115 } | 117 } |
116 | 118 |
117 Environment* previous = current; | 119 Environment* previous = current; |
118 current = current->outer(); | 120 current = current->outer(); |
119 while (current != NULL) { | 121 while (current != NULL) { |
120 // PP, FP, and PC. | 122 // PP, FP, and PC. |
121 builder->AddPp(current->code(), slot_ix++); | 123 builder->AddPp(Function::Handle(current->code().function()), slot_ix++); |
122 builder->AddCallerFp(slot_ix++); | 124 builder->AddCallerFp(slot_ix++); |
123 | 125 |
124 // 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 |
125 // which is recorded in the outer environment. | 127 // which is recorded in the outer environment. |
126 builder->AddReturnAddress(current->code(), | 128 builder->AddReturnAddress(Function::Handle(current->code().function()), |
127 Isolate::ToDeoptAfter(current->deopt_id()), | 129 Isolate::ToDeoptAfter(current->deopt_id()), |
128 slot_ix++); | 130 slot_ix++); |
129 | 131 |
130 // PC marker. | 132 // PC marker. |
131 builder->AddPcMarker(previous->code(), slot_ix++); | 133 builder->AddPcMarker(Function::Handle(previous->code().function()), |
| 134 slot_ix++); |
132 | 135 |
133 // The values of outgoing arguments can be changed from the inlined call so | 136 // The values of outgoing arguments can be changed from the inlined call so |
134 // we must read them from the previous environment. | 137 // we must read them from the previous environment. |
135 for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) { | 138 for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) { |
136 builder->AddCopy(previous->ValueAt(i), | 139 builder->AddCopy(previous->ValueAt(i), |
137 previous->LocationAt(i), | 140 previous->LocationAt(i), |
138 slot_ix++); | 141 slot_ix++); |
139 } | 142 } |
140 | 143 |
141 // Set the locals, note that outgoing arguments are not in the environment. | 144 // Set the locals, note that outgoing arguments are not in the environment. |
(...skipping 11 matching lines...) Expand all Loading... |
153 } | 156 } |
154 // The previous pointer is now the outermost environment. | 157 // The previous pointer is now the outermost environment. |
155 ASSERT(previous != NULL); | 158 ASSERT(previous != NULL); |
156 | 159 |
157 // For the outermost environment, set caller PC, caller PP, and caller FP. | 160 // For the outermost environment, set caller PC, caller PP, and caller FP. |
158 builder->AddCallerPp(slot_ix++); | 161 builder->AddCallerPp(slot_ix++); |
159 builder->AddCallerFp(slot_ix++); | 162 builder->AddCallerFp(slot_ix++); |
160 builder->AddCallerPc(slot_ix++); | 163 builder->AddCallerPc(slot_ix++); |
161 | 164 |
162 // PC marker. | 165 // PC marker. |
163 builder->AddPcMarker(previous->code(), slot_ix++); | 166 builder->AddPcMarker(Function::Handle(previous->code().function()), |
| 167 slot_ix++); |
164 | 168 |
165 // For the outermost environment, set the incoming arguments. | 169 // For the outermost environment, set the incoming arguments. |
166 for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) { | 170 for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) { |
167 builder->AddCopy(previous->ValueAt(i), previous->LocationAt(i), slot_ix++); | 171 builder->AddCopy(previous->ValueAt(i), previous->LocationAt(i), slot_ix++); |
168 } | 172 } |
169 | 173 |
170 return builder->CreateDeoptInfo(deopt_table); | 174 return builder->CreateDeoptInfo(deopt_table); |
171 } | 175 } |
172 | 176 |
173 | 177 |
(...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1880 DRegister dreg = EvenDRegisterOf(reg); | 1884 DRegister dreg = EvenDRegisterOf(reg); |
1881 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); | 1885 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); |
1882 } | 1886 } |
1883 | 1887 |
1884 | 1888 |
1885 #undef __ | 1889 #undef __ |
1886 | 1890 |
1887 } // namespace dart | 1891 } // namespace dart |
1888 | 1892 |
1889 #endif // defined TARGET_ARCH_ARM | 1893 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |