| 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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
| 6 | 6 |
| 7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
| 8 // | 8 // |
| 9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
| 10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 } | 130 } |
| 131 | 131 |
| 132 // Open a frame scope to indicate that there is a frame on the stack. The | 132 // Open a frame scope to indicate that there is a frame on the stack. The |
| 133 // MANUAL indicates that the scope shouldn't actually generate code to set up | 133 // MANUAL indicates that the scope shouldn't actually generate code to set up |
| 134 // the frame (that is done below). | 134 // the frame (that is done below). |
| 135 FrameScope frame_scope(masm_, StackFrame::MANUAL); | 135 FrameScope frame_scope(masm_, StackFrame::MANUAL); |
| 136 | 136 |
| 137 info->set_prologue_offset(masm_->pc_offset()); | 137 info->set_prologue_offset(masm_->pc_offset()); |
| 138 __ Prologue(info->GeneratePreagedPrologue()); | 138 __ Prologue(info->GeneratePreagedPrologue()); |
| 139 | 139 |
| 140 // Increment invocation count for the function. |
| 141 { |
| 142 Comment cmnt(masm_, "[ Increment invocation count"); |
| 143 __ lw(a0, FieldMemOperand(a1, JSFunction::kLiteralsOffset)); |
| 144 __ lw(a0, FieldMemOperand(a0, LiteralsArray::kFeedbackVectorOffset)); |
| 145 __ lw(t0, FieldMemOperand( |
| 146 a0, TypeFeedbackVector::kInvocationCountIndex * kPointerSize + |
| 147 TypeFeedbackVector::kHeaderSize)); |
| 148 __ Addu(t0, t0, Operand(Smi::FromInt(1))); |
| 149 __ sw(t0, FieldMemOperand( |
| 150 a0, TypeFeedbackVector::kInvocationCountIndex * kPointerSize + |
| 151 TypeFeedbackVector::kHeaderSize)); |
| 152 } |
| 153 |
| 140 { Comment cmnt(masm_, "[ Allocate locals"); | 154 { Comment cmnt(masm_, "[ Allocate locals"); |
| 141 int locals_count = info->scope()->num_stack_slots(); | 155 int locals_count = info->scope()->num_stack_slots(); |
| 142 // Generators allocate locals, if any, in context slots. | 156 // Generators allocate locals, if any, in context slots. |
| 143 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); | 157 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); |
| 144 OperandStackDepthIncrement(locals_count); | 158 OperandStackDepthIncrement(locals_count); |
| 145 if (locals_count > 0) { | 159 if (locals_count > 0) { |
| 146 if (locals_count >= 128) { | 160 if (locals_count >= 128) { |
| 147 Label ok; | 161 Label ok; |
| 148 __ Subu(t5, sp, Operand(locals_count * kPointerSize)); | 162 __ Subu(t5, sp, Operand(locals_count * kPointerSize)); |
| 149 __ LoadRoot(a2, Heap::kRealStackLimitRootIndex); | 163 __ LoadRoot(a2, Heap::kRealStackLimitRootIndex); |
| (...skipping 3566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3716 reinterpret_cast<uint32_t>( | 3730 reinterpret_cast<uint32_t>( |
| 3717 isolate->builtins()->OnStackReplacement()->entry())); | 3731 isolate->builtins()->OnStackReplacement()->entry())); |
| 3718 return ON_STACK_REPLACEMENT; | 3732 return ON_STACK_REPLACEMENT; |
| 3719 } | 3733 } |
| 3720 | 3734 |
| 3721 | 3735 |
| 3722 } // namespace internal | 3736 } // namespace internal |
| 3723 } // namespace v8 | 3737 } // namespace v8 |
| 3724 | 3738 |
| 3725 #endif // V8_TARGET_ARCH_MIPS | 3739 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |