| 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 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1432 // Instead of popping the value it is left alone on the simulated frame | 1432 // Instead of popping the value it is left alone on the simulated frame |
| 1433 // and materialized on the physical stack before the call. | 1433 // and materialized on the physical stack before the call. |
| 1434 // TODO(fschneider): Avoid special-casing for SSA mode here. | 1434 // TODO(fschneider): Avoid special-casing for SSA mode here. |
| 1435 if (compiler->is_ssa()) { | 1435 if (compiler->is_ssa()) { |
| 1436 ASSERT(locs()->in(0).IsRegister()); | 1436 ASSERT(locs()->in(0).IsRegister()); |
| 1437 __ PushRegister(locs()->in(0).reg()); | 1437 __ PushRegister(locs()->in(0).reg()); |
| 1438 } | 1438 } |
| 1439 } | 1439 } |
| 1440 | 1440 |
| 1441 | 1441 |
| 1442 // Helper to either use the constant value of a defintion or the defintion. |
| 1443 static Value* UseDefinition(Definition* defn) { |
| 1444 if (defn->IsBind() && defn->AsBind()->computation()->IsConstant()) { |
| 1445 return defn->AsBind()->computation()->AsConstant(); |
| 1446 } else { |
| 1447 return new UseVal(defn); |
| 1448 } |
| 1449 } |
| 1450 |
| 1451 |
| 1452 Environment::Environment(const GrowableArray<Definition*>& definitions, |
| 1453 intptr_t fixed_parameter_count) |
| 1454 : values_(definitions.length()), |
| 1455 locations_(NULL), |
| 1456 fixed_parameter_count_(fixed_parameter_count) { |
| 1457 for (intptr_t i = 0; i < definitions.length(); ++i) { |
| 1458 values_.Add(UseDefinition(definitions[i])); |
| 1459 } |
| 1460 } |
| 1461 |
| 1462 |
| 1442 #undef __ | 1463 #undef __ |
| 1443 | 1464 |
| 1444 } // namespace dart | 1465 } // namespace dart |
| OLD | NEW |