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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 if (new_target_var != nullptr) { | 267 if (new_target_var != nullptr) { |
268 Comment cmnt(masm_, "[ new.target"); | 268 Comment cmnt(masm_, "[ new.target"); |
269 SetVar(new_target_var, a3, a0, a2); | 269 SetVar(new_target_var, a3, a0, a2); |
270 } | 270 } |
271 | 271 |
272 // Possibly allocate RestParameters | 272 // Possibly allocate RestParameters |
273 int rest_index; | 273 int rest_index; |
274 Variable* rest_param = scope()->rest_parameter(&rest_index); | 274 Variable* rest_param = scope()->rest_parameter(&rest_index); |
275 if (rest_param) { | 275 if (rest_param) { |
276 Comment cmnt(masm_, "[ Allocate rest parameter array"); | 276 Comment cmnt(masm_, "[ Allocate rest parameter array"); |
277 | 277 if (!function_in_register_a1) { |
278 int num_parameters = info->scope()->num_parameters(); | 278 __ lw(a1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
279 int offset = num_parameters * kPointerSize; | 279 } |
280 | 280 FastNewRestParameterStub stub(isolate()); |
281 __ li(RestParamAccessDescriptor::parameter_count(), | 281 __ CallStub(&stub); |
282 Operand(Smi::FromInt(num_parameters))); | |
283 __ Addu(RestParamAccessDescriptor::parameter_pointer(), fp, | |
284 Operand(StandardFrameConstants::kCallerSPOffset + offset)); | |
285 __ li(RestParamAccessDescriptor::rest_parameter_index(), | |
286 Operand(Smi::FromInt(rest_index))); | |
287 DCHECK(a1.is(RestParamAccessDescriptor::rest_parameter_index())); | |
288 function_in_register_a1 = false; | 282 function_in_register_a1 = false; |
289 | |
290 RestParamAccessStub stub(isolate()); | |
291 __ CallStub(&stub); | |
292 | |
293 SetVar(rest_param, v0, a1, a2); | 283 SetVar(rest_param, v0, a1, a2); |
294 } | 284 } |
295 | 285 |
296 Variable* arguments = scope()->arguments(); | 286 Variable* arguments = scope()->arguments(); |
297 if (arguments != NULL) { | 287 if (arguments != NULL) { |
298 // Function uses arguments object. | 288 // Function uses arguments object. |
299 Comment cmnt(masm_, "[ Allocate arguments object"); | 289 Comment cmnt(masm_, "[ Allocate arguments object"); |
300 DCHECK(a1.is(ArgumentsAccessNewDescriptor::function())); | 290 DCHECK(a1.is(ArgumentsAccessNewDescriptor::function())); |
301 if (!function_in_register_a1) { | 291 if (!function_in_register_a1) { |
302 // Load this again, if it's used by the local context below. | 292 // Load this again, if it's used by the local context below. |
(...skipping 4396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4699 reinterpret_cast<uint32_t>( | 4689 reinterpret_cast<uint32_t>( |
4700 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4690 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4701 return OSR_AFTER_STACK_CHECK; | 4691 return OSR_AFTER_STACK_CHECK; |
4702 } | 4692 } |
4703 | 4693 |
4704 | 4694 |
4705 } // namespace internal | 4695 } // namespace internal |
4706 } // namespace v8 | 4696 } // namespace v8 |
4707 | 4697 |
4708 #endif // V8_TARGET_ARCH_MIPS | 4698 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |