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 "lib/error.h" | 10 #include "lib/error.h" |
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1066 | 1066 |
1067 | 1067 |
1068 void FlowGraphCompiler::EmitOptimizedInstanceCall( | 1068 void FlowGraphCompiler::EmitOptimizedInstanceCall( |
1069 ExternalLabel* target_label, | 1069 ExternalLabel* target_label, |
1070 const ICData& ic_data, | 1070 const ICData& ic_data, |
1071 const Array& arguments_descriptor, | 1071 const Array& arguments_descriptor, |
1072 intptr_t argument_count, | 1072 intptr_t argument_count, |
1073 intptr_t deopt_id, | 1073 intptr_t deopt_id, |
1074 intptr_t token_pos, | 1074 intptr_t token_pos, |
1075 LocationSummary* locs) { | 1075 LocationSummary* locs) { |
1076 UNIMPLEMENTED(); | 1076 // Each ICData propagated from unoptimized to optimized code contains the |
1077 // function that corresponds to the Dart function of that IC call. Due | |
1078 // to inlining in optimized code, that function may not correspond to the | |
1079 // top-level function (parsed_function().function()) which could be | |
1080 // reoptimized and which counter needs to be incremented. | |
1081 // Pass the function explicitly, it is used in IC stub. | |
1082 __ LoadObject(R6, parsed_function().function()); | |
1083 __ LoadObject(R4, arguments_descriptor); | |
1084 __ LoadObject(R5, ic_data); | |
1085 GenerateDartCall(deopt_id, | |
1086 token_pos, | |
1087 target_label, | |
1088 PcDescriptors::kIcCall, | |
1089 locs); | |
1090 __ Drop(argument_count); | |
1077 } | 1091 } |
1078 | 1092 |
1079 | 1093 |
1080 void FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label, | 1094 void FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label, |
1081 const ICData& ic_data, | 1095 const ICData& ic_data, |
1082 const Array& arguments_descriptor, | 1096 const Array& arguments_descriptor, |
1083 intptr_t argument_count, | 1097 intptr_t argument_count, |
1084 intptr_t deopt_id, | 1098 intptr_t deopt_id, |
1085 intptr_t token_pos, | 1099 intptr_t token_pos, |
1086 LocationSummary* locs) { | 1100 LocationSummary* locs) { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1121 PcDescriptors::kFuncCall, | 1135 PcDescriptors::kFuncCall, |
1122 locs); | 1136 locs); |
1123 AddStaticCallTarget(function); | 1137 AddStaticCallTarget(function); |
1124 __ Drop(argument_count); | 1138 __ Drop(argument_count); |
1125 } | 1139 } |
1126 | 1140 |
1127 | 1141 |
1128 void FlowGraphCompiler::EmitEqualityRegConstCompare(Register reg, | 1142 void FlowGraphCompiler::EmitEqualityRegConstCompare(Register reg, |
1129 const Object& obj, | 1143 const Object& obj, |
1130 bool needs_number_check) { | 1144 bool needs_number_check) { |
1131 UNIMPLEMENTED(); | 1145 if (needs_number_check) { |
1146 if (!obj.IsMint() && !obj.IsDouble() && !obj.IsBigint()) { | |
1147 needs_number_check = false; | |
1148 } | |
1149 } | |
1150 | |
1151 if (obj.IsSmi() && (Smi::Cast(obj).Value() == 0)) { | |
zra
2013/04/24 18:22:26
Why only the 0 case?
regis
2013/04/24 18:40:47
This is an optimization copied from the Intel side
| |
1152 ASSERT(!needs_number_check); | |
1153 __ tst(reg, ShifterOperand(reg)); | |
1154 return; | |
1155 } | |
1156 | |
1157 if (needs_number_check) { | |
1158 __ Push(reg); | |
1159 __ PushObject(obj); | |
1160 __ BranchLink(&StubCode::IdenticalWithNumberCheckLabel()); | |
1161 __ Drop(1); // Discard constant. | |
1162 __ Pop(reg); // Restore 'reg'. | |
1163 return; | |
1164 } | |
1165 | |
1166 __ CompareObject(reg, obj); | |
1132 } | 1167 } |
1133 | 1168 |
1134 | 1169 |
1135 void FlowGraphCompiler::EmitEqualityRegRegCompare(Register left, | 1170 void FlowGraphCompiler::EmitEqualityRegRegCompare(Register left, |
1136 Register right, | 1171 Register right, |
1137 bool needs_number_check) { | 1172 bool needs_number_check) { |
1138 if (needs_number_check) { | 1173 if (needs_number_check) { |
1139 __ Push(left); | 1174 __ Push(left); |
1140 __ Push(right); | 1175 __ Push(right); |
1141 __ BranchLink(&StubCode::IdenticalWithNumberCheckLabel()); | 1176 __ BranchLink(&StubCode::IdenticalWithNumberCheckLabel()); |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1443 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { | 1478 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { |
1444 __ vldrd(reg, Address(SP, kDoubleSize, Address::PostIndex)); | 1479 __ vldrd(reg, Address(SP, kDoubleSize, Address::PostIndex)); |
1445 } | 1480 } |
1446 | 1481 |
1447 | 1482 |
1448 #undef __ | 1483 #undef __ |
1449 | 1484 |
1450 } // namespace dart | 1485 } // namespace dart |
1451 | 1486 |
1452 #endif // defined TARGET_ARCH_ARM | 1487 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |