| 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/flow_graph_optimizer.h" | 5 #include "vm/flow_graph_optimizer.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/cha.h" | 8 #include "vm/cha.h" |
| 9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
| (...skipping 1461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1472 ICData::ZoneHandle( | 1472 ICData::ZoneHandle( |
| 1473 call->ic_data()->AsUnaryClassChecksForArgNr(0)), | 1473 call->ic_data()->AsUnaryClassChecksForArgNr(0)), |
| 1474 call->deopt_id(), | 1474 call->deopt_id(), |
| 1475 call->env(), | 1475 call->env(), |
| 1476 call); | 1476 call); |
| 1477 intptr_t mask = 0; | 1477 intptr_t mask = 0; |
| 1478 if (getter == MethodRecognizer::kFloat32x4Shuffle) { | 1478 if (getter == MethodRecognizer::kFloat32x4Shuffle) { |
| 1479 ASSERT(call->ArgumentCount() == 2); | 1479 ASSERT(call->ArgumentCount() == 2); |
| 1480 // Extract shuffle mask. | 1480 // Extract shuffle mask. |
| 1481 Definition* mask_definition = call->ArgumentAt(1); | 1481 Definition* mask_definition = call->ArgumentAt(1); |
| 1482 if (!mask_definition->IsConstant()) { |
| 1483 // Not a constant. |
| 1484 return false; |
| 1485 } |
| 1482 ASSERT(mask_definition->IsConstant()); | 1486 ASSERT(mask_definition->IsConstant()); |
| 1483 ConstantInstr* constant_instruction = mask_definition->AsConstant(); | 1487 ConstantInstr* constant_instruction = mask_definition->AsConstant(); |
| 1484 const Object& constant_mask = constant_instruction->value(); | 1488 const Object& constant_mask = constant_instruction->value(); |
| 1489 if (!constant_mask.IsSmi()) { |
| 1490 // Not a smi. |
| 1491 return false; |
| 1492 } |
| 1485 ASSERT(constant_mask.IsSmi()); | 1493 ASSERT(constant_mask.IsSmi()); |
| 1486 mask = Smi::Cast(constant_mask).Value(); | 1494 mask = Smi::Cast(constant_mask).Value(); |
| 1487 ASSERT(mask >= 0); | 1495 if (mask < 0 || mask > 255) { |
| 1488 ASSERT(mask <= 255); | 1496 // Not a valid mask. |
| 1497 return false; |
| 1498 } |
| 1489 } | 1499 } |
| 1490 Float32x4ShuffleInstr* instr = new Float32x4ShuffleInstr( | 1500 Float32x4ShuffleInstr* instr = new Float32x4ShuffleInstr( |
| 1491 getter, | 1501 getter, |
| 1492 new Value(call->ArgumentAt(0)), | 1502 new Value(call->ArgumentAt(0)), |
| 1493 mask, | 1503 mask, |
| 1494 call->deopt_id()); | 1504 call->deopt_id()); |
| 1495 ReplaceCall(call, instr); | 1505 ReplaceCall(call, instr); |
| 1496 return true; | 1506 return true; |
| 1497 } | 1507 } |
| 1498 | 1508 |
| (...skipping 5997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7496 } | 7506 } |
| 7497 | 7507 |
| 7498 // Insert materializations at environment uses. | 7508 // Insert materializations at environment uses. |
| 7499 for (intptr_t i = 0; i < exits.length(); i++) { | 7509 for (intptr_t i = 0; i < exits.length(); i++) { |
| 7500 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields); | 7510 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields); |
| 7501 } | 7511 } |
| 7502 } | 7512 } |
| 7503 | 7513 |
| 7504 | 7514 |
| 7505 } // namespace dart | 7515 } // namespace dart |
| OLD | NEW |