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 2777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2788 // v0: result parameter for PerformGC, if any | 2788 // v0: result parameter for PerformGC, if any |
2789 // s0: number of arguments including receiver (C callee-saved) | 2789 // s0: number of arguments including receiver (C callee-saved) |
2790 // s1: pointer to the first argument (C callee-saved) | 2790 // s1: pointer to the first argument (C callee-saved) |
2791 // s2: pointer to builtin function (C callee-saved) | 2791 // s2: pointer to builtin function (C callee-saved) |
2792 | 2792 |
2793 Isolate* isolate = masm->isolate(); | 2793 Isolate* isolate = masm->isolate(); |
2794 | 2794 |
2795 if (do_gc) { | 2795 if (do_gc) { |
2796 // Move result passed in v0 into a0 to call PerformGC. | 2796 // Move result passed in v0 into a0 to call PerformGC. |
2797 __ mov(a0, v0); | 2797 __ mov(a0, v0); |
2798 __ PrepareCallCFunction(2, 0, a1); | 2798 __ PrepareCallCFunction(1, 0, a1); |
2799 __ li(a1, Operand(ExternalReference::isolate_address(masm->isolate()))); | 2799 __ CallCFunction(ExternalReference::perform_gc_function(isolate), 1, 0); |
2800 __ CallCFunction(ExternalReference::perform_gc_function(isolate), 2, 0); | |
2801 } | 2800 } |
2802 | 2801 |
2803 ExternalReference scope_depth = | 2802 ExternalReference scope_depth = |
2804 ExternalReference::heap_always_allocate_scope_depth(isolate); | 2803 ExternalReference::heap_always_allocate_scope_depth(isolate); |
2805 if (always_allocate) { | 2804 if (always_allocate) { |
2806 __ li(a0, Operand(scope_depth)); | 2805 __ li(a0, Operand(scope_depth)); |
2807 __ lw(a1, MemOperand(a0)); | 2806 __ lw(a1, MemOperand(a0)); |
2808 __ Addu(a1, a1, Operand(1)); | 2807 __ Addu(a1, a1, Operand(1)); |
2809 __ sw(a1, MemOperand(a0)); | 2808 __ sw(a1, MemOperand(a0)); |
2810 } | 2809 } |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2869 __ andi(t0, a2, kFailureTagMask); | 2868 __ andi(t0, a2, kFailureTagMask); |
2870 __ Branch(USE_DELAY_SLOT, &failure_returned, eq, t0, Operand(zero_reg)); | 2869 __ Branch(USE_DELAY_SLOT, &failure_returned, eq, t0, Operand(zero_reg)); |
2871 // Restore stack (remove arg slots) in branch delay slot. | 2870 // Restore stack (remove arg slots) in branch delay slot. |
2872 __ addiu(sp, sp, kCArgsSlotsSize); | 2871 __ addiu(sp, sp, kCArgsSlotsSize); |
2873 | 2872 |
2874 | 2873 |
2875 // Exit C frame and return. | 2874 // Exit C frame and return. |
2876 // v0:v1: result | 2875 // v0:v1: result |
2877 // sp: stack pointer | 2876 // sp: stack pointer |
2878 // fp: frame pointer | 2877 // fp: frame pointer |
2879 __ LeaveExitFrame(save_doubles_, s0, true, EMIT_RETURN); | 2878 __ LeaveExitFrame(save_doubles_, s0, true); |
2880 | 2879 |
2881 // Check if we should retry or throw exception. | 2880 // Check if we should retry or throw exception. |
2882 Label retry; | 2881 Label retry; |
2883 __ bind(&failure_returned); | 2882 __ bind(&failure_returned); |
2884 STATIC_ASSERT(Failure::RETRY_AFTER_GC == 0); | 2883 STATIC_ASSERT(Failure::RETRY_AFTER_GC == 0); |
2885 __ andi(t0, v0, ((1 << kFailureTypeTagSize) - 1) << kFailureTagSize); | 2884 __ andi(t0, v0, ((1 << kFailureTypeTagSize) - 1) << kFailureTagSize); |
2886 __ Branch(&retry, eq, t0, Operand(zero_reg)); | 2885 __ Branch(&retry, eq, t0, Operand(zero_reg)); |
2887 | 2886 |
2888 // Special handling of out of memory exceptions. | 2887 // Special handling of out of memory exceptions. |
2889 JumpIfOOM(masm, v0, t0, throw_out_of_memory_exception); | 2888 JumpIfOOM(masm, v0, t0, throw_out_of_memory_exception); |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3402 ASSERT(kind() == Code::LOAD_IC); | 3401 ASSERT(kind() == Code::LOAD_IC); |
3403 // ----------- S t a t e ------------- | 3402 // ----------- S t a t e ------------- |
3404 // -- a2 : name | 3403 // -- a2 : name |
3405 // -- ra : return address | 3404 // -- ra : return address |
3406 // -- a0 : receiver | 3405 // -- a0 : receiver |
3407 // -- sp[0] : receiver | 3406 // -- sp[0] : receiver |
3408 // ----------------------------------- | 3407 // ----------------------------------- |
3409 receiver = a0; | 3408 receiver = a0; |
3410 } | 3409 } |
3411 | 3410 |
3412 StubCompiler::GenerateLoadStringLength(masm, receiver, a3, t0, &miss); | 3411 StubCompiler::GenerateLoadStringLength(masm, receiver, a3, t0, &miss, |
| 3412 support_wrapper_); |
3413 | 3413 |
3414 __ bind(&miss); | 3414 __ bind(&miss); |
3415 StubCompiler::TailCallBuiltin( | 3415 StubCompiler::TailCallBuiltin( |
3416 masm, BaseLoadStoreStubCompiler::MissBuiltin(kind())); | 3416 masm, BaseLoadStoreStubCompiler::MissBuiltin(kind())); |
3417 } | 3417 } |
3418 | 3418 |
3419 | 3419 |
3420 void StoreArrayLengthStub::Generate(MacroAssembler* masm) { | 3420 void StoreArrayLengthStub::Generate(MacroAssembler* masm) { |
3421 // This accepts as a receiver anything JSArray::SetElementsLength accepts | 3421 // This accepts as a receiver anything JSArray::SetElementsLength accepts |
3422 // (currently anything except for external arrays which means anything with | 3422 // (currently anything except for external arrays which means anything with |
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4149 // Already there | 4149 // Already there |
4150 | 4150 |
4151 // Argument 1 (a0): Subject string. | 4151 // Argument 1 (a0): Subject string. |
4152 __ mov(a0, subject); | 4152 __ mov(a0, subject); |
4153 | 4153 |
4154 // Locate the code entry and call it. | 4154 // Locate the code entry and call it. |
4155 __ Addu(t9, t9, Operand(Code::kHeaderSize - kHeapObjectTag)); | 4155 __ Addu(t9, t9, Operand(Code::kHeaderSize - kHeapObjectTag)); |
4156 DirectCEntryStub stub; | 4156 DirectCEntryStub stub; |
4157 stub.GenerateCall(masm, t9); | 4157 stub.GenerateCall(masm, t9); |
4158 | 4158 |
4159 __ LeaveExitFrame(false, no_reg, true); | 4159 __ LeaveExitFrame(false, no_reg); |
4160 | 4160 |
4161 // v0: result | 4161 // v0: result |
4162 // subject: subject string (callee saved) | 4162 // subject: subject string (callee saved) |
4163 // regexp_data: RegExp data (callee saved) | 4163 // regexp_data: RegExp data (callee saved) |
4164 // last_match_info_elements: Last match info elements (callee saved) | 4164 // last_match_info_elements: Last match info elements (callee saved) |
4165 // Check the result. | 4165 // Check the result. |
4166 Label success; | 4166 Label success; |
4167 __ Branch(&success, eq, v0, Operand(1)); | 4167 __ Branch(&success, eq, v0, Operand(1)); |
4168 // We expect exactly one result since we force the called regexp to behave | 4168 // We expect exactly one result since we force the called regexp to behave |
4169 // as non-global. | 4169 // as non-global. |
(...skipping 3111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7281 __ bind(&fast_elements_case); | 7281 __ bind(&fast_elements_case); |
7282 GenerateCase(masm, FAST_ELEMENTS); | 7282 GenerateCase(masm, FAST_ELEMENTS); |
7283 } | 7283 } |
7284 | 7284 |
7285 | 7285 |
7286 #undef __ | 7286 #undef __ |
7287 | 7287 |
7288 } } // namespace v8::internal | 7288 } } // namespace v8::internal |
7289 | 7289 |
7290 #endif // V8_TARGET_ARCH_MIPS | 7290 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |