Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Unified Diff: src/builtins/mips64/builtins-mips64.cc

Issue 2674593003: [TypeFeedbackVector] Root feedback vectors at function literal site. (Closed)
Patch Set: REBASE+liveedit fix. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins/mips/builtins-mips.cc ('k') | src/builtins/ppc/builtins-ppc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/mips64/builtins-mips64.cc
diff --git a/src/builtins/mips64/builtins-mips64.cc b/src/builtins/mips64/builtins-mips64.cc
index c3dcf05212fc863745d8e1a77268002be9a3fc47..f404d608cb1fceb0bf5cfdc1b7f73db252af74cf 100644
--- a/src/builtins/mips64/builtins-mips64.cc
+++ b/src/builtins/mips64/builtins-mips64.cc
@@ -1009,6 +1009,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
// Increment invocation count for the function.
__ ld(a0, FieldMemOperand(a1, JSFunction::kFeedbackVectorOffset));
+ __ ld(a0, FieldMemOperand(a0, Cell::kValueOffset));
__ ld(a4, FieldMemOperand(
a0, TypeFeedbackVector::kInvocationCountIndex * kPointerSize +
TypeFeedbackVector::kHeaderSize));
@@ -1343,18 +1344,24 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
Register argument_count = a0;
Register closure = a1;
Register new_target = a3;
+ Register map = a0;
+ Register index = a2;
+
+ // Do we have a valid feedback vector?
+ __ ld(index, FieldMemOperand(closure, JSFunction::kFeedbackVectorOffset));
+ __ ld(index, FieldMemOperand(index, Cell::kValueOffset));
+ __ JumpIfRoot(index, Heap::kUndefinedValueRootIndex,
+ &gotta_call_runtime_no_stack);
+
__ push(argument_count);
__ push(new_target);
__ push(closure);
- Register map = a0;
- Register index = a2;
__ ld(map, FieldMemOperand(closure, JSFunction::kSharedFunctionInfoOffset));
__ ld(map, FieldMemOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset));
__ ld(index, FieldMemOperand(map, FixedArray::kLengthOffset));
- __ Branch(&gotta_call_runtime, lt, index, Operand(Smi::FromInt(2)));
+ __ Branch(&try_shared, lt, index, Operand(Smi::FromInt(2)));
- // Find literals.
// a3 : native context
// a2 : length / index
// a0 : optimized code map
@@ -1374,20 +1381,6 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
SharedFunctionInfo::kOffsetToPreviousContext));
__ ld(temp, FieldMemOperand(temp, WeakCell::kValueOffset));
__ Branch(&loop_bottom, ne, temp, Operand(native_context));
- // Feedback vector available?
- __ ld(temp, FieldMemOperand(array_pointer,
- SharedFunctionInfo::kOffsetToPreviousLiterals));
- __ ld(temp, FieldMemOperand(temp, WeakCell::kValueOffset));
- __ JumpIfSmi(temp, &gotta_call_runtime);
-
- // Save the feedback vector in the closure.
- __ ld(a4, MemOperand(sp, 0));
- __ sd(temp, FieldMemOperand(a4, JSFunction::kFeedbackVectorOffset));
- __ push(index);
- __ RecordWriteField(a4, JSFunction::kFeedbackVectorOffset, temp, index,
- kRAHasNotBeenSaved, kDontSaveFPRegs, EMIT_REMEMBERED_SET,
- OMIT_SMI_CHECK);
- __ pop(index);
// Code available?
Register entry = a4;
@@ -1397,7 +1390,7 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
__ ld(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.
__ Daddu(entry, entry, Operand(Code::kHeaderSize - kHeapObjectTag));
@@ -1432,9 +1425,7 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
Operand(Smi::FromInt(SharedFunctionInfo::kEntryLength)));
__ Branch(&loop_top, gt, index, Operand(Smi::FromInt(1)));
- // We found neither literals nor code.
- __ jmp(&gotta_call_runtime);
-
+ // We found no code.
__ bind(&try_shared);
__ pop(closure);
__ pop(new_target);
« no previous file with comments | « src/builtins/mips/builtins-mips.cc ('k') | src/builtins/ppc/builtins-ppc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698