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_X64 | 5 #if V8_TARGET_ARCH_X64 |
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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); | 140 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); |
141 if (locals_count == 1) { | 141 if (locals_count == 1) { |
142 __ PushRoot(Heap::kUndefinedValueRootIndex); | 142 __ PushRoot(Heap::kUndefinedValueRootIndex); |
143 } else if (locals_count > 1) { | 143 } else if (locals_count > 1) { |
144 if (locals_count >= 128) { | 144 if (locals_count >= 128) { |
145 Label ok; | 145 Label ok; |
146 __ movp(rcx, rsp); | 146 __ movp(rcx, rsp); |
147 __ subp(rcx, Immediate(locals_count * kPointerSize)); | 147 __ subp(rcx, Immediate(locals_count * kPointerSize)); |
148 __ CompareRoot(rcx, Heap::kRealStackLimitRootIndex); | 148 __ CompareRoot(rcx, Heap::kRealStackLimitRootIndex); |
149 __ j(above_equal, &ok, Label::kNear); | 149 __ j(above_equal, &ok, Label::kNear); |
150 __ InvokeBuiltin(Context::STACK_OVERFLOW_BUILTIN_INDEX, CALL_FUNCTION); | 150 __ CallRuntime(Runtime::kThrowStackOverflow, 0); |
151 __ bind(&ok); | 151 __ bind(&ok); |
152 } | 152 } |
153 __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex); | 153 __ LoadRoot(rdx, Heap::kUndefinedValueRootIndex); |
154 const int kMaxPushes = 32; | 154 const int kMaxPushes = 32; |
155 if (locals_count >= kMaxPushes) { | 155 if (locals_count >= kMaxPushes) { |
156 int loop_iterations = locals_count / kMaxPushes; | 156 int loop_iterations = locals_count / kMaxPushes; |
157 __ movp(rcx, Immediate(loop_iterations)); | 157 __ movp(rcx, Immediate(loop_iterations)); |
158 Label loop_header; | 158 Label loop_header; |
159 __ bind(&loop_header); | 159 __ bind(&loop_header); |
160 // Do pushes. | 160 // Do pushes. |
(...skipping 5122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5283 Assembler::target_address_at(call_target_address, | 5283 Assembler::target_address_at(call_target_address, |
5284 unoptimized_code)); | 5284 unoptimized_code)); |
5285 return OSR_AFTER_STACK_CHECK; | 5285 return OSR_AFTER_STACK_CHECK; |
5286 } | 5286 } |
5287 | 5287 |
5288 | 5288 |
5289 } // namespace internal | 5289 } // namespace internal |
5290 } // namespace v8 | 5290 } // namespace v8 |
5291 | 5291 |
5292 #endif // V8_TARGET_ARCH_X64 | 5292 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |