OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 | 282 |
283 __ Bind(&done); | 283 __ Bind(&done); |
284 | 284 |
285 SetVar(new_target_var, x0, x2, x3); | 285 SetVar(new_target_var, x0, x2, x3); |
286 } | 286 } |
287 | 287 |
288 Variable* arguments = scope()->arguments(); | 288 Variable* arguments = scope()->arguments(); |
289 if (arguments != NULL) { | 289 if (arguments != NULL) { |
290 // Function uses arguments object. | 290 // Function uses arguments object. |
291 Comment cmnt(masm_, "[ Allocate arguments object"); | 291 Comment cmnt(masm_, "[ Allocate arguments object"); |
| 292 DCHECK(x1.is(ArgumentsAccessNewDescriptor::function())); |
292 if (!function_in_register_x1) { | 293 if (!function_in_register_x1) { |
293 // Load this again, if it's used by the local context below. | 294 // Load this again, if it's used by the local context below. |
294 __ Ldr(x3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 295 __ Ldr(x1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
295 } else { | |
296 __ Mov(x3, x1); | |
297 } | 296 } |
298 // Receiver is just before the parameters on the caller's stack. | 297 // Receiver is just before the parameters on the caller's stack. |
299 int num_parameters = info->scope()->num_parameters(); | 298 int num_parameters = info->scope()->num_parameters(); |
300 int offset = num_parameters * kPointerSize; | 299 int offset = num_parameters * kPointerSize; |
301 __ Add(x2, fp, StandardFrameConstants::kCallerSPOffset + offset); | 300 __ Mov(ArgumentsAccessNewDescriptor::parameter_count(), |
302 __ Mov(x1, Smi::FromInt(num_parameters)); | 301 Smi::FromInt(num_parameters)); |
303 __ Push(x3, x2, x1); | 302 __ Add(ArgumentsAccessNewDescriptor::parameter_pointer(), fp, |
| 303 StandardFrameConstants::kCallerSPOffset + offset); |
304 | 304 |
305 // Arguments to ArgumentsAccessStub: | 305 // Arguments to ArgumentsAccessStub: |
306 // function, receiver address, parameter count. | 306 // function, parameter pointer, parameter count. |
307 // The stub will rewrite receiver and parameter count if the previous | 307 // The stub will rewrite parameter pointer and parameter count if the |
308 // stack frame was an arguments adapter frame. | 308 // previous stack frame was an arguments adapter frame. |
309 ArgumentsAccessStub::Type type; | 309 bool is_unmapped = is_strict(language_mode()) || !has_simple_parameters(); |
310 if (is_strict(language_mode()) || !has_simple_parameters()) { | 310 ArgumentsAccessStub::Type type = ArgumentsAccessStub::ComputeType( |
311 type = ArgumentsAccessStub::NEW_STRICT; | 311 is_unmapped, literal()->has_duplicate_parameters()); |
312 } else if (literal()->has_duplicate_parameters()) { | |
313 type = ArgumentsAccessStub::NEW_SLOPPY_SLOW; | |
314 } else { | |
315 type = ArgumentsAccessStub::NEW_SLOPPY_FAST; | |
316 } | |
317 ArgumentsAccessStub stub(isolate(), type); | 312 ArgumentsAccessStub stub(isolate(), type); |
318 __ CallStub(&stub); | 313 __ CallStub(&stub); |
319 | 314 |
320 SetVar(arguments, x0, x1, x2); | 315 SetVar(arguments, x0, x1, x2); |
321 } | 316 } |
322 | 317 |
323 if (FLAG_trace) { | 318 if (FLAG_trace) { |
324 __ CallRuntime(Runtime::kTraceEnter, 0); | 319 __ CallRuntime(Runtime::kTraceEnter, 0); |
325 } | 320 } |
326 | 321 |
(...skipping 4919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5246 } | 5241 } |
5247 | 5242 |
5248 return INTERRUPT; | 5243 return INTERRUPT; |
5249 } | 5244 } |
5250 | 5245 |
5251 | 5246 |
5252 } // namespace internal | 5247 } // namespace internal |
5253 } // namespace v8 | 5248 } // namespace v8 |
5254 | 5249 |
5255 #endif // V8_TARGET_ARCH_ARM64 | 5250 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |