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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 FastNewRestParameterStub stub(isolate()); | 263 FastNewRestParameterStub stub(isolate()); |
264 __ CallStub(&stub); | 264 __ CallStub(&stub); |
265 function_in_register_r1 = false; | 265 function_in_register_r1 = false; |
266 SetVar(rest_param, r0, r1, r2); | 266 SetVar(rest_param, r0, r1, r2); |
267 } | 267 } |
268 | 268 |
269 Variable* arguments = scope()->arguments(); | 269 Variable* arguments = scope()->arguments(); |
270 if (arguments != NULL) { | 270 if (arguments != NULL) { |
271 // Function uses arguments object. | 271 // Function uses arguments object. |
272 Comment cmnt(masm_, "[ Allocate arguments object"); | 272 Comment cmnt(masm_, "[ Allocate arguments object"); |
273 DCHECK(r1.is(ArgumentsAccessNewDescriptor::function())); | |
274 if (!function_in_register_r1) { | 273 if (!function_in_register_r1) { |
275 // Load this again, if it's used by the local context below. | 274 // Load this again, if it's used by the local context below. |
276 __ ldr(r1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 275 __ ldr(r1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
277 } | 276 } |
278 // Receiver is just before the parameters on the caller's stack. | 277 if (is_strict(language_mode()) || !has_simple_parameters()) { |
279 int num_parameters = info->scope()->num_parameters(); | 278 FastNewStrictArgumentsStub stub(isolate()); |
280 int offset = num_parameters * kPointerSize; | 279 __ CallStub(&stub); |
281 __ mov(ArgumentsAccessNewDescriptor::parameter_count(), | 280 } else { |
282 Operand(Smi::FromInt(num_parameters))); | 281 DCHECK(r1.is(ArgumentsAccessNewDescriptor::function())); |
283 __ add(ArgumentsAccessNewDescriptor::parameter_pointer(), fp, | 282 // Receiver is just before the parameters on the caller's stack. |
284 Operand(StandardFrameConstants::kCallerSPOffset + offset)); | 283 int num_parameters = info->scope()->num_parameters(); |
| 284 int offset = num_parameters * kPointerSize; |
| 285 __ mov(ArgumentsAccessNewDescriptor::parameter_count(), |
| 286 Operand(Smi::FromInt(num_parameters))); |
| 287 __ add(ArgumentsAccessNewDescriptor::parameter_pointer(), fp, |
| 288 Operand(StandardFrameConstants::kCallerSPOffset + offset)); |
285 | 289 |
286 // Arguments to ArgumentsAccessStub: | 290 // Arguments to ArgumentsAccessStub: |
287 // function, parameter pointer, parameter count. | 291 // function, parameter pointer, parameter count. |
288 // The stub will rewrite parameter pointer and parameter count if the | 292 // The stub will rewrite parameter pointer and parameter count if the |
289 // previous stack frame was an arguments adapter frame. | 293 // previous stack frame was an arguments adapter frame. |
290 bool is_unmapped = is_strict(language_mode()) || !has_simple_parameters(); | 294 ArgumentsAccessStub::Type type = ArgumentsAccessStub::ComputeType( |
291 ArgumentsAccessStub::Type type = ArgumentsAccessStub::ComputeType( | 295 literal()->has_duplicate_parameters()); |
292 is_unmapped, literal()->has_duplicate_parameters()); | 296 ArgumentsAccessStub stub(isolate(), type); |
293 ArgumentsAccessStub stub(isolate(), type); | 297 __ CallStub(&stub); |
294 __ CallStub(&stub); | 298 } |
295 | 299 |
296 SetVar(arguments, r0, r1, r2); | 300 SetVar(arguments, r0, r1, r2); |
297 } | 301 } |
298 | 302 |
299 if (FLAG_trace) { | 303 if (FLAG_trace) { |
300 __ CallRuntime(Runtime::kTraceEnter); | 304 __ CallRuntime(Runtime::kTraceEnter); |
301 } | 305 } |
302 | 306 |
303 // Visit the declarations and body unless there is an illegal | 307 // Visit the declarations and body unless there is an illegal |
304 // redeclaration. | 308 // redeclaration. |
(...skipping 4407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4712 DCHECK(interrupt_address == | 4716 DCHECK(interrupt_address == |
4713 isolate->builtins()->OsrAfterStackCheck()->entry()); | 4717 isolate->builtins()->OsrAfterStackCheck()->entry()); |
4714 return OSR_AFTER_STACK_CHECK; | 4718 return OSR_AFTER_STACK_CHECK; |
4715 } | 4719 } |
4716 | 4720 |
4717 | 4721 |
4718 } // namespace internal | 4722 } // namespace internal |
4719 } // namespace v8 | 4723 } // namespace v8 |
4720 | 4724 |
4721 #endif // V8_TARGET_ARCH_ARM | 4725 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |