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

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 886503002: Extract LoadAccessor into a masm function. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix whitespace Created 5 years, 10 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
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | src/x87/macro-assembler-x87.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | src/x87/macro-assembler-x87.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698