| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/dart_entry.h" | 8 #include "vm/dart_entry.h" |
| 9 #include "vm/flow_graph_allocator.h" | 9 #include "vm/flow_graph_allocator.h" |
| 10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
| (...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1160 if (HasTryIndex()) { | 1160 if (HasTryIndex()) { |
| 1161 compiler->AddExceptionHandler(try_index(), | 1161 compiler->AddExceptionHandler(try_index(), |
| 1162 compiler->assembler()->CodeSize()); | 1162 compiler->assembler()->CodeSize()); |
| 1163 } | 1163 } |
| 1164 if (HasParallelMove()) { | 1164 if (HasParallelMove()) { |
| 1165 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); | 1165 compiler->parallel_move_resolver()->EmitNativeCode(parallel_move()); |
| 1166 } | 1166 } |
| 1167 } | 1167 } |
| 1168 | 1168 |
| 1169 | 1169 |
| 1170 LocationSummary* StoreInstanceFieldComp::MakeLocationSummary() const { | |
| 1171 const intptr_t kNumInputs = 2; | |
| 1172 const intptr_t num_temps = HasICData() ? 1 : 0; | |
| 1173 LocationSummary* summary = | |
| 1174 new LocationSummary(kNumInputs, num_temps, LocationSummary::kNoCall); | |
| 1175 summary->set_in(0, Location::RequiresRegister()); | |
| 1176 summary->set_in(1, Location::RequiresRegister()); | |
| 1177 if (HasICData()) { | |
| 1178 summary->set_temp(0, Location::RequiresRegister()); | |
| 1179 } | |
| 1180 return summary; | |
| 1181 } | |
| 1182 | |
| 1183 | |
| 1184 void StoreInstanceFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) { | |
| 1185 Register instance_reg = locs()->in(0).reg(); | |
| 1186 Register value_reg = locs()->in(1).reg(); | |
| 1187 | |
| 1188 if (HasICData()) { | |
| 1189 ASSERT(original() != NULL); | |
| 1190 Label* deopt = compiler->AddDeoptStub(original()->deopt_id(), | |
| 1191 original()->try_index(), | |
| 1192 kDeoptInstanceGetterSameTarget); | |
| 1193 // Smis do not have instance fields (Smi class is always first). | |
| 1194 Register temp_reg = locs()->temp(0).reg(); | |
| 1195 ASSERT(temp_reg != instance_reg); | |
| 1196 ASSERT(temp_reg != value_reg); | |
| 1197 ASSERT(ic_data() != NULL); | |
| 1198 compiler->EmitClassChecksNoSmi(*ic_data(), instance_reg, temp_reg, deopt); | |
| 1199 } | |
| 1200 __ StoreIntoObject(instance_reg, FieldAddress(instance_reg, field().Offset()), | |
| 1201 value_reg); | |
| 1202 } | |
| 1203 | |
| 1204 | |
| 1205 LocationSummary* ThrowInstr::MakeLocationSummary() const { | 1170 LocationSummary* ThrowInstr::MakeLocationSummary() const { |
| 1206 return new LocationSummary(0, 0, LocationSummary::kCall); | 1171 return new LocationSummary(0, 0, LocationSummary::kCall); |
| 1207 } | 1172 } |
| 1208 | 1173 |
| 1209 | 1174 |
| 1210 | 1175 |
| 1211 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1176 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1212 compiler->GenerateCallRuntime(deopt_id(), | 1177 compiler->GenerateCallRuntime(deopt_id(), |
| 1213 token_pos(), | 1178 token_pos(), |
| 1214 try_index(), | 1179 try_index(), |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1409 token_pos(), | 1374 token_pos(), |
| 1410 try_index(), | 1375 try_index(), |
| 1411 dst_type(), | 1376 dst_type(), |
| 1412 dst_name(), | 1377 dst_name(), |
| 1413 locs()); | 1378 locs()); |
| 1414 } | 1379 } |
| 1415 ASSERT(locs()->in(0).reg() == locs()->out().reg()); | 1380 ASSERT(locs()->in(0).reg() == locs()->out().reg()); |
| 1416 } | 1381 } |
| 1417 | 1382 |
| 1418 | 1383 |
| 1419 LocationSummary* StoreStaticFieldComp::MakeLocationSummary() const { | |
| 1420 LocationSummary* locs = new LocationSummary(1, 1, LocationSummary::kNoCall); | |
| 1421 locs->set_in(0, Location::RequiresRegister()); | |
| 1422 locs->set_temp(0, Location::RequiresRegister()); | |
| 1423 locs->set_out(Location::SameAsFirstInput()); | |
| 1424 return locs; | |
| 1425 } | |
| 1426 | |
| 1427 | |
| 1428 void StoreStaticFieldComp::EmitNativeCode(FlowGraphCompiler* compiler) { | |
| 1429 Register value = locs()->in(0).reg(); | |
| 1430 Register temp = locs()->temp(0).reg(); | |
| 1431 ASSERT(locs()->out().reg() == value); | |
| 1432 | |
| 1433 __ LoadObject(temp, field()); | |
| 1434 __ StoreIntoObject(temp, FieldAddress(temp, Field::value_offset()), value); | |
| 1435 } | |
| 1436 | |
| 1437 | |
| 1438 LocationSummary* BooleanNegateComp::MakeLocationSummary() const { | 1384 LocationSummary* BooleanNegateComp::MakeLocationSummary() const { |
| 1439 return LocationSummary::Make(1, | 1385 return LocationSummary::Make(1, |
| 1440 Location::RequiresRegister(), | 1386 Location::RequiresRegister(), |
| 1441 LocationSummary::kNoCall); | 1387 LocationSummary::kNoCall); |
| 1442 } | 1388 } |
| 1443 | 1389 |
| 1444 | 1390 |
| 1445 void BooleanNegateComp::EmitNativeCode(FlowGraphCompiler* compiler) { | 1391 void BooleanNegateComp::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 1446 Register value = locs()->in(0).reg(); | 1392 Register value = locs()->in(0).reg(); |
| 1447 Register result = locs()->out().reg(); | 1393 Register result = locs()->out().reg(); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1579 ? UseDefinition(values()[i]->AsUse()->definition()) | 1525 ? UseDefinition(values()[i]->AsUse()->definition()) |
| 1580 : val); | 1526 : val); |
| 1581 } | 1527 } |
| 1582 return copy; | 1528 return copy; |
| 1583 } | 1529 } |
| 1584 | 1530 |
| 1585 | 1531 |
| 1586 #undef __ | 1532 #undef __ |
| 1587 | 1533 |
| 1588 } // namespace dart | 1534 } // namespace dart |
| OLD | NEW |