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 2747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2758 bool do_gc, | 2758 bool do_gc, |
2759 bool always_allocate) { | 2759 bool always_allocate) { |
2760 // r0: result parameter for PerformGC, if any | 2760 // r0: result parameter for PerformGC, if any |
2761 // r4: number of arguments including receiver (C callee-saved) | 2761 // r4: number of arguments including receiver (C callee-saved) |
2762 // r5: pointer to builtin function (C callee-saved) | 2762 // r5: pointer to builtin function (C callee-saved) |
2763 // r6: pointer to the first argument (C callee-saved) | 2763 // r6: pointer to the first argument (C callee-saved) |
2764 Isolate* isolate = masm->isolate(); | 2764 Isolate* isolate = masm->isolate(); |
2765 | 2765 |
2766 if (do_gc) { | 2766 if (do_gc) { |
2767 // Passing r0. | 2767 // Passing r0. |
2768 __ PrepareCallCFunction(2, 0, r1); | 2768 __ PrepareCallCFunction(1, 0, r1); |
2769 __ mov(r1, Operand(ExternalReference::isolate_address(masm->isolate()))); | |
2770 __ CallCFunction(ExternalReference::perform_gc_function(isolate), | 2769 __ CallCFunction(ExternalReference::perform_gc_function(isolate), |
2771 2, 0); | 2770 1, 0); |
2772 } | 2771 } |
2773 | 2772 |
2774 ExternalReference scope_depth = | 2773 ExternalReference scope_depth = |
2775 ExternalReference::heap_always_allocate_scope_depth(isolate); | 2774 ExternalReference::heap_always_allocate_scope_depth(isolate); |
2776 if (always_allocate) { | 2775 if (always_allocate) { |
2777 __ mov(r0, Operand(scope_depth)); | 2776 __ mov(r0, Operand(scope_depth)); |
2778 __ ldr(r1, MemOperand(r0)); | 2777 __ ldr(r1, MemOperand(r0)); |
2779 __ add(r1, r1, Operand(1)); | 2778 __ add(r1, r1, Operand(1)); |
2780 __ str(r1, MemOperand(r0)); | 2779 __ str(r1, MemOperand(r0)); |
2781 } | 2780 } |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2835 // Lower 2 bits of r2 are 0 iff r0 has failure tag. | 2834 // Lower 2 bits of r2 are 0 iff r0 has failure tag. |
2836 __ add(r2, r0, Operand(1)); | 2835 __ add(r2, r0, Operand(1)); |
2837 __ tst(r2, Operand(kFailureTagMask)); | 2836 __ tst(r2, Operand(kFailureTagMask)); |
2838 __ b(eq, &failure_returned); | 2837 __ b(eq, &failure_returned); |
2839 | 2838 |
2840 // Exit C frame and return. | 2839 // Exit C frame and return. |
2841 // r0:r1: result | 2840 // r0:r1: result |
2842 // sp: stack pointer | 2841 // sp: stack pointer |
2843 // fp: frame pointer | 2842 // fp: frame pointer |
2844 // Callee-saved register r4 still holds argc. | 2843 // Callee-saved register r4 still holds argc. |
2845 __ LeaveExitFrame(save_doubles_, r4, true); | 2844 __ LeaveExitFrame(save_doubles_, r4); |
2846 __ mov(pc, lr); | 2845 __ mov(pc, lr); |
2847 | 2846 |
2848 // check if we should retry or throw exception | 2847 // check if we should retry or throw exception |
2849 Label retry; | 2848 Label retry; |
2850 __ bind(&failure_returned); | 2849 __ bind(&failure_returned); |
2851 STATIC_ASSERT(Failure::RETRY_AFTER_GC == 0); | 2850 STATIC_ASSERT(Failure::RETRY_AFTER_GC == 0); |
2852 __ tst(r0, Operand(((1 << kFailureTypeTagSize) - 1) << kFailureTagSize)); | 2851 __ tst(r0, Operand(((1 << kFailureTypeTagSize) - 1) << kFailureTagSize)); |
2853 __ b(eq, &retry); | 2852 __ b(eq, &retry); |
2854 | 2853 |
2855 // Special handling of out of memory exceptions. | 2854 // Special handling of out of memory exceptions. |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3369 ASSERT(kind() == Code::LOAD_IC); | 3368 ASSERT(kind() == Code::LOAD_IC); |
3370 // ----------- S t a t e ------------- | 3369 // ----------- S t a t e ------------- |
3371 // -- r2 : name | 3370 // -- r2 : name |
3372 // -- lr : return address | 3371 // -- lr : return address |
3373 // -- r0 : receiver | 3372 // -- r0 : receiver |
3374 // -- sp[0] : receiver | 3373 // -- sp[0] : receiver |
3375 // ----------------------------------- | 3374 // ----------------------------------- |
3376 receiver = r0; | 3375 receiver = r0; |
3377 } | 3376 } |
3378 | 3377 |
3379 StubCompiler::GenerateLoadStringLength(masm, receiver, r3, r4, &miss); | 3378 StubCompiler::GenerateLoadStringLength(masm, receiver, r3, r4, &miss, |
| 3379 support_wrapper_); |
3380 | 3380 |
3381 __ bind(&miss); | 3381 __ bind(&miss); |
3382 StubCompiler::TailCallBuiltin( | 3382 StubCompiler::TailCallBuiltin( |
3383 masm, BaseLoadStoreStubCompiler::MissBuiltin(kind())); | 3383 masm, BaseLoadStoreStubCompiler::MissBuiltin(kind())); |
3384 } | 3384 } |
3385 | 3385 |
3386 | 3386 |
3387 void StoreArrayLengthStub::Generate(MacroAssembler* masm) { | 3387 void StoreArrayLengthStub::Generate(MacroAssembler* masm) { |
3388 // This accepts as a receiver anything JSArray::SetElementsLength accepts | 3388 // This accepts as a receiver anything JSArray::SetElementsLength accepts |
3389 // (currently anything except for external arrays which means anything with | 3389 // (currently anything except for external arrays which means anything with |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4064 // Already there | 4064 // Already there |
4065 | 4065 |
4066 // Argument 1 (r0): Subject string. | 4066 // Argument 1 (r0): Subject string. |
4067 __ mov(r0, subject); | 4067 __ mov(r0, subject); |
4068 | 4068 |
4069 // Locate the code entry and call it. | 4069 // Locate the code entry and call it. |
4070 __ add(r7, r7, Operand(Code::kHeaderSize - kHeapObjectTag)); | 4070 __ add(r7, r7, Operand(Code::kHeaderSize - kHeapObjectTag)); |
4071 DirectCEntryStub stub; | 4071 DirectCEntryStub stub; |
4072 stub.GenerateCall(masm, r7); | 4072 stub.GenerateCall(masm, r7); |
4073 | 4073 |
4074 __ LeaveExitFrame(false, no_reg, true); | 4074 __ LeaveExitFrame(false, no_reg); |
4075 | 4075 |
4076 // r0: result | 4076 // r0: result |
4077 // subject: subject string (callee saved) | 4077 // subject: subject string (callee saved) |
4078 // regexp_data: RegExp data (callee saved) | 4078 // regexp_data: RegExp data (callee saved) |
4079 // last_match_info_elements: Last match info elements (callee saved) | 4079 // last_match_info_elements: Last match info elements (callee saved) |
4080 // Check the result. | 4080 // Check the result. |
4081 Label success; | 4081 Label success; |
4082 __ cmp(r0, Operand(1)); | 4082 __ cmp(r0, Operand(1)); |
4083 // We expect exactly one result since we force the called regexp to behave | 4083 // We expect exactly one result since we force the called regexp to behave |
4084 // as non-global. | 4084 // as non-global. |
(...skipping 3069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7154 __ bind(&fast_elements_case); | 7154 __ bind(&fast_elements_case); |
7155 GenerateCase(masm, FAST_ELEMENTS); | 7155 GenerateCase(masm, FAST_ELEMENTS); |
7156 } | 7156 } |
7157 | 7157 |
7158 | 7158 |
7159 #undef __ | 7159 #undef __ |
7160 | 7160 |
7161 } } // namespace v8::internal | 7161 } } // namespace v8::internal |
7162 | 7162 |
7163 #endif // V8_TARGET_ARCH_ARM | 7163 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |