OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2296 __ Ret(); | 2296 __ Ret(); |
2297 | 2297 |
2298 // Slow case: handle non-smi or out-of-bounds access to arguments by calling | 2298 // Slow case: handle non-smi or out-of-bounds access to arguments by calling |
2299 // the runtime system. | 2299 // the runtime system. |
2300 __ Bind(&slow); | 2300 __ Bind(&slow); |
2301 __ Push(key); | 2301 __ Push(key); |
2302 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1); | 2302 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1); |
2303 } | 2303 } |
2304 | 2304 |
2305 | 2305 |
2306 void ArgumentsAccessStub::GenerateNewNonStrictSlow(MacroAssembler* masm) { | 2306 void ArgumentsAccessStub::GenerateNewSloppySlow(MacroAssembler* masm) { |
2307 // Stack layout on entry. | 2307 // Stack layout on entry. |
2308 // jssp[0]: number of parameters (tagged) | 2308 // jssp[0]: number of parameters (tagged) |
2309 // jssp[8]: address of receiver argument | 2309 // jssp[8]: address of receiver argument |
2310 // jssp[16]: function | 2310 // jssp[16]: function |
2311 | 2311 |
2312 // Check if the calling frame is an arguments adaptor frame. | 2312 // Check if the calling frame is an arguments adaptor frame. |
2313 Label runtime; | 2313 Label runtime; |
2314 Register caller_fp = x10; | 2314 Register caller_fp = x10; |
2315 __ Ldr(caller_fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 2315 __ Ldr(caller_fp, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
2316 // Load and untag the context. | 2316 // Load and untag the context. |
2317 STATIC_ASSERT((kSmiShift / kBitsPerByte) == 4); | 2317 STATIC_ASSERT((kSmiShift / kBitsPerByte) == 4); |
2318 __ Ldr(w11, MemOperand(caller_fp, StandardFrameConstants::kContextOffset + | 2318 __ Ldr(w11, MemOperand(caller_fp, StandardFrameConstants::kContextOffset + |
2319 (kSmiShift / kBitsPerByte))); | 2319 (kSmiShift / kBitsPerByte))); |
2320 __ Cmp(w11, StackFrame::ARGUMENTS_ADAPTOR); | 2320 __ Cmp(w11, StackFrame::ARGUMENTS_ADAPTOR); |
2321 __ B(ne, &runtime); | 2321 __ B(ne, &runtime); |
2322 | 2322 |
2323 // Patch the arguments.length and parameters pointer in the current frame. | 2323 // Patch the arguments.length and parameters pointer in the current frame. |
2324 __ Ldr(x11, MemOperand(caller_fp, | 2324 __ Ldr(x11, MemOperand(caller_fp, |
2325 ArgumentsAdaptorFrameConstants::kLengthOffset)); | 2325 ArgumentsAdaptorFrameConstants::kLengthOffset)); |
2326 __ Poke(x11, 0 * kXRegSizeInBytes); | 2326 __ Poke(x11, 0 * kXRegSizeInBytes); |
2327 __ Add(x10, caller_fp, Operand::UntagSmiAndScale(x11, kPointerSizeLog2)); | 2327 __ Add(x10, caller_fp, Operand::UntagSmiAndScale(x11, kPointerSizeLog2)); |
2328 __ Add(x10, x10, Operand(StandardFrameConstants::kCallerSPOffset)); | 2328 __ Add(x10, x10, Operand(StandardFrameConstants::kCallerSPOffset)); |
2329 __ Poke(x10, 1 * kXRegSizeInBytes); | 2329 __ Poke(x10, 1 * kXRegSizeInBytes); |
2330 | 2330 |
2331 __ Bind(&runtime); | 2331 __ Bind(&runtime); |
2332 __ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1); | 2332 __ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1); |
2333 } | 2333 } |
2334 | 2334 |
2335 | 2335 |
2336 void ArgumentsAccessStub::GenerateNewNonStrictFast(MacroAssembler* masm) { | 2336 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) { |
2337 // Stack layout on entry. | 2337 // Stack layout on entry. |
2338 // jssp[0]: number of parameters (tagged) | 2338 // jssp[0]: number of parameters (tagged) |
2339 // jssp[8]: address of receiver argument | 2339 // jssp[8]: address of receiver argument |
2340 // jssp[16]: function | 2340 // jssp[16]: function |
2341 // | 2341 // |
2342 // Returns pointer to result object in x0. | 2342 // Returns pointer to result object in x0. |
2343 | 2343 |
2344 // Note: arg_count_smi is an alias of param_count_smi. | 2344 // Note: arg_count_smi is an alias of param_count_smi. |
2345 Register arg_count_smi = x3; | 2345 Register arg_count_smi = x3; |
2346 Register param_count_smi = x3; | 2346 Register param_count_smi = x3; |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2491 | 2491 |
2492 // Initialize parameter map. If there are no mapped arguments, we're done. | 2492 // Initialize parameter map. If there are no mapped arguments, we're done. |
2493 Label skip_parameter_map; | 2493 Label skip_parameter_map; |
2494 __ Cmp(mapped_params, 0); | 2494 __ Cmp(mapped_params, 0); |
2495 // Set up backing store address, because it is needed later for filling in | 2495 // Set up backing store address, because it is needed later for filling in |
2496 // the unmapped arguments. | 2496 // the unmapped arguments. |
2497 Register backing_store = x6; | 2497 Register backing_store = x6; |
2498 __ CmovX(backing_store, elements, eq); | 2498 __ CmovX(backing_store, elements, eq); |
2499 __ B(eq, &skip_parameter_map); | 2499 __ B(eq, &skip_parameter_map); |
2500 | 2500 |
2501 __ LoadRoot(x10, Heap::kNonStrictArgumentsElementsMapRootIndex); | 2501 __ LoadRoot(x10, Heap::kSloppyArgumentsElementsMapRootIndex); |
2502 __ Str(x10, FieldMemOperand(elements, FixedArray::kMapOffset)); | 2502 __ Str(x10, FieldMemOperand(elements, FixedArray::kMapOffset)); |
2503 __ Add(x10, mapped_params, 2); | 2503 __ Add(x10, mapped_params, 2); |
2504 __ SmiTag(x10); | 2504 __ SmiTag(x10); |
2505 __ Str(x10, FieldMemOperand(elements, FixedArray::kLengthOffset)); | 2505 __ Str(x10, FieldMemOperand(elements, FixedArray::kLengthOffset)); |
2506 __ Str(cp, FieldMemOperand(elements, | 2506 __ Str(cp, FieldMemOperand(elements, |
2507 FixedArray::kHeaderSize + 0 * kPointerSize)); | 2507 FixedArray::kHeaderSize + 0 * kPointerSize)); |
2508 __ Add(x10, elements, Operand(mapped_params, LSL, kPointerSizeLog2)); | 2508 __ Add(x10, elements, Operand(mapped_params, LSL, kPointerSizeLog2)); |
2509 __ Add(x10, x10, kParameterMapHeaderSize); | 2509 __ Add(x10, x10, kParameterMapHeaderSize); |
2510 __ Str(x10, FieldMemOperand(elements, | 2510 __ Str(x10, FieldMemOperand(elements, |
2511 FixedArray::kHeaderSize + 1 * kPointerSize)); | 2511 FixedArray::kHeaderSize + 1 * kPointerSize)); |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3389 if (NeedsChecks()) { | 3389 if (NeedsChecks()) { |
3390 // Do not transform the receiver for strict mode functions. | 3390 // Do not transform the receiver for strict mode functions. |
3391 __ Ldr(x3, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset)); | 3391 __ Ldr(x3, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset)); |
3392 __ Ldr(w4, FieldMemOperand(x3, SharedFunctionInfo::kCompilerHintsOffset)); | 3392 __ Ldr(w4, FieldMemOperand(x3, SharedFunctionInfo::kCompilerHintsOffset)); |
3393 __ Tbnz(w4, SharedFunctionInfo::kStrictModeFunction, &cont); | 3393 __ Tbnz(w4, SharedFunctionInfo::kStrictModeFunction, &cont); |
3394 | 3394 |
3395 // Do not transform the receiver for native (Compilerhints already in x3). | 3395 // Do not transform the receiver for native (Compilerhints already in x3). |
3396 __ Tbnz(w4, SharedFunctionInfo::kNative, &cont); | 3396 __ Tbnz(w4, SharedFunctionInfo::kNative, &cont); |
3397 } | 3397 } |
3398 | 3398 |
3399 // Compute the receiver in non-strict mode. | 3399 // Compute the receiver in sloppy mode. |
3400 __ Peek(x3, argc_ * kPointerSize); | 3400 __ Peek(x3, argc_ * kPointerSize); |
3401 | 3401 |
3402 if (NeedsChecks()) { | 3402 if (NeedsChecks()) { |
3403 __ JumpIfSmi(x3, &wrap); | 3403 __ JumpIfSmi(x3, &wrap); |
3404 __ JumpIfObjectType(x3, x10, type, FIRST_SPEC_OBJECT_TYPE, &wrap, lt); | 3404 __ JumpIfObjectType(x3, x10, type, FIRST_SPEC_OBJECT_TYPE, &wrap, lt); |
3405 } else { | 3405 } else { |
3406 __ B(&wrap); | 3406 __ B(&wrap); |
3407 } | 3407 } |
3408 | 3408 |
3409 __ Bind(&cont); | 3409 __ Bind(&cont); |
(...skipping 2389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5799 MemOperand(fp, 6 * kPointerSize), | 5799 MemOperand(fp, 6 * kPointerSize), |
5800 NULL); | 5800 NULL); |
5801 } | 5801 } |
5802 | 5802 |
5803 | 5803 |
5804 #undef __ | 5804 #undef __ |
5805 | 5805 |
5806 } } // namespace v8::internal | 5806 } } // namespace v8::internal |
5807 | 5807 |
5808 #endif // V8_TARGET_ARCH_A64 | 5808 #endif // V8_TARGET_ARCH_A64 |
OLD | NEW |