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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 FastNewRestParameterStub stub(isolate()); | 271 FastNewRestParameterStub stub(isolate()); |
272 __ CallStub(&stub); | 272 __ CallStub(&stub); |
273 function_in_register_a1 = false; | 273 function_in_register_a1 = false; |
274 SetVar(rest_param, v0, a1, a2); | 274 SetVar(rest_param, v0, a1, a2); |
275 } | 275 } |
276 | 276 |
277 Variable* arguments = scope()->arguments(); | 277 Variable* arguments = scope()->arguments(); |
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 DCHECK(a1.is(ArgumentsAccessNewDescriptor::function())); | |
282 if (!function_in_register_a1) { | 281 if (!function_in_register_a1) { |
283 // 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. |
284 __ ld(a1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 283 __ ld(a1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
285 } | 284 } |
286 // Receiver is just before the parameters on the caller's stack. | 285 if (is_strict(language_mode()) || !has_simple_parameters()) { |
287 int num_parameters = info->scope()->num_parameters(); | 286 FastNewStrictArgumentsStub stub(isolate()); |
288 int offset = num_parameters * kPointerSize; | 287 __ CallStub(&stub); |
289 __ li(ArgumentsAccessNewDescriptor::parameter_count(), | 288 } else { |
290 Operand(Smi::FromInt(num_parameters))); | 289 DCHECK(a1.is(ArgumentsAccessNewDescriptor::function())); |
291 __ Daddu(ArgumentsAccessNewDescriptor::parameter_pointer(), fp, | 290 // Receiver is just before the parameters on the caller's stack. |
292 Operand(StandardFrameConstants::kCallerSPOffset + offset)); | 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)); |
293 | 297 |
294 // Arguments to ArgumentsAccessStub: | 298 // Arguments to ArgumentsAccessStub: |
295 // function, parameter pointer, parameter count. | 299 // function, parameter pointer, parameter count. |
296 // The stub will rewrite parameter pointer and parameter count if the | 300 // The stub will rewrite parameter pointer and parameter count if the |
297 // previous stack frame was an arguments adapter frame. | 301 // previous stack frame was an arguments adapter frame. |
298 bool is_unmapped = is_strict(language_mode()) || !has_simple_parameters(); | 302 ArgumentsAccessStub::Type type = ArgumentsAccessStub::ComputeType( |
299 ArgumentsAccessStub::Type type = ArgumentsAccessStub::ComputeType( | 303 literal()->has_duplicate_parameters()); |
300 is_unmapped, literal()->has_duplicate_parameters()); | 304 ArgumentsAccessStub stub(isolate(), type); |
301 ArgumentsAccessStub stub(isolate(), type); | 305 __ CallStub(&stub); |
302 __ CallStub(&stub); | 306 } |
303 | 307 |
304 SetVar(arguments, v0, a1, a2); | 308 SetVar(arguments, v0, a1, a2); |
305 } | 309 } |
306 | 310 |
307 if (FLAG_trace) { | 311 if (FLAG_trace) { |
308 __ CallRuntime(Runtime::kTraceEnter); | 312 __ CallRuntime(Runtime::kTraceEnter); |
309 } | 313 } |
310 | 314 |
311 // Visit the declarations and body unless there is an illegal | 315 // Visit the declarations and body unless there is an illegal |
312 // redeclaration. | 316 // redeclaration. |
(...skipping 4351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4664 reinterpret_cast<uint64_t>( | 4668 reinterpret_cast<uint64_t>( |
4665 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4669 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4666 return OSR_AFTER_STACK_CHECK; | 4670 return OSR_AFTER_STACK_CHECK; |
4667 } | 4671 } |
4668 | 4672 |
4669 | 4673 |
4670 } // namespace internal | 4674 } // namespace internal |
4671 } // namespace v8 | 4675 } // namespace v8 |
4672 | 4676 |
4673 #endif // V8_TARGET_ARCH_MIPS64 | 4677 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |