Esempio n. 1
0
 /**
  * TODO When tracking integer-stamps, the state at each successor of a TypeSwitchNode should track
  * an integer-stamp for the LoadHubNode (meet over the constants leading to that successor).
  * However, are LoadHubNode-s shared frequently enough?
  */
 private void registerTypeSwitchNode(TypeSwitchNode typeSwitch, BeginNode begin) {
   if (typeSwitch.value() instanceof LoadHubNode) {
     LoadHubNode loadHub = (LoadHubNode) typeSwitch.value();
     ResolvedJavaType type = null;
     for (int i = 0; i < typeSwitch.keyCount(); i++) {
       if (typeSwitch.keySuccessor(i) == begin) {
         if (type == null) {
           type = typeSwitch.typeAt(i);
         } else {
           type = FlowUtil.widen(type, typeSwitch.typeAt(i));
         }
       }
     }
     if (type == null) {
       // `begin` denotes the default case of the TypeSwitchNode
       return;
     }
     // it's unwarranted to assume loadHub.object() to be non-null
     state.trackCC(loadHub.getValue(), type, begin);
   }
 }