Index: src/builtins/ppc/builtins-ppc.cc |
diff --git a/src/builtins/ppc/builtins-ppc.cc b/src/builtins/ppc/builtins-ppc.cc |
index 06abce4b584bfcd60a09ac3da9af6b24dae5b26e..e3f438c71511a25b11aeaa8105cfdd79cde4f2ba 100644 |
--- a/src/builtins/ppc/builtins-ppc.cc |
+++ b/src/builtins/ppc/builtins-ppc.cc |
@@ -1034,6 +1034,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { |
// Increment invocation count for the function. |
__ LoadP(r7, FieldMemOperand(r4, JSFunction::kFeedbackVectorOffset)); |
+ __ LoadP(r7, FieldMemOperand(r7, Cell::kValueOffset)); |
__ LoadP(r8, FieldMemOperand(r7, TypeFeedbackVector::kInvocationCountIndex * |
kPointerSize + |
TypeFeedbackVector::kHeaderSize)); |
@@ -1364,15 +1365,20 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
Register closure = r4; |
Register map = r9; |
Register index = r5; |
+ |
+ // 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. |
// r10 : native context |
// r5 : length / index |
// r9 : optimized code map |
@@ -1393,19 +1399,6 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
__ LoadP(temp, FieldMemOperand(temp, WeakCell::kValueOffset)); |
__ cmp(temp, native_context); |
__ bne(&loop_bottom); |
- // 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, r7, |
- kLRHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET, |
- OMIT_SMI_CHECK); |
// Code available? |
Register entry = r7; |
@@ -1415,7 +1408,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. |
__ addi(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag)); |
__ StoreP(entry, FieldMemOperand(closure, JSFunction::kCodeEntryOffset), r0); |
@@ -1449,7 +1442,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); |