Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: src/arm/code-stubs-arm.cc

Issue 2841913003: [WIP] Initial CallFunctionCallback builtin.
Patch Set: Fix wrong register for arm64. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/arm/macro-assembler-arm.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_ARM 5 #if V8_TARGET_ARCH_ARM
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 8
9 #include "src/api-arguments.h" 9 #include "src/api-arguments.h"
10 #include "src/assembler-inl.h" 10 #include "src/assembler-inl.h"
(...skipping 2595 matching lines...) Expand 10 before | Expand all | Expand 10 after
2606 2606
2607 Label fast_elements_case; 2607 Label fast_elements_case;
2608 __ cmp(r3, Operand(FAST_ELEMENTS)); 2608 __ cmp(r3, Operand(FAST_ELEMENTS));
2609 __ b(eq, &fast_elements_case); 2609 __ b(eq, &fast_elements_case);
2610 GenerateCase(masm, FAST_HOLEY_ELEMENTS); 2610 GenerateCase(masm, FAST_HOLEY_ELEMENTS);
2611 2611
2612 __ bind(&fast_elements_case); 2612 __ bind(&fast_elements_case);
2613 GenerateCase(masm, FAST_ELEMENTS); 2613 GenerateCase(masm, FAST_ELEMENTS);
2614 } 2614 }
2615 2615
2616 static int AddressOffset(ExternalReference ref0, ExternalReference ref1) {
2617 return ref0.address() - ref1.address();
2618 }
2619
2620
2621 // Calls an API function. Allocates HandleScope, extracts returned value 2616 // Calls an API function. Allocates HandleScope, extracts returned value
2622 // from handle and propagates exceptions. Restores context. stack_space 2617 // from handle and propagates exceptions. Restores context. stack_space
2623 // - space to be unwound on exit (includes the call JS arguments space and 2618 // - space to be unwound on exit (includes the call JS arguments space and
2624 // the additional space allocated for the fast call). 2619 // the additional space allocated for the fast call).
2625 static void CallApiFunctionAndReturn(MacroAssembler* masm, 2620 static void CallApiFunctionAndReturn(MacroAssembler* masm,
2626 Register function_address, 2621 Register function_address,
2627 ExternalReference thunk_ref, 2622 ExternalReference thunk_ref,
2628 int stack_space, 2623 int stack_space,
2629 MemOperand* stack_space_operand, 2624 MemOperand* stack_space_operand,
2630 MemOperand return_value_operand, 2625 MemOperand return_value_operand,
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
2725 } 2720 }
2726 __ LeaveExitFrame(false, r4, !restore_context, stack_space_operand != NULL); 2721 __ LeaveExitFrame(false, r4, !restore_context, stack_space_operand != NULL);
2727 2722
2728 // Check if the function scheduled an exception. 2723 // Check if the function scheduled an exception.
2729 __ LoadRoot(r4, Heap::kTheHoleValueRootIndex); 2724 __ LoadRoot(r4, Heap::kTheHoleValueRootIndex);
2730 __ mov(ip, Operand(ExternalReference::scheduled_exception_address(isolate))); 2725 __ mov(ip, Operand(ExternalReference::scheduled_exception_address(isolate)));
2731 __ ldr(r5, MemOperand(ip)); 2726 __ ldr(r5, MemOperand(ip));
2732 __ cmp(r4, r5); 2727 __ cmp(r4, r5);
2733 __ b(ne, &promote_scheduled_exception); 2728 __ b(ne, &promote_scheduled_exception);
2734 2729
2730 // Check if the function returned a valid JavaScript value.
2731 __ AssertApiCallResult(r0);
2732
2735 __ mov(pc, lr); 2733 __ mov(pc, lr);
2736 2734
2737 // Re-throw by promoting a scheduled exception. 2735 // Re-throw by promoting a scheduled exception.
2738 __ bind(&promote_scheduled_exception); 2736 __ bind(&promote_scheduled_exception);
2739 __ TailCallRuntime(Runtime::kPromoteScheduledException); 2737 __ TailCallRuntime(Runtime::kPromoteScheduledException);
2740 2738
2741 // HandleScope limit has changed. Delete allocated extensions. 2739 // HandleScope limit has changed. Delete allocated extensions.
2742 __ bind(&delete_allocated_handles); 2740 __ bind(&delete_allocated_handles);
2743 __ str(r5, MemOperand(r9, kLimitOffset)); 2741 __ str(r5, MemOperand(r9, kLimitOffset));
2744 __ mov(r4, r0); 2742 __ mov(r4, r0);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
2803 // return value 2801 // return value
2804 __ push(scratch); 2802 __ push(scratch);
2805 // return value default 2803 // return value default
2806 __ push(scratch); 2804 __ push(scratch);
2807 // isolate 2805 // isolate
2808 __ mov(scratch, Operand(ExternalReference::isolate_address(masm->isolate()))); 2806 __ mov(scratch, Operand(ExternalReference::isolate_address(masm->isolate())));
2809 __ push(scratch); 2807 __ push(scratch);
2810 // holder 2808 // holder
2811 __ push(holder); 2809 __ push(holder);
2812 2810
2811 if (!is_store()) {
2812 __ mov(r0, Operand(argc()));
2813 __ Jump(masm->isolate()->builtins()->CallFunctionCallback(),
2814 RelocInfo::CODE_TARGET);
2815 }
2816
2813 // Prepare arguments. 2817 // Prepare arguments.
2814 __ mov(scratch, sp); 2818 __ mov(scratch, sp);
2815 2819
2816 // Allocate the v8::Arguments structure in the arguments' space since 2820 // Allocate the v8::Arguments structure in the arguments' space since
2817 // it's not controlled by GC. 2821 // it's not controlled by GC.
2818 const int kApiStackSpace = 3; 2822 const int kApiStackSpace = 3;
2819 2823
2820 FrameScope frame_scope(masm, StackFrame::MANUAL); 2824 FrameScope frame_scope(masm, StackFrame::MANUAL);
2821 __ EnterExitFrame(false, kApiStackSpace); 2825 __ EnterExitFrame(false, kApiStackSpace);
2822 2826
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
2919 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, 2923 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref,
2920 kStackUnwindSpace, NULL, return_value_operand, NULL); 2924 kStackUnwindSpace, NULL, return_value_operand, NULL);
2921 } 2925 }
2922 2926
2923 #undef __ 2927 #undef __
2924 2928
2925 } // namespace internal 2929 } // namespace internal
2926 } // namespace v8 2930 } // namespace v8
2927 2931
2928 #endif // V8_TARGET_ARCH_ARM 2932 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | src/arm/macro-assembler-arm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698