Index: src/builtins/arm/builtins-arm.cc |
diff --git a/src/builtins/arm/builtins-arm.cc b/src/builtins/arm/builtins-arm.cc |
index f8d01e9b9b7e7a18a233e5ce9f1903d7f1ed3e06..e2ac3ae5682a86441374008a10b7eb66fc0958c9 100644 |
--- a/src/builtins/arm/builtins-arm.cc |
+++ b/src/builtins/arm/builtins-arm.cc |
@@ -1350,6 +1350,7 @@ |
__ cmp(index, Operand(Smi::FromInt(2))); |
__ b(lt, &gotta_call_runtime); |
+ // Find literals. |
// r3 : native context |
// r2 : length / index |
// r0 : optimized code map |
@@ -1369,6 +1370,20 @@ |
__ ldr(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); |
__ cmp(temp, native_context); |
__ b(ne, &loop_bottom); |
+ // Literals available? |
+ __ ldr(temp, FieldMemOperand(array_pointer, |
+ SharedFunctionInfo::kOffsetToPreviousLiterals)); |
+ __ ldr(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); |
+ __ JumpIfSmi(temp, &gotta_call_runtime); |
+ |
+ // Save the literals in the closure. |
+ __ ldr(r4, MemOperand(sp, 0)); |
+ __ str(temp, FieldMemOperand(r4, JSFunction::kLiteralsOffset)); |
+ __ push(index); |
+ __ RecordWriteField(r4, JSFunction::kLiteralsOffset, temp, index, |
+ kLRHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, |
+ OMIT_SMI_CHECK); |
+ __ pop(index); |
// Code available? |
Register entry = r4; |
@@ -1378,7 +1393,7 @@ |
__ ldr(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. |
__ add(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag)); |
@@ -1413,7 +1428,7 @@ |
__ cmp(index, Operand(Smi::FromInt(1))); |
__ b(gt, &loop_top); |
- // We found no code. |
+ // We found neither literals nor code. |
__ jmp(&gotta_call_runtime); |
__ bind(&try_shared); |