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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 MemOperand(a2, ConstructFrameConstants::kOriginalConstructorOffset)); | 284 MemOperand(a2, ConstructFrameConstants::kOriginalConstructorOffset)); |
285 __ Branch(&done); | 285 __ Branch(&done); |
286 | 286 |
287 __ bind(&non_construct_frame); | 287 __ bind(&non_construct_frame); |
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 // Possibly allocate RestParameters | |
295 int rest_index; | |
296 Variable* rest_param = scope()->rest_parameter(&rest_index); | |
297 if (rest_param) { | |
298 Comment cmnt(masm_, "[ Allocate rest parameter array"); | |
299 | |
300 int num_parameters = info->scope()->num_parameters(); | |
301 int offset = num_parameters * kPointerSize; | |
302 | |
303 __ Daddu(a3, fp, | |
304 Operand(StandardFrameConstants::kCallerSPOffset + offset)); | |
305 __ li(a2, Operand(Smi::FromInt(num_parameters))); | |
306 __ li(a1, Operand(Smi::FromInt(rest_index))); | |
307 __ li(a0, Operand(Smi::FromInt(language_mode()))); | |
308 __ Push(a3, a2, a1, a0); | |
309 function_in_register_a1 = false; | |
310 | |
311 RestParamAccessStub stub(isolate()); | |
312 __ CallStub(&stub); | |
313 | |
314 SetVar(rest_param, v0, a1, a2); | |
315 } | |
316 | |
317 Variable* arguments = scope()->arguments(); | 294 Variable* arguments = scope()->arguments(); |
318 if (arguments != NULL) { | 295 if (arguments != NULL) { |
319 // Function uses arguments object. | 296 // Function uses arguments object. |
320 Comment cmnt(masm_, "[ Allocate arguments object"); | 297 Comment cmnt(masm_, "[ Allocate arguments object"); |
321 if (!function_in_register_a1) { | 298 if (!function_in_register_a1) { |
322 // Load this again, if it's used by the local context below. | 299 // Load this again, if it's used by the local context below. |
323 __ ld(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 300 __ ld(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
324 } else { | 301 } else { |
325 __ mov(a3, a1); | 302 __ mov(a3, a1); |
326 } | 303 } |
(...skipping 5024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5351 reinterpret_cast<uint64_t>( | 5328 reinterpret_cast<uint64_t>( |
5352 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5329 isolate->builtins()->OsrAfterStackCheck()->entry())); |
5353 return OSR_AFTER_STACK_CHECK; | 5330 return OSR_AFTER_STACK_CHECK; |
5354 } | 5331 } |
5355 | 5332 |
5356 | 5333 |
5357 } // namespace internal | 5334 } // namespace internal |
5358 } // namespace v8 | 5335 } // namespace v8 |
5359 | 5336 |
5360 #endif // V8_TARGET_ARCH_MIPS64 | 5337 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |