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

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

Issue 1289643005: Rename accessors of class Field to make it more apparent as to what is being accessed - static fiel… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: add-comment Created 5 years, 3 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
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 2074 matching lines...) Expand 10 before | Expand all | Expand 10 after
2085 2085
2086 // When the parser is building an implicit static getter for optimization, 2086 // When the parser is building an implicit static getter for optimization,
2087 // it can generate a function body where deoptimization ids do not line up 2087 // it can generate a function body where deoptimization ids do not line up
2088 // with the unoptimized code. 2088 // with the unoptimized code.
2089 // 2089 //
2090 // This is safe only so long as LoadStaticFieldInstr cannot deoptimize. 2090 // This is safe only so long as LoadStaticFieldInstr cannot deoptimize.
2091 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2091 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2092 __ Comment("LoadStaticFieldInstr"); 2092 __ Comment("LoadStaticFieldInstr");
2093 Register field = locs()->in(0).reg(); 2093 Register field = locs()->in(0).reg();
2094 Register result = locs()->out(0).reg(); 2094 Register result = locs()->out(0).reg();
2095 __ LoadFromOffset(result, field, Field::value_offset() - kHeapObjectTag); 2095 __ LoadFromOffset(result,
2096 field,
2097 Field::static_value_offset() - kHeapObjectTag);
2096 } 2098 }
2097 2099
2098 2100
2099 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(Zone* zone, 2101 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(Zone* zone,
2100 bool opt) const { 2102 bool opt) const {
2101 LocationSummary* locs = new(zone) LocationSummary( 2103 LocationSummary* locs = new(zone) LocationSummary(
2102 zone, 1, 1, LocationSummary::kNoCall); 2104 zone, 1, 1, LocationSummary::kNoCall);
2103 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister() 2105 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister()
2104 : Location::RequiresRegister()); 2106 : Location::RequiresRegister());
2105 locs->set_temp(0, Location::RequiresRegister()); 2107 locs->set_temp(0, Location::RequiresRegister());
2106 return locs; 2108 return locs;
2107 } 2109 }
2108 2110
2109 2111
2110 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2112 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2111 __ Comment("StoreStaticFieldInstr"); 2113 __ Comment("StoreStaticFieldInstr");
2112 Register value = locs()->in(0).reg(); 2114 Register value = locs()->in(0).reg();
2113 Register temp = locs()->temp(0).reg(); 2115 Register temp = locs()->temp(0).reg();
2114 2116
2115 __ LoadObject(temp, field()); 2117 __ LoadObject(temp, field());
2116 if (this->value()->NeedsStoreBuffer()) { 2118 if (this->value()->NeedsStoreBuffer()) {
2117 __ StoreIntoObject(temp, 2119 __ StoreIntoObject(temp,
2118 FieldAddress(temp, Field::value_offset()), value, CanValueBeSmi()); 2120 FieldAddress(temp, Field::static_value_offset()),
2121 value,
2122 CanValueBeSmi());
2119 } else { 2123 } else {
2120 __ StoreIntoObjectNoBarrier( 2124 __ StoreIntoObjectNoBarrier(
2121 temp, FieldAddress(temp, Field::value_offset()), value); 2125 temp, FieldAddress(temp, Field::static_value_offset()), value);
2122 } 2126 }
2123 } 2127 }
2124 2128
2125 2129
2126 LocationSummary* InstanceOfInstr::MakeLocationSummary(Zone* zone, 2130 LocationSummary* InstanceOfInstr::MakeLocationSummary(Zone* zone,
2127 bool opt) const { 2131 bool opt) const {
2128 const intptr_t kNumInputs = 3; 2132 const intptr_t kNumInputs = 3;
2129 const intptr_t kNumTemps = 0; 2133 const intptr_t kNumTemps = 0;
2130 LocationSummary* summary = new(zone) LocationSummary( 2134 LocationSummary* summary = new(zone) LocationSummary(
2131 zone, kNumInputs, kNumTemps, LocationSummary::kCall); 2135 zone, kNumInputs, kNumTemps, LocationSummary::kCall);
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
2585 } 2589 }
2586 2590
2587 2591
2588 void InitStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2592 void InitStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2589 Register field = locs()->in(0).reg(); 2593 Register field = locs()->in(0).reg();
2590 Register temp = locs()->temp(0).reg(); 2594 Register temp = locs()->temp(0).reg();
2591 2595
2592 Label call_runtime, no_call; 2596 Label call_runtime, no_call;
2593 __ Comment("InitStaticFieldInstr"); 2597 __ Comment("InitStaticFieldInstr");
2594 2598
2595 __ lw(temp, FieldAddress(field, Field::value_offset())); 2599 __ lw(temp, FieldAddress(field, Field::static_value_offset()));
2596 __ BranchEqual(temp, Object::sentinel(), &call_runtime); 2600 __ BranchEqual(temp, Object::sentinel(), &call_runtime);
2597 __ BranchNotEqual(temp, Object::transition_sentinel(), &no_call); 2601 __ BranchNotEqual(temp, Object::transition_sentinel(), &no_call);
2598 2602
2599 __ Bind(&call_runtime); 2603 __ Bind(&call_runtime);
2600 __ addiu(SP, SP, Immediate(-2 * kWordSize)); 2604 __ addiu(SP, SP, Immediate(-2 * kWordSize));
2601 __ LoadObject(TMP, Object::null_object()); 2605 __ LoadObject(TMP, Object::null_object());
2602 __ sw(TMP, Address(SP, 1 * kWordSize)); // Make room for (unused) result. 2606 __ sw(TMP, Address(SP, 1 * kWordSize)); // Make room for (unused) result.
2603 __ sw(field, Address(SP, 0 * kWordSize)); 2607 __ sw(field, Address(SP, 0 * kWordSize));
2604 2608
2605 compiler->GenerateRuntimeCall(token_pos(), 2609 compiler->GenerateRuntimeCall(token_pos(),
(...skipping 2992 matching lines...) Expand 10 before | Expand all | Expand 10 after
5598 1, 5602 1,
5599 locs()); 5603 locs());
5600 __ lw(result, Address(SP, 1 * kWordSize)); 5604 __ lw(result, Address(SP, 1 * kWordSize));
5601 __ addiu(SP, SP, Immediate(2 * kWordSize)); 5605 __ addiu(SP, SP, Immediate(2 * kWordSize));
5602 } 5606 }
5603 5607
5604 5608
5605 } // namespace dart 5609 } // namespace dart
5606 5610
5607 #endif // defined TARGET_ARCH_MIPS 5611 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698