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

Side by Side Diff: runtime/vm/intrinsifier_mips.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) 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/intrinsifier.h" 8 #include "vm/intrinsifier.h"
9 9
10 #include "vm/assembler.h" 10 #include "vm/assembler.h"
(...skipping 1584 matching lines...) Expand 10 before | Expand all | Expand 10 after
1595 // var state = ((_A * (_state[kSTATE_LO])) + _state[kSTATE_HI]) & _MASK_64; 1595 // var state = ((_A * (_state[kSTATE_LO])) + _state[kSTATE_HI]) & _MASK_64;
1596 // _state[kSTATE_LO] = state & _MASK_32; 1596 // _state[kSTATE_LO] = state & _MASK_32;
1597 // _state[kSTATE_HI] = state >> 32; 1597 // _state[kSTATE_HI] = state >> 32;
1598 void Intrinsifier::Random_nextState(Assembler* assembler) { 1598 void Intrinsifier::Random_nextState(Assembler* assembler) {
1599 const Library& math_lib = Library::Handle(Library::MathLibrary()); 1599 const Library& math_lib = Library::Handle(Library::MathLibrary());
1600 ASSERT(!math_lib.IsNull()); 1600 ASSERT(!math_lib.IsNull());
1601 const Class& random_class = Class::Handle( 1601 const Class& random_class = Class::Handle(
1602 math_lib.LookupClassAllowPrivate(Symbols::_Random())); 1602 math_lib.LookupClassAllowPrivate(Symbols::_Random()));
1603 ASSERT(!random_class.IsNull()); 1603 ASSERT(!random_class.IsNull());
1604 const Field& state_field = Field::ZoneHandle( 1604 const Field& state_field = Field::ZoneHandle(
1605 random_class.LookupInstanceField(Symbols::_state())); 1605 random_class.LookupInstanceFieldAllowPrivate(Symbols::_state()));
1606 ASSERT(!state_field.IsNull()); 1606 ASSERT(!state_field.IsNull());
1607 const Field& random_A_field = Field::ZoneHandle( 1607 const Field& random_A_field = Field::ZoneHandle(
1608 random_class.LookupStaticField(Symbols::_A())); 1608 random_class.LookupStaticFieldAllowPrivate(Symbols::_A()));
1609 ASSERT(!random_A_field.IsNull()); 1609 ASSERT(!random_A_field.IsNull());
1610 ASSERT(random_A_field.is_const()); 1610 ASSERT(random_A_field.is_const());
1611 const Instance& a_value = Instance::Handle(random_A_field.StaticValue()); 1611 const Instance& a_value = Instance::Handle(random_A_field.StaticValue());
1612 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); 1612 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value();
1613 // 'a_int_value' is a mask. 1613 // 'a_int_value' is a mask.
1614 ASSERT(Utils::IsUint(32, a_int_value)); 1614 ASSERT(Utils::IsUint(32, a_int_value));
1615 int32_t a_int32_value = static_cast<int32_t>(a_int_value); 1615 int32_t a_int32_value = static_cast<int32_t>(a_int_value);
1616 1616
1617 // Receiver. 1617 // Receiver.
1618 __ lw(T0, Address(SP, 0 * kWordSize)); 1618 __ lw(T0, Address(SP, 0 * kWordSize));
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
2243 2243
2244 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { 2244 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) {
2245 __ LoadIsolate(V0); 2245 __ LoadIsolate(V0);
2246 __ Ret(); 2246 __ Ret();
2247 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset())); 2247 __ delay_slot()->lw(V0, Address(V0, Isolate::current_tag_offset()));
2248 } 2248 }
2249 2249
2250 } // namespace dart 2250 } // namespace dart
2251 2251
2252 #endif // defined TARGET_ARCH_MIPS 2252 #endif // defined TARGET_ARCH_MIPS
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698