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/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 int locals_count = info->scope()->num_stack_slots(); | 153 int locals_count = info->scope()->num_stack_slots(); |
154 // Generators allocate locals, if any, in context slots. | 154 // Generators allocate locals, if any, in context slots. |
155 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); | 155 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); |
156 if (locals_count > 0) { | 156 if (locals_count > 0) { |
157 if (locals_count >= 128) { | 157 if (locals_count >= 128) { |
158 Label ok; | 158 Label ok; |
159 __ Add(ip, sp, -(locals_count * kPointerSize), r0); | 159 __ Add(ip, sp, -(locals_count * kPointerSize), r0); |
160 __ LoadRoot(r5, Heap::kRealStackLimitRootIndex); | 160 __ LoadRoot(r5, Heap::kRealStackLimitRootIndex); |
161 __ cmpl(ip, r5); | 161 __ cmpl(ip, r5); |
162 __ bc_short(ge, &ok); | 162 __ bc_short(ge, &ok); |
163 __ InvokeBuiltin(Context::STACK_OVERFLOW_BUILTIN_INDEX, CALL_FUNCTION); | 163 __ CallRuntime(Runtime::kThrowStackOverflow, 0); |
164 __ bind(&ok); | 164 __ bind(&ok); |
165 } | 165 } |
166 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); | 166 __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); |
167 int kMaxPushes = FLAG_optimize_for_size ? 4 : 32; | 167 int kMaxPushes = FLAG_optimize_for_size ? 4 : 32; |
168 if (locals_count >= kMaxPushes) { | 168 if (locals_count >= kMaxPushes) { |
169 int loop_iterations = locals_count / kMaxPushes; | 169 int loop_iterations = locals_count / kMaxPushes; |
170 __ mov(r5, Operand(loop_iterations)); | 170 __ mov(r5, Operand(loop_iterations)); |
171 __ mtctr(r5); | 171 __ mtctr(r5); |
172 Label loop_header; | 172 Label loop_header; |
173 __ bind(&loop_header); | 173 __ bind(&loop_header); |
(...skipping 5136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5310 return ON_STACK_REPLACEMENT; | 5310 return ON_STACK_REPLACEMENT; |
5311 } | 5311 } |
5312 | 5312 |
5313 DCHECK(interrupt_address == | 5313 DCHECK(interrupt_address == |
5314 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5314 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5315 return OSR_AFTER_STACK_CHECK; | 5315 return OSR_AFTER_STACK_CHECK; |
5316 } | 5316 } |
5317 } // namespace internal | 5317 } // namespace internal |
5318 } // namespace v8 | 5318 } // namespace v8 |
5319 #endif // V8_TARGET_ARCH_PPC | 5319 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |