Index: src/arm64/macro-assembler-arm64.cc |
diff --git a/src/arm64/macro-assembler-arm64.cc b/src/arm64/macro-assembler-arm64.cc |
index bd7b950247cc70a8b9d20189f226494752f3d9df..fbf459db46c4b27308562dcbf75748748b3d2771 100644 |
--- a/src/arm64/macro-assembler-arm64.cc |
+++ b/src/arm64/macro-assembler-arm64.cc |
@@ -3269,6 +3269,28 @@ void MacroAssembler::JumpIfObjectType(Register object, |
} |
+void MacroAssembler::AllocateJSValue(Register result, Register constructor, |
+ Register value, Register scratch1, |
+ Register scratch2, Label* gc_required) { |
+ DCHECK(!result.is(constructor)); |
+ DCHECK(!result.is(scratch1)); |
+ DCHECK(!result.is(scratch2)); |
+ DCHECK(!result.is(value)); |
+ |
+ // Allocate JSValue in new space. |
+ Allocate(JSValue::kSize, result, scratch1, scratch2, gc_required, TAG_OBJECT); |
+ |
+ // Initialize the JSValue. |
+ LoadGlobalFunctionInitialMap(constructor, scratch1, scratch2); |
+ Str(scratch1, FieldMemOperand(result, HeapObject::kMapOffset)); |
+ LoadRoot(scratch1, Heap::kEmptyFixedArrayRootIndex); |
+ Str(scratch1, FieldMemOperand(result, JSObject::kPropertiesOffset)); |
+ Str(scratch1, FieldMemOperand(result, JSObject::kElementsOffset)); |
+ Str(value, FieldMemOperand(result, JSValue::kValueOffset)); |
+ STATIC_ASSERT(JSValue::kSize == 4 * kPointerSize); |
+} |
+ |
+ |
void MacroAssembler::JumpIfNotObjectType(Register object, |
Register map, |
Register type_reg, |