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