}
+void MacroAssembler::LoadAccessor(Register dst, Register holder,
+ int accessor_index,
+ AccessorComponent accessor) {
+ ldr(dst, FieldMemOperand(holder, HeapObject::kMapOffset));
+ LoadInstanceDescriptors(dst, dst);
+ ldr(dst,
+ FieldMemOperand(dst, DescriptorArray::GetValueOffset(accessor_index)));
+ int offset = accessor == ACCESSOR_GETTER ? AccessorPair::kGetterOffset
+ : AccessorPair::kSetterOffset;
+ ldr(dst, FieldMemOperand(dst, offset));
+}
+
+
void MacroAssembler::CheckEnumCache(Register null_value, Label* call_runtime) {
Register empty_fixed_array_value = r6;
LoadRoot(empty_fixed_array_value, Heap::kEmptyFixedArrayRootIndex);
void LoadInstanceDescriptors(Register map, Register descriptors);
void EnumLength(Register dst, Register map);
void NumberOfOwnDescriptors(Register dst, Register map);
+ void LoadAccessor(Register dst, Register holder, int accessor_index,
+ AccessorComponent accessor);
template<typename Field>
void DecodeField(Register dst, Register src) {
}
+void MacroAssembler::LoadAccessor(Register dst, Register holder,
+ int accessor_index,
+ AccessorComponent accessor) {
+ Ldr(dst, FieldMemOperand(holder, HeapObject::kMapOffset));
+ LoadInstanceDescriptors(dst, dst);
+ Ldr(dst,
+ FieldMemOperand(dst, DescriptorArray::GetValueOffset(accessor_index)));
+ int offset = accessor == ACCESSOR_GETTER ? AccessorPair::kGetterOffset
+ : AccessorPair::kSetterOffset;
+ Ldr(dst, FieldMemOperand(dst, offset));
+}
+
+
void MacroAssembler::CheckEnumCache(Register object,
Register null_value,
Register scratch0,
void EnumLengthUntagged(Register dst, Register map);
void EnumLengthSmi(Register dst, Register map);
void NumberOfOwnDescriptors(Register dst, Register map);
+ void LoadAccessor(Register dst, Register holder, int accessor_index,
+ AccessorComponent accessor);
template<typename Field>
void DecodeField(Register dst, Register src) {
}
+void MacroAssembler::LoadAccessor(Register dst, Register holder,
+ int accessor_index,
+ AccessorComponent accessor) {
+ mov(dst, FieldOperand(holder, HeapObject::kMapOffset));
+ LoadInstanceDescriptors(dst, dst);
+ mov(dst, FieldOperand(dst, DescriptorArray::GetValueOffset(accessor_index)));
+ int offset = accessor == ACCESSOR_GETTER ? AccessorPair::kGetterOffset
+ : AccessorPair::kSetterOffset;
+ mov(dst, FieldOperand(dst, offset));
+}
+
+
void MacroAssembler::LoadPowerOf2(XMMRegister dst,
Register scratch,
int power) {
void LoadInstanceDescriptors(Register map, Register descriptors);
void EnumLength(Register dst, Register map);
void NumberOfOwnDescriptors(Register dst, Register map);
+ void LoadAccessor(Register dst, Register holder, int accessor_index,
+ AccessorComponent accessor);
template<typename Field>
void DecodeField(Register reg) {
__ push(receiver);
ParameterCount actual(0);
ParameterCount expected(expected_arguments);
- Register scratch = holder;
- __ ldr(scratch, FieldMemOperand(holder, HeapObject::kMapOffset));
- __ LoadInstanceDescriptors(scratch, scratch);
- __ ldr(scratch, FieldMemOperand(scratch, DescriptorArray::GetValueOffset(
- accessor_index)));
- __ ldr(r1, FieldMemOperand(scratch, AccessorPair::kGetterOffset));
+ __ LoadAccessor(r1, holder, accessor_index, ACCESSOR_GETTER);
__ InvokeFunction(r1, expected, actual, CALL_FUNCTION, NullCallWrapper());
} else {
// If we generate a global code snippet for deoptimization only, remember
__ Push(receiver, value());
ParameterCount actual(1);
ParameterCount expected(expected_arguments);
- Register scratch = holder;
- __ ldr(scratch, FieldMemOperand(holder, HeapObject::kMapOffset));
- __ LoadInstanceDescriptors(scratch, scratch);
- __ ldr(scratch, FieldMemOperand(scratch, DescriptorArray::GetValueOffset(
- accessor_index)));
- __ ldr(r1, FieldMemOperand(scratch, AccessorPair::kSetterOffset));
+ __ LoadAccessor(r1, holder, accessor_index, ACCESSOR_SETTER);
__ InvokeFunction(r1, expected, actual, CALL_FUNCTION, NullCallWrapper());
} else {
// If we generate a global code snippet for deoptimization only, remember
__ Push(receiver, value());
ParameterCount actual(1);
ParameterCount expected(expected_arguments);
- Register scratch = holder;
- __ Ldr(scratch, FieldMemOperand(holder, HeapObject::kMapOffset));
- __ LoadInstanceDescriptors(scratch, scratch);
- __ Ldr(scratch, FieldMemOperand(scratch, DescriptorArray::GetValueOffset(
- accessor_index)));
- __ Ldr(x1, FieldMemOperand(scratch, AccessorPair::kSetterOffset));
+ __ LoadAccessor(x1, holder, accessor_index, ACCESSOR_SETTER);
__ InvokeFunction(x1, expected, actual, CALL_FUNCTION, NullCallWrapper());
} else {
// If we generate a global code snippet for deoptimization only, remember
__ Push(receiver);
ParameterCount actual(0);
ParameterCount expected(expected_arguments);
- Register scratch = holder;
- __ Ldr(scratch, FieldMemOperand(holder, HeapObject::kMapOffset));
- __ LoadInstanceDescriptors(scratch, scratch);
- __ Ldr(scratch, FieldMemOperand(scratch, DescriptorArray::GetValueOffset(
- accessor_index)));
- __ Ldr(x1, FieldMemOperand(scratch, AccessorPair::kGetterOffset));
+ __ LoadAccessor(x1, holder, accessor_index, ACCESSOR_GETTER);
__ InvokeFunction(x1, expected, actual, CALL_FUNCTION, NullCallWrapper());
} else {
// If we generate a global code snippet for deoptimization only, remember
__ push(receiver);
ParameterCount actual(0);
ParameterCount expected(expected_arguments);
- Register scratch = holder;
- __ mov(scratch, FieldOperand(holder, HeapObject::kMapOffset));
- __ LoadInstanceDescriptors(scratch, scratch);
- __ mov(scratch, FieldOperand(scratch, DescriptorArray::GetValueOffset(
- accessor_index)));
- __ mov(edi, FieldOperand(scratch, AccessorPair::kGetterOffset));
+ __ LoadAccessor(edi, holder, accessor_index, ACCESSOR_GETTER);
__ InvokeFunction(edi, expected, actual, CALL_FUNCTION,
NullCallWrapper());
} else {
__ push(value());
ParameterCount actual(1);
ParameterCount expected(expected_arguments);
- Register scratch = holder;
- __ mov(scratch, FieldOperand(holder, HeapObject::kMapOffset));
- __ LoadInstanceDescriptors(scratch, scratch);
- __ mov(scratch, FieldOperand(scratch, DescriptorArray::GetValueOffset(
- accessor_index)));
- __ mov(edi, FieldOperand(scratch, AccessorPair::kSetterOffset));
+ __ LoadAccessor(edi, holder, accessor_index, ACCESSOR_SETTER);
__ InvokeFunction(edi, expected, actual, CALL_FUNCTION,
NullCallWrapper());
} else {
__ push(receiver);
ParameterCount actual(0);
ParameterCount expected(expected_arguments);
- Register scratch = holder;
- __ lw(scratch, FieldMemOperand(holder, HeapObject::kMapOffset));
- __ LoadInstanceDescriptors(scratch, scratch);
- __ lw(scratch, FieldMemOperand(scratch, DescriptorArray::GetValueOffset(
- accessor_index)));
- __ lw(a1, FieldMemOperand(scratch, AccessorPair::kGetterOffset));
+ __ LoadAccessor(a1, holder, accessor_index, ACCESSOR_GETTER);
__ InvokeFunction(a1, expected, actual, CALL_FUNCTION, NullCallWrapper());
} else {
// If we generate a global code snippet for deoptimization only, remember
__ Push(receiver, value());
ParameterCount actual(1);
ParameterCount expected(expected_arguments);
- Register scratch = holder;
- __ lw(scratch, FieldMemOperand(holder, HeapObject::kMapOffset));
- __ LoadInstanceDescriptors(scratch, scratch);
- __ lw(scratch, FieldMemOperand(scratch, DescriptorArray::GetValueOffset(
- accessor_index)));
- __ lw(a1, FieldMemOperand(scratch, AccessorPair::kSetterOffset));
+ __ LoadAccessor(a1, holder, accessor_index, ACCESSOR_SETTER);
__ InvokeFunction(a1, expected, actual, CALL_FUNCTION, NullCallWrapper());
} else {
// If we generate a global code snippet for deoptimization only, remember
__ push(receiver);
ParameterCount actual(0);
ParameterCount expected(expected_arguments);
- Register scratch = holder;
- __ ld(scratch, FieldMemOperand(holder, HeapObject::kMapOffset));
- __ LoadInstanceDescriptors(scratch, scratch);
- __ ld(scratch, FieldMemOperand(scratch, DescriptorArray::GetValueOffset(
- accessor_index)));
- __ ld(a1, FieldMemOperand(scratch, AccessorPair::kGetterOffset));
+ __ LoadAccessor(a1, holder, accessor_index, ACCESSOR_GETTER);
__ InvokeFunction(a1, expected, actual, CALL_FUNCTION, NullCallWrapper());
} else {
// If we generate a global code snippet for deoptimization only, remember
__ Push(receiver, value());
ParameterCount actual(1);
ParameterCount expected(expected_arguments);
- Register scratch = holder;
- __ ld(scratch, FieldMemOperand(holder, HeapObject::kMapOffset));
- __ LoadInstanceDescriptors(scratch, scratch);
- __ ld(scratch, FieldMemOperand(scratch, DescriptorArray::GetValueOffset(
- accessor_index)));
- __ ld(a1, FieldMemOperand(scratch, AccessorPair::kSetterOffset));
+ __ LoadAccessor(a1, holder, accessor_index, ACCESSOR_SETTER);
__ InvokeFunction(a1, expected, actual, CALL_FUNCTION, NullCallWrapper());
} else {
// If we generate a global code snippet for deoptimization only, remember
__ Push(value());
ParameterCount actual(1);
ParameterCount expected(expected_arguments);
- Register scratch = holder;
- __ movp(scratch, FieldOperand(holder, HeapObject::kMapOffset));
- __ LoadInstanceDescriptors(scratch, scratch);
- __ movp(scratch, FieldOperand(scratch, DescriptorArray::GetValueOffset(
- accessor_index)));
- __ movp(rdi, FieldOperand(scratch, AccessorPair::kSetterOffset));
+ __ LoadAccessor(rdi, holder, accessor_index, ACCESSOR_SETTER);
__ InvokeFunction(rdi, expected, actual, CALL_FUNCTION,
NullCallWrapper());
} else {
__ Push(receiver);
ParameterCount actual(0);
ParameterCount expected(expected_arguments);
- Register scratch = holder;
- __ movp(scratch, FieldOperand(holder, HeapObject::kMapOffset));
- __ LoadInstanceDescriptors(scratch, scratch);
- __ movp(scratch, FieldOperand(scratch, DescriptorArray::GetValueOffset(
- accessor_index)));
- __ movp(rdi, FieldOperand(scratch, AccessorPair::kGetterOffset));
+ __ LoadAccessor(rdi, holder, accessor_index, ACCESSOR_GETTER);
__ InvokeFunction(rdi, expected, actual, CALL_FUNCTION,
NullCallWrapper());
} else {
__ push(receiver);
ParameterCount actual(0);
ParameterCount expected(expected_arguments);
- Register scratch = holder;
- __ mov(scratch, FieldOperand(holder, HeapObject::kMapOffset));
- __ LoadInstanceDescriptors(scratch, scratch);
- __ mov(scratch, FieldOperand(scratch, DescriptorArray::GetValueOffset(
- accessor_index)));
- __ mov(edi, FieldOperand(scratch, AccessorPair::kGetterOffset));
+ __ LoadAccessor(edi, holder, accessor_index, ACCESSOR_GETTER);
__ InvokeFunction(edi, expected, actual, CALL_FUNCTION,
NullCallWrapper());
} else {
__ push(value());
ParameterCount actual(1);
ParameterCount expected(expected_arguments);
- Register scratch = holder;
- __ mov(scratch, FieldOperand(holder, HeapObject::kMapOffset));
- __ LoadInstanceDescriptors(scratch, scratch);
- __ mov(scratch, FieldOperand(scratch, DescriptorArray::GetValueOffset(
- accessor_index)));
- __ mov(edi, FieldOperand(scratch, AccessorPair::kSetterOffset));
+ __ LoadAccessor(edi, holder, accessor_index, ACCESSOR_SETTER);
__ InvokeFunction(edi, expected, actual, CALL_FUNCTION,
NullCallWrapper());
} else {
}
+void MacroAssembler::LoadAccessor(Register dst, Register holder,
+ int accessor_index,
+ AccessorComponent accessor) {
+ lw(dst, FieldMemOperand(holder, HeapObject::kMapOffset));
+ LoadInstanceDescriptors(dst, dst);
+ lw(dst,
+ FieldMemOperand(dst, DescriptorArray::GetValueOffset(accessor_index)));
+ int offset = accessor == ACCESSOR_GETTER ? AccessorPair::kGetterOffset
+ : AccessorPair::kSetterOffset;
+ lw(dst, FieldMemOperand(dst, offset));
+}
+
+
void MacroAssembler::CheckEnumCache(Register null_value, Label* call_runtime) {
Register empty_fixed_array_value = t2;
LoadRoot(empty_fixed_array_value, Heap::kEmptyFixedArrayRootIndex);
void LoadInstanceDescriptors(Register map, Register descriptors);
void EnumLength(Register dst, Register map);
void NumberOfOwnDescriptors(Register dst, Register map);
+ void LoadAccessor(Register dst, Register holder, int accessor_index,
+ AccessorComponent accessor);
template<typename Field>
void DecodeField(Register dst, Register src) {
}
+void MacroAssembler::LoadAccessor(Register dst, Register holder,
+ int accessor_index,
+ AccessorComponent accessor) {
+ ld(dst, FieldMemOperand(holder, HeapObject::kMapOffset));
+ LoadInstanceDescriptors(dst, dst);
+ ld(dst,
+ FieldMemOperand(dst, DescriptorArray::GetValueOffset(accessor_index)));
+ int offset = accessor == ACCESSOR_GETTER ? AccessorPair::kGetterOffset
+ : AccessorPair::kSetterOffset;
+ ld(dst, FieldMemOperand(dst, offset));
+}
+
+
void MacroAssembler::CheckEnumCache(Register null_value, Label* call_runtime) {
Register empty_fixed_array_value = a6;
LoadRoot(empty_fixed_array_value, Heap::kEmptyFixedArrayRootIndex);
void LoadInstanceDescriptors(Register map, Register descriptors);
void EnumLength(Register dst, Register map);
void NumberOfOwnDescriptors(Register dst, Register map);
+ void LoadAccessor(Register dst, Register holder, int accessor_index,
+ AccessorComponent accessor);
template<typename Field>
void DecodeField(Register dst, Register src) {
}
+void MacroAssembler::LoadAccessor(Register dst, Register holder,
+ int accessor_index,
+ AccessorComponent accessor) {
+ movp(dst, FieldOperand(holder, HeapObject::kMapOffset));
+ LoadInstanceDescriptors(dst, dst);
+ movp(dst, FieldOperand(dst, DescriptorArray::GetValueOffset(accessor_index)));
+ int offset = accessor == ACCESSOR_GETTER ? AccessorPair::kGetterOffset
+ : AccessorPair::kSetterOffset;
+ movp(dst, FieldOperand(dst, offset));
+}
+
+
void MacroAssembler::DispatchWeakMap(Register obj, Register scratch1,
Register scratch2, Handle<WeakCell> cell,
Handle<Code> success,
void LoadInstanceDescriptors(Register map, Register descriptors);
void EnumLength(Register dst, Register map);
void NumberOfOwnDescriptors(Register dst, Register map);
+ void LoadAccessor(Register dst, Register holder, int accessor_index,
+ AccessorComponent accessor);
template<typename Field>
void DecodeField(Register reg) {
}
+void MacroAssembler::LoadAccessor(Register dst, Register holder,
+ int accessor_index,
+ AccessorComponent accessor) {
+ mov(dst, FieldOperand(holder, HeapObject::kMapOffset));
+ LoadInstanceDescriptors(dst, dst);
+ mov(dst, FieldOperand(dst, DescriptorArray::GetValueOffset(accessor_index)));
+ int offset = accessor == ACCESSOR_GETTER ? AccessorPair::kGetterOffset
+ : AccessorPair::kSetterOffset;
+ mov(dst, FieldOperand(dst, offset));
+}
+
+
void MacroAssembler::LookupNumberStringCache(Register object,
Register result,
Register scratch1,
void LoadInstanceDescriptors(Register map, Register descriptors);
void EnumLength(Register dst, Register map);
void NumberOfOwnDescriptors(Register dst, Register map);
+ void LoadAccessor(Register dst, Register holder, int accessor_index,
+ AccessorComponent accessor);
template<typename Field>
void DecodeField(Register reg) {