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

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

Issue 16858013: Notify CPU profiler when calling native getters (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 bool returns_handle = 958 bool returns_handle =
959 !CallbackTable::ReturnsVoid(masm->isolate(), function_address); 959 !CallbackTable::ReturnsVoid(masm->isolate(), function_address);
960 ApiFunction fun(function_address); 960 ApiFunction fun(function_address);
961 ExternalReference::Type type = 961 ExternalReference::Type type =
962 returns_handle ? 962 returns_handle ?
963 ExternalReference::DIRECT_API_CALL : 963 ExternalReference::DIRECT_API_CALL :
964 ExternalReference::DIRECT_API_CALL_NEW; 964 ExternalReference::DIRECT_API_CALL_NEW;
965 ExternalReference ref = ExternalReference(&fun, 965 ExternalReference ref = ExternalReference(&fun,
966 type, 966 type,
967 masm->isolate()); 967 masm->isolate());
968 Address thunk_address = returns_handle
969 ? FUNCTION_ADDR(&InvokeInvocationCallback)
970 : FUNCTION_ADDR(&InvokeFunctionCallback);
971 ExternalReference::Type thunk_type =
972 returns_handle ?
973 ExternalReference::PROFILING_API_CALL :
974 ExternalReference::PROFILING_API_CALL_NEW;
975 ApiFunction thunk_fun(thunk_address);
976 ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type,
977 masm->isolate());
978
968 AllowExternalCallThatCantCauseGC scope(masm); 979 AllowExternalCallThatCantCauseGC scope(masm);
969 __ CallApiFunctionAndReturn(ref, 980 __ CallApiFunctionAndReturn(ref,
981 function_address,
982 thunk_ref,
983 r1,
970 kStackUnwindSpace, 984 kStackUnwindSpace,
971 returns_handle, 985 returns_handle,
972 kFastApiCallArguments + 1); 986 kFastApiCallArguments + 1);
973 } 987 }
974 988
975 989
976 class CallInterceptorCompiler BASE_EMBEDDED { 990 class CallInterceptorCompiler BASE_EMBEDDED {
977 public: 991 public:
978 CallInterceptorCompiler(StubCompiler* stub_compiler, 992 CallInterceptorCompiler(StubCompiler* stub_compiler,
979 const ParameterCount& arguments, 993 const ParameterCount& arguments,
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
1456 1470
1457 // Create AccessorInfo instance on the stack above the exit frame with 1471 // Create AccessorInfo instance on the stack above the exit frame with
1458 // scratch2 (internal::Object** args_) as the data. 1472 // scratch2 (internal::Object** args_) as the data.
1459 __ str(scratch2(), MemOperand(sp, 1 * kPointerSize)); 1473 __ str(scratch2(), MemOperand(sp, 1 * kPointerSize));
1460 __ add(r1, sp, Operand(1 * kPointerSize)); // r1 = AccessorInfo& 1474 __ add(r1, sp, Operand(1 * kPointerSize)); // r1 = AccessorInfo&
1461 1475
1462 const int kStackUnwindSpace = kFastApiCallArguments + 1; 1476 const int kStackUnwindSpace = kFastApiCallArguments + 1;
1463 Address getter_address = v8::ToCData<Address>(callback->getter()); 1477 Address getter_address = v8::ToCData<Address>(callback->getter());
1464 bool returns_handle = 1478 bool returns_handle =
1465 !CallbackTable::ReturnsVoid(isolate(), getter_address); 1479 !CallbackTable::ReturnsVoid(isolate(), getter_address);
1480
1466 ApiFunction fun(getter_address); 1481 ApiFunction fun(getter_address);
1467 ExternalReference::Type type = 1482 ExternalReference::Type type =
1468 returns_handle ? 1483 returns_handle ?
1469 ExternalReference::DIRECT_GETTER_CALL : 1484 ExternalReference::DIRECT_GETTER_CALL :
1470 ExternalReference::DIRECT_GETTER_CALL_NEW; 1485 ExternalReference::DIRECT_GETTER_CALL_NEW;
1486 ExternalReference ref = ExternalReference(&fun, type, isolate());
1471 1487
1472 ExternalReference ref = ExternalReference(&fun, type, isolate()); 1488 Address thunk_address = returns_handle
1489 ? FUNCTION_ADDR(&InvokeAccessorGetter)
1490 : FUNCTION_ADDR(&InvokeAccessorGetterCallback);
1491 ExternalReference::Type thunk_type =
1492 returns_handle ?
1493 ExternalReference::PROFILING_GETTER_CALL :
1494 ExternalReference::PROFILING_GETTER_CALL_NEW;
1495 ApiFunction thunk_fun(thunk_address);
1496 ExternalReference thunk_ref = ExternalReference(&thunk_fun, thunk_type,
1497 isolate());
1473 __ CallApiFunctionAndReturn(ref, 1498 __ CallApiFunctionAndReturn(ref,
1499 getter_address,
1500 thunk_ref,
1501 r2,
1474 kStackUnwindSpace, 1502 kStackUnwindSpace,
1475 returns_handle, 1503 returns_handle,
1476 5); 1504 5);
1477 } 1505 }
1478 1506
1479 1507
1480 void BaseLoadStubCompiler::GenerateLoadInterceptor( 1508 void BaseLoadStubCompiler::GenerateLoadInterceptor(
1481 Register holder_reg, 1509 Register holder_reg,
1482 Handle<JSObject> object, 1510 Handle<JSObject> object,
1483 Handle<JSObject> interceptor_holder, 1511 Handle<JSObject> interceptor_holder,
(...skipping 2162 matching lines...) Expand 10 before | Expand all | Expand 10 after
3646 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow); 3674 TailCallBuiltin(masm, Builtins::kKeyedStoreIC_Slow);
3647 } 3675 }
3648 } 3676 }
3649 3677
3650 3678
3651 #undef __ 3679 #undef __
3652 3680
3653 } } // namespace v8::internal 3681 } } // namespace v8::internal
3654 3682
3655 #endif // V8_TARGET_ARCH_ARM 3683 #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