Bug 247363 - --enableDollarVM = true use In MiniBrowser
Summary: --enableDollarVM = true use In MiniBrowser
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified macOS 13
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-02 06:43 PDT by wjllz
Modified: 2022-11-02 20:09 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wjllz 2022-11-02 06:43:56 PDT
Hey, I use xcode to build all webkit project, and I run MiniBrowser.app, I know when I run javascriptcore singlely, I could use additional function like  |describe|, |$vm.breakpoint(true)|, when I run MiniBrowser.app, is there a way to still could use it?

Like :

<script>
   let arr = [1.1, 2.2, 3.3];
   console.log(describe(arr);
   $vm.breakpoint(true);
</script>

And when I run javascriptcore singlely, I could use |--enableDollarVM=true| to enable some useful function, when I use MiniBrowser.app , is there still a way to use "|--enableDollarVM=true|" flag? And How? Thank u.

I think If I could use this, I could dump the DFG IR when I use minibrowser.app....
Comment 1 Mark Lam 2022-11-02 14:10:19 PDT
1. $vm is disabled on release builds by default.  Are you using a debug build?
2. $vm is only meant to be used by VM developers for debugging and testing purposes.
3. You don't need $vm to dump DFG IR.  There are options to dump them.  See OptionsList.h.

What platform are you running on?
Comment 2 wjllz 2022-11-02 18:28:02 PDT
(In reply to Mark Lam from comment #1)
> 1. $vm is disabled on release builds by default.  Are you using a debug
> build?
> 2. $vm is only meant to be used by VM developers for debugging and testing
> purposes.
> 3. You don't need $vm to dump DFG IR.  There are options to dump them.  See
> OptionsList.h.
> 
> What platform are you running on?

I run it in macos, and I build it in debug version.

I know how to dumpIR when I use javascrptcore, when I finish building, I have a executable named "jsc", then I could use :

>.  ./jsc test.js --DumpGraphAtEachPhase=true

But I don't know how to use |DumpGraphAtEachPhase| when I use MiniBrowser.app(not jsc ), like:

>.   ./MiniBrowser test.html --DumpGraphAtEachPhase=true


Thx
Comment 3 wjllz 2022-11-02 18:28:26 PDT
(In reply to Mark Lam from comment #1)
> 1. $vm is disabled on release builds by default.  Are you using a debug
> build?
> 2. $vm is only meant to be used by VM developers for debugging and testing
> purposes.
> 3. You don't need $vm to dump DFG IR.  There are options to dump them.  See
> OptionsList.h.
> 
> What platform are you running on?

I run it in macos, and I build it in debug version.

I know how to dumpIR when I use javascrptcore, when I finish building, I have a executable named "jsc", then I could use :

>.  ./jsc test.js --DumpGraphAtEachPhase=true

But I don't know how to use |DumpGraphAtEachPhase| when I use MiniBrowser.app(not jsc ), like:

>.   ./MiniBrowser test.html --DumpGraphAtEachPhase=true


Thx
Comment 4 Mark Lam 2022-11-02 18:59:26 PDT
Ok, if you're using these options for development or debugging, that's fine.  To enable any JSC options, just run mini browser with environment variables set in your shell like this:

__XPC_JSC_useDollarVM=1 __XPC_JSC_dumpGraphAtEachPhase=1

The __XPC_ prefix is needed if you're using WebKit2 processes.

For more help, you can ask in the #jsc or #dev channels at webkit.slack.com.

As for this bug, you're welcome to contribute a patch to enhance MiniBrowser to support taking options and routing them to JSC if you like.  Otherwise, we won't be adding these options to MiniBrowser.  There is no reason to add it.
Comment 5 wjllz 2022-11-02 20:09:08 PDT
(In reply to Mark Lam from comment #4)
> Ok, if you're using these options for development or debugging, that's fine.
> To enable any JSC options, just run mini browser with environment variables
> set in your shell like this:
> 
> __XPC_JSC_useDollarVM=1 __XPC_JSC_dumpGraphAtEachPhase=1
> 
> The __XPC_ prefix is needed if you're using WebKit2 processes.
> 
> For more help, you can ask in the #jsc or #dev channels at webkit.slack.com.
> 
> As for this bug, you're welcome to contribute a patch to enhance MiniBrowser
> to support taking options and routing them to JSC if you like.  Otherwise,
> we won't be adding these options to MiniBrowser.  There is no reason to add
> it.

got it! thank u!