| 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_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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 SetVar(this_function_var, a1, a0, a2); | 262 SetVar(this_function_var, a1, a0, a2); |
| 263 } | 263 } |
| 264 | 264 |
| 265 // Possibly set up a local binding to the new target value. | 265 // Possibly set up a local binding to the new target value. |
| 266 Variable* new_target_var = scope()->new_target_var(); | 266 Variable* new_target_var = scope()->new_target_var(); |
| 267 if (new_target_var != nullptr) { | 267 if (new_target_var != nullptr) { |
| 268 Comment cmnt(masm_, "[ new.target"); | 268 Comment cmnt(masm_, "[ new.target"); |
| 269 SetVar(new_target_var, a3, a0, a2); | 269 SetVar(new_target_var, a3, a0, a2); |
| 270 } | 270 } |
| 271 | 271 |
| 272 // Possibly allocate RestParameters |
| 273 int rest_index; |
| 274 Variable* rest_param = scope()->rest_parameter(&rest_index); |
| 275 if (rest_param) { |
| 276 Comment cmnt(masm_, "[ Allocate rest parameter array"); |
| 277 |
| 278 int num_parameters = info->scope()->num_parameters(); |
| 279 int offset = num_parameters * kPointerSize; |
| 280 |
| 281 __ Addu(a3, fp, Operand(StandardFrameConstants::kCallerSPOffset + offset)); |
| 282 __ li(a2, Operand(Smi::FromInt(num_parameters))); |
| 283 __ li(a1, Operand(Smi::FromInt(rest_index))); |
| 284 __ li(a0, Operand(Smi::FromInt(language_mode()))); |
| 285 __ Push(a3, a2, a1, a0); |
| 286 function_in_register_a1 = false; |
| 287 |
| 288 RestParamAccessStub stub(isolate()); |
| 289 __ CallStub(&stub); |
| 290 |
| 291 SetVar(rest_param, v0, a1, a2); |
| 292 } |
| 293 |
| 272 Variable* arguments = scope()->arguments(); | 294 Variable* arguments = scope()->arguments(); |
| 273 if (arguments != NULL) { | 295 if (arguments != NULL) { |
| 274 // Function uses arguments object. | 296 // Function uses arguments object. |
| 275 Comment cmnt(masm_, "[ Allocate arguments object"); | 297 Comment cmnt(masm_, "[ Allocate arguments object"); |
| 276 DCHECK(a1.is(ArgumentsAccessNewDescriptor::function())); | 298 DCHECK(a1.is(ArgumentsAccessNewDescriptor::function())); |
| 277 if (!function_in_register_a1) { | 299 if (!function_in_register_a1) { |
| 278 // Load this again, if it's used by the local context below. | 300 // Load this again, if it's used by the local context below. |
| 279 __ lw(a1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 301 __ lw(a1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 280 } | 302 } |
| 281 // Receiver is just before the parameters on the caller's stack. | 303 // Receiver is just before the parameters on the caller's stack. |
| (...skipping 4564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4846 reinterpret_cast<uint32_t>( | 4868 reinterpret_cast<uint32_t>( |
| 4847 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4869 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 4848 return OSR_AFTER_STACK_CHECK; | 4870 return OSR_AFTER_STACK_CHECK; |
| 4849 } | 4871 } |
| 4850 | 4872 |
| 4851 | 4873 |
| 4852 } // namespace internal | 4874 } // namespace internal |
| 4853 } // namespace v8 | 4875 } // namespace v8 |
| 4854 | 4876 |
| 4855 #endif // V8_TARGET_ARCH_MIPS | 4877 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |