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_ARM | 5 #if V8_TARGET_ARCH_ARM |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 MemOperand(r2, ConstructFrameConstants::kOriginalConstructorOffset)); | 265 MemOperand(r2, ConstructFrameConstants::kOriginalConstructorOffset)); |
266 __ b(&done); | 266 __ b(&done); |
267 | 267 |
268 __ bind(&non_construct_frame); | 268 __ bind(&non_construct_frame); |
269 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); | 269 __ LoadRoot(r0, Heap::kUndefinedValueRootIndex); |
270 __ bind(&done); | 270 __ bind(&done); |
271 | 271 |
272 SetVar(new_target_var, r0, r2, r3); | 272 SetVar(new_target_var, r0, r2, r3); |
273 } | 273 } |
274 | 274 |
275 // Possibly allocate RestParameters | |
276 int rest_index; | |
277 Variable* rest_param = scope()->rest_parameter(&rest_index); | |
278 if (rest_param) { | |
279 Comment cmnt(masm_, "[ Allocate rest parameter array"); | |
280 | |
281 int num_parameters = info->scope()->num_parameters(); | |
282 int offset = num_parameters * kPointerSize; | |
283 | |
284 __ add(r3, fp, Operand(StandardFrameConstants::kCallerSPOffset + offset)); | |
285 __ mov(r2, Operand(Smi::FromInt(num_parameters))); | |
286 __ mov(r1, Operand(Smi::FromInt(rest_index))); | |
287 __ mov(r0, Operand(Smi::FromInt(language_mode()))); | |
288 __ Push(r3, r2, r1, r0); | |
289 | |
290 RestParamAccessStub stub(isolate()); | |
291 __ CallStub(&stub); | |
292 | |
293 SetVar(rest_param, r0, r1, r2); | |
294 } | |
295 | |
296 Variable* arguments = scope()->arguments(); | 275 Variable* arguments = scope()->arguments(); |
297 if (arguments != NULL) { | 276 if (arguments != NULL) { |
298 // Function uses arguments object. | 277 // Function uses arguments object. |
299 Comment cmnt(masm_, "[ Allocate arguments object"); | 278 Comment cmnt(masm_, "[ Allocate arguments object"); |
300 if (!function_in_register) { | 279 if (!function_in_register) { |
301 // Load this again, if it's used by the local context below. | 280 // Load this again, if it's used by the local context below. |
302 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 281 __ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
303 } else { | 282 } else { |
304 __ mov(r3, r1); | 283 __ mov(r3, r1); |
305 } | 284 } |
(...skipping 5071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5377 DCHECK(interrupt_address == | 5356 DCHECK(interrupt_address == |
5378 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5357 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5379 return OSR_AFTER_STACK_CHECK; | 5358 return OSR_AFTER_STACK_CHECK; |
5380 } | 5359 } |
5381 | 5360 |
5382 | 5361 |
5383 } // namespace internal | 5362 } // namespace internal |
5384 } // namespace v8 | 5363 } // namespace v8 |
5385 | 5364 |
5386 #endif // V8_TARGET_ARCH_ARM | 5365 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |