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); |
290 } else { | 293 } else { |
291 DCHECK(a1.is(ArgumentsAccessNewDescriptor::function())); | 294 FastNewSloppyArgumentsStub stub(isolate()); |
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); | |
307 __ CallStub(&stub); | 295 __ CallStub(&stub); |
308 } | 296 } |
309 | 297 |
310 SetVar(arguments, v0, a1, a2); | 298 SetVar(arguments, v0, a1, a2); |
311 } | 299 } |
312 | 300 |
313 if (FLAG_trace) { | 301 if (FLAG_trace) { |
314 __ CallRuntime(Runtime::kTraceEnter); | 302 __ CallRuntime(Runtime::kTraceEnter); |
315 } | 303 } |
316 | 304 |
(...skipping 4277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4594 reinterpret_cast<uint32_t>( | 4582 reinterpret_cast<uint32_t>( |
4595 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4583 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4596 return OSR_AFTER_STACK_CHECK; | 4584 return OSR_AFTER_STACK_CHECK; |
4597 } | 4585 } |
4598 | 4586 |
4599 | 4587 |
4600 } // namespace internal | 4588 } // namespace internal |
4601 } // namespace v8 | 4589 } // namespace v8 |
4602 | 4590 |
4603 #endif // V8_TARGET_ARCH_MIPS | 4591 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |