| 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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 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 3475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3605 isolate->builtins()->OnStackReplacement()->entry(), | 3616 isolate->builtins()->OnStackReplacement()->entry(), |
| 3606 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3617 Assembler::target_address_at(call_target_address, unoptimized_code)); |
| 3607 return ON_STACK_REPLACEMENT; | 3618 return ON_STACK_REPLACEMENT; |
| 3608 } | 3619 } |
| 3609 | 3620 |
| 3610 | 3621 |
| 3611 } // namespace internal | 3622 } // namespace internal |
| 3612 } // namespace v8 | 3623 } // namespace v8 |
| 3613 | 3624 |
| 3614 #endif // V8_TARGET_ARCH_IA32 | 3625 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |