When Token.printICode is set to true (generally only for debugging purposes), Rhino prints all the interpreter bytecode it generated. For the Icode_REG_STRxx instructions Rhino will also print inline the string value, but it does not do it for the (far more common) Icode_REG_STR_Cxx instructions.
This tiny PR just extends the same behavior to the Icode_REG_STR_Cxx. Therfore, for this js code:
a + b
it will now print this:
ICode dump, for null, length = 10
MaxStack = 2
[0] LINE : 2
[3] REG_STR_C0 "a"
[4] NAME
[5] REG_STR_C1 "b"
[6] NAME
[7] ADD
[8] POP_RESULT
[9] RETURN_RESULT
whereas the old version would have just printed something like:
[3] REG_STR_C0
There are no unit tests for all this stuff, but it's currently being used only for debugging purposes... so I didn't really think that it was worth creating a whole test suite from scratch for this change.
When
Token.printICode
is set to true (generally only for debugging purposes), Rhino prints all the interpreter bytecode it generated. For theIcode_REG_STRxx
instructions Rhino will also print inline the string value, but it does not do it for the (far more common)Icode_REG_STR_Cxx
instructions.This tiny PR just extends the same behavior to the
Icode_REG_STR_Cxx
. Therfore, for this js code:it will now print this:
whereas the old version would have just printed something like:
There are no unit tests for all this stuff, but it's currently being used only for debugging purposes... so I didn't really think that it was worth creating a whole test suite from scratch for this change.