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

Side by Side Diff: runtime/vm/intrinsifier_ia32.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: self-code-review 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
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 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after
1628 const Class& random_class = Class::Handle( 1628 const Class& random_class = Class::Handle(
1629 math_lib.LookupClassAllowPrivate(Symbols::_Random())); 1629 math_lib.LookupClassAllowPrivate(Symbols::_Random()));
1630 ASSERT(!random_class.IsNull()); 1630 ASSERT(!random_class.IsNull());
1631 const Field& state_field = Field::ZoneHandle( 1631 const Field& state_field = Field::ZoneHandle(
1632 random_class.LookupInstanceField(Symbols::_state())); 1632 random_class.LookupInstanceField(Symbols::_state()));
1633 ASSERT(!state_field.IsNull()); 1633 ASSERT(!state_field.IsNull());
1634 const Field& random_A_field = Field::ZoneHandle( 1634 const Field& random_A_field = Field::ZoneHandle(
1635 random_class.LookupStaticField(Symbols::_A())); 1635 random_class.LookupStaticField(Symbols::_A()));
1636 ASSERT(!random_A_field.IsNull()); 1636 ASSERT(!random_A_field.IsNull());
1637 ASSERT(random_A_field.is_const()); 1637 ASSERT(random_A_field.is_const());
1638 const Instance& a_value = Instance::Handle(random_A_field.value()); 1638 const Instance& a_value =
1639 Instance::Handle(random_A_field.StaticFieldValue());
1639 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); 1640 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value();
1640 // 'a_int_value' is a mask. 1641 // 'a_int_value' is a mask.
1641 ASSERT(Utils::IsUint(32, a_int_value)); 1642 ASSERT(Utils::IsUint(32, a_int_value));
1642 int32_t a_int32_value = static_cast<int32_t>(a_int_value); 1643 int32_t a_int32_value = static_cast<int32_t>(a_int_value);
1643 __ movl(EAX, Address(ESP, + 1 * kWordSize)); // Receiver. 1644 // Receiver.
1644 __ movl(EBX, FieldAddress(EAX, state_field.Offset())); // Field '_state'. 1645 __ movl(EAX, Address(ESP, + 1 * kWordSize));
1646 // Field '_state'.
1647 __ movl(EBX, FieldAddress(EAX, state_field.InstanceFieldOffset()));
1645 // Addresses of _state[0] and _state[1]. 1648 // Addresses of _state[0] and _state[1].
1646 const intptr_t scale = Instance::ElementSizeFor(kTypedDataUint32ArrayCid); 1649 const intptr_t scale = Instance::ElementSizeFor(kTypedDataUint32ArrayCid);
1647 const intptr_t offset = Instance::DataOffsetFor(kTypedDataUint32ArrayCid); 1650 const intptr_t offset = Instance::DataOffsetFor(kTypedDataUint32ArrayCid);
1648 Address addr_0 = FieldAddress(EBX, 0 * scale + offset); 1651 Address addr_0 = FieldAddress(EBX, 0 * scale + offset);
1649 Address addr_1 = FieldAddress(EBX, 1 * scale + offset); 1652 Address addr_1 = FieldAddress(EBX, 1 * scale + offset);
1650 __ movl(EAX, Immediate(a_int32_value)); 1653 __ movl(EAX, Immediate(a_int32_value));
1651 // 64-bit multiply EAX * value -> EDX:EAX. 1654 // 64-bit multiply EAX * value -> EDX:EAX.
1652 __ mull(addr_0); 1655 __ mull(addr_0);
1653 __ addl(EAX, addr_1); 1656 __ addl(EAX, addr_1);
1654 __ adcl(EDX, Immediate(0)); 1657 __ adcl(EDX, Immediate(0));
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
2146 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { 2149 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) {
2147 __ LoadIsolate(EAX); 2150 __ LoadIsolate(EAX);
2148 __ movl(EAX, Address(EAX, Isolate::current_tag_offset())); 2151 __ movl(EAX, Address(EAX, Isolate::current_tag_offset()));
2149 __ ret(); 2152 __ ret();
2150 } 2153 }
2151 2154
2152 #undef __ 2155 #undef __
2153 } // namespace dart 2156 } // namespace dart
2154 2157
2155 #endif // defined TARGET_ARCH_IA32 2158 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698