V4 IR: change IR printing to be more readable.
authorErik Verbruggen <erik.verbruggen@digia.com>
Tue, 5 Aug 2014 12:11:16 +0000 (14:11 +0200)
committerErik Verbruggen <erik.verbruggen@digia.com>
Wed, 13 Aug 2014 10:53:19 +0000 (12:53 +0200)
commit2fea3d1899eb8cc81920b631ea73a1f130674950
tree5e115b5fa3597b96b21176578aa1f741c76163f2
parentd6a79aa6b06726d19d231d1da3ecb5b6509f0f1a
V4 IR: change IR printing to be more readable.

New structure:
- "comments" now start with a semi-colon, and have a list of key: values.
    ; predecessors: L17 L26 L36, loop_header: yes
    ; line: 30, column: 3

- when a temporary has a known type, it is written in front of the
  teporary when it is being assigned, and not repeated.
    var %109 = this
    double %42 = 42

- an expression starts with the operation, followed by the operands that
  are separated by commas. The type of the operands is the type
  mentioned when they are assigned.
    int32 %115 = sub %184, %185
    if gt %27, 0 goto L40 else goto L41

- conversions do mention the operand type in order to make them easier
  to read.
    double %178 = convert var to double %60

- phi node operands are prefixed by the from-label to make it easy to
  match those operands with the from-block.
    double %62 = phi L35: %58, L34: %61

- all names except for "this" and built-ins are prefixed by a dot in
  order to make it clear that a lookup will occur, just like member
  accesses.
    $6 = call .int2char($0)
    %7 = this
    %8 = %7.toString()

Change-Id: I9f626a91f97ca7c3f27e01a5539f3c4fc10a46b4
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/qml/compiler/qv4jsir.cpp
src/qml/compiler/qv4jsir_p.h
src/qml/compiler/qv4ssa.cpp
src/qml/jit/qv4regalloc.cpp