| 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 __ LoadRoot(v0, Heap::kUndefinedValueRootIndex); | 288 __ LoadRoot(v0, Heap::kUndefinedValueRootIndex); |
| 289 __ bind(&done); | 289 __ bind(&done); |
| 290 | 290 |
| 291 SetVar(new_target_var, v0, a2, a3); | 291 SetVar(new_target_var, v0, a2, a3); |
| 292 } | 292 } |
| 293 | 293 |
| 294 Variable* arguments = scope()->arguments(); | 294 Variable* arguments = scope()->arguments(); |
| 295 if (arguments != NULL) { | 295 if (arguments != NULL) { |
| 296 // Function uses arguments object. | 296 // Function uses arguments object. |
| 297 Comment cmnt(masm_, "[ Allocate arguments object"); | 297 Comment cmnt(masm_, "[ Allocate arguments object"); |
| 298 DCHECK(a1.is(ArgumentsAccessNewDescriptor::function())); |
| 298 if (!function_in_register_a1) { | 299 if (!function_in_register_a1) { |
| 299 // Load this again, if it's used by the local context below. | 300 // Load this again, if it's used by the local context below. |
| 300 __ ld(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 301 __ ld(a1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 301 } else { | |
| 302 __ mov(a3, a1); | |
| 303 } | 302 } |
| 304 // Receiver is just before the parameters on the caller's stack. | 303 // Receiver is just before the parameters on the caller's stack. |
| 305 int num_parameters = info->scope()->num_parameters(); | 304 int num_parameters = info->scope()->num_parameters(); |
| 306 int offset = num_parameters * kPointerSize; | 305 int offset = num_parameters * kPointerSize; |
| 307 __ Daddu(a2, fp, | 306 __ li(ArgumentsAccessNewDescriptor::parameter_count(), |
| 308 Operand(StandardFrameConstants::kCallerSPOffset + offset)); | 307 Operand(Smi::FromInt(num_parameters))); |
| 309 __ li(a1, Operand(Smi::FromInt(num_parameters))); | 308 __ Daddu(ArgumentsAccessNewDescriptor::parameter_pointer(), fp, |
| 310 __ Push(a3, a2, a1); | 309 Operand(StandardFrameConstants::kCallerSPOffset + offset)); |
| 311 | 310 |
| 312 // Arguments to ArgumentsAccessStub: | 311 // Arguments to ArgumentsAccessStub: |
| 313 // function, receiver address, parameter count. | 312 // function, parameter pointer, parameter count. |
| 314 // The stub will rewrite receiever and parameter count if the previous | 313 // The stub will rewrite parameter pointer and parameter count if the |
| 315 // stack frame was an arguments adapter frame. | 314 // previous stack frame was an arguments adapter frame. |
| 316 ArgumentsAccessStub::Type type; | 315 bool is_unmapped = is_strict(language_mode()) || !has_simple_parameters(); |
| 317 if (is_strict(language_mode()) || !has_simple_parameters()) { | 316 ArgumentsAccessStub::Type type = ArgumentsAccessStub::ComputeType( |
| 318 type = ArgumentsAccessStub::NEW_STRICT; | 317 is_unmapped, literal()->has_duplicate_parameters()); |
| 319 } else if (literal()->has_duplicate_parameters()) { | |
| 320 type = ArgumentsAccessStub::NEW_SLOPPY_SLOW; | |
| 321 } else { | |
| 322 type = ArgumentsAccessStub::NEW_SLOPPY_FAST; | |
| 323 } | |
| 324 ArgumentsAccessStub stub(isolate(), type); | 318 ArgumentsAccessStub stub(isolate(), type); |
| 325 __ CallStub(&stub); | 319 __ CallStub(&stub); |
| 326 | 320 |
| 327 SetVar(arguments, v0, a1, a2); | 321 SetVar(arguments, v0, a1, a2); |
| 328 } | 322 } |
| 329 | 323 |
| 330 if (FLAG_trace) { | 324 if (FLAG_trace) { |
| 331 __ CallRuntime(Runtime::kTraceEnter, 0); | 325 __ CallRuntime(Runtime::kTraceEnter, 0); |
| 332 } | 326 } |
| 333 | 327 |
| (...skipping 4902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5236 reinterpret_cast<uint64_t>( | 5230 reinterpret_cast<uint64_t>( |
| 5237 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5231 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 5238 return OSR_AFTER_STACK_CHECK; | 5232 return OSR_AFTER_STACK_CHECK; |
| 5239 } | 5233 } |
| 5240 | 5234 |
| 5241 | 5235 |
| 5242 } // namespace internal | 5236 } // namespace internal |
| 5243 } // namespace v8 | 5237 } // namespace v8 |
| 5244 | 5238 |
| 5245 #endif // V8_TARGET_ARCH_MIPS64 | 5239 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |