| 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 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1491 // Instead of popping the value it is left alone on the simulated frame | 1491 // Instead of popping the value it is left alone on the simulated frame |
| 1492 // and materialized on the physical stack before the call. | 1492 // and materialized on the physical stack before the call. |
| 1493 // TODO(fschneider): Avoid special-casing for SSA mode here. | 1493 // TODO(fschneider): Avoid special-casing for SSA mode here. |
| 1494 if (compiler->is_ssa()) { | 1494 if (compiler->is_ssa()) { |
| 1495 ASSERT(locs()->in(0).IsRegister()); | 1495 ASSERT(locs()->in(0).IsRegister()); |
| 1496 __ PushRegister(locs()->in(0).reg()); | 1496 __ PushRegister(locs()->in(0).reg()); |
| 1497 } | 1497 } |
| 1498 } | 1498 } |
| 1499 | 1499 |
| 1500 | 1500 |
| 1501 // Helper to either use the constant value of a defintion or the defintion. | 1501 // Helper to either use the constant value of a definition or the definition. |
| 1502 static Value* UseDefinition(Definition* defn) { | 1502 static Value* UseDefinition(Definition* defn) { |
| 1503 if (defn->IsBind() && defn->AsBind()->computation()->IsConstant()) { | 1503 if (defn->IsBind() && defn->AsBind()->computation()->IsConstant()) { |
| 1504 return defn->AsBind()->computation()->AsConstant(); | 1504 return defn->AsBind()->computation()->AsConstant(); |
| 1505 } else { | 1505 } else { |
| 1506 return new UseVal(defn); | 1506 return new UseVal(defn); |
| 1507 } | 1507 } |
| 1508 } | 1508 } |
| 1509 | 1509 |
| 1510 | 1510 |
| 1511 Environment::Environment(const GrowableArray<Definition*>& definitions, | 1511 Environment::Environment(const GrowableArray<Definition*>& definitions, |
| 1512 intptr_t fixed_parameter_count) | 1512 intptr_t fixed_parameter_count) |
| 1513 : values_(definitions.length()), | 1513 : values_(definitions.length()), |
| 1514 locations_(NULL), | 1514 locations_(NULL), |
| 1515 fixed_parameter_count_(fixed_parameter_count) { | 1515 fixed_parameter_count_(fixed_parameter_count) { |
| 1516 for (intptr_t i = 0; i < definitions.length(); ++i) { | 1516 for (intptr_t i = 0; i < definitions.length(); ++i) { |
| 1517 values_.Add(UseDefinition(definitions[i])); | 1517 values_.Add(UseDefinition(definitions[i])); |
| 1518 } | 1518 } |
| 1519 } | 1519 } |
| 1520 | 1520 |
| 1521 | 1521 |
| 1522 #undef __ | 1522 #undef __ |
| 1523 | 1523 |
| 1524 } // namespace dart | 1524 } // namespace dart |
| OLD | NEW |