diff graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java @ 2661:194d93d089bd

Towards clean up of canTrap().
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Wed, 11 May 2011 17:18:31 +0200
parents 9f557e940180
children 6ca76b891d31 405e7947a940
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java	Wed May 11 16:40:22 2011 +0200
+++ b/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java	Wed May 11 17:18:31 2011 +0200
@@ -625,13 +625,9 @@
 
     @Override
     public void visitNullCheck(NullCheck x) {
-        // TODO: this is suboptimal because it may result in an unnecessary move
         CiValue value = load(x.object());
-        if (x.canTrap()) {
-            LIRDebugInfo info = stateFor(x);
-            lir.nullCheck(value, info);
-        }
-        x.setOperand(value);
+        LIRDebugInfo info = stateFor(x);
+        lir.nullCheck(value, info);
     }
 
     @Override
@@ -1595,7 +1591,7 @@
         }
 
         public boolean requiresNullCheck() {
-            return current == null || current.canTrap() || current instanceof InstanceOf || current instanceof CheckCast;
+            return current == null || true;
         }
 
         public boolean requiresBoundsCheck() {