OLD | NEW |
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_X87 | 5 #if V8_TARGET_ARCH_X87 |
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 Loading... |
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 __ mov(ecx, FieldOperand(edi, JSFunction::kLiteralsOffset)); |
| 124 __ mov(ecx, FieldOperand(ecx, LiteralsArray::kFeedbackVectorOffset)); |
| 125 __ add(FieldOperand( |
| 126 ecx, TypeFeedbackVector::kInvocationCountIndex * kPointerSize + |
| 127 TypeFeedbackVector::kHeaderSize), |
| 128 Immediate(Smi::FromInt(1))); |
| 129 } |
| 130 |
120 { Comment cmnt(masm_, "[ Allocate locals"); | 131 { Comment cmnt(masm_, "[ Allocate locals"); |
121 int locals_count = info->scope()->num_stack_slots(); | 132 int locals_count = info->scope()->num_stack_slots(); |
122 // Generators allocate locals, if any, in context slots. | 133 // Generators allocate locals, if any, in context slots. |
123 DCHECK(!IsGeneratorFunction(literal()->kind()) || locals_count == 0); | 134 DCHECK(!IsGeneratorFunction(literal()->kind()) || locals_count == 0); |
124 OperandStackDepthIncrement(locals_count); | 135 OperandStackDepthIncrement(locals_count); |
125 if (locals_count == 1) { | 136 if (locals_count == 1) { |
126 __ push(Immediate(isolate()->factory()->undefined_value())); | 137 __ push(Immediate(isolate()->factory()->undefined_value())); |
127 } else if (locals_count > 1) { | 138 } else if (locals_count > 1) { |
128 if (locals_count >= 128) { | 139 if (locals_count >= 128) { |
129 Label ok; | 140 Label ok; |
(...skipping 3471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3601 isolate->builtins()->OnStackReplacement()->entry(), | 3612 isolate->builtins()->OnStackReplacement()->entry(), |
3602 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3613 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3603 return ON_STACK_REPLACEMENT; | 3614 return ON_STACK_REPLACEMENT; |
3604 } | 3615 } |
3605 | 3616 |
3606 | 3617 |
3607 } // namespace internal | 3618 } // namespace internal |
3608 } // namespace v8 | 3619 } // namespace v8 |
3609 | 3620 |
3610 #endif // V8_TARGET_ARCH_X87 | 3621 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |