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 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 const CallOptimization& optimization, | 781 const CallOptimization& optimization, |
782 int argc, | 782 int argc, |
783 Register holder_in, | 783 Register holder_in, |
784 bool restore_context) { | 784 bool restore_context) { |
785 ASSERT(optimization.is_simple_api_call()); | 785 ASSERT(optimization.is_simple_api_call()); |
786 | 786 |
787 // Abi for CallApiFunctionStub. | 787 // Abi for CallApiFunctionStub. |
788 Register callee = r0; | 788 Register callee = r0; |
789 Register call_data = r4; | 789 Register call_data = r4; |
790 Register holder = r2; | 790 Register holder = r2; |
791 Register api_function_address = r3; | 791 Register api_function_address = r1; |
792 Register thunk_arg = r1; | |
793 | 792 |
794 // Put holder in place. | 793 // Put holder in place. |
795 __ Move(holder, holder_in); | 794 __ Move(holder, holder_in); |
796 | 795 |
797 Isolate* isolate = masm->isolate(); | 796 Isolate* isolate = masm->isolate(); |
798 Handle<JSFunction> function = optimization.constant_function(); | 797 Handle<JSFunction> function = optimization.constant_function(); |
799 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); | 798 Handle<CallHandlerInfo> api_call_info = optimization.api_call_info(); |
800 Handle<Object> call_data_obj(api_call_info->data(), isolate); | 799 Handle<Object> call_data_obj(api_call_info->data(), isolate); |
801 | 800 |
802 // Put callee in place. | 801 // Put callee in place. |
(...skipping 12 matching lines...) Expand all Loading... |
815 } | 814 } |
816 | 815 |
817 // Put api_function_address in place. | 816 // Put api_function_address in place. |
818 Address function_address = v8::ToCData<Address>(api_call_info->callback()); | 817 Address function_address = v8::ToCData<Address>(api_call_info->callback()); |
819 ApiFunction fun(function_address); | 818 ApiFunction fun(function_address); |
820 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL; | 819 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL; |
821 ExternalReference ref = ExternalReference(&fun, | 820 ExternalReference ref = ExternalReference(&fun, |
822 type, | 821 type, |
823 masm->isolate()); | 822 masm->isolate()); |
824 __ mov(api_function_address, Operand(ref)); | 823 __ mov(api_function_address, Operand(ref)); |
825 __ mov(thunk_arg, Operand(reinterpret_cast<int32_t>(function_address))); | |
826 | 824 |
827 // Jump to stub. | 825 // Jump to stub. |
828 CallApiFunctionStub stub(restore_context, call_data_undefined, argc); | 826 CallApiFunctionStub stub(restore_context, call_data_undefined, argc); |
829 __ TailCallStub(&stub); | 827 __ TailCallStub(&stub); |
830 } | 828 } |
831 | 829 |
832 | 830 |
833 // Generates call to API function. | 831 // Generates call to API function. |
834 static void GenerateFastApiCall(MacroAssembler* masm, | 832 static void GenerateFastApiCall(MacroAssembler* masm, |
835 const CallOptimization& optimization, | 833 const CallOptimization& optimization, |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1332 // scratch2 (internal::Object** args_) as the data. | 1330 // scratch2 (internal::Object** args_) as the data. |
1333 __ str(scratch2(), MemOperand(sp, 1 * kPointerSize)); | 1331 __ str(scratch2(), MemOperand(sp, 1 * kPointerSize)); |
1334 __ add(r1, sp, Operand(1 * kPointerSize)); // r1 = AccessorInfo& | 1332 __ add(r1, sp, Operand(1 * kPointerSize)); // r1 = AccessorInfo& |
1335 | 1333 |
1336 const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1; | 1334 const int kStackUnwindSpace = PropertyCallbackArguments::kArgsLength + 1; |
1337 Address getter_address = v8::ToCData<Address>(callback->getter()); | 1335 Address getter_address = v8::ToCData<Address>(callback->getter()); |
1338 | 1336 |
1339 ApiFunction fun(getter_address); | 1337 ApiFunction fun(getter_address); |
1340 ExternalReference::Type type = ExternalReference::DIRECT_GETTER_CALL; | 1338 ExternalReference::Type type = ExternalReference::DIRECT_GETTER_CALL; |
1341 ExternalReference ref = ExternalReference(&fun, type, isolate()); | 1339 ExternalReference ref = ExternalReference(&fun, type, isolate()); |
1342 Register getter_address_reg = r3; | 1340 Register getter_address_reg = r2; |
1343 Register thunk_last_arg = r2; | |
1344 __ mov(getter_address_reg, Operand(ref)); | 1341 __ mov(getter_address_reg, Operand(ref)); |
1345 __ mov(thunk_last_arg, Operand(reinterpret_cast<int32_t>(getter_address))); | |
1346 | 1342 |
1347 Address thunk_address = FUNCTION_ADDR(&InvokeAccessorGetterCallback); | 1343 Address thunk_address = FUNCTION_ADDR(&InvokeAccessorGetterCallback); |
1348 ExternalReference::Type thunk_type = | 1344 ExternalReference::Type thunk_type = |
1349 ExternalReference::PROFILING_GETTER_CALL; | 1345 ExternalReference::PROFILING_GETTER_CALL; |
1350 ApiFunction thunk_fun(thunk_address); | 1346 ApiFunction thunk_fun(thunk_address); |
1351 ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type, | 1347 ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type, |
1352 isolate()); | 1348 isolate()); |
1353 __ CallApiFunctionAndReturn(getter_address_reg, | 1349 __ CallApiFunctionAndReturn(getter_address_reg, |
1354 thunk_ref, | 1350 thunk_ref, |
1355 thunk_last_arg, | |
1356 kStackUnwindSpace, | 1351 kStackUnwindSpace, |
1357 MemOperand(fp, 6 * kPointerSize), | 1352 MemOperand(fp, 6 * kPointerSize), |
1358 NULL); | 1353 NULL); |
1359 } | 1354 } |
1360 | 1355 |
1361 | 1356 |
1362 void LoadStubCompiler::GenerateLoadInterceptor( | 1357 void LoadStubCompiler::GenerateLoadInterceptor( |
1363 Register holder_reg, | 1358 Register holder_reg, |
1364 Handle<Object> object, | 1359 Handle<Object> object, |
1365 Handle<JSObject> interceptor_holder, | 1360 Handle<JSObject> interceptor_holder, |
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2120 // ----------------------------------- | 2115 // ----------------------------------- |
2121 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 2116 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
2122 } | 2117 } |
2123 | 2118 |
2124 | 2119 |
2125 #undef __ | 2120 #undef __ |
2126 | 2121 |
2127 } } // namespace v8::internal | 2122 } } // namespace v8::internal |
2128 | 2123 |
2129 #endif // V8_TARGET_ARCH_ARM | 2124 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |