How to see what the code is compiling?



  • Is there a decompier or a dysssembler in the whitecode? This is an example from the piton.

    In [6]: def f():
       ...:     a=1
       ...:
    

    In [7]: dis.dis(f)
    2 0 LOAD_CONST 1 (1)
    3 STORE_FAST 0 (a)
    6 LOAD_CONST 0 (None)
    9 RETURN_VALUE



  • For V8 https://github.com/v8/v8 () An built-in dissembler may be used:

    First, gather the movement of their origins, including support for the dyssambler:

    make ia32.release objectprint=on disassembler=on
    

    Then start d8 shell with the options

    out/ia32.release/d8 --print-opt-code --code-comments --trace-hydrogen your_app.js
    

    The first two options will print an assembler code with commentaries. The third option generates a track that can be examined with C1Visualizer.

    The decision was honest. https://www.quora.com/Is-there-a-way-to-view-the-machine-code-produced-by-v8-in-Chrome , on the last source v8, did not check

    Relevant options for spidermonkey ( movement FF):

    IONFLAGS=codegen js --ion-offthread-compile=off app.js
    

    taken from https://stackoverflow.com/questions/26744110/print-ion-monkey-generated-code


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2