OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 2347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2358 __ lw(v0, MemOperand(a3, kDisplacement)); | 2358 __ lw(v0, MemOperand(a3, kDisplacement)); |
2359 | 2359 |
2360 // Slow-case: Handle non-smi or out-of-bounds access to arguments | 2360 // Slow-case: Handle non-smi or out-of-bounds access to arguments |
2361 // by calling the runtime system. | 2361 // by calling the runtime system. |
2362 __ bind(&slow); | 2362 __ bind(&slow); |
2363 __ push(a1); | 2363 __ push(a1); |
2364 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1); | 2364 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1); |
2365 } | 2365 } |
2366 | 2366 |
2367 | 2367 |
2368 void ArgumentsAccessStub::GenerateNewNonStrictSlow(MacroAssembler* masm) { | 2368 void ArgumentsAccessStub::GenerateNewSloppySlow(MacroAssembler* masm) { |
2369 // sp[0] : number of parameters | 2369 // sp[0] : number of parameters |
2370 // sp[4] : receiver displacement | 2370 // sp[4] : receiver displacement |
2371 // sp[8] : function | 2371 // sp[8] : function |
2372 // Check if the calling frame is an arguments adaptor frame. | 2372 // Check if the calling frame is an arguments adaptor frame. |
2373 Label runtime; | 2373 Label runtime; |
2374 __ lw(a3, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); | 2374 __ lw(a3, MemOperand(fp, StandardFrameConstants::kCallerFPOffset)); |
2375 __ lw(a2, MemOperand(a3, StandardFrameConstants::kContextOffset)); | 2375 __ lw(a2, MemOperand(a3, StandardFrameConstants::kContextOffset)); |
2376 __ Branch(&runtime, | 2376 __ Branch(&runtime, |
2377 ne, | 2377 ne, |
2378 a2, | 2378 a2, |
2379 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 2379 Operand(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
2380 | 2380 |
2381 // Patch the arguments.length and the parameters pointer in the current frame. | 2381 // Patch the arguments.length and the parameters pointer in the current frame. |
2382 __ lw(a2, MemOperand(a3, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 2382 __ lw(a2, MemOperand(a3, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
2383 __ sw(a2, MemOperand(sp, 0 * kPointerSize)); | 2383 __ sw(a2, MemOperand(sp, 0 * kPointerSize)); |
2384 __ sll(t3, a2, 1); | 2384 __ sll(t3, a2, 1); |
2385 __ Addu(a3, a3, Operand(t3)); | 2385 __ Addu(a3, a3, Operand(t3)); |
2386 __ addiu(a3, a3, StandardFrameConstants::kCallerSPOffset); | 2386 __ addiu(a3, a3, StandardFrameConstants::kCallerSPOffset); |
2387 __ sw(a3, MemOperand(sp, 1 * kPointerSize)); | 2387 __ sw(a3, MemOperand(sp, 1 * kPointerSize)); |
2388 | 2388 |
2389 __ bind(&runtime); | 2389 __ bind(&runtime); |
2390 __ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1); | 2390 __ TailCallRuntime(Runtime::kNewArgumentsFast, 3, 1); |
2391 } | 2391 } |
2392 | 2392 |
2393 | 2393 |
2394 void ArgumentsAccessStub::GenerateNewNonStrictFast(MacroAssembler* masm) { | 2394 void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) { |
2395 // Stack layout: | 2395 // Stack layout: |
2396 // sp[0] : number of parameters (tagged) | 2396 // sp[0] : number of parameters (tagged) |
2397 // sp[4] : address of receiver argument | 2397 // sp[4] : address of receiver argument |
2398 // sp[8] : function | 2398 // sp[8] : function |
2399 // Registers used over whole function: | 2399 // Registers used over whole function: |
2400 // t2 : allocated object (tagged) | 2400 // t2 : allocated object (tagged) |
2401 // t5 : mapped parameter count (tagged) | 2401 // t5 : mapped parameter count (tagged) |
2402 | 2402 |
2403 __ lw(a1, MemOperand(sp, 0 * kPointerSize)); | 2403 __ lw(a1, MemOperand(sp, 0 * kPointerSize)); |
2404 // a1 = parameter count (tagged) | 2404 // a1 = parameter count (tagged) |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2516 Label skip_parameter_map; | 2516 Label skip_parameter_map; |
2517 Label skip3; | 2517 Label skip3; |
2518 __ Branch(&skip3, ne, a1, Operand(Smi::FromInt(0))); | 2518 __ Branch(&skip3, ne, a1, Operand(Smi::FromInt(0))); |
2519 // Move backing store address to a3, because it is | 2519 // Move backing store address to a3, because it is |
2520 // expected there when filling in the unmapped arguments. | 2520 // expected there when filling in the unmapped arguments. |
2521 __ mov(a3, t0); | 2521 __ mov(a3, t0); |
2522 __ bind(&skip3); | 2522 __ bind(&skip3); |
2523 | 2523 |
2524 __ Branch(&skip_parameter_map, eq, a1, Operand(Smi::FromInt(0))); | 2524 __ Branch(&skip_parameter_map, eq, a1, Operand(Smi::FromInt(0))); |
2525 | 2525 |
2526 __ LoadRoot(t2, Heap::kNonStrictArgumentsElementsMapRootIndex); | 2526 __ LoadRoot(t2, Heap::kSloppyArgumentsElementsMapRootIndex); |
2527 __ sw(t2, FieldMemOperand(t0, FixedArray::kMapOffset)); | 2527 __ sw(t2, FieldMemOperand(t0, FixedArray::kMapOffset)); |
2528 __ Addu(t2, a1, Operand(Smi::FromInt(2))); | 2528 __ Addu(t2, a1, Operand(Smi::FromInt(2))); |
2529 __ sw(t2, FieldMemOperand(t0, FixedArray::kLengthOffset)); | 2529 __ sw(t2, FieldMemOperand(t0, FixedArray::kLengthOffset)); |
2530 __ sw(cp, FieldMemOperand(t0, FixedArray::kHeaderSize + 0 * kPointerSize)); | 2530 __ sw(cp, FieldMemOperand(t0, FixedArray::kHeaderSize + 0 * kPointerSize)); |
2531 __ sll(t6, a1, 1); | 2531 __ sll(t6, a1, 1); |
2532 __ Addu(t2, t0, Operand(t6)); | 2532 __ Addu(t2, t0, Operand(t6)); |
2533 __ Addu(t2, t2, Operand(kParameterMapHeaderSize)); | 2533 __ Addu(t2, t2, Operand(kParameterMapHeaderSize)); |
2534 __ sw(t2, FieldMemOperand(t0, FixedArray::kHeaderSize + 1 * kPointerSize)); | 2534 __ sw(t2, FieldMemOperand(t0, FixedArray::kHeaderSize + 1 * kPointerSize)); |
2535 | 2535 |
2536 // Copy the parameter slots and the holes in the arguments. | 2536 // Copy the parameter slots and the holes in the arguments. |
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3278 // Do not transform the receiver for strict mode functions and natives. | 3278 // Do not transform the receiver for strict mode functions and natives. |
3279 __ lw(a3, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); | 3279 __ lw(a3, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
3280 __ lw(t0, FieldMemOperand(a3, SharedFunctionInfo::kCompilerHintsOffset)); | 3280 __ lw(t0, FieldMemOperand(a3, SharedFunctionInfo::kCompilerHintsOffset)); |
3281 int32_t strict_mode_function_mask = | 3281 int32_t strict_mode_function_mask = |
3282 1 << (SharedFunctionInfo::kStrictModeFunction + kSmiTagSize); | 3282 1 << (SharedFunctionInfo::kStrictModeFunction + kSmiTagSize); |
3283 int32_t native_mask = 1 << (SharedFunctionInfo::kNative + kSmiTagSize); | 3283 int32_t native_mask = 1 << (SharedFunctionInfo::kNative + kSmiTagSize); |
3284 __ And(at, t0, Operand(strict_mode_function_mask | native_mask)); | 3284 __ And(at, t0, Operand(strict_mode_function_mask | native_mask)); |
3285 __ Branch(&cont, ne, at, Operand(zero_reg)); | 3285 __ Branch(&cont, ne, at, Operand(zero_reg)); |
3286 } | 3286 } |
3287 | 3287 |
3288 // Compute the receiver in non-strict mode. | 3288 // Compute the receiver in sloppy mode. |
3289 __ lw(a3, MemOperand(sp, argc_ * kPointerSize)); | 3289 __ lw(a3, MemOperand(sp, argc_ * kPointerSize)); |
3290 | 3290 |
3291 if (NeedsChecks()) { | 3291 if (NeedsChecks()) { |
3292 __ JumpIfSmi(a3, &wrap); | 3292 __ JumpIfSmi(a3, &wrap); |
3293 __ GetObjectType(a3, t0, t0); | 3293 __ GetObjectType(a3, t0, t0); |
3294 __ Branch(&wrap, lt, t0, Operand(FIRST_SPEC_OBJECT_TYPE)); | 3294 __ Branch(&wrap, lt, t0, Operand(FIRST_SPEC_OBJECT_TYPE)); |
3295 } else { | 3295 } else { |
3296 __ jmp(&wrap); | 3296 __ jmp(&wrap); |
3297 } | 3297 } |
3298 | 3298 |
(...skipping 2459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5758 MemOperand(fp, 6 * kPointerSize), | 5758 MemOperand(fp, 6 * kPointerSize), |
5759 NULL); | 5759 NULL); |
5760 } | 5760 } |
5761 | 5761 |
5762 | 5762 |
5763 #undef __ | 5763 #undef __ |
5764 | 5764 |
5765 } } // namespace v8::internal | 5765 } } // namespace v8::internal |
5766 | 5766 |
5767 #endif // V8_TARGET_ARCH_MIPS | 5767 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |