Fix constant folding for simple binary expression
This change improves constant folding of numeric and
string literals.
Also, we go back generating quadruples instead of
IR-tree-expressions. This is kind of needed to reduce register
pressure in the V4 VM. That is, V4 has typed registers so before
reusing a register we need to look at the type and eventually
dispose its contents (e.g. when a QString or a QUrl is stored
in the register). Unfortunately, we can't effort to have all
these checks in the V4 instructions. So we change `binop'
to generate literals (e.g. CONST or STRING) or a TEMP (aka
a preassigned register that cannot be reused).
For exmaple, the IR code generated for
Rectangle {
color: "b" + "l" + ("u" + "e")
width: 10 + 20 + 30
}
is
====================
line: 3 column: 10
L0x811ca10:
t0 = string_to_color("blue");
return t0;
====================
line: 4 column: 10
L0x811ca50:
return 60;
Change-Id: I4d8482ddab9193d8469bda6461bfb2e5a3eeb197
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>