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

Issue 10706002: Implements a new API to set a function entry hook for profiling. (Closed)

Created:
8 years, 5 months ago by Sigurður Ásgeirsson
Modified:
8 years, 5 months ago
CC:
v8-dev
Visibility:
Public.

Description

Implements a new API to set a function entry hook for profiling. Exposes a new API; V8::SetFunctionEntryHook. If a non-NULL function entry hook is set, the code generator(s) will invoke on the entry hook at the very start of each generated function. Committed: https://code.google.com/p/v8/source/detail?r=12107

Patch Set 1 #

Total comments: 6

Patch Set 2 : Make API return a bool. Test optimized codegen. Test unsupported platforms. #

Patch Set 3 : Use a code stub to bridge to a native function. #

Patch Set 4 : Implement x64 function entry code stub. #

Patch Set 5 : Sketch ARM code stub. #

Total comments: 28

Patch Set 6 : Rebase to ToT. #

Patch Set 7 : Remove timer arg from entry_hook. Improve testing, now passes test on arm/ia32/x64. #

Patch Set 8 : Localized implementation in ProfilerEntryHookStub. #

Total comments: 6

Patch Set 9 : Address danno's comments. #

Patch Set 10 : Cast trampoline function pointer through intptr_t, to satisfy finicky compilers. #

Patch Set 11 : Account for differing calling conventions on X64 platforms. #

Patch Set 12 : Fix X64 crashes. #

Patch Set 13 : Make test non-threaded as it manipulates process-global state, and thus can't deterministically run… #

Unified diffs Side-by-side diffs Delta from patch set Stats (+373 lines, -6 lines) Patch
M include/v8.h View 1 2 3 4 5 6 7 2 chunks +36 lines, -4 lines 0 comments Download
M src/api.cc View 1 2 3 4 5 6 7 2 chunks +6 lines, -0 lines 0 comments Download
M src/arm/code-stubs-arm.cc View 1 2 3 4 5 6 7 8 9 1 chunk +59 lines, -0 lines 0 comments Download
M src/arm/full-codegen-arm.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M src/arm/lithium-codegen-arm.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M src/code-stubs.h View 1 2 3 4 5 6 7 2 chunks +33 lines, -1 line 0 comments Download
M src/code-stubs.cc View 1 2 3 4 5 6 7 1 chunk +22 lines, -0 lines 0 comments Download
M src/ia32/code-stubs-ia32.cc View 1 2 3 4 5 6 7 1 chunk +32 lines, -0 lines 0 comments Download
M src/ia32/full-codegen-ia32.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -1 line 0 comments Download
M src/ia32/lithium-codegen-ia32.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M src/x64/code-stubs-x64.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +68 lines, -0 lines 0 comments Download
M src/x64/full-codegen-x64.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M src/x64/lithium-codegen-x64.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M test/cctest/test-api.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +105 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
Sigurður Ásgeirsson
Hi guys, here's a start on the entry hook API along with a test for ...
8 years, 5 months ago (2012-06-27 16:41:20 UTC) #1
danno
My main concern here is the lack of support on other platforms, specifically that the ...
8 years, 5 months ago (2012-06-27 23:01:54 UTC) #2
Sigurður Ásgeirsson
Thanks, a new patch coming up, unless you object to the API suggestion. https://chromiumcodereview.appspot.com/10706002/diff/1/include/v8.h File ...
8 years, 5 months ago (2012-06-28 09:41:41 UTC) #3
Sigurður Ásgeirsson
Thanks, please take another look. https://chromiumcodereview.appspot.com/10706002/diff/1/test/cctest/test-api.cc File test/cctest/test-api.cc (right): https://chromiumcodereview.appspot.com/10706002/diff/1/test/cctest/test-api.cc#newcode10900 test/cctest/test-api.cc:10900: "function foo(i) { return ...
8 years, 5 months ago (2012-06-28 10:35:34 UTC) #4
Sigurður Ásgeirsson
PTAL - I moved to using a code stub to bridge the entry hook to ...
8 years, 5 months ago (2012-06-29 15:43:45 UTC) #5
Sigurður Ásgeirsson
PTAL, I wrote the support for x64 and sketched the ARM stub. Right now ARM ...
8 years, 5 months ago (2012-07-03 14:08:06 UTC) #6
danno
Generally, the approach looks sound, but there is a bunch of details that need to ...
8 years, 5 months ago (2012-07-10 09:37:13 UTC) #7
Sigurður Ásgeirsson
PTAL. I'd like to discuss the pregenerate/no pregenerate issue with you, I don't understand what ...
8 years, 5 months ago (2012-07-11 14:50:34 UTC) #8
Sigurður Ásgeirsson
I believe this is ready for prime time, please take another look.
8 years, 5 months ago (2012-07-12 11:58:58 UTC) #9
danno
LGTM. If you fix the nits and double check the TODO, I can land this ...
8 years, 5 months ago (2012-07-12 15:23:11 UTC) #10
Sigurður Ásgeirsson
Comments addressed - thanks! https://chromiumcodereview.appspot.com/10706002/diff/20008/src/arm/code-stubs-arm.cc File src/arm/code-stubs-arm.cc (right): https://chromiumcodereview.appspot.com/10706002/diff/20008/src/arm/code-stubs-arm.cc#newcode7565 src/arm/code-stubs-arm.cc:7565: if (frame_alignment > kPointerSize) On ...
8 years, 5 months ago (2012-07-12 15:38:54 UTC) #11
danno
Landing
8 years, 5 months ago (2012-07-12 15:39:59 UTC) #12
Sigurður Ásgeirsson
It seems some compilers will only cast function pointers to integral types or void*, I ...
8 years, 5 months ago (2012-07-12 16:43:19 UTC) #13
Sigurður Ásgeirsson
Fixed the linux/X64 fallout. I hadn't realized Windows stands alone in it's calling convention :(.
8 years, 5 months ago (2012-07-13 15:58:30 UTC) #14
danno
LGTM agian, landing
8 years, 5 months ago (2012-07-13 16:16:16 UTC) #15
Sigurður Ásgeirsson
Please take another look. This is now passing tests on X64 for me.
8 years, 5 months ago (2012-07-16 14:55:51 UTC) #16
danno
8 years, 5 months ago (2012-07-17 15:13:10 UTC) #17
LGTM, landing

Powered by Google App Engine
This is Rietveld 408576698