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

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

Issue 23479007: MIPS: remove old style callbacks (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 | « no previous file | no next file » | 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 867 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 878
879 FrameScope frame_scope(masm, StackFrame::MANUAL); 879 FrameScope frame_scope(masm, StackFrame::MANUAL);
880 __ EnterExitFrame(false, kApiStackSpace); 880 __ EnterExitFrame(false, kApiStackSpace);
881 881
882 // NOTE: the O32 abi requires a0 to hold a special pointer when returning a 882 // NOTE: the O32 abi requires a0 to hold a special pointer when returning a
883 // struct from the function (which is currently the case). This means we pass 883 // struct from the function (which is currently the case). This means we pass
884 // the first argument in a1 instead of a0, if returns_handle is true. 884 // the first argument in a1 instead of a0, if returns_handle is true.
885 // CallApiFunctionAndReturn will set up a0. 885 // CallApiFunctionAndReturn will set up a0.
886 886
887 Address function_address = v8::ToCData<Address>(api_call_info->callback()); 887 Address function_address = v8::ToCData<Address>(api_call_info->callback());
888 bool returns_handle = 888 // TODO(dcarney): fix signatures using returns_handle
889 !CallbackTable::ReturnsVoid(masm->isolate(), function_address); 889 const bool returns_handle = false;
890 890
891 Register first_arg = returns_handle ? a1 : a0; 891 Register first_arg = returns_handle ? a1 : a0;
892 Register second_arg = returns_handle ? a2 : a1; 892 Register second_arg = returns_handle ? a2 : a1;
893 893
894 // first_arg = v8::Arguments& 894 // first_arg = v8::Arguments&
895 // Arguments is built at sp + 1 (sp is a reserved spot for ra). 895 // Arguments is built at sp + 1 (sp is a reserved spot for ra).
896 __ Addu(first_arg, sp, kPointerSize); 896 __ Addu(first_arg, sp, kPointerSize);
897 897
898 // v8::Arguments::implicit_args_ 898 // v8::Arguments::implicit_args_
899 __ sw(a2, MemOperand(first_arg, 0 * kPointerSize)); 899 __ sw(a2, MemOperand(first_arg, 0 * kPointerSize));
(...skipping 10 matching lines...) Expand all
910 ApiFunction fun(function_address); 910 ApiFunction fun(function_address);
911 ExternalReference::Type type = 911 ExternalReference::Type type =
912 returns_handle ? 912 returns_handle ?
913 ExternalReference::DIRECT_API_CALL : 913 ExternalReference::DIRECT_API_CALL :
914 ExternalReference::DIRECT_API_CALL_NEW; 914 ExternalReference::DIRECT_API_CALL_NEW;
915 ExternalReference ref = 915 ExternalReference ref =
916 ExternalReference(&fun, 916 ExternalReference(&fun,
917 type, 917 type,
918 masm->isolate()); 918 masm->isolate());
919 919
920 Address thunk_address = returns_handle 920 Address thunk_address = FUNCTION_ADDR(&InvokeFunctionCallback);
921 ? FUNCTION_ADDR(&InvokeInvocationCallback)
922 : FUNCTION_ADDR(&InvokeFunctionCallback);
923 ExternalReference::Type thunk_type = 921 ExternalReference::Type thunk_type =
924 returns_handle ? 922 returns_handle ?
925 ExternalReference::PROFILING_API_CALL : 923 ExternalReference::PROFILING_API_CALL :
926 ExternalReference::PROFILING_API_CALL_NEW; 924 ExternalReference::PROFILING_API_CALL_NEW;
927 ApiFunction thunk_fun(thunk_address); 925 ApiFunction thunk_fun(thunk_address);
928 ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type, 926 ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type,
929 masm->isolate()); 927 masm->isolate());
930 928
931 AllowExternalCallThatCantCauseGC scope(masm); 929 AllowExternalCallThatCantCauseGC scope(masm);
932 __ CallApiFunctionAndReturn(ref, 930 __ CallApiFunctionAndReturn(ref,
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
1413 __ sw(scratch3(), MemOperand(sp, 4 * kPointerSize)); 1411 __ sw(scratch3(), MemOperand(sp, 4 * kPointerSize));
1414 __ LoadRoot(scratch3(), Heap::kUndefinedValueRootIndex); 1412 __ LoadRoot(scratch3(), Heap::kUndefinedValueRootIndex);
1415 __ sw(scratch3(), MemOperand(sp, 3 * kPointerSize)); 1413 __ sw(scratch3(), MemOperand(sp, 3 * kPointerSize));
1416 __ sw(scratch3(), MemOperand(sp, 2 * kPointerSize)); 1414 __ sw(scratch3(), MemOperand(sp, 2 * kPointerSize));
1417 __ li(scratch4(), 1415 __ li(scratch4(),
1418 Operand(ExternalReference::isolate_address(isolate()))); 1416 Operand(ExternalReference::isolate_address(isolate())));
1419 __ sw(scratch4(), MemOperand(sp, 1 * kPointerSize)); 1417 __ sw(scratch4(), MemOperand(sp, 1 * kPointerSize));
1420 __ sw(name(), MemOperand(sp, 0 * kPointerSize)); 1418 __ sw(name(), MemOperand(sp, 0 * kPointerSize));
1421 1419
1422 Address getter_address = v8::ToCData<Address>(callback->getter()); 1420 Address getter_address = v8::ToCData<Address>(callback->getter());
1423 bool returns_handle = 1421 // TODO(dcarney): fix signatures using returns_handle
1424 !CallbackTable::ReturnsVoid(isolate(), getter_address); 1422 const bool returns_handle = false;
1425 1423
1426 Register first_arg = returns_handle ? a1 : a0; 1424 Register first_arg = returns_handle ? a1 : a0;
1427 Register second_arg = returns_handle ? a2 : a1; 1425 Register second_arg = returns_handle ? a2 : a1;
1428 Register third_arg = returns_handle ? a3 : a2; 1426 Register third_arg = returns_handle ? a3 : a2;
1429 1427
1430 __ mov(a2, scratch2()); // Saved in case scratch2 == a1. 1428 __ mov(a2, scratch2()); // Saved in case scratch2 == a1.
1431 __ mov(first_arg, sp); // (first argument - see note below) = Handle<Name> 1429 __ mov(first_arg, sp); // (first argument - see note below) = Handle<Name>
1432 1430
1433 // NOTE: the O32 abi requires a0 to hold a special pointer when returning a 1431 // NOTE: the O32 abi requires a0 to hold a special pointer when returning a
1434 // struct from the function (which is currently the case). This means we pass 1432 // struct from the function (which is currently the case). This means we pass
(...skipping 12 matching lines...) Expand all
1447 1445
1448 const int kStackUnwindSpace = kFastApiCallArguments + 1; 1446 const int kStackUnwindSpace = kFastApiCallArguments + 1;
1449 1447
1450 ApiFunction fun(getter_address); 1448 ApiFunction fun(getter_address);
1451 ExternalReference::Type type = 1449 ExternalReference::Type type =
1452 returns_handle ? 1450 returns_handle ?
1453 ExternalReference::DIRECT_GETTER_CALL : 1451 ExternalReference::DIRECT_GETTER_CALL :
1454 ExternalReference::DIRECT_GETTER_CALL_NEW; 1452 ExternalReference::DIRECT_GETTER_CALL_NEW;
1455 ExternalReference ref = ExternalReference(&fun, type, isolate()); 1453 ExternalReference ref = ExternalReference(&fun, type, isolate());
1456 1454
1457 Address thunk_address = returns_handle 1455 Address thunk_address = FUNCTION_ADDR(&InvokeAccessorGetterCallback);
1458 ? FUNCTION_ADDR(&InvokeAccessorGetter)
1459 : FUNCTION_ADDR(&InvokeAccessorGetterCallback);
1460 ExternalReference::Type thunk_type = 1456 ExternalReference::Type thunk_type =
1461 returns_handle ? 1457 ExternalReference::PROFILING_GETTER_CALL_NEW;
1462 ExternalReference::PROFILING_GETTER_CALL :
1463 ExternalReference::PROFILING_GETTER_CALL_NEW;
1464 ApiFunction thunk_fun(thunk_address); 1458 ApiFunction thunk_fun(thunk_address);
1465 ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type, 1459 ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type,
1466 isolate()); 1460 isolate());
1467 __ CallApiFunctionAndReturn(ref, 1461 __ CallApiFunctionAndReturn(ref,
1468 getter_address, 1462 getter_address,
1469 thunk_ref, 1463 thunk_ref,
1470 third_arg, 1464 third_arg,
1471 kStackUnwindSpace, 1465 kStackUnwindSpace,
1472 returns_handle, 1466 returns_handle,
1473 5); 1467 5);
(...skipping 1737 matching lines...) Expand 10 before | Expand all | Expand 10 after
3211 // ----------------------------------- 3205 // -----------------------------------
3212 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric); 3206 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_MissForceGeneric);
3213 } 3207 }
3214 3208
3215 3209
3216 #undef __ 3210 #undef __
3217 3211
3218 } } // namespace v8::internal 3212 } } // namespace v8::internal
3219 3213
3220 #endif // V8_TARGET_ARCH_MIPS 3214 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698