mraleph / irhydra

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

Error parsing input files #44

Closed trevnorris closed 9 years ago

trevnorris commented 9 years ago

Test script:

'use strict';

function runSplice(arr, index) {
  for (var i = 0; i < 1e7; i++) {
    arr.splice(index, 1);
    arr.push(100);
  }
}

(function runner() {
  var arr = new Array(150);
  for (var i = 0; i < arr.length; ++i) {
    arr[i] = i;
  }

  runSplice(arr, 5);
}());

To reproduce:

$ ./out/x64.release/d8 --trace_hydrogen --trace_phase=Z --trace_deopt \
    --code_comments --hydrogen_track_positions --redirect_code_traces \
    --redirect_code_traces_to=code.asm --print_opt_code test.js

In the bottom left corner should see the message:

ERROR: Source does not match IR. See console for more details.

  • Now click on "Hide Disassembly" and select "Split Disassembly"

Should see that a majority of the IR output is no longer there.

Tested with V8 v4.2.77.20 and v4.4.63

brendankenny commented 9 years ago

If it's helpful, note that with #43 you can now put the asm and cfg files in a gist and link to them in irhydra directly.

trevnorris commented 9 years ago

The #gist: link thing isn't working for me, but here are the files: https://gist.github.com/trevnorris/8160de664e5b594576b0

(ran with d8 v4.4.63)

trevnorris commented 9 years ago

@mraleph Awesome! Thanks.

brendankenny commented 9 years ago

Weird, I was able to reproduce http://mrale.ph/irhydra/2/#gist:8160de664e5b594576b0 not displaying anything for me either, but now it's working for me. @mraleph did you fix something?

mraleph commented 9 years ago

@brendankenny I think I fixed by this hack https://github.com/mraleph/irhydra/blob/65d73e92c3344f90be320b2bf863920a11b4e173/irhydra/lib/src/modes/v8/hydrogen_parser.dart#L31-L32

there was a new line missing at the end of hydrogen.cfg