Index: src/builtins/s390/builtins-s390.cc |
diff --git a/src/builtins/s390/builtins-s390.cc b/src/builtins/s390/builtins-s390.cc |
index 94a2b468e877174252860a7e1df7e2b6d1fe1a50..8a6f5b8a6f4b8b2a2a38fdf3023d9d754d8906a6 100644 |
--- a/src/builtins/s390/builtins-s390.cc |
+++ b/src/builtins/s390/builtins-s390.cc |
@@ -1368,12 +1368,6 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
Register closure = r3; |
Register map = r8; |
Register index = r4; |
- |
- // Do we have a valid feedback vector? |
- __ LoadP(index, FieldMemOperand(closure, JSFunction::kLiteralsOffset)); |
- __ LoadP(index, FieldMemOperand(index, LiteralsArray::kFeedbackVectorOffset)); |
- __ JumpIfRoot(index, Heap::kUndefinedValueRootIndex, &gotta_call_runtime); |
- |
__ LoadP(map, |
FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); |
__ LoadP(map, |
@@ -1403,6 +1397,18 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
__ LoadP(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); |
__ CmpP(temp, native_context); |
__ bne(&loop_bottom, Label::kNear); |
+ // Literals available? |
+ __ LoadP(temp, |
+ FieldMemOperand(array_pointer, |
+ SharedFunctionInfo::kOffsetToPreviousLiterals)); |
+ __ LoadP(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); |
+ __ JumpIfSmi(temp, &gotta_call_runtime); |
+ |
+ // Save the literals in the closure. |
+ __ StoreP(temp, FieldMemOperand(closure, JSFunction::kLiteralsOffset), r0); |
+ __ RecordWriteField(closure, JSFunction::kLiteralsOffset, temp, r6, |
+ kLRHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, |
+ OMIT_SMI_CHECK); |
// Code available? |
Register entry = r6; |
@@ -1412,7 +1418,7 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
__ LoadP(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. |
// Store code entry in the closure. |
__ AddP(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag)); |
__ StoreP(entry, FieldMemOperand(closure, JSFunction::kCodeEntryOffset), r0); |
@@ -1446,7 +1452,7 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
__ CmpSmiLiteral(index, Smi::FromInt(1), r0); |
__ bgt(&loop_top); |
- // We found no code. |
+ // We found neither literals nor code. |
__ b(&gotta_call_runtime); |
__ bind(&try_shared); |