OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/division-by-constant.h" | 10 #include "src/base/division-by-constant.h" |
(...skipping 3395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3406 | 3406 |
3407 | 3407 |
3408 void MacroAssembler::EnumLength(Register dst, Register map) { | 3408 void MacroAssembler::EnumLength(Register dst, Register map) { |
3409 STATIC_ASSERT(Map::EnumLengthBits::kShift == 0); | 3409 STATIC_ASSERT(Map::EnumLengthBits::kShift == 0); |
3410 movl(dst, FieldOperand(map, Map::kBitField3Offset)); | 3410 movl(dst, FieldOperand(map, Map::kBitField3Offset)); |
3411 andl(dst, Immediate(Map::EnumLengthBits::kMask)); | 3411 andl(dst, Immediate(Map::EnumLengthBits::kMask)); |
3412 Integer32ToSmi(dst, dst); | 3412 Integer32ToSmi(dst, dst); |
3413 } | 3413 } |
3414 | 3414 |
3415 | 3415 |
| 3416 void MacroAssembler::LoadAccessor(Register dst, Register holder, |
| 3417 int accessor_index, |
| 3418 AccessorComponent accessor) { |
| 3419 movp(dst, FieldOperand(holder, HeapObject::kMapOffset)); |
| 3420 LoadInstanceDescriptors(dst, dst); |
| 3421 movp(dst, FieldOperand(dst, DescriptorArray::GetValueOffset(accessor_index))); |
| 3422 int offset = accessor == ACCESSOR_GETTER ? AccessorPair::kGetterOffset |
| 3423 : AccessorPair::kSetterOffset; |
| 3424 movp(dst, FieldOperand(dst, offset)); |
| 3425 } |
| 3426 |
| 3427 |
3416 void MacroAssembler::DispatchWeakMap(Register obj, Register scratch1, | 3428 void MacroAssembler::DispatchWeakMap(Register obj, Register scratch1, |
3417 Register scratch2, Handle<WeakCell> cell, | 3429 Register scratch2, Handle<WeakCell> cell, |
3418 Handle<Code> success, | 3430 Handle<Code> success, |
3419 SmiCheckType smi_check_type) { | 3431 SmiCheckType smi_check_type) { |
3420 Label fail; | 3432 Label fail; |
3421 if (smi_check_type == DO_SMI_CHECK) { | 3433 if (smi_check_type == DO_SMI_CHECK) { |
3422 JumpIfSmi(obj, &fail); | 3434 JumpIfSmi(obj, &fail); |
3423 } | 3435 } |
3424 movq(scratch1, FieldOperand(obj, HeapObject::kMapOffset)); | 3436 movq(scratch1, FieldOperand(obj, HeapObject::kMapOffset)); |
3425 CmpWeakValue(scratch1, cell, scratch2); | 3437 CmpWeakValue(scratch1, cell, scratch2); |
(...skipping 1753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5179 if (mag.shift > 0) sarl(rdx, Immediate(mag.shift)); | 5191 if (mag.shift > 0) sarl(rdx, Immediate(mag.shift)); |
5180 movl(rax, dividend); | 5192 movl(rax, dividend); |
5181 shrl(rax, Immediate(31)); | 5193 shrl(rax, Immediate(31)); |
5182 addl(rdx, rax); | 5194 addl(rdx, rax); |
5183 } | 5195 } |
5184 | 5196 |
5185 | 5197 |
5186 } } // namespace v8::internal | 5198 } } // namespace v8::internal |
5187 | 5199 |
5188 #endif // V8_TARGET_ARCH_X64 | 5200 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |