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

Side by Side Diff: src/full-codegen/mips/full-codegen-mips.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
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_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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 { Comment cmnt(masm_, "[ Allocate locals"); 155 { Comment cmnt(masm_, "[ Allocate locals");
156 int locals_count = info->scope()->num_stack_slots(); 156 int locals_count = info->scope()->num_stack_slots();
157 // Generators allocate locals, if any, in context slots. 157 // Generators allocate locals, if any, in context slots.
158 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); 158 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0);
159 if (locals_count > 0) { 159 if (locals_count > 0) {
160 if (locals_count >= 128) { 160 if (locals_count >= 128) {
161 Label ok; 161 Label ok;
162 __ Subu(t5, sp, Operand(locals_count * kPointerSize)); 162 __ Subu(t5, sp, Operand(locals_count * kPointerSize));
163 __ LoadRoot(a2, Heap::kRealStackLimitRootIndex); 163 __ LoadRoot(a2, Heap::kRealStackLimitRootIndex);
164 __ Branch(&ok, hs, t5, Operand(a2)); 164 __ Branch(&ok, hs, t5, Operand(a2));
165 __ InvokeBuiltin(Context::STACK_OVERFLOW_BUILTIN_INDEX, CALL_FUNCTION); 165 __ CallRuntime(Runtime::kThrowStackOverflow, 0);
166 __ bind(&ok); 166 __ bind(&ok);
167 } 167 }
168 __ LoadRoot(t5, Heap::kUndefinedValueRootIndex); 168 __ LoadRoot(t5, Heap::kUndefinedValueRootIndex);
169 int kMaxPushes = FLAG_optimize_for_size ? 4 : 32; 169 int kMaxPushes = FLAG_optimize_for_size ? 4 : 32;
170 if (locals_count >= kMaxPushes) { 170 if (locals_count >= kMaxPushes) {
171 int loop_iterations = locals_count / kMaxPushes; 171 int loop_iterations = locals_count / kMaxPushes;
172 __ li(a2, Operand(loop_iterations)); 172 __ li(a2, Operand(loop_iterations));
173 Label loop_header; 173 Label loop_header;
174 __ bind(&loop_header); 174 __ bind(&loop_header);
175 // Do pushes. 175 // Do pushes.
(...skipping 5155 matching lines...) Expand 10 before | Expand all | Expand 10 after
5331 reinterpret_cast<uint32_t>( 5331 reinterpret_cast<uint32_t>(
5332 isolate->builtins()->OsrAfterStackCheck()->entry())); 5332 isolate->builtins()->OsrAfterStackCheck()->entry()));
5333 return OSR_AFTER_STACK_CHECK; 5333 return OSR_AFTER_STACK_CHECK;
5334 } 5334 }
5335 5335
5336 5336
5337 } // namespace internal 5337 } // namespace internal
5338 } // namespace v8 5338 } // namespace v8
5339 5339
5340 #endif // V8_TARGET_ARCH_MIPS 5340 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/full-codegen/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698