Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(578)

Side by Side Diff: runtime/vm/intermediate_language_mips.cc

Issue 1722733002: In background compilation make a copy of Field in order to freeze its state (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: e Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
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 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after
1634 locs()->temp(locs()->temp_count() - 1).reg() : kNoRegister; 1634 locs()->temp(locs()->temp_count() - 1).reg() : kNoRegister;
1635 1635
1636 Label ok, fail_label; 1636 Label ok, fail_label;
1637 1637
1638 Label* deopt = compiler->is_optimizing() ? 1638 Label* deopt = compiler->is_optimizing() ?
1639 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL; 1639 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL;
1640 1640
1641 Label* fail = (deopt != NULL) ? deopt : &fail_label; 1641 Label* fail = (deopt != NULL) ? deopt : &fail_label;
1642 1642
1643 if (emit_full_guard) { 1643 if (emit_full_guard) {
1644 __ LoadObject(field_reg, Field::ZoneHandle(field().raw())); 1644 __ LoadObject(field_reg, Field::ZoneHandle(field().Original()));
1645 1645
1646 FieldAddress field_cid_operand(field_reg, Field::guarded_cid_offset()); 1646 FieldAddress field_cid_operand(field_reg, Field::guarded_cid_offset());
1647 FieldAddress field_nullability_operand( 1647 FieldAddress field_nullability_operand(
1648 field_reg, Field::is_nullable_offset()); 1648 field_reg, Field::is_nullable_offset());
1649 1649
1650 if (value_cid == kDynamicCid) { 1650 if (value_cid == kDynamicCid) {
1651 LoadValueCid(compiler, value_cid_reg, value_reg); 1651 LoadValueCid(compiler, value_cid_reg, value_reg);
1652 1652
1653 __ lhu(CMPRES1, field_cid_operand); 1653 __ lhu(CMPRES1, field_cid_operand);
1654 __ beq(value_cid_reg, CMPRES1, &ok); 1654 __ beq(value_cid_reg, CMPRES1, &ok);
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
1779 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL; 1779 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptGuardField) : NULL;
1780 1780
1781 const Register value_reg = locs()->in(0).reg(); 1781 const Register value_reg = locs()->in(0).reg();
1782 1782
1783 if (!compiler->is_optimizing() || 1783 if (!compiler->is_optimizing() ||
1784 (field().guarded_list_length() == Field::kUnknownFixedLength)) { 1784 (field().guarded_list_length() == Field::kUnknownFixedLength)) {
1785 const Register field_reg = locs()->temp(0).reg(); 1785 const Register field_reg = locs()->temp(0).reg();
1786 1786
1787 Label ok; 1787 Label ok;
1788 1788
1789 __ LoadObject(field_reg, Field::ZoneHandle(field().raw())); 1789 __ LoadObject(field_reg, Field::ZoneHandle(field().Original()));
1790 1790
1791 __ lb(CMPRES1, FieldAddress(field_reg, 1791 __ lb(CMPRES1, FieldAddress(field_reg,
1792 Field::guarded_list_length_in_object_offset_offset())); 1792 Field::guarded_list_length_in_object_offset_offset()));
1793 __ blez(CMPRES1, &ok); 1793 __ blez(CMPRES1, &ok);
1794 1794
1795 __ lw(CMPRES2, FieldAddress(field_reg, 1795 __ lw(CMPRES2, FieldAddress(field_reg,
1796 Field::guarded_list_length_offset())); 1796 Field::guarded_list_length_offset()));
1797 1797
1798 // Load the length from the value. GuardFieldClass already verified that 1798 // Load the length from the value. GuardFieldClass already verified that
1799 // value's class matches guarded class id of the field. 1799 // value's class matches guarded class id of the field.
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
1994 1994
1995 if (ShouldEmitStoreBarrier()) { 1995 if (ShouldEmitStoreBarrier()) {
1996 // Value input is a writable register and should be manually preserved 1996 // Value input is a writable register and should be manually preserved
1997 // across allocation slow-path. 1997 // across allocation slow-path.
1998 locs()->live_registers()->Add(locs()->in(1), kTagged); 1998 locs()->live_registers()->Add(locs()->in(1), kTagged);
1999 } 1999 }
2000 2000
2001 Label store_pointer; 2001 Label store_pointer;
2002 Label store_double; 2002 Label store_double;
2003 2003
2004 __ LoadObject(temp, Field::ZoneHandle(field().raw())); 2004 __ LoadObject(temp, *field().OriginalAsHandle(compiler->zone()));
siva 2016/02/25 23:38:33 Ditto.
2005 2005
2006 __ lhu(temp2, FieldAddress(temp, Field::is_nullable_offset())); 2006 __ lhu(temp2, FieldAddress(temp, Field::is_nullable_offset()));
2007 __ BranchEqual(temp2, Immediate(kNullCid), &store_pointer); 2007 __ BranchEqual(temp2, Immediate(kNullCid), &store_pointer);
2008 2008
2009 __ lbu(temp2, FieldAddress(temp, Field::kind_bits_offset())); 2009 __ lbu(temp2, FieldAddress(temp, Field::kind_bits_offset()));
2010 __ andi(CMPRES1, temp2, Immediate(1 << Field::kUnboxingCandidateBit)); 2010 __ andi(CMPRES1, temp2, Immediate(1 << Field::kUnboxingCandidateBit));
2011 __ beq(CMPRES1, ZR, &store_pointer); 2011 __ beq(CMPRES1, ZR, &store_pointer);
2012 2012
2013 __ lhu(temp2, FieldAddress(temp, Field::guarded_cid_offset())); 2013 __ lhu(temp2, FieldAddress(temp, Field::guarded_cid_offset()));
2014 __ BranchEqual(temp2, Immediate(kDoubleCid), &store_double); 2014 __ BranchEqual(temp2, Immediate(kDoubleCid), &store_double);
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
2100 locs->set_temp(0, Location::RequiresRegister()); 2100 locs->set_temp(0, Location::RequiresRegister());
2101 return locs; 2101 return locs;
2102 } 2102 }
2103 2103
2104 2104
2105 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2105 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2106 __ Comment("StoreStaticFieldInstr"); 2106 __ Comment("StoreStaticFieldInstr");
2107 Register value = locs()->in(0).reg(); 2107 Register value = locs()->in(0).reg();
2108 Register temp = locs()->temp(0).reg(); 2108 Register temp = locs()->temp(0).reg();
2109 2109
2110 __ LoadObject(temp, field()); 2110 __ LoadObject(temp, *field().OriginalAsHandle(compiler->zone()));
siva 2016/02/25 23:38:33 Ditto.
2111 if (this->value()->NeedsStoreBuffer()) { 2111 if (this->value()->NeedsStoreBuffer()) {
2112 __ StoreIntoObject(temp, 2112 __ StoreIntoObject(temp,
2113 FieldAddress(temp, Field::static_value_offset()), 2113 FieldAddress(temp, Field::static_value_offset()),
2114 value, 2114 value,
2115 CanValueBeSmi()); 2115 CanValueBeSmi());
2116 } else { 2116 } else {
2117 __ StoreIntoObjectNoBarrier( 2117 __ StoreIntoObjectNoBarrier(
2118 temp, FieldAddress(temp, Field::static_value_offset()), value); 2118 temp, FieldAddress(temp, Field::static_value_offset()), value);
2119 } 2119 }
2120 } 2120 }
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
2310 2310
2311 Label done; 2311 Label done;
2312 Register result_reg = locs()->out(0).reg(); 2312 Register result_reg = locs()->out(0).reg();
2313 if (IsPotentialUnboxedLoad()) { 2313 if (IsPotentialUnboxedLoad()) {
2314 Register temp = locs()->temp(1).reg(); 2314 Register temp = locs()->temp(1).reg();
2315 DRegister value = locs()->temp(0).fpu_reg(); 2315 DRegister value = locs()->temp(0).fpu_reg();
2316 2316
2317 Label load_pointer; 2317 Label load_pointer;
2318 Label load_double; 2318 Label load_double;
2319 2319
2320 __ LoadObject(result_reg, Field::ZoneHandle(field()->raw())); 2320 __ LoadObject(result_reg, Field::ZoneHandle(field()->Original()));
2321 2321
2322 FieldAddress field_cid_operand(result_reg, Field::guarded_cid_offset()); 2322 FieldAddress field_cid_operand(result_reg, Field::guarded_cid_offset());
2323 FieldAddress field_nullability_operand(result_reg, 2323 FieldAddress field_nullability_operand(result_reg,
2324 Field::is_nullable_offset()); 2324 Field::is_nullable_offset());
2325 2325
2326 __ lhu(temp, field_nullability_operand); 2326 __ lhu(temp, field_nullability_operand);
2327 __ BranchEqual(temp, Immediate(kNullCid), &load_pointer); 2327 __ BranchEqual(temp, Immediate(kNullCid), &load_pointer);
2328 2328
2329 __ lhu(temp, field_cid_operand); 2329 __ lhu(temp, field_cid_operand);
2330 __ BranchEqual(temp, Immediate(kDoubleCid), &load_double); 2330 __ BranchEqual(temp, Immediate(kDoubleCid), &load_double);
(...skipping 3266 matching lines...) Expand 10 before | Expand all | Expand 10 after
5597 1, 5597 1,
5598 locs()); 5598 locs());
5599 __ lw(result, Address(SP, 1 * kWordSize)); 5599 __ lw(result, Address(SP, 1 * kWordSize));
5600 __ addiu(SP, SP, Immediate(2 * kWordSize)); 5600 __ addiu(SP, SP, Immediate(2 * kWordSize));
5601 } 5601 }
5602 5602
5603 5603
5604 } // namespace dart 5604 } // namespace dart
5605 5605
5606 #endif // defined TARGET_ARCH_MIPS 5606 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698