| 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/globals.h" // Needed here to get TARGET_ARCH_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 } | 965 } |
| 966 } | 966 } |
| 967 | 967 |
| 968 | 968 |
| 969 LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary() const { | 969 LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary() const { |
| 970 const intptr_t kNumInputs = 2; | 970 const intptr_t kNumInputs = 2; |
| 971 const intptr_t num_temps = 0; | 971 const intptr_t num_temps = 0; |
| 972 LocationSummary* summary = | 972 LocationSummary* summary = |
| 973 new LocationSummary(kNumInputs, num_temps, LocationSummary::kNoCall); | 973 new LocationSummary(kNumInputs, num_temps, LocationSummary::kNoCall); |
| 974 summary->set_in(0, Location::RequiresRegister()); | 974 summary->set_in(0, Location::RequiresRegister()); |
| 975 summary->set_in(1, | 975 summary->set_in(1, (value()->NeedsStoreBuffer() && emit_store_barrier()) |
| 976 value()->NeedsStoreBuffer() ? Location::WritableRegister() | 976 ? Location::WritableRegister() |
| 977 : Location::RequiresRegister()); | 977 : Location::RegisterOrConstant(value())); |
| 978 return summary; | 978 return summary; |
| 979 } | 979 } |
| 980 | 980 |
| 981 | 981 |
| 982 void StoreInstanceFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 982 void StoreInstanceFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 983 Register instance_reg = locs()->in(0).reg(); | 983 Register instance_reg = locs()->in(0).reg(); |
| 984 Register value_reg = locs()->in(1).reg(); | |
| 985 if (this->value()->NeedsStoreBuffer() && emit_store_barrier()) { | 984 if (this->value()->NeedsStoreBuffer() && emit_store_barrier()) { |
| 985 Register value_reg = locs()->in(1).reg(); |
| 986 __ StoreIntoObject(instance_reg, | 986 __ StoreIntoObject(instance_reg, |
| 987 FieldAddress(instance_reg, field().Offset()), value_reg); | 987 FieldAddress(instance_reg, field().Offset()), value_reg); |
| 988 } else { | 988 } else { |
| 989 __ StoreIntoObjectNoBarrier(instance_reg, | 989 if (locs()->in(1).IsConstant()) { |
| 990 FieldAddress(instance_reg, field().Offset()), value_reg); | 990 __ StoreObject(FieldAddress(instance_reg, field().Offset()), |
| 991 locs()->in(1).constant()); |
| 992 } else { |
| 993 Register value_reg = locs()->in(1).reg(); |
| 994 __ StoreIntoObjectNoBarrier(instance_reg, |
| 995 FieldAddress(instance_reg, field().Offset()), value_reg); |
| 996 } |
| 991 } | 997 } |
| 992 } | 998 } |
| 993 | 999 |
| 994 | 1000 |
| 995 LocationSummary* LoadStaticFieldInstr::MakeLocationSummary() const { | 1001 LocationSummary* LoadStaticFieldInstr::MakeLocationSummary() const { |
| 996 return LocationSummary::Make(0, | 1002 return LocationSummary::Make(0, |
| 997 Location::RequiresRegister(), | 1003 Location::RequiresRegister(), |
| 998 LocationSummary::kNoCall); | 1004 LocationSummary::kNoCall); |
| 999 } | 1005 } |
| 1000 | 1006 |
| (...skipping 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2287 __ j(ABOVE_EQUAL, deopt); | 2293 __ j(ABOVE_EQUAL, deopt); |
| 2288 } | 2294 } |
| 2289 } | 2295 } |
| 2290 | 2296 |
| 2291 | 2297 |
| 2292 } // namespace dart | 2298 } // namespace dart |
| 2293 | 2299 |
| 2294 #undef __ | 2300 #undef __ |
| 2295 | 2301 |
| 2296 #endif // defined TARGET_ARCH_X64 | 2302 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |