コード例 #1
1
ファイル: GuardsTestFactory.java プロジェクト: headius/graal
 @SuppressWarnings("unused")
 protected int executeAndSpecialize0(
     Class<?> minimumState, VirtualFrame frameValue, Object expressionValue, String reason) {
   neverPartOfCompilation();
   int result = 0;
   Class<?> resultClass = null;
   boolean allowed = (minimumState == GlobalFlagGuardUninitializedNode.class);
   String message = createInfo0(reason, expressionValue);
   allowed = allowed || (minimumState == GlobalFlagGuardObjectNode.class);
   if (super.globalFlagGuard()) {
     if (resultClass == null) {
       result = super.doSpecialized(expressionValue);
       resultClass = GlobalFlagGuardObjectNode.class;
     }
     if (allowed) {
       super.replace(new GlobalFlagGuardObjectNode(this), message);
       return result;
     }
   }
   if (resultClass == null) {
     result = super.doGeneric(expressionValue);
     resultClass = GlobalFlagGuardGenericNode.class;
   }
   super.replace(new GlobalFlagGuardGenericNode(this), message);
   return result;
 }
コード例 #2
1
ファイル: GuardsTestFactory.java プロジェクト: headius/graal
 @SuppressWarnings("unused")
 protected int executeAndSpecialize0(
     Class<?> minimumState,
     VirtualFrame frameValue,
     Object value0Value,
     Object value1Value,
     String reason) {
   neverPartOfCompilation();
   int result = 0;
   Class<?> resultClass = null;
   boolean allowed = (minimumState == InvocationGuardUninitializedNode.class);
   String message = createInfo0(reason, value0Value, value1Value);
   allowed = allowed || (minimumState == InvocationGuardIntNode.class);
   if (SIMPLETYPES.isInteger(value0Value) && SIMPLETYPES.isInteger(value1Value)) {
     int value0ValueCast = SIMPLETYPES.asInteger(value0Value);
     int value1ValueCast = SIMPLETYPES.asInteger(value1Value);
     if (super.guard(value0ValueCast, value1ValueCast)) {
       if (resultClass == null) {
         result = super.doSpecialized(value0ValueCast, value1ValueCast);
         resultClass = InvocationGuardIntNode.class;
       }
       if (allowed) {
         super.replace(new InvocationGuardIntNode(this), message);
         return result;
       }
     }
   }
   if (resultClass == null) {
     result = super.doGeneric(value0Value, value1Value);
     resultClass = InvocationGuardGenericNode.class;
   }
   super.replace(new InvocationGuardGenericNode(this), message);
   return result;
 }