Skip to content

Workaround for V8 profiler in order to show correct function names in…#470

Merged
slavchev merged 1 commit intomasterfrom
slavchev/profiler-show-func-names
Jun 10, 2016
Merged

Workaround for V8 profiler in order to show correct function names in…#470
slavchev merged 1 commit intomasterfrom
slavchev/profiler-show-func-names

Conversation

@slavchev
Copy link
Copy Markdown

@slavchev slavchev commented Jun 3, 2016

… CPU

profiles. By default, V8 maps all native functions to the address of the
C++ handler (MetadataNode::MethodCallback). As a result there is only one
entry (the last one) in the map for all Java methods. While using libffi
to generate unique native handler with sole purpose to forward the call to
MetadataNode::MethodCallback works fine on Windows, it does not work for
Android x86/arm because V8 profiler cannot unwind properly the stack.
Hence, we wrap all Java methods with JS functions and take advantage of
ScriptOrigin.

… CPU

profiles. By default, V8 maps all native functions to the address of the
C++ handler (MetadataNode::MethodCallback). As a result there is only one
entry (the last one) in the map for all Java methods. While using libffi
to generate unique native handler with sole purpose to forward the call to
MetadataNode::MethodCallback works fine on Windows, it does not work for
Android x86/arm because V8 profiler cannot unwind properly the stack.
Hence, we wrap all Java methods with JS functions and take advantage of
ScriptOrigin.
@ns-bot
Copy link
Copy Markdown

ns-bot commented Jun 3, 2016

💔

@slavchev
Copy link
Copy Markdown
Author

slavchev commented Jun 3, 2016

ping @NativeScript/android-runtime

@blagoev
Copy link
Copy Markdown
Contributor

blagoev commented Jun 10, 2016

run ci

@blagoev
Copy link
Copy Markdown
Contributor

blagoev commented Jun 10, 2016

looks good

@slavchev slavchev merged commit a88bfa4 into master Jun 10, 2016
@slavchev slavchev deleted the slavchev/profiler-show-func-names branch June 10, 2016 10:48
@Plamen5kov
Copy link
Copy Markdown
Contributor

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants