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); | |
291 } else { | 288 } else { |
292 FastNewSloppyArgumentsStub stub(isolate()); | 289 DCHECK(a1.is(ArgumentsAccessNewDescriptor::function())); |
| 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); |
293 __ CallStub(&stub); | 305 __ CallStub(&stub); |
294 } | 306 } |
295 | 307 |
296 SetVar(arguments, v0, a1, a2); | 308 SetVar(arguments, v0, a1, a2); |
297 } | 309 } |
298 | 310 |
299 if (FLAG_trace) { | 311 if (FLAG_trace) { |
300 __ CallRuntime(Runtime::kTraceEnter); | 312 __ CallRuntime(Runtime::kTraceEnter); |
301 } | 313 } |
302 | 314 |
(...skipping 4294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4597 reinterpret_cast<uint64_t>( | 4609 reinterpret_cast<uint64_t>( |
4598 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4610 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4599 return OSR_AFTER_STACK_CHECK; | 4611 return OSR_AFTER_STACK_CHECK; |
4600 } | 4612 } |
4601 | 4613 |
4602 | 4614 |
4603 } // namespace internal | 4615 } // namespace internal |
4604 } // namespace v8 | 4616 } // namespace v8 |
4605 | 4617 |
4606 #endif // V8_TARGET_ARCH_MIPS64 | 4618 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |