Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Side by Side Diff: src/full-codegen/x64/full-codegen-x64.cc

Issue 1337883002: [builtins] Remove the weird STACK_OVERFLOW builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/full-codegen/mips64/full-codegen-mips64.cc ('k') | src/ia32/builtins-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698