|
Jode 1.90-CVS Build Aug 6, 2004 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jode.flow.CreateIfThenElseOperator
Constructor Summary | |
CreateIfThenElseOperator()
|
Method Summary | |
static boolean |
create(InstructionContainer ic,
StructuredBlock last)
This handles the normal form of the ? |
static boolean |
createFunny(ConditionalBlock cb,
StructuredBlock last)
This handles the more complicated form of the ? |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CreateIfThenElseOperator()
Method Detail |
public static boolean createFunny(ConditionalBlock cb, StructuredBlock last)
if (cond) PUSH e1 else { IF (c2) GOTO flow_2_ PUSH false } ->IF (stack_0 == 0) GOTO flow_1_ GOTO flow_2_is transformed to
push cond ? e1 : c2 ->IF (stack_0 == 0) GOTO flow_1_ GOTO flow_2_The
->
points to the lastModified block. Note
that both the if and the then part may contain this
condition+push0-block. There may be even stack if-then-else-blocks
for very complicated nested ?-:-Operators. Also note that the produced code is suboptimal: The push-0 could sometimes be better replaced with a correct jump.
public static boolean create(InstructionContainer ic, StructuredBlock last)
if (cond) push e1 GOTO flow_1_ ->push e2 GOTO flow_2is transformed to
->push cond ? e1 : e2The
->
points to the lastModified block.
|
Jode 1.90-CVS Build Aug 6, 2004 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |