| 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 "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1114 | 1114 |
| 1115 | 1115 |
| 1116 void FlowGraphCompiler::EmitOptimizedInstanceCall( | 1116 void FlowGraphCompiler::EmitOptimizedInstanceCall( |
| 1117 ExternalLabel* target_label, | 1117 ExternalLabel* target_label, |
| 1118 const ICData& ic_data, | 1118 const ICData& ic_data, |
| 1119 const Array& arguments_descriptor, | 1119 const Array& arguments_descriptor, |
| 1120 intptr_t argument_count, | 1120 intptr_t argument_count, |
| 1121 intptr_t deopt_id, | 1121 intptr_t deopt_id, |
| 1122 intptr_t token_pos, | 1122 intptr_t token_pos, |
| 1123 LocationSummary* locs) { | 1123 LocationSummary* locs) { |
| 1124 UNIMPLEMENTED(); | 1124 // Each ICData propagated from unoptimized to optimized code contains the |
| 1125 // function that corresponds to the Dart function of that IC call. Due |
| 1126 // to inlining in optimized code, that function may not correspond to the |
| 1127 // top-level function (parsed_function().function()) which could be |
| 1128 // reoptimized and which counter needs to be incremented. |
| 1129 // Pass the function explicitly, it is used in IC stub. |
| 1130 __ LoadObject(T0, parsed_function().function()); |
| 1131 __ LoadObject(S4, arguments_descriptor); |
| 1132 __ LoadObject(S5, ic_data); |
| 1133 GenerateDartCall(deopt_id, |
| 1134 token_pos, |
| 1135 target_label, |
| 1136 PcDescriptors::kIcCall, |
| 1137 locs); |
| 1138 __ Drop(argument_count); |
| 1125 } | 1139 } |
| 1126 | 1140 |
| 1127 | 1141 |
| 1128 void FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label, | 1142 void FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label, |
| 1129 const ICData& ic_data, | 1143 const ICData& ic_data, |
| 1130 const Array& arguments_descriptor, | 1144 const Array& arguments_descriptor, |
| 1131 intptr_t argument_count, | 1145 intptr_t argument_count, |
| 1132 intptr_t deopt_id, | 1146 intptr_t deopt_id, |
| 1133 intptr_t token_pos, | 1147 intptr_t token_pos, |
| 1134 LocationSummary* locs) { | 1148 LocationSummary* locs) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1172 PcDescriptors::kFuncCall, | 1186 PcDescriptors::kFuncCall, |
| 1173 locs); | 1187 locs); |
| 1174 AddStaticCallTarget(function); | 1188 AddStaticCallTarget(function); |
| 1175 __ Drop(argument_count); | 1189 __ Drop(argument_count); |
| 1176 } | 1190 } |
| 1177 | 1191 |
| 1178 | 1192 |
| 1179 void FlowGraphCompiler::EmitEqualityRegConstCompare(Register reg, | 1193 void FlowGraphCompiler::EmitEqualityRegConstCompare(Register reg, |
| 1180 const Object& obj, | 1194 const Object& obj, |
| 1181 bool needs_number_check) { | 1195 bool needs_number_check) { |
| 1182 UNIMPLEMENTED(); | 1196 if (needs_number_check && |
| 1197 (obj.IsMint() || obj.IsDouble() || obj.IsBigint())) { |
| 1198 __ addiu(SP, SP, Immediate(-2 * kWordSize)); |
| 1199 __ sw(reg, Address(SP, 1 * kWordSize)); |
| 1200 __ LoadObject(TMP1, obj); |
| 1201 __ sw(TMP1, Address(SP, 0 * kWordSize)); |
| 1202 __ BranchLink(&StubCode::IdenticalWithNumberCheckLabel()); |
| 1203 __ lw(reg, Address(SP, 1 * kWordSize)); // Restore 'reg'. |
| 1204 __ addiu(SP, SP, Immediate(2 * kWordSize)); // Discard constant. |
| 1205 return; |
| 1206 } |
| 1207 __ CompareObject(CMPRES, reg, obj); |
| 1183 } | 1208 } |
| 1184 | 1209 |
| 1185 | 1210 |
| 1186 void FlowGraphCompiler::EmitEqualityRegRegCompare(Register left, | 1211 void FlowGraphCompiler::EmitEqualityRegRegCompare(Register left, |
| 1187 Register right, | 1212 Register right, |
| 1188 bool needs_number_check) { | 1213 bool needs_number_check) { |
| 1189 __ TraceSimMsg("EqualityRegRegCompare"); | 1214 __ TraceSimMsg("EqualityRegRegCompare"); |
| 1190 if (needs_number_check) { | 1215 if (needs_number_check) { |
| 1191 __ addiu(SP, SP, Immediate(-2 * kWordSize)); | 1216 __ addiu(SP, SP, Immediate(-2 * kWordSize)); |
| 1192 __ sw(left, Address(SP, 1 * kWordSize)); | 1217 __ sw(left, Address(SP, 1 * kWordSize)); |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1533 __ AddImmediate(SP, kDoubleSize); | 1558 __ AddImmediate(SP, kDoubleSize); |
| 1534 } | 1559 } |
| 1535 | 1560 |
| 1536 | 1561 |
| 1537 #undef __ | 1562 #undef __ |
| 1538 | 1563 |
| 1539 | 1564 |
| 1540 } // namespace dart | 1565 } // namespace dart |
| 1541 | 1566 |
| 1542 #endif // defined TARGET_ARCH_MIPS | 1567 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |