OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 126 |
127 if (prologue_offset) { | 127 if (prologue_offset) { |
128 // Prologue logic requires it's starting address in ip and the | 128 // Prologue logic requires it's starting address in ip and the |
129 // corresponding offset from the function entry. | 129 // corresponding offset from the function entry. |
130 prologue_offset += Instruction::kInstrSize; | 130 prologue_offset += Instruction::kInstrSize; |
131 __ addi(ip, ip, Operand(prologue_offset)); | 131 __ addi(ip, ip, Operand(prologue_offset)); |
132 } | 132 } |
133 info->set_prologue_offset(prologue_offset); | 133 info->set_prologue_offset(prologue_offset); |
134 __ Prologue(info->GeneratePreagedPrologue(), ip, prologue_offset); | 134 __ Prologue(info->GeneratePreagedPrologue(), ip, prologue_offset); |
135 | 135 |
| 136 // Increment invocation count for the function. |
| 137 { |
| 138 Comment cmnt(masm_, "[ Increment invocation count"); |
| 139 __ LoadP(r7, FieldMemOperand(r4, JSFunction::kLiteralsOffset)); |
| 140 __ LoadP(r7, FieldMemOperand(r7, LiteralsArray::kFeedbackVectorOffset)); |
| 141 __ LoadP(r8, FieldMemOperand(r7, TypeFeedbackVector::kInvocationCountIndex * |
| 142 kPointerSize + |
| 143 TypeFeedbackVector::kHeaderSize)); |
| 144 __ AddSmiLiteral(r8, r8, Smi::FromInt(1), r0); |
| 145 __ StoreP(r8, |
| 146 FieldMemOperand( |
| 147 r7, TypeFeedbackVector::kInvocationCountIndex * kPointerSize + |
| 148 TypeFeedbackVector::kHeaderSize), |
| 149 r0); |
| 150 } |
| 151 |
136 { | 152 { |
137 Comment cmnt(masm_, "[ Allocate locals"); | 153 Comment cmnt(masm_, "[ Allocate locals"); |
138 int locals_count = info->scope()->num_stack_slots(); | 154 int locals_count = info->scope()->num_stack_slots(); |
139 // Generators allocate locals, if any, in context slots. | 155 // Generators allocate locals, if any, in context slots. |
140 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); | 156 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); |
141 OperandStackDepthIncrement(locals_count); | 157 OperandStackDepthIncrement(locals_count); |
142 if (locals_count > 0) { | 158 if (locals_count > 0) { |
143 if (locals_count >= 128) { | 159 if (locals_count >= 128) { |
144 Label ok; | 160 Label ok; |
145 __ Add(ip, sp, -(locals_count * kPointerSize), r0); | 161 __ Add(ip, sp, -(locals_count * kPointerSize), r0); |
(...skipping 3551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3697 | 3713 |
3698 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); | 3714 DCHECK(Assembler::IsCrSet(Assembler::instr_at(cmp_address))); |
3699 | 3715 |
3700 DCHECK(interrupt_address == | 3716 DCHECK(interrupt_address == |
3701 isolate->builtins()->OnStackReplacement()->entry()); | 3717 isolate->builtins()->OnStackReplacement()->entry()); |
3702 return ON_STACK_REPLACEMENT; | 3718 return ON_STACK_REPLACEMENT; |
3703 } | 3719 } |
3704 } // namespace internal | 3720 } // namespace internal |
3705 } // namespace v8 | 3721 } // namespace v8 |
3706 #endif // V8_TARGET_ARCH_PPC | 3722 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |