Chromium Code Reviews| 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 __ ldr(r2, FieldMemOperand(r1, JSFunction::kLiteralsOffset)); | |
|
Michael Starzinger
2016/09/14 07:53:45
suggestion: We could even add a code comment (the
mvstanton
2016/09/14 09:26:09
Let's certainly do so!
Benedikt Meurer
2016/09/14 10:55:44
Done.
| |
| 133 __ ldr(r2, FieldMemOperand(r2, LiteralsArray::kFeedbackVectorOffset)); | |
| 134 __ ldr(r9, FieldMemOperand( | |
| 135 r2, TypeFeedbackVector::kInvocationCountIndex * kPointerSize + | |
| 136 TypeFeedbackVector::kHeaderSize)); | |
| 137 __ add(r9, r9, Operand(Smi::FromInt(1))); | |
| 138 __ str(r9, FieldMemOperand( | |
| 139 r2, TypeFeedbackVector::kInvocationCountIndex * kPointerSize + | |
| 140 TypeFeedbackVector::kHeaderSize)); | |
| 141 | |
| 131 { Comment cmnt(masm_, "[ Allocate locals"); | 142 { Comment cmnt(masm_, "[ Allocate locals"); |
| 132 int locals_count = info->scope()->num_stack_slots(); | 143 int locals_count = info->scope()->num_stack_slots(); |
| 133 // Generators allocate locals, if any, in context slots. | 144 // Generators allocate locals, if any, in context slots. |
| 134 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); | 145 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); |
| 135 OperandStackDepthIncrement(locals_count); | 146 OperandStackDepthIncrement(locals_count); |
| 136 if (locals_count > 0) { | 147 if (locals_count > 0) { |
| 137 if (locals_count >= 128) { | 148 if (locals_count >= 128) { |
| 138 Label ok; | 149 Label ok; |
| 139 __ sub(r9, sp, Operand(locals_count * kPointerSize)); | 150 __ sub(r9, sp, Operand(locals_count * kPointerSize)); |
| 140 __ LoadRoot(r2, Heap::kRealStackLimitRootIndex); | 151 __ LoadRoot(r2, Heap::kRealStackLimitRootIndex); |
| (...skipping 3634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3775 DCHECK(interrupt_address == | 3786 DCHECK(interrupt_address == |
| 3776 isolate->builtins()->OnStackReplacement()->entry()); | 3787 isolate->builtins()->OnStackReplacement()->entry()); |
| 3777 return ON_STACK_REPLACEMENT; | 3788 return ON_STACK_REPLACEMENT; |
| 3778 } | 3789 } |
| 3779 | 3790 |
| 3780 | 3791 |
| 3781 } // namespace internal | 3792 } // namespace internal |
| 3782 } // namespace v8 | 3793 } // namespace v8 |
| 3783 | 3794 |
| 3784 #endif // V8_TARGET_ARCH_ARM | 3795 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |