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 1592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1603 locs()->temp(locs()->temp_count() - 1).reg() : kNoRegister; | 1603 locs()->temp(locs()->temp_count() - 1).reg() : kNoRegister; |
1604 | 1604 |
1605 Label ok, fail_label; | 1605 Label ok, fail_label; |
1606 | 1606 |
1607 Label* deopt = compiler->is_optimizing() ? | 1607 Label* deopt = compiler->is_optimizing() ? |
1608 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL; | 1608 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL; |
1609 | 1609 |
1610 Label* fail = (deopt != NULL) ? deopt : &fail_label; | 1610 Label* fail = (deopt != NULL) ? deopt : &fail_label; |
1611 | 1611 |
1612 if (emit_full_guard) { | 1612 if (emit_full_guard) { |
1613 __ LoadObject(field_reg, Field::ZoneHandle(field().raw())); | 1613 __ LoadObject(field_reg, Field::ZoneHandle(field().Original())); |
1614 | 1614 |
1615 FieldAddress field_cid_operand(field_reg, Field::guarded_cid_offset()); | 1615 FieldAddress field_cid_operand(field_reg, Field::guarded_cid_offset()); |
1616 FieldAddress field_nullability_operand( | 1616 FieldAddress field_nullability_operand( |
1617 field_reg, Field::is_nullable_offset()); | 1617 field_reg, Field::is_nullable_offset()); |
1618 | 1618 |
1619 if (value_cid == kDynamicCid) { | 1619 if (value_cid == kDynamicCid) { |
1620 LoadValueCid(compiler, value_cid_reg, value_reg); | 1620 LoadValueCid(compiler, value_cid_reg, value_reg); |
1621 __ ldrh(IP, field_cid_operand); | 1621 __ ldrh(IP, field_cid_operand); |
1622 __ cmp(value_cid_reg, Operand(IP)); | 1622 __ cmp(value_cid_reg, Operand(IP)); |
1623 __ b(&ok, EQ); | 1623 __ b(&ok, EQ); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1750 const Register value_reg = locs()->in(0).reg(); | 1750 const Register value_reg = locs()->in(0).reg(); |
1751 | 1751 |
1752 if (!compiler->is_optimizing() || | 1752 if (!compiler->is_optimizing() || |
1753 (field().guarded_list_length() == Field::kUnknownFixedLength)) { | 1753 (field().guarded_list_length() == Field::kUnknownFixedLength)) { |
1754 const Register field_reg = locs()->temp(0).reg(); | 1754 const Register field_reg = locs()->temp(0).reg(); |
1755 const Register offset_reg = locs()->temp(1).reg(); | 1755 const Register offset_reg = locs()->temp(1).reg(); |
1756 const Register length_reg = locs()->temp(2).reg(); | 1756 const Register length_reg = locs()->temp(2).reg(); |
1757 | 1757 |
1758 Label ok; | 1758 Label ok; |
1759 | 1759 |
1760 __ LoadObject(field_reg, Field::ZoneHandle(field().raw())); | 1760 __ LoadObject(field_reg, Field::ZoneHandle(field().Original())); |
1761 | 1761 |
1762 __ ldrsb(offset_reg, FieldAddress(field_reg, | 1762 __ ldrsb(offset_reg, FieldAddress(field_reg, |
1763 Field::guarded_list_length_in_object_offset_offset())); | 1763 Field::guarded_list_length_in_object_offset_offset())); |
1764 __ ldr(length_reg, FieldAddress(field_reg, | 1764 __ ldr(length_reg, FieldAddress(field_reg, |
1765 Field::guarded_list_length_offset())); | 1765 Field::guarded_list_length_offset())); |
1766 | 1766 |
1767 __ tst(offset_reg, Operand(offset_reg)); | 1767 __ tst(offset_reg, Operand(offset_reg)); |
1768 __ b(&ok, MI); | 1768 __ b(&ok, MI); |
1769 | 1769 |
1770 // Load the length from the value. GuardFieldClass already verified that | 1770 // Load the length from the value. GuardFieldClass already verified that |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2107 // Value input is a writable register and should be manually preserved | 2107 // Value input is a writable register and should be manually preserved |
2108 // across allocation slow-path. | 2108 // across allocation slow-path. |
2109 locs()->live_registers()->Add(locs()->in(1), kTagged); | 2109 locs()->live_registers()->Add(locs()->in(1), kTagged); |
2110 } | 2110 } |
2111 | 2111 |
2112 Label store_pointer; | 2112 Label store_pointer; |
2113 Label store_double; | 2113 Label store_double; |
2114 Label store_float32x4; | 2114 Label store_float32x4; |
2115 Label store_float64x2; | 2115 Label store_float64x2; |
2116 | 2116 |
2117 __ LoadObject(temp, Field::ZoneHandle(field().raw())); | 2117 __ LoadObject(temp, *field().OriginalAsHandle(compiler->zone())); |
siva
2016/02/25 23:38:32
__ LoadObject(temp, Field::ZoneHandle(compiler->zo
srdjan
2016/02/26 00:40:42
Done.
| |
2118 | 2118 |
2119 __ ldrh(temp2, FieldAddress(temp, Field::is_nullable_offset())); | 2119 __ ldrh(temp2, FieldAddress(temp, Field::is_nullable_offset())); |
2120 __ CompareImmediate(temp2, kNullCid); | 2120 __ CompareImmediate(temp2, kNullCid); |
2121 __ b(&store_pointer, EQ); | 2121 __ b(&store_pointer, EQ); |
2122 | 2122 |
2123 __ ldrb(temp2, FieldAddress(temp, Field::kind_bits_offset())); | 2123 __ ldrb(temp2, FieldAddress(temp, Field::kind_bits_offset())); |
2124 __ tst(temp2, Operand(1 << Field::kUnboxingCandidateBit)); | 2124 __ tst(temp2, Operand(1 << Field::kUnboxingCandidateBit)); |
2125 __ b(&store_pointer, EQ); | 2125 __ b(&store_pointer, EQ); |
2126 | 2126 |
2127 __ ldrh(temp2, FieldAddress(temp, Field::guarded_cid_offset())); | 2127 __ ldrh(temp2, FieldAddress(temp, Field::guarded_cid_offset())); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2247 : Location::RequiresRegister()); | 2247 : Location::RequiresRegister()); |
2248 locs->set_temp(0, Location::RequiresRegister()); | 2248 locs->set_temp(0, Location::RequiresRegister()); |
2249 return locs; | 2249 return locs; |
2250 } | 2250 } |
2251 | 2251 |
2252 | 2252 |
2253 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2253 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2254 const Register value = locs()->in(0).reg(); | 2254 const Register value = locs()->in(0).reg(); |
2255 const Register temp = locs()->temp(0).reg(); | 2255 const Register temp = locs()->temp(0).reg(); |
2256 | 2256 |
2257 __ LoadObject(temp, field()); | 2257 __ LoadObject(temp, *field().OriginalAsHandle(compiler->zone())); |
siva
2016/02/25 23:38:32
Ditto.
| |
2258 if (this->value()->NeedsStoreBuffer()) { | 2258 if (this->value()->NeedsStoreBuffer()) { |
2259 __ StoreIntoObject(temp, | 2259 __ StoreIntoObject(temp, |
2260 FieldAddress(temp, Field::static_value_offset()), | 2260 FieldAddress(temp, Field::static_value_offset()), |
2261 value, | 2261 value, |
2262 CanValueBeSmi()); | 2262 CanValueBeSmi()); |
2263 } else { | 2263 } else { |
2264 __ StoreIntoObjectNoBarrier( | 2264 __ StoreIntoObjectNoBarrier( |
2265 temp, FieldAddress(temp, Field::static_value_offset()), value); | 2265 temp, FieldAddress(temp, Field::static_value_offset()), value); |
2266 } | 2266 } |
2267 } | 2267 } |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2469 if (IsPotentialUnboxedLoad()) { | 2469 if (IsPotentialUnboxedLoad()) { |
2470 const DRegister value = EvenDRegisterOf(locs()->temp(0).fpu_reg()); | 2470 const DRegister value = EvenDRegisterOf(locs()->temp(0).fpu_reg()); |
2471 const Register temp = locs()->temp(1).reg(); | 2471 const Register temp = locs()->temp(1).reg(); |
2472 const Register temp2 = locs()->temp(2).reg(); | 2472 const Register temp2 = locs()->temp(2).reg(); |
2473 | 2473 |
2474 Label load_pointer; | 2474 Label load_pointer; |
2475 Label load_double; | 2475 Label load_double; |
2476 Label load_float32x4; | 2476 Label load_float32x4; |
2477 Label load_float64x2; | 2477 Label load_float64x2; |
2478 | 2478 |
2479 __ LoadObject(result_reg, Field::ZoneHandle(field()->raw())); | 2479 __ LoadObject(result_reg, Field::ZoneHandle(field()->Original())); |
2480 | 2480 |
2481 FieldAddress field_cid_operand(result_reg, Field::guarded_cid_offset()); | 2481 FieldAddress field_cid_operand(result_reg, Field::guarded_cid_offset()); |
2482 FieldAddress field_nullability_operand(result_reg, | 2482 FieldAddress field_nullability_operand(result_reg, |
2483 Field::is_nullable_offset()); | 2483 Field::is_nullable_offset()); |
2484 | 2484 |
2485 __ ldrh(temp, field_nullability_operand); | 2485 __ ldrh(temp, field_nullability_operand); |
2486 __ CompareImmediate(temp, kNullCid); | 2486 __ CompareImmediate(temp, kNullCid); |
2487 __ b(&load_pointer, EQ); | 2487 __ b(&load_pointer, EQ); |
2488 | 2488 |
2489 __ ldrh(temp, field_cid_operand); | 2489 __ ldrh(temp, field_cid_operand); |
(...skipping 4333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6823 1, | 6823 1, |
6824 locs()); | 6824 locs()); |
6825 __ Drop(1); | 6825 __ Drop(1); |
6826 __ Pop(result); | 6826 __ Pop(result); |
6827 } | 6827 } |
6828 | 6828 |
6829 | 6829 |
6830 } // namespace dart | 6830 } // namespace dart |
6831 | 6831 |
6832 #endif // defined TARGET_ARCH_ARM | 6832 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |