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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 if (arguments != NULL) { | 280 if (arguments != NULL) { |
281 // Function uses arguments object. | 281 // Function uses arguments object. |
282 Comment cmnt(masm_, "[ Allocate arguments object"); | 282 Comment cmnt(masm_, "[ Allocate arguments object"); |
283 if (!function_in_register_a1) { | 283 if (!function_in_register_a1) { |
284 // Load this again, if it's used by the local context below. | 284 // Load this again, if it's used by the local context below. |
285 __ lw(a1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 285 __ lw(a1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
286 } | 286 } |
287 if (is_strict(language_mode()) || !has_simple_parameters()) { | 287 if (is_strict(language_mode()) || !has_simple_parameters()) { |
288 FastNewStrictArgumentsStub stub(isolate()); | 288 FastNewStrictArgumentsStub stub(isolate()); |
289 __ CallStub(&stub); | 289 __ CallStub(&stub); |
290 } else if (literal()->has_duplicate_parameters()) { | |
291 __ Push(a1); | |
292 __ CallRuntime(Runtime::kNewSloppyArguments_Generic); | |
293 } else { | 290 } else { |
294 FastNewSloppyArgumentsStub stub(isolate()); | 291 DCHECK(a1.is(ArgumentsAccessNewDescriptor::function())); |
| 292 // Receiver is just before the parameters on the caller's stack. |
| 293 int num_parameters = info->scope()->num_parameters(); |
| 294 int offset = num_parameters * kPointerSize; |
| 295 __ li(ArgumentsAccessNewDescriptor::parameter_count(), |
| 296 Operand(Smi::FromInt(num_parameters))); |
| 297 __ Addu(ArgumentsAccessNewDescriptor::parameter_pointer(), fp, |
| 298 Operand(StandardFrameConstants::kCallerSPOffset + offset)); |
| 299 |
| 300 // Arguments to ArgumentsAccessStub: |
| 301 // function, parameter pointer, parameter count. |
| 302 // The stub will rewrite parameter pointer and parameter count if the |
| 303 // previous stack frame was an arguments adapter frame. |
| 304 ArgumentsAccessStub::Type type = ArgumentsAccessStub::ComputeType( |
| 305 literal()->has_duplicate_parameters()); |
| 306 ArgumentsAccessStub stub(isolate(), type); |
295 __ CallStub(&stub); | 307 __ CallStub(&stub); |
296 } | 308 } |
297 | 309 |
298 SetVar(arguments, v0, a1, a2); | 310 SetVar(arguments, v0, a1, a2); |
299 } | 311 } |
300 | 312 |
301 if (FLAG_trace) { | 313 if (FLAG_trace) { |
302 __ CallRuntime(Runtime::kTraceEnter); | 314 __ CallRuntime(Runtime::kTraceEnter); |
303 } | 315 } |
304 | 316 |
(...skipping 4277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4582 reinterpret_cast<uint32_t>( | 4594 reinterpret_cast<uint32_t>( |
4583 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4595 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4584 return OSR_AFTER_STACK_CHECK; | 4596 return OSR_AFTER_STACK_CHECK; |
4585 } | 4597 } |
4586 | 4598 |
4587 | 4599 |
4588 } // namespace internal | 4600 } // namespace internal |
4589 } // namespace v8 | 4601 } // namespace v8 |
4590 | 4602 |
4591 #endif // V8_TARGET_ARCH_MIPS | 4603 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |