Index: src/builtins/arm/builtins-arm.cc |
diff --git a/src/builtins/arm/builtins-arm.cc b/src/builtins/arm/builtins-arm.cc |
index 2fd8541bea682554db65e54e2a520af021fd6fe8..4097de8d268f40feb323b1470ed69af979322dda 100644 |
--- a/src/builtins/arm/builtins-arm.cc |
+++ b/src/builtins/arm/builtins-arm.cc |
@@ -1337,12 +1337,19 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
Register argument_count = r0; |
Register closure = r1; |
Register new_target = r3; |
+ Register map = argument_count; |
+ Register index = r2; |
+ |
+ // Do we have a valid feedback vector? |
+ __ ldr(index, FieldMemOperand(closure, JSFunction::kLiteralsOffset)); |
+ __ ldr(index, FieldMemOperand(index, LiteralsArray::kFeedbackVectorOffset)); |
+ __ JumpIfRoot(index, Heap::kUndefinedValueRootIndex, |
+ &gotta_call_runtime_no_stack); |
+ |
__ push(argument_count); |
__ push(new_target); |
__ push(closure); |
- Register map = argument_count; |
- Register index = r2; |
__ ldr(map, FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); |
__ ldr(map, |
FieldMemOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset)); |
@@ -1350,7 +1357,6 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
__ cmp(index, Operand(Smi::FromInt(2))); |
__ b(lt, &gotta_call_runtime); |
- // Find literals. |
// r3 : native context |
// r2 : length / index |
// r0 : optimized code map |
@@ -1370,20 +1376,6 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
__ 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; |
@@ -1393,7 +1385,7 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
__ ldr(entry, FieldMemOperand(entry, WeakCell::kValueOffset)); |
__ JumpIfSmi(entry, &try_shared); |
- // Found literals and code. Get them into the closure and return. |
+ // Found code. Get it into the closure and return. |
__ pop(closure); |
// Store code entry in the closure. |
__ add(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag)); |
@@ -1428,7 +1420,7 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
__ cmp(index, Operand(Smi::FromInt(1))); |
__ b(gt, &loop_top); |
- // We found neither literals nor code. |
+ // We found no code. |
__ jmp(&gotta_call_runtime); |
__ bind(&try_shared); |