mraleph / irhydra

Tool for displaying IR used by V8 and Dart VM optimizing compilers
Apache License 2.0
433 stars 32 forks source link

How to run irhydra2 on windows? #57

Closed NE-SmallTown closed 7 years ago

NE-SmallTown commented 7 years ago

JavaScript Workflow

Requires Dart SDK.

$ cd irhydra

Get all dependencies

$ pub get

Serve dart2js compiled IRHydra at http://localhost:8080/

It will be recompiled when needed.

$ pub serve or

Build IRHydra for deployment. Result is in build/

$ pub build

But the doc doesn't mention that how to run it on windows,is there any way to slove?Thanks.

mraleph commented 7 years ago

@NE-SmallTown do you want to run from source? then instructions are roughly the same.

Alternatively just use already deployed version at http://mrale.ph/irhydra/2

(note: this application has no server side component so even if you are using deployed version you are not uploading your code anywhere - it stays within your browser)

NE-SmallTown commented 7 years ago

@mraleph Thanks for your reply soon.I download the dartium-windows-ia32-release and irhydra-master now,but I don't know how to convert the *.js file to *.asm,the video says that we should run the alias d8ir,but d8ir is not a command.And Get, pub are also not a command on windows.

mraleph commented 7 years ago

@NE-SmallTown if you want to get asm out V8 you don't need neither dartium nor irhydra itself.

You need V8 or node.js binary (see https://developers.google.com/v8/build about how to build V8).

Then you run

d8 --trace-hydrogen --trace-phase=Z --trace-deopt --code-comments --hydrogen-track-positions --redirect-code-traces --redirect-code-traces-to=code.asm your-javascript-file.js

or

node --trace-hydrogen --trace-phase=Z --trace-deopt --code-comments --hydrogen-track-positions --redirect-code-traces --redirect-code-traces-to=code.asm your-javascript-file.js

from this you get hydrogen.cfg and code.asm files which you can open in IRHydra.

NE-SmallTown commented 7 years ago

Thanks!

Final question,the doc says:

IRHydra is written in Dart the easiest way to run it is to download full Dart bundle and use Dart Editor.

I think it means that if we want to use IRHydra ,we should download full Dart bundle and use Dart Editor.But just now you tell me that we don't need it,so I am a little confused.

mraleph commented 7 years ago

The doc says that in the "Running Locally" section. It's about what you need if you want to run irhydra itself from source. Usually you don't need that unless you want to contribute.

NE-SmallTown commented 7 years ago

Yup,I get it.Thanks a lot!