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

Side by Side Diff: runtime/vm/intrinsifier_ia32.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 // The intrinsic code below is executed before a method has built its frame. 5 // The intrinsic code below is executed before a method has built its frame.
6 // The return address is on the stack and the arguments below it. 6 // The return address is on the stack and the arguments below it.
7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved. 7 // Registers EDX (arguments descriptor) and ECX (function) must be preserved.
8 // Each intrinsification method returns true if the corresponding 8 // Each intrinsification method returns true if the corresponding
9 // Dart method was intrinsified. 9 // Dart method was intrinsified.
10 10
(...skipping 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after
1634 // var state = ((_A * (_state[kSTATE_LO])) + _state[kSTATE_HI]) & _MASK_64; 1634 // var state = ((_A * (_state[kSTATE_LO])) + _state[kSTATE_HI]) & _MASK_64;
1635 // _state[kSTATE_LO] = state & _MASK_32; 1635 // _state[kSTATE_LO] = state & _MASK_32;
1636 // _state[kSTATE_HI] = state >> 32; 1636 // _state[kSTATE_HI] = state >> 32;
1637 void Intrinsifier::Random_nextState(Assembler* assembler) { 1637 void Intrinsifier::Random_nextState(Assembler* assembler) {
1638 const Library& math_lib = Library::Handle(Library::MathLibrary()); 1638 const Library& math_lib = Library::Handle(Library::MathLibrary());
1639 ASSERT(!math_lib.IsNull()); 1639 ASSERT(!math_lib.IsNull());
1640 const Class& random_class = Class::Handle( 1640 const Class& random_class = Class::Handle(
1641 math_lib.LookupClassAllowPrivate(Symbols::_Random())); 1641 math_lib.LookupClassAllowPrivate(Symbols::_Random()));
1642 ASSERT(!random_class.IsNull()); 1642 ASSERT(!random_class.IsNull());
1643 const Field& state_field = Field::ZoneHandle( 1643 const Field& state_field = Field::ZoneHandle(
1644 random_class.LookupInstanceField(Symbols::_state())); 1644 random_class.LookupInstanceFieldAllowPrivate(Symbols::_state()));
1645 ASSERT(!state_field.IsNull()); 1645 ASSERT(!state_field.IsNull());
1646 const Field& random_A_field = Field::ZoneHandle( 1646 const Field& random_A_field = Field::ZoneHandle(
1647 random_class.LookupStaticField(Symbols::_A())); 1647 random_class.LookupStaticFieldAllowPrivate(Symbols::_A()));
1648 ASSERT(!random_A_field.IsNull()); 1648 ASSERT(!random_A_field.IsNull());
1649 ASSERT(random_A_field.is_const()); 1649 ASSERT(random_A_field.is_const());
1650 const Instance& a_value = Instance::Handle(random_A_field.StaticValue()); 1650 const Instance& a_value = Instance::Handle(random_A_field.StaticValue());
1651 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); 1651 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value();
1652 // 'a_int_value' is a mask. 1652 // 'a_int_value' is a mask.
1653 ASSERT(Utils::IsUint(32, a_int_value)); 1653 ASSERT(Utils::IsUint(32, a_int_value));
1654 int32_t a_int32_value = static_cast<int32_t>(a_int_value); 1654 int32_t a_int32_value = static_cast<int32_t>(a_int_value);
1655 // Receiver. 1655 // Receiver.
1656 __ movl(EAX, Address(ESP, + 1 * kWordSize)); 1656 __ movl(EAX, Address(ESP, + 1 * kWordSize));
1657 // Field '_state'. 1657 // Field '_state'.
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
2161 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { 2161 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) {
2162 __ LoadIsolate(EAX); 2162 __ LoadIsolate(EAX);
2163 __ movl(EAX, Address(EAX, Isolate::current_tag_offset())); 2163 __ movl(EAX, Address(EAX, Isolate::current_tag_offset()));
2164 __ ret(); 2164 __ ret();
2165 } 2165 }
2166 2166
2167 #undef __ 2167 #undef __
2168 } // namespace dart 2168 } // namespace dart
2169 2169
2170 #endif // defined TARGET_ARCH_IA32 2170 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698