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

Side by Side Diff: src/full-codegen/x64/full-codegen-x64.cc

Issue 2337123003: [turbofan] Collect invocation counts and compute relative call frequencies. (Closed)
Patch Set: Address feedback. Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/heap/heap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if V8_TARGET_ARCH_X64 5 #if V8_TARGET_ARCH_X64
6 6
7 #include "src/full-codegen/full-codegen.h" 7 #include "src/full-codegen/full-codegen.h"
8 #include "src/ast/compile-time-value.h" 8 #include "src/ast/compile-time-value.h"
9 #include "src/ast/scopes.h" 9 #include "src/ast/scopes.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 } 110 }
111 111
112 // Open a frame scope to indicate that there is a frame on the stack. The 112 // Open a frame scope to indicate that there is a frame on the stack. The
113 // MANUAL indicates that the scope shouldn't actually generate code to set up 113 // MANUAL indicates that the scope shouldn't actually generate code to set up
114 // the frame (that is done below). 114 // the frame (that is done below).
115 FrameScope frame_scope(masm_, StackFrame::MANUAL); 115 FrameScope frame_scope(masm_, StackFrame::MANUAL);
116 116
117 info->set_prologue_offset(masm_->pc_offset()); 117 info->set_prologue_offset(masm_->pc_offset());
118 __ Prologue(info->GeneratePreagedPrologue()); 118 __ Prologue(info->GeneratePreagedPrologue());
119 119
120 // Increment invocation count for the function.
121 {
122 Comment cmnt(masm_, "[ Increment invocation count");
123 __ movp(rcx, FieldOperand(rdi, JSFunction::kLiteralsOffset));
124 __ movp(rcx, FieldOperand(rcx, LiteralsArray::kFeedbackVectorOffset));
125 __ SmiAddConstant(
126 FieldOperand(rcx,
127 TypeFeedbackVector::kInvocationCountIndex * kPointerSize +
128 TypeFeedbackVector::kHeaderSize),
129 Smi::FromInt(1));
130 }
131
120 { Comment cmnt(masm_, "[ Allocate locals"); 132 { Comment cmnt(masm_, "[ Allocate locals");
121 int locals_count = info->scope()->num_stack_slots(); 133 int locals_count = info->scope()->num_stack_slots();
122 // Generators allocate locals, if any, in context slots. 134 // Generators allocate locals, if any, in context slots.
123 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); 135 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0);
124 OperandStackDepthIncrement(locals_count); 136 OperandStackDepthIncrement(locals_count);
125 if (locals_count == 1) { 137 if (locals_count == 1) {
126 __ PushRoot(Heap::kUndefinedValueRootIndex); 138 __ PushRoot(Heap::kUndefinedValueRootIndex);
127 } else if (locals_count > 1) { 139 } else if (locals_count > 1) {
128 if (locals_count >= 128) { 140 if (locals_count >= 128) {
129 Label ok; 141 Label ok;
(...skipping 3465 matching lines...) Expand 10 before | Expand all | Expand 10 after
3595 DCHECK_EQ( 3607 DCHECK_EQ(
3596 isolate->builtins()->OnStackReplacement()->entry(), 3608 isolate->builtins()->OnStackReplacement()->entry(),
3597 Assembler::target_address_at(call_target_address, unoptimized_code)); 3609 Assembler::target_address_at(call_target_address, unoptimized_code));
3598 return ON_STACK_REPLACEMENT; 3610 return ON_STACK_REPLACEMENT;
3599 } 3611 }
3600 3612
3601 } // namespace internal 3613 } // namespace internal
3602 } // namespace v8 3614 } // namespace v8
3603 3615
3604 #endif // V8_TARGET_ARCH_X64 3616 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698