| 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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
| 6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 Environment* current = deopt_env_; | 83 Environment* current = deopt_env_; |
| 84 | 84 |
| 85 // Emit all kMaterializeObject instructions describing objects to be | 85 // Emit all kMaterializeObject instructions describing objects to be |
| 86 // materialized on the deoptimization as a prefix to the deoptimization info. | 86 // materialized on the deoptimization as a prefix to the deoptimization info. |
| 87 EmitMaterializations(deopt_env_, builder); | 87 EmitMaterializations(deopt_env_, builder); |
| 88 | 88 |
| 89 // The real frame starts here. | 89 // The real frame starts here. |
| 90 builder->MarkFrameStart(); | 90 builder->MarkFrameStart(); |
| 91 | 91 |
| 92 // Current PP, FP, and PC. | 92 // Current PP, FP, and PC. |
| 93 builder->AddPp(current->code(), slot_ix++); | 93 builder->AddPp(Function::Handle(current->code().function()), slot_ix++); |
| 94 builder->AddCallerFp(slot_ix++); | 94 builder->AddCallerFp(slot_ix++); |
| 95 builder->AddReturnAddress(current->code(), deopt_id(), slot_ix++); | 95 builder->AddReturnAddress(Function::Handle(current->code().function()), |
| 96 deopt_id(), |
| 97 slot_ix++); |
| 96 | 98 |
| 97 // Callee's PC marker is not used anymore. Pass Code::null() to set to 0. | 99 // Callee's PC marker is not used anymore. Pass Code::null() to set to 0. |
| 98 builder->AddPcMarker(Code::Handle(), slot_ix++); | 100 builder->AddPcMarker(Function::Handle(), slot_ix++); |
| 99 | 101 |
| 100 // Emit all values that are needed for materialization as a part of the | 102 // Emit all values that are needed for materialization as a part of the |
| 101 // expression stack for the bottom-most frame. This guarantees that GC | 103 // expression stack for the bottom-most frame. This guarantees that GC |
| 102 // will be able to find them during materialization. | 104 // will be able to find them during materialization. |
| 103 slot_ix = builder->EmitMaterializationArguments(slot_ix); | 105 slot_ix = builder->EmitMaterializationArguments(slot_ix); |
| 104 | 106 |
| 105 // For the innermost environment, set outgoing arguments and the locals. | 107 // For the innermost environment, set outgoing arguments and the locals. |
| 106 for (intptr_t i = current->Length() - 1; | 108 for (intptr_t i = current->Length() - 1; |
| 107 i >= current->fixed_parameter_count(); | 109 i >= current->fixed_parameter_count(); |
| 108 i--) { | 110 i--) { |
| 109 builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++); | 111 builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++); |
| 110 } | 112 } |
| 111 | 113 |
| 112 Environment* previous = current; | 114 Environment* previous = current; |
| 113 current = current->outer(); | 115 current = current->outer(); |
| 114 while (current != NULL) { | 116 while (current != NULL) { |
| 115 // PP, FP, and PC. | 117 // PP, FP, and PC. |
| 116 builder->AddPp(current->code(), slot_ix++); | 118 builder->AddPp(Function::Handle(current->code().function()), slot_ix++); |
| 117 builder->AddCallerFp(slot_ix++); | 119 builder->AddCallerFp(slot_ix++); |
| 118 | 120 |
| 119 // For any outer environment the deopt id is that of the call instruction | 121 // For any outer environment the deopt id is that of the call instruction |
| 120 // which is recorded in the outer environment. | 122 // which is recorded in the outer environment. |
| 121 builder->AddReturnAddress(current->code(), | 123 builder->AddReturnAddress(Function::Handle(current->code().function()), |
| 122 Isolate::ToDeoptAfter(current->deopt_id()), | 124 Isolate::ToDeoptAfter(current->deopt_id()), |
| 123 slot_ix++); | 125 slot_ix++); |
| 124 | 126 |
| 125 // PC marker. | 127 // PC marker. |
| 126 builder->AddPcMarker(previous->code(), slot_ix++); | 128 builder->AddPcMarker(Function::Handle(previous->code().function()), |
| 129 slot_ix++); |
| 127 | 130 |
| 128 // The values of outgoing arguments can be changed from the inlined call so | 131 // The values of outgoing arguments can be changed from the inlined call so |
| 129 // we must read them from the previous environment. | 132 // we must read them from the previous environment. |
| 130 for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) { | 133 for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) { |
| 131 builder->AddCopy(previous->ValueAt(i), | 134 builder->AddCopy(previous->ValueAt(i), |
| 132 previous->LocationAt(i), | 135 previous->LocationAt(i), |
| 133 slot_ix++); | 136 slot_ix++); |
| 134 } | 137 } |
| 135 | 138 |
| 136 // Set the locals, note that outgoing arguments are not in the environment. | 139 // Set the locals, note that outgoing arguments are not in the environment. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 148 } | 151 } |
| 149 // The previous pointer is now the outermost environment. | 152 // The previous pointer is now the outermost environment. |
| 150 ASSERT(previous != NULL); | 153 ASSERT(previous != NULL); |
| 151 | 154 |
| 152 // For the outermost environment, set caller PC, caller PP, and caller FP. | 155 // For the outermost environment, set caller PC, caller PP, and caller FP. |
| 153 builder->AddCallerPp(slot_ix++); | 156 builder->AddCallerPp(slot_ix++); |
| 154 builder->AddCallerFp(slot_ix++); | 157 builder->AddCallerFp(slot_ix++); |
| 155 builder->AddCallerPc(slot_ix++); | 158 builder->AddCallerPc(slot_ix++); |
| 156 | 159 |
| 157 // PC marker. | 160 // PC marker. |
| 158 builder->AddPcMarker(previous->code(), slot_ix++); | 161 builder->AddPcMarker(Function::Handle(previous->code().function()), |
| 162 slot_ix++); |
| 159 | 163 |
| 160 // For the outermost environment, set the incoming arguments. | 164 // For the outermost environment, set the incoming arguments. |
| 161 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--) { |
| 162 builder->AddCopy(previous->ValueAt(i), previous->LocationAt(i), slot_ix++); | 166 builder->AddCopy(previous->ValueAt(i), previous->LocationAt(i), slot_ix++); |
| 163 } | 167 } |
| 164 | 168 |
| 165 return builder->CreateDeoptInfo(deopt_table); | 169 return builder->CreateDeoptInfo(deopt_table); |
| 166 } | 170 } |
| 167 | 171 |
| 168 | 172 |
| (...skipping 1691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1860 __ AddImmediate(SP, kDoubleSize); | 1864 __ AddImmediate(SP, kDoubleSize); |
| 1861 } | 1865 } |
| 1862 | 1866 |
| 1863 | 1867 |
| 1864 #undef __ | 1868 #undef __ |
| 1865 | 1869 |
| 1866 | 1870 |
| 1867 } // namespace dart | 1871 } // namespace dart |
| 1868 | 1872 |
| 1869 #endif // defined TARGET_ARCH_MIPS | 1873 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |