Chromium Code Reviews| 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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 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 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 946 } | 946 } |
| 947 } | 947 } |
| 948 | 948 |
| 949 | 949 |
| 950 LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary() const { | 950 LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary() const { |
| 951 const intptr_t kNumInputs = 2; | 951 const intptr_t kNumInputs = 2; |
| 952 const intptr_t num_temps = 0; | 952 const intptr_t num_temps = 0; |
| 953 LocationSummary* summary = | 953 LocationSummary* summary = |
| 954 new LocationSummary(kNumInputs, num_temps, LocationSummary::kNoCall); | 954 new LocationSummary(kNumInputs, num_temps, LocationSummary::kNoCall); |
| 955 summary->set_in(0, Location::RequiresRegister()); | 955 summary->set_in(0, Location::RequiresRegister()); |
| 956 summary->set_in(1, | 956 summary->set_in(1, (value()->NeedsStoreBuffer() && emit_store_barrier()) |
|
Vyacheslav Egorov (Google)
2012/09/13 10:35:43
nice catch.
maybe move this a && b to some helper
Florian Schneider
2012/09/13 10:46:07
Done.
| |
| 957 value()->NeedsStoreBuffer() ? Location::WritableRegister() | 957 ? Location::WritableRegister() |
| 958 : Location::RequiresRegister()); | 958 : Location::RegisterOrConstant(value())); |
| 959 return summary; | 959 return summary; |
| 960 } | 960 } |
| 961 | 961 |
| 962 | 962 |
| 963 void StoreInstanceFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 963 void StoreInstanceFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 964 Register instance_reg = locs()->in(0).reg(); | 964 Register instance_reg = locs()->in(0).reg(); |
| 965 Register value_reg = locs()->in(1).reg(); | |
| 966 if (this->value()->NeedsStoreBuffer() && emit_store_barrier()) { | 965 if (this->value()->NeedsStoreBuffer() && emit_store_barrier()) { |
| 966 Register value_reg = locs()->in(1).reg(); | |
| 967 __ StoreIntoObject(instance_reg, | 967 __ StoreIntoObject(instance_reg, |
| 968 FieldAddress(instance_reg, field().Offset()), value_reg); | 968 FieldAddress(instance_reg, field().Offset()), value_reg); |
| 969 } else { | 969 } else { |
| 970 __ StoreIntoObjectNoBarrier(instance_reg, | 970 if (locs()->in(1).IsConstant()) { |
| 971 FieldAddress(instance_reg, field().Offset()), value_reg); | 971 __ StoreIntoObjectNoBarrier( |
| 972 instance_reg, | |
| 973 FieldAddress(instance_reg, field().Offset()), | |
| 974 locs()->in(1).constant()); | |
| 975 } else { | |
| 976 Register value_reg = locs()->in(1).reg(); | |
| 977 __ StoreIntoObjectNoBarrier(instance_reg, | |
| 978 FieldAddress(instance_reg, field().Offset()), value_reg); | |
| 979 } | |
| 972 } | 980 } |
| 973 } | 981 } |
| 974 | 982 |
| 975 | 983 |
| 976 LocationSummary* LoadStaticFieldInstr::MakeLocationSummary() const { | 984 LocationSummary* LoadStaticFieldInstr::MakeLocationSummary() const { |
| 977 return LocationSummary::Make(0, | 985 return LocationSummary::Make(0, |
| 978 Location::RequiresRegister(), | 986 Location::RequiresRegister(), |
| 979 LocationSummary::kNoCall); | 987 LocationSummary::kNoCall); |
| 980 } | 988 } |
| 981 | 989 |
| (...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2261 __ j(ABOVE_EQUAL, deopt); | 2269 __ j(ABOVE_EQUAL, deopt); |
| 2262 } | 2270 } |
| 2263 } | 2271 } |
| 2264 | 2272 |
| 2265 | 2273 |
| 2266 } // namespace dart | 2274 } // namespace dart |
| 2267 | 2275 |
| 2268 #undef __ | 2276 #undef __ |
| 2269 | 2277 |
| 2270 #endif // defined TARGET_ARCH_X64 | 2278 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |