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

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

Issue 1868803002: Use symbols when looking up fields in a class (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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) 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/intrinsifier.h" 8 #include "vm/intrinsifier.h"
9 9
10 #include "vm/assembler.h" 10 #include "vm/assembler.h"
(...skipping 1564 matching lines...) Expand 10 before | Expand all | Expand 10 after
1575 // var state = ((_A * (_state[kSTATE_LO])) + _state[kSTATE_HI]) & _MASK_64; 1575 // var state = ((_A * (_state[kSTATE_LO])) + _state[kSTATE_HI]) & _MASK_64;
1576 // _state[kSTATE_LO] = state & _MASK_32; 1576 // _state[kSTATE_LO] = state & _MASK_32;
1577 // _state[kSTATE_HI] = state >> 32; 1577 // _state[kSTATE_HI] = state >> 32;
1578 void Intrinsifier::Random_nextState(Assembler* assembler) { 1578 void Intrinsifier::Random_nextState(Assembler* assembler) {
1579 const Library& math_lib = Library::Handle(Library::MathLibrary()); 1579 const Library& math_lib = Library::Handle(Library::MathLibrary());
1580 ASSERT(!math_lib.IsNull()); 1580 ASSERT(!math_lib.IsNull());
1581 const Class& random_class = Class::Handle( 1581 const Class& random_class = Class::Handle(
1582 math_lib.LookupClassAllowPrivate(Symbols::_Random())); 1582 math_lib.LookupClassAllowPrivate(Symbols::_Random()));
1583 ASSERT(!random_class.IsNull()); 1583 ASSERT(!random_class.IsNull());
1584 const Field& state_field = Field::ZoneHandle( 1584 const Field& state_field = Field::ZoneHandle(
1585 random_class.LookupInstanceField(Symbols::_state())); 1585 random_class.LookupInstanceFieldAllowPrivate(Symbols::_state()));
1586 ASSERT(!state_field.IsNull()); 1586 ASSERT(!state_field.IsNull());
1587 const Field& random_A_field = Field::ZoneHandle( 1587 const Field& random_A_field = Field::ZoneHandle(
1588 random_class.LookupStaticField(Symbols::_A())); 1588 random_class.LookupStaticFieldAllowPrivate(Symbols::_A()));
1589 ASSERT(!random_A_field.IsNull()); 1589 ASSERT(!random_A_field.IsNull());
1590 ASSERT(random_A_field.is_const()); 1590 ASSERT(random_A_field.is_const());
1591 const Instance& a_value = Instance::Handle(random_A_field.StaticValue()); 1591 const Instance& a_value = Instance::Handle(random_A_field.StaticValue());
1592 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); 1592 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value();
1593 1593
1594 // Receiver. 1594 // Receiver.
1595 __ ldr(R0, Address(SP, 0 * kWordSize)); 1595 __ ldr(R0, Address(SP, 0 * kWordSize));
1596 // Field '_state'. 1596 // Field '_state'.
1597 __ ldr(R1, FieldAddress(R0, state_field.Offset())); 1597 __ ldr(R1, FieldAddress(R0, state_field.Offset()));
1598 1598
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
2210 2210
2211 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { 2211 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) {
2212 __ LoadIsolate(R0); 2212 __ LoadIsolate(R0);
2213 __ ldr(R0, Address(R0, Isolate::current_tag_offset())); 2213 __ ldr(R0, Address(R0, Isolate::current_tag_offset()));
2214 __ ret(); 2214 __ ret();
2215 } 2215 }
2216 2216
2217 } // namespace dart 2217 } // namespace dart
2218 2218
2219 #endif // defined TARGET_ARCH_ARM64 2219 #endif // defined TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698