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

Unified Diff: src/builtins/x64/builtins-x64.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/s390/builtins-s390.cc ('k') | src/builtins/x87/builtins-x87.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/x64/builtins-x64.cc
diff --git a/src/builtins/x64/builtins-x64.cc b/src/builtins/x64/builtins-x64.cc
index 107391504e40eb124dce76dac931a484667d60c6..caf247070a3855bc161520ee476640c9dfd64b29 100644
--- a/src/builtins/x64/builtins-x64.cc
+++ b/src/builtins/x64/builtins-x64.cc
@@ -623,6 +623,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
// Increment invocation count for the function.
__ movp(rcx, FieldOperand(rdi, JSFunction::kFeedbackVectorOffset));
+ __ movp(rcx, FieldOperand(rcx, Cell::kValueOffset));
__ SmiAddConstant(
FieldOperand(rcx,
TypeFeedbackVector::kInvocationCountIndex * kPointerSize +
@@ -995,13 +996,18 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
Register closure = rdi;
Register map = r8;
Register index = r9;
+
+ // Do we have a valid feedback vector?
+ __ movp(rbx, FieldOperand(closure, JSFunction::kFeedbackVectorOffset));
+ __ movp(rbx, FieldOperand(rbx, Cell::kValueOffset));
+ __ JumpIfRoot(rbx, Heap::kUndefinedValueRootIndex, &gotta_call_runtime);
+
__ movp(map, FieldOperand(closure, JSFunction::kSharedFunctionInfoOffset));
__ movp(map, FieldOperand(map, SharedFunctionInfo::kOptimizedCodeMapOffset));
__ SmiToInteger32(index, FieldOperand(map, FixedArray::kLengthOffset));
__ cmpl(index, Immediate(2));
- __ j(less, &gotta_call_runtime);
+ __ j(less, &try_shared);
- // Find literals.
// r14 : native context
// r9 : length / index
// r8 : optimized code map
@@ -1018,17 +1024,6 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
__ movp(temp, FieldOperand(temp, WeakCell::kValueOffset));
__ cmpp(temp, native_context);
__ j(not_equal, &loop_bottom);
- // Feedback vector available?
- __ movp(temp, FieldOperand(map, index, times_pointer_size,
- SharedFunctionInfo::kOffsetToPreviousLiterals));
- __ movp(temp, FieldOperand(temp, WeakCell::kValueOffset));
- __ JumpIfSmi(temp, &gotta_call_runtime);
-
- // Save the feedback vector in the closure.
- __ movp(FieldOperand(closure, JSFunction::kFeedbackVectorOffset), temp);
- __ movp(r15, index);
- __ RecordWriteField(closure, JSFunction::kFeedbackVectorOffset, temp, r15,
- kDontSaveFPRegs, EMIT_REMEMBERED_SET, OMIT_SMI_CHECK);
// Code available?
Register entry = rcx;
@@ -1037,7 +1032,7 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
__ movp(entry, FieldOperand(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.
__ leap(entry, FieldOperand(entry, Code::kHeaderSize));
__ movp(FieldOperand(closure, JSFunction::kCodeEntryOffset), entry);
__ RecordWriteCodeEntryField(closure, entry, r15);
@@ -1068,9 +1063,7 @@ void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
__ cmpl(index, Immediate(1));
__ j(greater, &loop_top);
- // We found neither literals nor code.
- __ jmp(&gotta_call_runtime);
-
+ // We found no code.
__ bind(&try_shared);
__ movp(entry, FieldOperand(closure, JSFunction::kSharedFunctionInfoOffset));
// Is the shared function marked for tier up?
« no previous file with comments | « src/builtins/s390/builtins-s390.cc ('k') | src/builtins/x87/builtins-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698