| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 2226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2237 | 2237 |
| 2238 | 2238 |
| 2239 // When the parser is building an implicit static getter for optimization, | 2239 // When the parser is building an implicit static getter for optimization, |
| 2240 // it can generate a function body where deoptimization ids do not line up | 2240 // it can generate a function body where deoptimization ids do not line up |
| 2241 // with the unoptimized code. | 2241 // with the unoptimized code. |
| 2242 // | 2242 // |
| 2243 // This is safe only so long as LoadStaticFieldInstr cannot deoptimize. | 2243 // This is safe only so long as LoadStaticFieldInstr cannot deoptimize. |
| 2244 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2244 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2245 const Register field = locs()->in(0).reg(); | 2245 const Register field = locs()->in(0).reg(); |
| 2246 const Register result = locs()->out(0).reg(); | 2246 const Register result = locs()->out(0).reg(); |
| 2247 __ LoadFieldFromOffset(kWord, result, field, Field::value_offset()); | 2247 __ LoadFieldFromOffset(kWord, result, field, Field::static_value_offset()); |
| 2248 } | 2248 } |
| 2249 | 2249 |
| 2250 | 2250 |
| 2251 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(Zone* zone, | 2251 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(Zone* zone, |
| 2252 bool opt) const { | 2252 bool opt) const { |
| 2253 LocationSummary* locs = new(zone) LocationSummary( | 2253 LocationSummary* locs = new(zone) LocationSummary( |
| 2254 zone, 1, 1, LocationSummary::kNoCall); | 2254 zone, 1, 1, LocationSummary::kNoCall); |
| 2255 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister() | 2255 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister() |
| 2256 : Location::RequiresRegister()); | 2256 : Location::RequiresRegister()); |
| 2257 locs->set_temp(0, Location::RequiresRegister()); | 2257 locs->set_temp(0, Location::RequiresRegister()); |
| 2258 return locs; | 2258 return locs; |
| 2259 } | 2259 } |
| 2260 | 2260 |
| 2261 | 2261 |
| 2262 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2262 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2263 const Register value = locs()->in(0).reg(); | 2263 const Register value = locs()->in(0).reg(); |
| 2264 const Register temp = locs()->temp(0).reg(); | 2264 const Register temp = locs()->temp(0).reg(); |
| 2265 | 2265 |
| 2266 __ LoadObject(temp, field()); | 2266 __ LoadObject(temp, field()); |
| 2267 if (this->value()->NeedsStoreBuffer()) { | 2267 if (this->value()->NeedsStoreBuffer()) { |
| 2268 __ StoreIntoObject(temp, | 2268 __ StoreIntoObject(temp, |
| 2269 FieldAddress(temp, Field::value_offset()), value, CanValueBeSmi()); | 2269 FieldAddress(temp, Field::static_value_offset()), |
| 2270 value, |
| 2271 CanValueBeSmi()); |
| 2270 } else { | 2272 } else { |
| 2271 __ StoreIntoObjectNoBarrier( | 2273 __ StoreIntoObjectNoBarrier( |
| 2272 temp, FieldAddress(temp, Field::value_offset()), value); | 2274 temp, FieldAddress(temp, Field::static_value_offset()), value); |
| 2273 } | 2275 } |
| 2274 } | 2276 } |
| 2275 | 2277 |
| 2276 | 2278 |
| 2277 LocationSummary* InstanceOfInstr::MakeLocationSummary(Zone* zone, | 2279 LocationSummary* InstanceOfInstr::MakeLocationSummary(Zone* zone, |
| 2278 bool opt) const { | 2280 bool opt) const { |
| 2279 const intptr_t kNumInputs = 3; | 2281 const intptr_t kNumInputs = 3; |
| 2280 const intptr_t kNumTemps = 0; | 2282 const intptr_t kNumTemps = 0; |
| 2281 LocationSummary* summary = new(zone) LocationSummary( | 2283 LocationSummary* summary = new(zone) LocationSummary( |
| 2282 zone, kNumInputs, kNumTemps, LocationSummary::kCall); | 2284 zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2768 locs->set_temp(0, Location::RegisterLocation(R1)); | 2770 locs->set_temp(0, Location::RegisterLocation(R1)); |
| 2769 return locs; | 2771 return locs; |
| 2770 } | 2772 } |
| 2771 | 2773 |
| 2772 | 2774 |
| 2773 void InitStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2775 void InitStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2774 Register field = locs()->in(0).reg(); | 2776 Register field = locs()->in(0).reg(); |
| 2775 Register temp = locs()->temp(0).reg(); | 2777 Register temp = locs()->temp(0).reg(); |
| 2776 Label call_runtime, no_call; | 2778 Label call_runtime, no_call; |
| 2777 | 2779 |
| 2778 __ ldr(temp, FieldAddress(field, Field::value_offset())); | 2780 __ ldr(temp, FieldAddress(field, Field::static_value_offset())); |
| 2779 __ CompareObject(temp, Object::sentinel()); | 2781 __ CompareObject(temp, Object::sentinel()); |
| 2780 __ b(&call_runtime, EQ); | 2782 __ b(&call_runtime, EQ); |
| 2781 | 2783 |
| 2782 __ CompareObject(temp, Object::transition_sentinel()); | 2784 __ CompareObject(temp, Object::transition_sentinel()); |
| 2783 __ b(&no_call, NE); | 2785 __ b(&no_call, NE); |
| 2784 | 2786 |
| 2785 __ Bind(&call_runtime); | 2787 __ Bind(&call_runtime); |
| 2786 __ PushObject(Object::null_object()); // Make room for (unused) result. | 2788 __ PushObject(Object::null_object()); // Make room for (unused) result. |
| 2787 __ Push(field); | 2789 __ Push(field); |
| 2788 compiler->GenerateRuntimeCall(token_pos(), | 2790 compiler->GenerateRuntimeCall(token_pos(), |
| (...skipping 4073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6862 1, | 6864 1, |
| 6863 locs()); | 6865 locs()); |
| 6864 __ Drop(1); | 6866 __ Drop(1); |
| 6865 __ Pop(result); | 6867 __ Pop(result); |
| 6866 } | 6868 } |
| 6867 | 6869 |
| 6868 | 6870 |
| 6869 } // namespace dart | 6871 } // namespace dart |
| 6870 | 6872 |
| 6871 #endif // defined TARGET_ARCH_ARM | 6873 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |