| 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_ARM | 5 #if V8_TARGET_ARCH_ARM |
| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 } | 121 } |
| 122 | 122 |
| 123 // Open a frame scope to indicate that there is a frame on the stack. The | 123 // Open a frame scope to indicate that there is a frame on the stack. The |
| 124 // MANUAL indicates that the scope shouldn't actually generate code to set up | 124 // MANUAL indicates that the scope shouldn't actually generate code to set up |
| 125 // the frame (that is done below). | 125 // the frame (that is done below). |
| 126 FrameScope frame_scope(masm_, StackFrame::MANUAL); | 126 FrameScope frame_scope(masm_, StackFrame::MANUAL); |
| 127 | 127 |
| 128 info->set_prologue_offset(masm_->pc_offset()); | 128 info->set_prologue_offset(masm_->pc_offset()); |
| 129 __ Prologue(info->GeneratePreagedPrologue()); | 129 __ Prologue(info->GeneratePreagedPrologue()); |
| 130 | 130 |
| 131 // Increment invocation count for the function. |
| 132 { |
| 133 Comment cmnt(masm_, "[ Increment invocation count"); |
| 134 __ ldr(r2, FieldMemOperand(r1, JSFunction::kLiteralsOffset)); |
| 135 __ ldr(r2, FieldMemOperand(r2, LiteralsArray::kFeedbackVectorOffset)); |
| 136 __ ldr(r9, FieldMemOperand(r2, TypeFeedbackVector::kInvocationCountIndex * |
| 137 kPointerSize + |
| 138 TypeFeedbackVector::kHeaderSize)); |
| 139 __ add(r9, r9, Operand(Smi::FromInt(1))); |
| 140 __ str(r9, FieldMemOperand(r2, TypeFeedbackVector::kInvocationCountIndex * |
| 141 kPointerSize + |
| 142 TypeFeedbackVector::kHeaderSize)); |
| 143 } |
| 144 |
| 131 { Comment cmnt(masm_, "[ Allocate locals"); | 145 { Comment cmnt(masm_, "[ Allocate locals"); |
| 132 int locals_count = info->scope()->num_stack_slots(); | 146 int locals_count = info->scope()->num_stack_slots(); |
| 133 // Generators allocate locals, if any, in context slots. | 147 // Generators allocate locals, if any, in context slots. |
| 134 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); | 148 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); |
| 135 OperandStackDepthIncrement(locals_count); | 149 OperandStackDepthIncrement(locals_count); |
| 136 if (locals_count > 0) { | 150 if (locals_count > 0) { |
| 137 if (locals_count >= 128) { | 151 if (locals_count >= 128) { |
| 138 Label ok; | 152 Label ok; |
| 139 __ sub(r9, sp, Operand(locals_count * kPointerSize)); | 153 __ sub(r9, sp, Operand(locals_count * kPointerSize)); |
| 140 __ LoadRoot(r2, Heap::kRealStackLimitRootIndex); | 154 __ LoadRoot(r2, Heap::kRealStackLimitRootIndex); |
| (...skipping 3634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3775 DCHECK(interrupt_address == | 3789 DCHECK(interrupt_address == |
| 3776 isolate->builtins()->OnStackReplacement()->entry()); | 3790 isolate->builtins()->OnStackReplacement()->entry()); |
| 3777 return ON_STACK_REPLACEMENT; | 3791 return ON_STACK_REPLACEMENT; |
| 3778 } | 3792 } |
| 3779 | 3793 |
| 3780 | 3794 |
| 3781 } // namespace internal | 3795 } // namespace internal |
| 3782 } // namespace v8 | 3796 } // namespace v8 |
| 3783 | 3797 |
| 3784 #endif // V8_TARGET_ARCH_ARM | 3798 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |