OLD | NEW |
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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
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 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1143 ASSERT(!state_field.IsNull()); | 1143 ASSERT(!state_field.IsNull()); |
1144 const Field& random_A_field = Field::ZoneHandle( | 1144 const Field& random_A_field = Field::ZoneHandle( |
1145 random_class.LookupStaticField(Symbols::_A())); | 1145 random_class.LookupStaticField(Symbols::_A())); |
1146 ASSERT(!random_A_field.IsNull()); | 1146 ASSERT(!random_A_field.IsNull()); |
1147 ASSERT(random_A_field.is_const()); | 1147 ASSERT(random_A_field.is_const()); |
1148 const Instance& a_value = Instance::Handle(random_A_field.value()); | 1148 const Instance& a_value = Instance::Handle(random_A_field.value()); |
1149 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); | 1149 const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value(); |
1150 __ movq(RAX, Address(RSP, + 1 * kWordSize)); // Receiver. | 1150 __ movq(RAX, Address(RSP, + 1 * kWordSize)); // Receiver. |
1151 __ movq(RBX, FieldAddress(RAX, state_field.Offset())); // Field '_state'. | 1151 __ movq(RBX, FieldAddress(RAX, state_field.Offset())); // Field '_state'. |
1152 // Addresses of _state[0] and _state[1]. | 1152 // Addresses of _state[0] and _state[1]. |
1153 Address addr_0 = FlowGraphCompiler::ElementAddressForIntIndex( | 1153 const intptr_t index_scale = |
1154 kTypedDataUint32ArrayCid, | 1154 FlowGraphCompiler::ElementSizeFor(kTypedDataUint32ArrayCid); |
1155 FlowGraphCompiler::ElementSizeFor(kTypedDataUint32ArrayCid), | 1155 const intptr_t offset = |
1156 RBX, | 1156 FlowGraphCompiler::DataOffsetFor(kTypedDataUint32ArrayCid); |
1157 0); | 1157 Address addr_0 = FieldAddress(RBX, 0 * index_scale + offset); |
1158 Address addr_1 = FlowGraphCompiler::ElementAddressForIntIndex( | 1158 Address addr_1 = FieldAddress(RBX, 1 * index_scale + offset); |
1159 kTypedDataUint32ArrayCid, | |
1160 FlowGraphCompiler::ElementSizeFor(kTypedDataUint32ArrayCid), | |
1161 RBX, | |
1162 1); | |
1163 | |
1164 __ movq(RAX, Immediate(a_int_value)); | 1159 __ movq(RAX, Immediate(a_int_value)); |
1165 __ movl(RCX, addr_0); | 1160 __ movl(RCX, addr_0); |
1166 __ imulq(RCX, RAX); | 1161 __ imulq(RCX, RAX); |
1167 __ movl(RDX, addr_1); | 1162 __ movl(RDX, addr_1); |
1168 __ addq(RDX, RCX); | 1163 __ addq(RDX, RCX); |
1169 __ movl(addr_0, RDX); | 1164 __ movl(addr_0, RDX); |
1170 __ shrq(RDX, Immediate(32)); | 1165 __ shrq(RDX, Immediate(32)); |
1171 __ movl(addr_1, RDX); | 1166 __ movl(addr_1, RDX); |
1172 __ ret(); | 1167 __ ret(); |
1173 } | 1168 } |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1583 // Set return value to Isolate::current_tag_. | 1578 // Set return value to Isolate::current_tag_. |
1584 __ movq(RAX, Address(RBX, Isolate::current_tag_offset())); | 1579 __ movq(RAX, Address(RBX, Isolate::current_tag_offset())); |
1585 __ ret(); | 1580 __ ret(); |
1586 } | 1581 } |
1587 | 1582 |
1588 #undef __ | 1583 #undef __ |
1589 | 1584 |
1590 } // namespace dart | 1585 } // namespace dart |
1591 | 1586 |
1592 #endif // defined TARGET_ARCH_X64 | 1587 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |