Re: [v8-users] How to intercept the context changing operation for JS code in v8

2019-06-01 Thread Ben Noordhuis
On Tue, May 28, 2019 at 4:14 PM Luo Wu wrote: > > I'm trying to understand the connection between them. Can I say that all JS > function calls will go through MacroAssembler::InvokeFunctionCode? And what I > need to do is to instrument that function? Or maybe I can leverage the > Runtime::kDebu

Re: [v8-users] How to intercept the context changing operation for JS code in v8

2019-05-28 Thread Luo Wu
I'm trying to understand the connection between them. Can I say that all JS function calls will go through *MacroAssembler::InvokeFunctionCode*? And what I need to do is to instrument that function? Or maybe I can leverage the Runtime::*kDebugOnFunctionCall*? Thank you. 在 2019年5月28日星期二 UTC+

Re: [v8-users] How to intercept the context changing operation for JS code in v8

2019-05-28 Thread Ben Noordhuis
On Tue, May 28, 2019 at 11:20 AM Luo Wu wrote: > > Thanks for your reply. > > I checked the code related to IsolateAddressId::kContextAddress. In > src/builtins/x64/builtins-x64.cc, it seems that the function > Generate_JSEntryTrampolineHelper just loads the context but does not > overwrites it

Re: [v8-users] How to intercept the context changing operation for JS code in v8

2019-05-28 Thread Luo Wu
Thanks for your reply. I checked the code related to *IsolateAddressId::kContextAddress*. In *src/builtins/x64/builtins-x64.cc*, it seems that the function *Generate_JSEntryTrampolineHelper* just loads the *context* but does not overwrites it. I also found that the context is overwrote in *Ma

Re: [v8-users] How to intercept the context changing operation for JS code in v8

2019-05-27 Thread Ben Noordhuis
On Sat, May 25, 2019 at 11:34 AM Luo Wu wrote: > > Hi all, > > I want to intercept and log the context changing event in v8. > > Say I have a script in main.html which invokes a function foo in the > iframe.html. When the function foo is executed, the isolate->context() is > changed to represent

[v8-users] How to intercept the context changing operation for JS code in v8

2019-05-25 Thread Luo Wu
Hi all, I want to intercept and log the context changing event in v8. Say I have a script in *main.html* which invokes a function *foo* in the *iframe.html*. When the function *foo* is executed, the isolate->context() is changed to represent for iframe.html. But I cannot find where the v8 set