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

Side by Side Diff: runtime/vm/intermediate_language_arm64.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_arm.cc ('k') | runtime/vm/intermediate_language_ia32.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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_ARM64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
6 #if defined(TARGET_ARCH_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
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 1950 matching lines...) Expand 10 before | Expand all | Expand 10 after
1961 1961
1962 1962
1963 // When the parser is building an implicit static getter for optimization, 1963 // When the parser is building an implicit static getter for optimization,
1964 // it can generate a function body where deoptimization ids do not line up 1964 // it can generate a function body where deoptimization ids do not line up
1965 // with the unoptimized code. 1965 // with the unoptimized code.
1966 // 1966 //
1967 // This is safe only so long as LoadStaticFieldInstr cannot deoptimize. 1967 // This is safe only so long as LoadStaticFieldInstr cannot deoptimize.
1968 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1968 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1969 const Register field = locs()->in(0).reg(); 1969 const Register field = locs()->in(0).reg();
1970 const Register result = locs()->out(0).reg(); 1970 const Register result = locs()->out(0).reg();
1971 __ LoadFieldFromOffset(result, field, Field::value_offset()); 1971 __ LoadFieldFromOffset(result, field, Field::static_value_offset());
1972 } 1972 }
1973 1973
1974 1974
1975 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(Zone* zone, 1975 LocationSummary* StoreStaticFieldInstr::MakeLocationSummary(Zone* zone,
1976 bool opt) const { 1976 bool opt) const {
1977 LocationSummary* locs = new(zone) LocationSummary( 1977 LocationSummary* locs = new(zone) LocationSummary(
1978 zone, 1, 1, LocationSummary::kNoCall); 1978 zone, 1, 1, LocationSummary::kNoCall);
1979 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister() 1979 locs->set_in(0, value()->NeedsStoreBuffer() ? Location::WritableRegister()
1980 : Location::RequiresRegister()); 1980 : Location::RequiresRegister());
1981 locs->set_temp(0, Location::RequiresRegister()); 1981 locs->set_temp(0, Location::RequiresRegister());
1982 return locs; 1982 return locs;
1983 } 1983 }
1984 1984
1985 1985
1986 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1986 void StoreStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1987 const Register value = locs()->in(0).reg(); 1987 const Register value = locs()->in(0).reg();
1988 const Register temp = locs()->temp(0).reg(); 1988 const Register temp = locs()->temp(0).reg();
1989 1989
1990 __ LoadObject(temp, field()); 1990 __ LoadObject(temp, field());
1991 if (this->value()->NeedsStoreBuffer()) { 1991 if (this->value()->NeedsStoreBuffer()) {
1992 __ StoreIntoObjectOffset( 1992 __ StoreIntoObjectOffset(
1993 temp, Field::value_offset(), value, CanValueBeSmi()); 1993 temp, Field::static_value_offset(), value, CanValueBeSmi());
1994 } else { 1994 } else {
1995 __ StoreIntoObjectOffsetNoBarrier(temp, Field::value_offset(), value); 1995 __ StoreIntoObjectOffsetNoBarrier(temp,
1996 Field::static_value_offset(),
1997 value);
1996 } 1998 }
1997 } 1999 }
1998 2000
1999 2001
2000 LocationSummary* InstanceOfInstr::MakeLocationSummary(Zone* zone, 2002 LocationSummary* InstanceOfInstr::MakeLocationSummary(Zone* zone,
2001 bool opt) const { 2003 bool opt) const {
2002 const intptr_t kNumInputs = 3; 2004 const intptr_t kNumInputs = 3;
2003 const intptr_t kNumTemps = 0; 2005 const intptr_t kNumTemps = 0;
2004 LocationSummary* summary = new(zone) LocationSummary( 2006 LocationSummary* summary = new(zone) LocationSummary(
2005 zone, kNumInputs, kNumTemps, LocationSummary::kCall); 2007 zone, kNumInputs, kNumTemps, LocationSummary::kCall);
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
2482 locs->set_temp(0, Location::RegisterLocation(R1)); 2484 locs->set_temp(0, Location::RegisterLocation(R1));
2483 return locs; 2485 return locs;
2484 } 2486 }
2485 2487
2486 2488
2487 void InitStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2489 void InitStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
2488 Register field = locs()->in(0).reg(); 2490 Register field = locs()->in(0).reg();
2489 Register temp = locs()->temp(0).reg(); 2491 Register temp = locs()->temp(0).reg();
2490 Label call_runtime, no_call; 2492 Label call_runtime, no_call;
2491 2493
2492 __ ldr(temp, FieldAddress(field, Field::value_offset())); 2494 __ ldr(temp, FieldAddress(field, Field::static_value_offset()));
2493 __ CompareObject(temp, Object::sentinel()); 2495 __ CompareObject(temp, Object::sentinel());
2494 __ b(&call_runtime, EQ); 2496 __ b(&call_runtime, EQ);
2495 2497
2496 __ CompareObject(temp, Object::transition_sentinel()); 2498 __ CompareObject(temp, Object::transition_sentinel());
2497 __ b(&no_call, NE); 2499 __ b(&no_call, NE);
2498 2500
2499 __ Bind(&call_runtime); 2501 __ Bind(&call_runtime);
2500 __ PushObject(Object::null_object()); // Make room for (unused) result. 2502 __ PushObject(Object::null_object()); // Make room for (unused) result.
2501 __ Push(field); 2503 __ Push(field);
2502 compiler->GenerateRuntimeCall(token_pos(), 2504 compiler->GenerateRuntimeCall(token_pos(),
(...skipping 3120 matching lines...) Expand 10 before | Expand all | Expand 10 after
5623 1, 5625 1,
5624 locs()); 5626 locs());
5625 __ Drop(1); 5627 __ Drop(1);
5626 __ Pop(result); 5628 __ Pop(result);
5627 } 5629 }
5628 5630
5629 5631
5630 } // namespace dart 5632 } // namespace dart
5631 5633
5632 #endif // defined TARGET_ARCH_ARM64 5634 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_arm.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698