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_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 "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1434 locs()->temp(locs()->temp_count() - 1).reg() : kNoRegister; | 1434 locs()->temp(locs()->temp_count() - 1).reg() : kNoRegister; |
1435 | 1435 |
1436 Label ok, fail_label; | 1436 Label ok, fail_label; |
1437 | 1437 |
1438 Label* deopt = compiler->is_optimizing() ? | 1438 Label* deopt = compiler->is_optimizing() ? |
1439 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL; | 1439 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL; |
1440 | 1440 |
1441 Label* fail = (deopt != NULL) ? deopt : &fail_label; | 1441 Label* fail = (deopt != NULL) ? deopt : &fail_label; |
1442 | 1442 |
1443 if (emit_full_guard) { | 1443 if (emit_full_guard) { |
1444 __ LoadObject(field_reg, Field::ZoneHandle(field().raw())); | 1444 __ LoadObject(field_reg, Field::ZoneHandle(field().Original())); |
1445 | 1445 |
1446 FieldAddress field_cid_operand(field_reg, Field::guarded_cid_offset()); | 1446 FieldAddress field_cid_operand(field_reg, Field::guarded_cid_offset()); |
1447 FieldAddress field_nullability_operand( | 1447 FieldAddress field_nullability_operand( |
1448 field_reg, Field::is_nullable_offset()); | 1448 field_reg, Field::is_nullable_offset()); |
1449 | 1449 |
1450 if (value_cid == kDynamicCid) { | 1450 if (value_cid == kDynamicCid) { |
1451 LoadValueCid(compiler, value_cid_reg, value_reg); | 1451 LoadValueCid(compiler, value_cid_reg, value_reg); |
1452 __ cmpw(value_cid_reg, field_cid_operand); | 1452 __ cmpw(value_cid_reg, field_cid_operand); |
1453 __ j(EQUAL, &ok); | 1453 __ j(EQUAL, &ok); |
1454 __ cmpw(value_cid_reg, field_nullability_operand); | 1454 __ cmpw(value_cid_reg, field_nullability_operand); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1582 const Register value_reg = locs()->in(0).reg(); | 1582 const Register value_reg = locs()->in(0).reg(); |
1583 | 1583 |
1584 if (!compiler->is_optimizing() || | 1584 if (!compiler->is_optimizing() || |
1585 (field().guarded_list_length() == Field::kUnknownFixedLength)) { | 1585 (field().guarded_list_length() == Field::kUnknownFixedLength)) { |
1586 const Register field_reg = locs()->temp(0).reg(); | 1586 const Register field_reg = locs()->temp(0).reg(); |
1587 const Register offset_reg = locs()->temp(1).reg(); | 1587 const Register offset_reg = locs()->temp(1).reg(); |
1588 const Register length_reg = locs()->temp(2).reg(); | 1588 const Register length_reg = locs()->temp(2).reg(); |
1589 | 1589 |
1590 Label ok; | 1590 Label ok; |
1591 | 1591 |
1592 __ LoadObject(field_reg, Field::ZoneHandle(field().raw())); | 1592 __ LoadObject(field_reg, Field::ZoneHandle(field().Original())); |
1593 | 1593 |
1594 __ movsxb(offset_reg, FieldAddress(field_reg, | 1594 __ movsxb(offset_reg, FieldAddress(field_reg, |
1595 Field::guarded_list_length_in_object_offset_offset())); | 1595 Field::guarded_list_length_in_object_offset_offset())); |
1596 __ movl(length_reg, FieldAddress(field_reg, | 1596 __ movl(length_reg, FieldAddress(field_reg, |
1597 Field::guarded_list_length_offset())); | 1597 Field::guarded_list_length_offset())); |
1598 | 1598 |
1599 __ cmpl(offset_reg, Immediate(0)); | 1599 __ cmpl(offset_reg, Immediate(0)); |
1600 __ j(NEGATIVE, &ok); | 1600 __ j(NEGATIVE, &ok); |
1601 | 1601 |
1602 // Load the length from the value. GuardFieldClass already verified that | 1602 // Load the length from the value. GuardFieldClass already verified that |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1822 // Value input is a writable register and should be manually preserved | 1822 // Value input is a writable register and should be manually preserved |
1823 // across allocation slow-path. | 1823 // across allocation slow-path. |
1824 locs()->live_registers()->Add(locs()->in(1), kTagged); | 1824 locs()->live_registers()->Add(locs()->in(1), kTagged); |
1825 } | 1825 } |
1826 | 1826 |
1827 Label store_pointer; | 1827 Label store_pointer; |
1828 Label store_double; | 1828 Label store_double; |
1829 Label store_float32x4; | 1829 Label store_float32x4; |
1830 Label store_float64x2; | 1830 Label store_float64x2; |
1831 | 1831 |
1832 __ LoadObject(temp, Field::ZoneHandle(field().raw())); | 1832 __ LoadObject(temp, *field().OriginalAsHandle(compiler->zone())); |
siva
2016/02/25 23:38:32
Ditto.
| |
1833 | 1833 |
1834 __ cmpw(FieldAddress(temp, Field::is_nullable_offset()), | 1834 __ cmpw(FieldAddress(temp, Field::is_nullable_offset()), |
1835 Immediate(kNullCid)); | 1835 Immediate(kNullCid)); |
1836 __ j(EQUAL, &store_pointer); | 1836 __ j(EQUAL, &store_pointer); |
1837 | 1837 |
1838 __ movzxb(temp2, FieldAddress(temp, Field::kind_bits_offset())); | 1838 __ movzxb(temp2, FieldAddress(temp, Field::kind_bits_offset())); |
1839 __ testl(temp2, Immediate(1 << Field::kUnboxingCandidateBit)); | 1839 __ testl(temp2, Immediate(1 << Field::kUnboxingCandidateBit)); |
1840 __ j(ZERO, &store_pointer); | 1840 __ j(ZERO, &store_pointer); |
1841 | 1841 |
1842 __ cmpw(FieldAddress(temp, Field::guarded_cid_offset()), | 1842 __ cmpw(FieldAddress(temp, Field::guarded_cid_offset()), |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1968 : Location::RequiresRegister()); | 1968 : Location::RequiresRegister()); |
1969 locs->set_temp(0, Location::RequiresRegister()); | 1969 locs->set_temp(0, Location::RequiresRegister()); |
1970 return locs; | 1970 return locs; |
1971 } | 1971 } |
1972 | 1972 |
1973 | 1973 |
1974 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 1974 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
1975 Register value = locs()->in(0).reg(); | 1975 Register value = locs()->in(0).reg(); |
1976 Register temp = locs()->temp(0).reg(); | 1976 Register temp = locs()->temp(0).reg(); |
1977 | 1977 |
1978 __ LoadObject(temp, field()); | 1978 __ LoadObject(temp, *field().OriginalAsHandle(compiler->zone())); |
siva
2016/02/25 23:38:33
Ditto.
| |
1979 if (this->value()->NeedsStoreBuffer()) { | 1979 if (this->value()->NeedsStoreBuffer()) { |
1980 __ StoreIntoObject(temp, | 1980 __ StoreIntoObject(temp, |
1981 FieldAddress(temp, Field::static_value_offset()), | 1981 FieldAddress(temp, Field::static_value_offset()), |
1982 value, | 1982 value, |
1983 CanValueBeSmi()); | 1983 CanValueBeSmi()); |
1984 } else { | 1984 } else { |
1985 __ StoreIntoObjectNoBarrier( | 1985 __ StoreIntoObjectNoBarrier( |
1986 temp, FieldAddress(temp, Field::static_value_offset()), value); | 1986 temp, FieldAddress(temp, Field::static_value_offset()), value); |
1987 } | 1987 } |
1988 } | 1988 } |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2191 if (IsPotentialUnboxedLoad()) { | 2191 if (IsPotentialUnboxedLoad()) { |
2192 Register temp = locs()->temp(1).reg(); | 2192 Register temp = locs()->temp(1).reg(); |
2193 XmmRegister value = locs()->temp(0).fpu_reg(); | 2193 XmmRegister value = locs()->temp(0).fpu_reg(); |
2194 | 2194 |
2195 | 2195 |
2196 Label load_pointer; | 2196 Label load_pointer; |
2197 Label load_double; | 2197 Label load_double; |
2198 Label load_float32x4; | 2198 Label load_float32x4; |
2199 Label load_float64x2; | 2199 Label load_float64x2; |
2200 | 2200 |
2201 __ LoadObject(result, Field::ZoneHandle(field()->raw())); | 2201 __ LoadObject(result, Field::ZoneHandle(field()->Original())); |
2202 | 2202 |
2203 FieldAddress field_cid_operand(result, Field::guarded_cid_offset()); | 2203 FieldAddress field_cid_operand(result, Field::guarded_cid_offset()); |
2204 FieldAddress field_nullability_operand(result, Field::is_nullable_offset()); | 2204 FieldAddress field_nullability_operand(result, Field::is_nullable_offset()); |
2205 | 2205 |
2206 __ cmpw(field_nullability_operand, Immediate(kNullCid)); | 2206 __ cmpw(field_nullability_operand, Immediate(kNullCid)); |
2207 __ j(EQUAL, &load_pointer); | 2207 __ j(EQUAL, &load_pointer); |
2208 | 2208 |
2209 __ cmpw(field_cid_operand, Immediate(kDoubleCid)); | 2209 __ cmpw(field_cid_operand, Immediate(kDoubleCid)); |
2210 __ j(EQUAL, &load_double); | 2210 __ j(EQUAL, &load_double); |
2211 | 2211 |
(...skipping 4620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6832 __ Drop(1); | 6832 __ Drop(1); |
6833 __ popl(result); | 6833 __ popl(result); |
6834 } | 6834 } |
6835 | 6835 |
6836 | 6836 |
6837 } // namespace dart | 6837 } // namespace dart |
6838 | 6838 |
6839 #undef __ | 6839 #undef __ |
6840 | 6840 |
6841 #endif // defined TARGET_ARCH_IA32 | 6841 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |