Index: src/arm/macro-assembler-arm.cc |
diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc |
index 5220b05bf846e10587ba0b936782843fdef0f433..57fa3f580492a8aefb7363c777a6af61cd2f626f 100644 |
--- a/src/arm/macro-assembler-arm.cc |
+++ b/src/arm/macro-assembler-arm.cc |
@@ -2936,6 +2936,28 @@ void MacroAssembler::AllocateHeapNumberWithValue(Register result, |
} |
+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::CopyBytes(Register src, |
Register dst, |
Register length, |