| 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/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
| 6 | 6 |
| 7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/bit_vector.h" | 8 #include "vm/bit_vector.h" |
| 9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 DECLARE_FLAG(bool, throw_on_javascript_int_overflow); | 36 DECLARE_FLAG(bool, throw_on_javascript_int_overflow); |
| 37 DECLARE_FLAG(bool, warn_on_javascript_compatibility); | 37 DECLARE_FLAG(bool, warn_on_javascript_compatibility); |
| 38 | 38 |
| 39 Definition::Definition() | 39 Definition::Definition() |
| 40 : range_(NULL), | 40 : range_(NULL), |
| 41 type_(NULL), | 41 type_(NULL), |
| 42 temp_index_(-1), | 42 temp_index_(-1), |
| 43 ssa_temp_index_(-1), | 43 ssa_temp_index_(-1), |
| 44 input_use_list_(NULL), | 44 input_use_list_(NULL), |
| 45 env_use_list_(NULL), | 45 env_use_list_(NULL), |
| 46 use_kind_(kValue), // Phis and parameters rely on this default. | |
| 47 constant_value_(Object::ZoneHandle(ConstantPropagator::Unknown())) { | 46 constant_value_(Object::ZoneHandle(ConstantPropagator::Unknown())) { |
| 48 } | 47 } |
| 49 | 48 |
| 50 | 49 |
| 51 Definition* Definition::OriginalDefinition() { | 50 Definition* Definition::OriginalDefinition() { |
| 52 Definition* defn = this; | 51 Definition* defn = this; |
| 53 while (defn->IsRedefinition() || defn->IsAssertAssignable()) { | 52 while (defn->IsRedefinition() || defn->IsAssertAssignable()) { |
| 54 if (defn->IsRedefinition()) { | 53 if (defn->IsRedefinition()) { |
| 55 defn = defn->AsRedefinition()->value()->definition(); | 54 defn = defn->AsRedefinition()->value()->definition(); |
| 56 } else { | 55 } else { |
| (...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1396 if (result != NULL) { | 1395 if (result != NULL) { |
| 1397 return result; | 1396 return result; |
| 1398 } | 1397 } |
| 1399 | 1398 |
| 1400 if ((op_kind() == Token::kMUL) && | 1399 if ((op_kind() == Token::kMUL) && |
| 1401 (left()->definition() == right()->definition())) { | 1400 (left()->definition() == right()->definition())) { |
| 1402 MathUnaryInstr* math_unary = | 1401 MathUnaryInstr* math_unary = |
| 1403 new MathUnaryInstr(MathUnaryInstr::kDoubleSquare, | 1402 new MathUnaryInstr(MathUnaryInstr::kDoubleSquare, |
| 1404 new Value(left()->definition()), | 1403 new Value(left()->definition()), |
| 1405 DeoptimizationTarget()); | 1404 DeoptimizationTarget()); |
| 1406 flow_graph->InsertBefore(this, math_unary, env(), Definition::kValue); | 1405 flow_graph->InsertBefore(this, math_unary, env(), FlowGraph::kValue); |
| 1407 return math_unary; | 1406 return math_unary; |
| 1408 } | 1407 } |
| 1409 | 1408 |
| 1410 return this; | 1409 return this; |
| 1411 } | 1410 } |
| 1412 | 1411 |
| 1413 | 1412 |
| 1414 Definition* BinarySmiOpInstr::Canonicalize(FlowGraph* flow_graph) { | 1413 Definition* BinarySmiOpInstr::Canonicalize(FlowGraph* flow_graph) { |
| 1415 Definition* result = NULL; | 1414 Definition* result = NULL; |
| 1416 | 1415 |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1654 if (!HasUses()) return NULL; | 1653 if (!HasUses()) return NULL; |
| 1655 // Fold away UnboxDouble(BoxDouble(v)). | 1654 // Fold away UnboxDouble(BoxDouble(v)). |
| 1656 BoxDoubleInstr* box_defn = value()->definition()->AsBoxDouble(); | 1655 BoxDoubleInstr* box_defn = value()->definition()->AsBoxDouble(); |
| 1657 if (box_defn != NULL) { | 1656 if (box_defn != NULL) { |
| 1658 return box_defn->value()->definition(); | 1657 return box_defn->value()->definition(); |
| 1659 } | 1658 } |
| 1660 | 1659 |
| 1661 ConstantInstr* c = value()->definition()->AsConstant(); | 1660 ConstantInstr* c = value()->definition()->AsConstant(); |
| 1662 if ((c != NULL) && c->value().IsDouble()) { | 1661 if ((c != NULL) && c->value().IsDouble()) { |
| 1663 UnboxedConstantInstr* uc = new UnboxedConstantInstr(c->value()); | 1662 UnboxedConstantInstr* uc = new UnboxedConstantInstr(c->value()); |
| 1664 flow_graph->InsertBefore(this, uc, NULL, Definition::kValue); | 1663 flow_graph->InsertBefore(this, uc, NULL, FlowGraph::kValue); |
| 1665 return uc; | 1664 return uc; |
| 1666 } | 1665 } |
| 1667 | 1666 |
| 1668 return this; | 1667 return this; |
| 1669 } | 1668 } |
| 1670 | 1669 |
| 1671 | 1670 |
| 1672 Definition* BoxFloat32x4Instr::Canonicalize(FlowGraph* flow_graph) { | 1671 Definition* BoxFloat32x4Instr::Canonicalize(FlowGraph* flow_graph) { |
| 1673 if (input_use_list() == NULL) { | 1672 if (input_use_list() == NULL) { |
| 1674 // Environments can accomodate any representation. No need to box. | 1673 // Environments can accomodate any representation. No need to box. |
| (...skipping 1749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3424 case Token::kTRUNCDIV: return 0; | 3423 case Token::kTRUNCDIV: return 0; |
| 3425 case Token::kMOD: return 1; | 3424 case Token::kMOD: return 1; |
| 3426 default: UNIMPLEMENTED(); return -1; | 3425 default: UNIMPLEMENTED(); return -1; |
| 3427 } | 3426 } |
| 3428 } | 3427 } |
| 3429 | 3428 |
| 3430 | 3429 |
| 3431 #undef __ | 3430 #undef __ |
| 3432 | 3431 |
| 3433 } // namespace dart | 3432 } // namespace dart |
| OLD | NEW |