Index: src/mips64/macro-assembler-mips64.cc |
diff --git a/src/mips64/macro-assembler-mips64.cc b/src/mips64/macro-assembler-mips64.cc |
index cc9f67ec3d273377bd6bb030af54b8f6b9b5664b..7b73ac74e4d350827dc3153d1083995dcba1d9dd 100644 |
--- a/src/mips64/macro-assembler-mips64.cc |
+++ b/src/mips64/macro-assembler-mips64.cc |
@@ -4028,6 +4028,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); |
+ sd(scratch1, FieldMemOperand(result, HeapObject::kMapOffset)); |
+ LoadRoot(scratch1, Heap::kEmptyFixedArrayRootIndex); |
+ sd(scratch1, FieldMemOperand(result, JSObject::kPropertiesOffset)); |
+ sd(scratch1, FieldMemOperand(result, JSObject::kElementsOffset)); |
+ sd(value, FieldMemOperand(result, JSValue::kValueOffset)); |
+ STATIC_ASSERT(JSValue::kSize == 4 * kPointerSize); |
+} |
+ |
+ |
void MacroAssembler::CopyBytes(Register src, |
Register dst, |
Register length, |