Index: src/builtins/s390/builtins-s390.cc |
diff --git a/src/builtins/s390/builtins-s390.cc b/src/builtins/s390/builtins-s390.cc |
index 856448f705ad701ac731f117a345a241fb70998d..dc35136aceacf02cd7e3b471d502833bbb6c3157 100644 |
--- a/src/builtins/s390/builtins-s390.cc |
+++ b/src/builtins/s390/builtins-s390.cc |
@@ -1039,6 +1039,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { |
// Increment invocation count for the function. |
__ LoadP(r6, FieldMemOperand(r3, JSFunction::kFeedbackVectorOffset)); |
+ __ LoadP(r6, FieldMemOperand(r6, Cell::kValueOffset)); |
__ LoadP(r1, FieldMemOperand(r6, TypeFeedbackVector::kInvocationCountIndex * |
kPointerSize + |
TypeFeedbackVector::kHeaderSize)); |
@@ -1369,13 +1370,19 @@ 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::kFeedbackVectorOffset)); |
+ __ LoadP(index, FieldMemOperand(index, Cell::kValueOffset)); |
+ __ JumpIfRoot(index, Heap::kUndefinedValueRootIndex, &gotta_call_runtime); |
+ |
__ LoadP(map, |
FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset)); |
__ LoadP(map, |
FieldMemOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset)); |
__ LoadP(index, FieldMemOperand(map, FixedArray::kLengthOffset)); |
__ CmpSmiLiteral(index, Smi::FromInt(2), r0); |
- __ blt(&gotta_call_runtime); |
+ __ blt(&try_shared); |
// Find literals. |
// r9 : native context |
@@ -1398,19 +1405,6 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
__ LoadP(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); |
__ CmpP(temp, native_context); |
__ bne(&loop_bottom, Label::kNear); |
- // Feedback vector available? |
- __ LoadP(temp, |
- FieldMemOperand(array_pointer, |
- SharedFunctionInfo::kOffsetToPreviousLiterals)); |
- __ LoadP(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); |
- __ JumpIfSmi(temp, &gotta_call_runtime); |
- |
- // Save the feedback vector in the closure. |
- __ StoreP(temp, FieldMemOperand(closure, JSFunction::kFeedbackVectorOffset), |
- r0); |
- __ RecordWriteField(closure, JSFunction::kFeedbackVectorOffset, temp, r6, |
- kLRHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, |
- OMIT_SMI_CHECK); |
// Code available? |
Register entry = r6; |
@@ -1420,7 +1414,7 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
__ LoadP(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. |
// Store code entry in the closure. |
__ AddP(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag)); |
__ StoreP(entry, FieldMemOperand(closure, JSFunction::kCodeEntryOffset), r0); |
@@ -1454,7 +1448,7 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
__ CmpSmiLiteral(index, Smi::FromInt(1), r0); |
__ bgt(&loop_top); |
- // We found neither literals nor code. |
+ // We found no code. |
__ b(&gotta_call_runtime); |
__ bind(&try_shared); |