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/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 1993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2004 | 2004 |
2005 | 2005 |
2006 LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary(Zone* zone, | 2006 LocationSummary* StoreInstanceFieldInstr::MakeLocationSummary(Zone* zone, |
2007 bool opt) const { | 2007 bool opt) const { |
2008 const intptr_t kNumInputs = 2; | 2008 const intptr_t kNumInputs = 2; |
2009 const intptr_t kNumTemps = | 2009 const intptr_t kNumTemps = |
2010 (IsUnboxedStore() && opt) ? 2 : | 2010 (IsUnboxedStore() && opt) ? 2 : |
2011 ((IsPotentialUnboxedStore()) ? 3 : 0); | 2011 ((IsPotentialUnboxedStore()) ? 3 : 0); |
2012 LocationSummary* summary = new(zone) LocationSummary( | 2012 LocationSummary* summary = new(zone) LocationSummary( |
2013 zone, kNumInputs, kNumTemps, | 2013 zone, kNumInputs, kNumTemps, |
2014 ((IsUnboxedStore() && opt && is_potential_unboxed_initialization_) || | 2014 ((IsUnboxedStore() && opt && is_initialization()) || |
2015 IsPotentialUnboxedStore()) | 2015 IsPotentialUnboxedStore()) |
2016 ? LocationSummary::kCallOnSlowPath | 2016 ? LocationSummary::kCallOnSlowPath |
2017 : LocationSummary::kNoCall); | 2017 : LocationSummary::kNoCall); |
2018 | 2018 |
2019 summary->set_in(0, Location::RequiresRegister()); | 2019 summary->set_in(0, Location::RequiresRegister()); |
2020 if (IsUnboxedStore() && opt) { | 2020 if (IsUnboxedStore() && opt) { |
2021 summary->set_in(1, Location::RequiresFpuRegister()); | 2021 summary->set_in(1, Location::RequiresFpuRegister()); |
2022 summary->set_temp(0, Location::RequiresRegister()); | 2022 summary->set_temp(0, Location::RequiresRegister()); |
2023 summary->set_temp(1, Location::RequiresRegister()); | 2023 summary->set_temp(1, Location::RequiresRegister()); |
2024 } else if (IsPotentialUnboxedStore()) { | 2024 } else if (IsPotentialUnboxedStore()) { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2065 Label skip_store; | 2065 Label skip_store; |
2066 | 2066 |
2067 const Register instance_reg = locs()->in(0).reg(); | 2067 const Register instance_reg = locs()->in(0).reg(); |
2068 | 2068 |
2069 if (IsUnboxedStore() && compiler->is_optimizing()) { | 2069 if (IsUnboxedStore() && compiler->is_optimizing()) { |
2070 const DRegister value = EvenDRegisterOf(locs()->in(1).fpu_reg()); | 2070 const DRegister value = EvenDRegisterOf(locs()->in(1).fpu_reg()); |
2071 const Register temp = locs()->temp(0).reg(); | 2071 const Register temp = locs()->temp(0).reg(); |
2072 const Register temp2 = locs()->temp(1).reg(); | 2072 const Register temp2 = locs()->temp(1).reg(); |
2073 const intptr_t cid = field().UnboxedFieldCid(); | 2073 const intptr_t cid = field().UnboxedFieldCid(); |
2074 | 2074 |
2075 if (is_potential_unboxed_initialization_) { | 2075 if (is_initialization()) { |
2076 const Class* cls = NULL; | 2076 const Class* cls = NULL; |
2077 switch (cid) { | 2077 switch (cid) { |
2078 case kDoubleCid: | 2078 case kDoubleCid: |
2079 cls = &compiler->double_class(); | 2079 cls = &compiler->double_class(); |
2080 break; | 2080 break; |
2081 case kFloat32x4Cid: | 2081 case kFloat32x4Cid: |
2082 cls = &compiler->float32x4_class(); | 2082 cls = &compiler->float32x4_class(); |
2083 break; | 2083 break; |
2084 case kFloat64x2Cid: | 2084 case kFloat64x2Cid: |
2085 cls = &compiler->float64x2_class(); | 2085 cls = &compiler->float64x2_class(); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2207 } | 2207 } |
2208 | 2208 |
2209 if (ShouldEmitStoreBarrier()) { | 2209 if (ShouldEmitStoreBarrier()) { |
2210 const Register value_reg = locs()->in(1).reg(); | 2210 const Register value_reg = locs()->in(1).reg(); |
2211 __ StoreIntoObjectOffset(instance_reg, | 2211 __ StoreIntoObjectOffset(instance_reg, |
2212 offset_in_bytes_, | 2212 offset_in_bytes_, |
2213 value_reg, | 2213 value_reg, |
2214 CanValueBeSmi()); | 2214 CanValueBeSmi()); |
2215 } else { | 2215 } else { |
2216 if (locs()->in(1).IsConstant()) { | 2216 if (locs()->in(1).IsConstant()) { |
2217 __ StoreIntoObjectNoBarrierOffset( | 2217 __ StoreIntoObjectNoBarrierOffset(instance_reg, |
2218 instance_reg, | 2218 offset_in_bytes_, |
2219 offset_in_bytes_, | 2219 locs()->in(1).constant()); |
2220 locs()->in(1).constant(), | |
2221 is_object_reference_initialization_ ? | |
2222 Assembler::kEmptyOrSmiOrNull : | |
2223 Assembler::kHeapObjectOrSmi); | |
2224 } else { | 2220 } else { |
2225 const Register value_reg = locs()->in(1).reg(); | 2221 const Register value_reg = locs()->in(1).reg(); |
2226 __ StoreIntoObjectNoBarrierOffset(instance_reg, | 2222 __ StoreIntoObjectNoBarrierOffset(instance_reg, |
2227 offset_in_bytes_, | 2223 offset_in_bytes_, |
2228 value_reg, | 2224 value_reg); |
2229 is_object_reference_initialization_ ? | |
2230 Assembler::kEmptyOrSmiOrNull : | |
2231 Assembler::kHeapObjectOrSmi); | |
2232 } | 2225 } |
2233 } | 2226 } |
2234 __ Bind(&skip_store); | 2227 __ Bind(&skip_store); |
2235 } | 2228 } |
2236 | 2229 |
2237 | 2230 |
2238 LocationSummary* LoadStaticFieldInstr::MakeLocationSummary(Zone* zone, | 2231 LocationSummary* LoadStaticFieldInstr::MakeLocationSummary(Zone* zone, |
2239 bool opt) const { | 2232 bool opt) const { |
2240 const intptr_t kNumInputs = 1; | 2233 const intptr_t kNumInputs = 1; |
2241 const intptr_t kNumTemps = 0; | 2234 const intptr_t kNumTemps = 0; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2338 | 2331 |
2339 __ TryAllocateArray(kArrayCid, instance_size, slow_path, | 2332 __ TryAllocateArray(kArrayCid, instance_size, slow_path, |
2340 R0, // instance | 2333 R0, // instance |
2341 R3, // end address | 2334 R3, // end address |
2342 R8, | 2335 R8, |
2343 R6); | 2336 R6); |
2344 // R0: new object start as a tagged pointer. | 2337 // R0: new object start as a tagged pointer. |
2345 // R3: new object end address. | 2338 // R3: new object end address. |
2346 | 2339 |
2347 // Store the type argument field. | 2340 // Store the type argument field. |
2348 __ InitializeFieldNoBarrier(R0, | 2341 __ StoreIntoObjectNoBarrier(R0, |
2349 FieldAddress(R0, Array::type_arguments_offset()), | 2342 FieldAddress(R0, Array::type_arguments_offset()), |
2350 kElemTypeReg); | 2343 kElemTypeReg); |
2351 | 2344 |
2352 // Set the length field. | 2345 // Set the length field. |
2353 __ InitializeFieldNoBarrier(R0, | 2346 __ StoreIntoObjectNoBarrier(R0, |
2354 FieldAddress(R0, Array::length_offset()), | 2347 FieldAddress(R0, Array::length_offset()), |
2355 kLengthReg); | 2348 kLengthReg); |
2356 | 2349 |
2357 // Initialize all array elements to raw_null. | 2350 // Initialize all array elements to raw_null. |
2358 // R0: new object start as a tagged pointer. | 2351 // R0: new object start as a tagged pointer. |
2359 // R3: new object end address. | 2352 // R3: new object end address. |
2360 // R6: iterator which initially points to the start of the variable | 2353 // R6: iterator which initially points to the start of the variable |
2361 // data area to be initialized. | 2354 // data area to be initialized. |
2362 // R8: null | 2355 // R8: null |
2363 if (num_elements > 0) { | 2356 if (num_elements > 0) { |
(...skipping 4590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6954 1, | 6947 1, |
6955 locs()); | 6948 locs()); |
6956 __ Drop(1); | 6949 __ Drop(1); |
6957 __ Pop(result); | 6950 __ Pop(result); |
6958 } | 6951 } |
6959 | 6952 |
6960 | 6953 |
6961 } // namespace dart | 6954 } // namespace dart |
6962 | 6955 |
6963 #endif // defined TARGET_ARCH_ARM | 6956 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |