Index: src/builtins/mips/builtins-mips.cc |
diff --git a/src/builtins/mips/builtins-mips.cc b/src/builtins/mips/builtins-mips.cc |
index 4842d35244792a266fdb0d5d28f4c15021207574..f0e0d21b25b33d9312f6e57ad9c7e2b6a21aeff4 100644 |
--- a/src/builtins/mips/builtins-mips.cc |
+++ b/src/builtins/mips/builtins-mips.cc |
@@ -1360,6 +1360,7 @@ |
__ lw(index, FieldMemOperand(map, FixedArray::kLengthOffset)); |
__ Branch(&gotta_call_runtime, lt, index, Operand(Smi::FromInt(2))); |
+ // Find literals. |
// a3 : native context |
// a2 : length / index |
// a0 : optimized code map |
@@ -1379,6 +1380,20 @@ |
SharedFunctionInfo::kOffsetToPreviousContext)); |
__ lw(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); |
__ Branch(&loop_bottom, ne, temp, Operand(native_context)); |
+ // Literals available? |
+ __ lw(temp, FieldMemOperand(array_pointer, |
+ SharedFunctionInfo::kOffsetToPreviousLiterals)); |
+ __ lw(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); |
+ __ JumpIfSmi(temp, &gotta_call_runtime); |
+ |
+ // Save the literals in the closure. |
+ __ lw(t0, MemOperand(sp, 0)); |
+ __ sw(temp, FieldMemOperand(t0, JSFunction::kLiteralsOffset)); |
+ __ push(index); |
+ __ RecordWriteField(t0, JSFunction::kLiteralsOffset, temp, index, |
+ kRAHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, |
+ OMIT_SMI_CHECK); |
+ __ pop(index); |
// Code available? |
Register entry = t0; |
@@ -1388,7 +1403,7 @@ |
__ lw(entry, FieldMemOperand(entry, WeakCell::kValueOffset)); |
__ JumpIfSmi(entry, &try_shared); |
- // Found code. Get it into the closure and return. |
+ // Found literals and code. Get them into the closure and return. |
__ pop(closure); |
// Store code entry in the closure. |
__ Addu(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag)); |
@@ -1423,7 +1438,7 @@ |
Operand(Smi::FromInt(SharedFunctionInfo::kEntryLength))); |
__ Branch(&loop_top, gt, index, Operand(Smi::FromInt(1))); |
- // We found no code. |
+ // We found neither literals nor code. |
__ jmp(&gotta_call_runtime); |
__ bind(&try_shared); |