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 1516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1527 // Chain the new context in context_value to its parent in CTX. | 1527 // Chain the new context in context_value to its parent in CTX. |
1528 __ StoreIntoObject(context_value, | 1528 __ StoreIntoObject(context_value, |
1529 FieldAddress(context_value, Context::parent_offset()), | 1529 FieldAddress(context_value, Context::parent_offset()), |
1530 CTX); | 1530 CTX); |
1531 // Set new context as current context. | 1531 // Set new context as current context. |
1532 __ MoveRegister(CTX, context_value); | 1532 __ MoveRegister(CTX, context_value); |
1533 } | 1533 } |
1534 | 1534 |
1535 | 1535 |
1536 LocationSummary* StoreVMFieldInstr::MakeLocationSummary() const { | 1536 LocationSummary* StoreVMFieldInstr::MakeLocationSummary() const { |
1537 return LocationSummary::Make( | 1537 const intptr_t kNumInputs = 2; |
1538 2, | 1538 const intptr_t kNumTemps = 0; |
1539 is_used() ? Location::SameAsFirstInput() : Location::NoLocation(), | 1539 LocationSummary* locs = |
1540 LocationSummary::kNoCall); | 1540 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 1541 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister() |
| 1542 : Location::RequiresRegister()); |
| 1543 locs->set_in(1, Location::RequiresRegister()); |
| 1544 return locs; |
1541 } | 1545 } |
1542 | 1546 |
1543 | 1547 |
1544 void StoreVMFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1548 void StoreVMFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
1545 Register value_reg = locs()->in(0).reg(); | 1549 Register value_reg = locs()->in(0).reg(); |
1546 Register dest_reg = locs()->in(1).reg(); | 1550 Register dest_reg = locs()->in(1).reg(); |
1547 ASSERT(!is_used() || (value_reg == locs()->out().reg())); | |
1548 | 1551 |
1549 if (value()->NeedsStoreBuffer()) { | 1552 if (value()->NeedsStoreBuffer()) { |
1550 __ StoreIntoObject(dest_reg, FieldAddress(dest_reg, offset_in_bytes()), | 1553 __ StoreIntoObject(dest_reg, FieldAddress(dest_reg, offset_in_bytes()), |
1551 value_reg); | 1554 value_reg); |
1552 } else { | 1555 } else { |
1553 __ StoreIntoObjectNoBarrier( | 1556 __ StoreIntoObjectNoBarrier( |
1554 dest_reg, FieldAddress(dest_reg, offset_in_bytes()), value_reg); | 1557 dest_reg, FieldAddress(dest_reg, offset_in_bytes()), value_reg); |
1555 } | 1558 } |
1556 } | 1559 } |
1557 | 1560 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1636 value->set_use_index(i); | 1639 value->set_use_index(i); |
1637 value->AddToEnvUseList(); | 1640 value->AddToEnvUseList(); |
1638 } | 1641 } |
1639 instr->set_env(copy); | 1642 instr->set_env(copy); |
1640 } | 1643 } |
1641 | 1644 |
1642 | 1645 |
1643 #undef __ | 1646 #undef __ |
1644 | 1647 |
1645 } // namespace dart | 1648 } // namespace dart |
OLD | NEW |