From: <dgr...@us...> - 2008-06-19 21:49:24
|
Revision: 14515 http://jikesrvm.svn.sourceforge.net/jikesrvm/?rev=14515&view=rev Author: dgrove-oss Date: 2008-06-19 14:49:23 -0700 (Thu, 19 Jun 2008) Log Message: ----------- bug fix in Simplifier. The code for MUST_IMPLEMENT_INTERFACE was improperly removing the check when the compile type of the RHS was an interface. This is exactly the case where we need to execute this instruction dynamically to properly detect IncompatibleClassChangeErrors. There may be a performance hit from this bug fix, but we need to properly implement the specification. Modified Paths: -------------- rvmroot/trunk/rvm/src/org/jikesrvm/compilers/opt/Simplifier.java Modified: rvmroot/trunk/rvm/src/org/jikesrvm/compilers/opt/Simplifier.java =================================================================== --- rvmroot/trunk/rvm/src/org/jikesrvm/compilers/opt/Simplifier.java 2008-06-18 15:02:48 UTC (rev 14514) +++ rvmroot/trunk/rvm/src/org/jikesrvm/compilers/opt/Simplifier.java 2008-06-19 21:49:23 UTC (rev 14515) @@ -880,11 +880,20 @@ TypeReference rhsType = ref.getType(); // our type byte ans = ClassLoaderProxy.includesType(lhsType, rhsType); if (ans == OptConstants.YES) { - Move.mutate(s, REF_MOVE, TypeCheck.getResult(s), ref); - if (ref.isConstant()) - return DefUseEffect.MOVE_FOLDED; - else - return DefUseEffect.MOVE_REDUCED; + RVMType rType = rhsType.peekType(); + if (rType != null) { + if (rType.isClassType() && rType.asClass().isInterface()) { + /* This is exactly the kind of typing that could require us to raise an IncompatibleClassChangeError */ + return DefUseEffect.UNCHANGED; + } + Move.mutate(s, REF_MOVE, TypeCheck.getResult(s), ref); + if (ref.isConstant()) + return DefUseEffect.MOVE_FOLDED; + else + return DefUseEffect.MOVE_REDUCED; + } else { + return DefUseEffect.UNCHANGED; + } } else if (ans == OptConstants.NO) { RVMType rType = rhsType.peekType(); if (rType != null && rType.isClassType() && rType.asClass().isFinal()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |