[Nice-commit] Nice/stdlib/nice/lang/inline ReferenceOp.java,1.7,1.8
Brought to you by:
bonniot
From: Daniel B. <bo...@us...> - 2005-02-08 19:30:12
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang/inline In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24175/stdlib/nice/lang/inline Modified Files: ReferenceOp.java Log Message: Optimization and cleanup. Index: ReferenceOp.java =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/inline/ReferenceOp.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ReferenceOp.java 15 Sep 2004 18:16:27 -0000 1.7 --- ReferenceOp.java 8 Feb 2005 19:29:51 -0000 1.8 *************** *** 49,57 **** Expression[] args = exp.getArgs(); CodeAttr code = comp.getCode(); ! Target stack = new StackTarget(Type.pointer_type); Label _else = new Label(code); Label _end = new Label(code); ! ! if (args[0] instanceof QuoteExp && ((QuoteExp)args[0]).getType() == Type.nullType) { --- 49,57 ---- Expression[] args = exp.getArgs(); CodeAttr code = comp.getCode(); ! Target stack = Target.pushObject; Label _else = new Label(code); Label _end = new Label(code); ! ! if (args[0] instanceof QuoteExp && ((QuoteExp)args[0]).getType() == Type.nullType) { *************** *** 63,67 **** } ! else if (args[1] instanceof QuoteExp && ((QuoteExp)args[1]).getType() == Type.nullType) { --- 63,67 ---- } ! else if (args[1] instanceof QuoteExp && ((QuoteExp)args[1]).getType() == Type.nullType) { *************** *** 85,93 **** code.emitPushBoolean(true); code.emitGoto(_end); ! code.popType(); //simulate 'else' otherwise gnu.bytecode don't like it _else.define(code); code.emitPushBoolean(false); _end.define(code); ! target.compileFromStack(comp, retType); } --- 85,93 ---- code.emitPushBoolean(true); code.emitGoto(_end); ! code.popType(); // simulate 'else' otherwise gnu.bytecode doesn't like it _else.define(code); code.emitPushBoolean(false); _end.define(code); ! target.compileFromStack(comp, retType); } *************** *** 96,102 **** { CodeAttr code = comp.getCode(); ! Target stack = new StackTarget(Type.pointer_type); ! if (args[0] instanceof QuoteExp && ((QuoteExp)args[0]).getType() == Type.nullType) { --- 96,102 ---- { CodeAttr code = comp.getCode(); ! Target stack = Target.pushObject; ! if (args[0] instanceof QuoteExp && ((QuoteExp)args[0]).getType() == Type.nullType) { *************** *** 116,120 **** } ! else if (args[1] instanceof QuoteExp && ((QuoteExp)args[1]).getType() == Type.nullType) { --- 116,120 ---- } ! else if (args[1] instanceof QuoteExp && ((QuoteExp)args[1]).getType() == Type.nullType) { *************** *** 149,155 **** { CodeAttr code = comp.getCode(); ! Target stack = new StackTarget(Type.pointer_type); ! if (args[0] instanceof QuoteExp && ((QuoteExp)args[0]).getType() == Type.nullType) { --- 149,155 ---- { CodeAttr code = comp.getCode(); ! Target stack = Target.pushObject; ! if (args[0] instanceof QuoteExp && ((QuoteExp)args[0]).getType() == Type.nullType) { *************** *** 169,173 **** } ! else if (args[1] instanceof QuoteExp && ((QuoteExp)args[1]).getType() == Type.nullType) { --- 169,173 ---- } ! else if (args[1] instanceof QuoteExp && ((QuoteExp)args[1]).getType() == Type.nullType) { *************** *** 200,204 **** private static final Type retType = Type.boolean_type; ! public Type getReturnType (Expression[] args) { --- 200,204 ---- private static final Type retType = Type.boolean_type; ! public Type getReturnType (Expression[] args) { *************** *** 214,218 **** exp = arguments[0]; - if (exp != null && nice.tools.typing.Types.isSure(exp.getType().getMonotype())) bossa.util.User.warning(exp, "Comparing a non-null value with null"); --- 214,217 ---- |