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

Side by Side Diff: src/arm/stub-cache-arm.cc

Issue 23588002: cleanup api callbacks now that handles are never returned directly (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: nits Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « src/arm/simulator-arm.cc ('k') | src/assembler.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 // 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 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 __ str(ip, MemOperand(r0, 1 * kPointerSize)); 896 __ str(ip, MemOperand(r0, 1 * kPointerSize));
897 // v8::Arguments::length_ = argc 897 // v8::Arguments::length_ = argc
898 __ mov(ip, Operand(argc)); 898 __ mov(ip, Operand(argc));
899 __ str(ip, MemOperand(r0, 2 * kPointerSize)); 899 __ str(ip, MemOperand(r0, 2 * kPointerSize));
900 // v8::Arguments::is_construct_call = 0 900 // v8::Arguments::is_construct_call = 0
901 __ mov(ip, Operand::Zero()); 901 __ mov(ip, Operand::Zero());
902 __ str(ip, MemOperand(r0, 3 * kPointerSize)); 902 __ str(ip, MemOperand(r0, 3 * kPointerSize));
903 903
904 const int kStackUnwindSpace = argc + kFastApiCallArguments + 1; 904 const int kStackUnwindSpace = argc + kFastApiCallArguments + 1;
905 Address function_address = v8::ToCData<Address>(api_call_info->callback()); 905 Address function_address = v8::ToCData<Address>(api_call_info->callback());
906 // TODO(dcarney): fix signatures using returns_handle
907 const bool returns_handle = false;
908 ApiFunction fun(function_address); 906 ApiFunction fun(function_address);
909 ExternalReference::Type type = 907 ExternalReference::Type type = ExternalReference::DIRECT_API_CALL;
910 returns_handle ?
911 ExternalReference::DIRECT_API_CALL :
912 ExternalReference::DIRECT_API_CALL_NEW;
913 ExternalReference ref = ExternalReference(&fun, 908 ExternalReference ref = ExternalReference(&fun,
914 type, 909 type,
915 masm->isolate()); 910 masm->isolate());
916 Address thunk_address = FUNCTION_ADDR(&InvokeFunctionCallback); 911 Address thunk_address = FUNCTION_ADDR(&InvokeFunctionCallback);
917 ExternalReference::Type thunk_type = 912 ExternalReference::Type thunk_type = ExternalReference::PROFILING_API_CALL;
918 returns_handle ?
919 ExternalReference::PROFILING_API_CALL :
920 ExternalReference::PROFILING_API_CALL_NEW;
921 ApiFunction thunk_fun(thunk_address); 913 ApiFunction thunk_fun(thunk_address);
922 ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type, 914 ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type,
923 masm->isolate()); 915 masm->isolate());
924 916
925 AllowExternalCallThatCantCauseGC scope(masm); 917 AllowExternalCallThatCantCauseGC scope(masm);
926 __ CallApiFunctionAndReturn(ref, 918 __ CallApiFunctionAndReturn(ref,
927 function_address, 919 function_address,
928 thunk_ref, 920 thunk_ref,
929 r1, 921 r1,
930 kStackUnwindSpace, 922 kStackUnwindSpace,
931 returns_handle,
932 kFastApiCallArguments + 1); 923 kFastApiCallArguments + 1);
933 } 924 }
934 925
935 926
936 class CallInterceptorCompiler BASE_EMBEDDED { 927 class CallInterceptorCompiler BASE_EMBEDDED {
937 public: 928 public:
938 CallInterceptorCompiler(StubCompiler* stub_compiler, 929 CallInterceptorCompiler(StubCompiler* stub_compiler,
939 const ParameterCount& arguments, 930 const ParameterCount& arguments,
940 Register name, 931 Register name,
941 Code::ExtraICState extra_ic_state) 932 Code::ExtraICState extra_ic_state)
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
1415 FrameScope frame_scope(masm(), StackFrame::MANUAL); 1406 FrameScope frame_scope(masm(), StackFrame::MANUAL);
1416 __ EnterExitFrame(false, kApiStackSpace); 1407 __ EnterExitFrame(false, kApiStackSpace);
1417 1408
1418 // Create AccessorInfo instance on the stack above the exit frame with 1409 // Create AccessorInfo instance on the stack above the exit frame with
1419 // scratch2 (internal::Object** args_) as the data. 1410 // scratch2 (internal::Object** args_) as the data.
1420 __ str(scratch2(), MemOperand(sp, 1 * kPointerSize)); 1411 __ str(scratch2(), MemOperand(sp, 1 * kPointerSize));
1421 __ add(r1, sp, Operand(1 * kPointerSize)); // r1 = AccessorInfo& 1412 __ add(r1, sp, Operand(1 * kPointerSize)); // r1 = AccessorInfo&
1422 1413
1423 const int kStackUnwindSpace = kFastApiCallArguments + 1; 1414 const int kStackUnwindSpace = kFastApiCallArguments + 1;
1424 Address getter_address = v8::ToCData<Address>(callback->getter()); 1415 Address getter_address = v8::ToCData<Address>(callback->getter());
1425 // TODO(dcarney): fix signatures using returns_handle
1426 const bool returns_handle = false;
1427 1416
1428 ApiFunction fun(getter_address); 1417 ApiFunction fun(getter_address);
1429 ExternalReference::Type type = 1418 ExternalReference::Type type = ExternalReference::DIRECT_GETTER_CALL;
1430 returns_handle ?
1431 ExternalReference::DIRECT_GETTER_CALL :
1432 ExternalReference::DIRECT_GETTER_CALL_NEW;
1433 ExternalReference ref = ExternalReference(&fun, type, isolate()); 1419 ExternalReference ref = ExternalReference(&fun, type, isolate());
1434 1420
1435 Address thunk_address = FUNCTION_ADDR(&InvokeAccessorGetterCallback); 1421 Address thunk_address = FUNCTION_ADDR(&InvokeAccessorGetterCallback);
1436 ExternalReference::Type thunk_type = 1422 ExternalReference::Type thunk_type =
1437 ExternalReference::PROFILING_GETTER_CALL_NEW; 1423 ExternalReference::PROFILING_GETTER_CALL;
1438 ApiFunction thunk_fun(thunk_address); 1424 ApiFunction thunk_fun(thunk_address);
1439 ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type, 1425 ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type,
1440 isolate()); 1426 isolate());
1441 __ CallApiFunctionAndReturn(ref, 1427 __ CallApiFunctionAndReturn(ref,
1442 getter_address, 1428 getter_address,
1443 thunk_ref, 1429 thunk_ref,
1444 r2, 1430 r2,
1445 kStackUnwindSpace, 1431 kStackUnwindSpace,
1446 returns_handle,
1447 5); 1432 5);
1448 } 1433 }
1449 1434
1450 1435
1451 void BaseLoadStubCompiler::GenerateLoadInterceptor( 1436 void BaseLoadStubCompiler::GenerateLoadInterceptor(
1452 Register holder_reg, 1437 Register holder_reg,
1453 Handle<JSObject> object, 1438 Handle<JSObject> object,
1454 Handle<JSObject> interceptor_holder, 1439 Handle<JSObject> interceptor_holder,
1455 LookupResult* lookup, 1440 LookupResult* lookup,
1456 Handle<Name> name) { 1441 Handle<Name> name) {
(...skipping 1710 matching lines...) Expand 10 before | Expand all | Expand 10 after
3167 // ----------------------------------- 3152 // -----------------------------------
3168 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); 3153 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric);
3169 } 3154 }
3170 3155
3171 3156
3172 #undef __ 3157 #undef __
3173 3158
3174 } } // namespace v8::internal 3159 } } // namespace v8::internal
3175 3160
3176 #endif // V8_TARGET_ARCH_ARM 3161 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/arm/simulator-arm.cc ('k') | src/assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698