| 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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 { Comment cmnt(masm_, "[ Allocate locals"); | 152 { Comment cmnt(masm_, "[ Allocate locals"); |
| 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 __ Dsubu(t1, sp, Operand(locals_count * kPointerSize)); | 159 __ Dsubu(t1, sp, Operand(locals_count * kPointerSize)); |
| 160 __ LoadRoot(a2, Heap::kRealStackLimitRootIndex); | 160 __ LoadRoot(a2, Heap::kRealStackLimitRootIndex); |
| 161 __ Branch(&ok, hs, t1, Operand(a2)); | 161 __ Branch(&ok, hs, t1, Operand(a2)); |
| 162 __ InvokeBuiltin(Context::STACK_OVERFLOW_BUILTIN_INDEX, CALL_FUNCTION); | 162 __ CallRuntime(Runtime::kThrowStackOverflow, 0); |
| 163 __ bind(&ok); | 163 __ bind(&ok); |
| 164 } | 164 } |
| 165 __ LoadRoot(t1, Heap::kUndefinedValueRootIndex); | 165 __ LoadRoot(t1, Heap::kUndefinedValueRootIndex); |
| 166 int kMaxPushes = FLAG_optimize_for_size ? 4 : 32; | 166 int kMaxPushes = FLAG_optimize_for_size ? 4 : 32; |
| 167 if (locals_count >= kMaxPushes) { | 167 if (locals_count >= kMaxPushes) { |
| 168 int loop_iterations = locals_count / kMaxPushes; | 168 int loop_iterations = locals_count / kMaxPushes; |
| 169 __ li(a2, Operand(loop_iterations)); | 169 __ li(a2, Operand(loop_iterations)); |
| 170 Label loop_header; | 170 Label loop_header; |
| 171 __ bind(&loop_header); | 171 __ bind(&loop_header); |
| 172 // Do pushes. | 172 // Do pushes. |
| (...skipping 5165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5338 reinterpret_cast<uint64_t>( | 5338 reinterpret_cast<uint64_t>( |
| 5339 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5339 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 5340 return OSR_AFTER_STACK_CHECK; | 5340 return OSR_AFTER_STACK_CHECK; |
| 5341 } | 5341 } |
| 5342 | 5342 |
| 5343 | 5343 |
| 5344 } // namespace internal | 5344 } // namespace internal |
| 5345 } // namespace v8 | 5345 } // namespace v8 |
| 5346 | 5346 |
| 5347 #endif // V8_TARGET_ARCH_MIPS64 | 5347 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |