src/share/vm/c1/c1_ValueMap.hpp

changeset 894
3a86a8dcf27c
parent 435
a61af66fc99e
child 905
ad8c8ca4ab0f
     1.1 --- a/src/share/vm/c1/c1_ValueMap.hpp	Wed Nov 19 14:20:51 2008 -0800
     1.2 +++ b/src/share/vm/c1/c1_ValueMap.hpp	Tue Nov 25 13:14:07 2008 -0800
     1.3 @@ -133,53 +133,77 @@
     1.4    virtual void kill_array(ValueType* type) = 0;
     1.5  
     1.6    // visitor functions
     1.7 -  void do_StoreField     (StoreField*      x) { kill_field(x->field()); };
     1.8 -  void do_StoreIndexed   (StoreIndexed*    x) { kill_array(x->type()); };
     1.9 -  void do_MonitorEnter   (MonitorEnter*    x) { kill_memory(); };
    1.10 -  void do_MonitorExit    (MonitorExit*     x) { kill_memory(); };
    1.11 -  void do_Invoke         (Invoke*          x) { kill_memory(); };
    1.12 -  void do_UnsafePutRaw   (UnsafePutRaw*    x) { kill_memory(); };
    1.13 -  void do_UnsafePutObject(UnsafePutObject* x) { kill_memory(); };
    1.14 -  void do_Intrinsic      (Intrinsic*       x) { if (!x->preserves_state()) kill_memory(); };
    1.15 +  void do_StoreField     (StoreField*      x) {
    1.16 +    if (!x->is_initialized()) {
    1.17 +      kill_memory();
    1.18 +    } else {
    1.19 +      kill_field(x->field());
    1.20 +    }
    1.21 +  }
    1.22 +  void do_StoreIndexed   (StoreIndexed*    x) { kill_array(x->type()); }
    1.23 +  void do_MonitorEnter   (MonitorEnter*    x) { kill_memory(); }
    1.24 +  void do_MonitorExit    (MonitorExit*     x) { kill_memory(); }
    1.25 +  void do_Invoke         (Invoke*          x) { kill_memory(); }
    1.26 +  void do_UnsafePutRaw   (UnsafePutRaw*    x) { kill_memory(); }
    1.27 +  void do_UnsafePutObject(UnsafePutObject* x) { kill_memory(); }
    1.28 +  void do_Intrinsic      (Intrinsic*       x) { if (!x->preserves_state()) kill_memory(); }
    1.29  
    1.30 -  void do_Phi            (Phi*             x) { /* nothing to do */ };
    1.31 -  void do_Local          (Local*           x) { /* nothing to do */ };
    1.32 -  void do_Constant       (Constant*        x) { /* nothing to do */ };
    1.33 -  void do_LoadField      (LoadField*       x) { /* nothing to do */ };
    1.34 -  void do_ArrayLength    (ArrayLength*     x) { /* nothing to do */ };
    1.35 -  void do_LoadIndexed    (LoadIndexed*     x) { /* nothing to do */ };
    1.36 -  void do_NegateOp       (NegateOp*        x) { /* nothing to do */ };
    1.37 -  void do_ArithmeticOp   (ArithmeticOp*    x) { /* nothing to do */ };
    1.38 -  void do_ShiftOp        (ShiftOp*         x) { /* nothing to do */ };
    1.39 -  void do_LogicOp        (LogicOp*         x) { /* nothing to do */ };
    1.40 -  void do_CompareOp      (CompareOp*       x) { /* nothing to do */ };
    1.41 -  void do_IfOp           (IfOp*            x) { /* nothing to do */ };
    1.42 -  void do_Convert        (Convert*         x) { /* nothing to do */ };
    1.43 -  void do_NullCheck      (NullCheck*       x) { /* nothing to do */ };
    1.44 -  void do_NewInstance    (NewInstance*     x) { /* nothing to do */ };
    1.45 -  void do_NewTypeArray   (NewTypeArray*    x) { /* nothing to do */ };
    1.46 -  void do_NewObjectArray (NewObjectArray*  x) { /* nothing to do */ };
    1.47 -  void do_NewMultiArray  (NewMultiArray*   x) { /* nothing to do */ };
    1.48 -  void do_CheckCast      (CheckCast*       x) { /* nothing to do */ };
    1.49 -  void do_InstanceOf     (InstanceOf*      x) { /* nothing to do */ };
    1.50 -  void do_BlockBegin     (BlockBegin*      x) { /* nothing to do */ };
    1.51 -  void do_Goto           (Goto*            x) { /* nothing to do */ };
    1.52 -  void do_If             (If*              x) { /* nothing to do */ };
    1.53 -  void do_IfInstanceOf   (IfInstanceOf*    x) { /* nothing to do */ };
    1.54 -  void do_TableSwitch    (TableSwitch*     x) { /* nothing to do */ };
    1.55 -  void do_LookupSwitch   (LookupSwitch*    x) { /* nothing to do */ };
    1.56 -  void do_Return         (Return*          x) { /* nothing to do */ };
    1.57 -  void do_Throw          (Throw*           x) { /* nothing to do */ };
    1.58 -  void do_Base           (Base*            x) { /* nothing to do */ };
    1.59 -  void do_OsrEntry       (OsrEntry*        x) { /* nothing to do */ };
    1.60 -  void do_ExceptionObject(ExceptionObject* x) { /* nothing to do */ };
    1.61 -  void do_RoundFP        (RoundFP*         x) { /* nothing to do */ };
    1.62 -  void do_UnsafeGetRaw   (UnsafeGetRaw*    x) { /* nothing to do */ };
    1.63 -  void do_UnsafeGetObject(UnsafeGetObject* x) { /* nothing to do */ };
    1.64 -  void do_UnsafePrefetchRead (UnsafePrefetchRead*  x) { /* nothing to do */ };
    1.65 -  void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) { /* nothing to do */ };
    1.66 -  void do_ProfileCall    (ProfileCall*     x) { /* nothing to do */ };
    1.67 -  void do_ProfileCounter (ProfileCounter*  x) { /* nothing to do */ };
    1.68 +  void do_Phi            (Phi*             x) { /* nothing to do */ }
    1.69 +  void do_Local          (Local*           x) { /* nothing to do */ }
    1.70 +  void do_Constant       (Constant*        x) { /* nothing to do */ }
    1.71 +  void do_LoadField      (LoadField*       x) {
    1.72 +    if (!x->is_initialized()) {
    1.73 +      kill_memory();
    1.74 +    }
    1.75 +  }
    1.76 +  void do_ArrayLength    (ArrayLength*     x) { /* nothing to do */ }
    1.77 +  void do_LoadIndexed    (LoadIndexed*     x) { /* nothing to do */ }
    1.78 +  void do_NegateOp       (NegateOp*        x) { /* nothing to do */ }
    1.79 +  void do_ArithmeticOp   (ArithmeticOp*    x) { /* nothing to do */ }
    1.80 +  void do_ShiftOp        (ShiftOp*         x) { /* nothing to do */ }
    1.81 +  void do_LogicOp        (LogicOp*         x) { /* nothing to do */ }
    1.82 +  void do_CompareOp      (CompareOp*       x) { /* nothing to do */ }
    1.83 +  void do_IfOp           (IfOp*            x) { /* nothing to do */ }
    1.84 +  void do_Convert        (Convert*         x) { /* nothing to do */ }
    1.85 +  void do_NullCheck      (NullCheck*       x) { /* nothing to do */ }
    1.86 +  void do_NewInstance    (NewInstance*     x) { /* nothing to do */ }
    1.87 +  void do_NewTypeArray   (NewTypeArray*    x) { /* nothing to do */ }
    1.88 +  void do_NewObjectArray (NewObjectArray*  x) { /* nothing to do */ }
    1.89 +  void do_NewMultiArray  (NewMultiArray*   x) { /* nothing to do */ }
    1.90 +  void do_CheckCast      (CheckCast*       x) { /* nothing to do */ }
    1.91 +  void do_InstanceOf     (InstanceOf*      x) { /* nothing to do */ }
    1.92 +  void do_BlockBegin     (BlockBegin*      x) { /* nothing to do */ }
    1.93 +  void do_Goto           (Goto*            x) { /* nothing to do */ }
    1.94 +  void do_If             (If*              x) { /* nothing to do */ }
    1.95 +  void do_IfInstanceOf   (IfInstanceOf*    x) { /* nothing to do */ }
    1.96 +  void do_TableSwitch    (TableSwitch*     x) { /* nothing to do */ }
    1.97 +  void do_LookupSwitch   (LookupSwitch*    x) { /* nothing to do */ }
    1.98 +  void do_Return         (Return*          x) { /* nothing to do */ }
    1.99 +  void do_Throw          (Throw*           x) { /* nothing to do */ }
   1.100 +  void do_Base           (Base*            x) { /* nothing to do */ }
   1.101 +  void do_OsrEntry       (OsrEntry*        x) { /* nothing to do */ }
   1.102 +  void do_ExceptionObject(ExceptionObject* x) { /* nothing to do */ }
   1.103 +  void do_RoundFP        (RoundFP*         x) { /* nothing to do */ }
   1.104 +  void do_UnsafeGetRaw   (UnsafeGetRaw*    x) { /* nothing to do */ }
   1.105 +  void do_UnsafeGetObject(UnsafeGetObject* x) { /* nothing to do */ }
   1.106 +  void do_UnsafePrefetchRead (UnsafePrefetchRead*  x) { /* nothing to do */ }
   1.107 +  void do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) { /* nothing to do */ }
   1.108 +  void do_ProfileCall    (ProfileCall*     x) { /* nothing to do */ }
   1.109 +  void do_ProfileCounter (ProfileCounter*  x) { /* nothing to do */ }
   1.110 +};
   1.111 +
   1.112 +
   1.113 +class ValueNumberingEffects: public ValueNumberingVisitor {
   1.114 + private:
   1.115 +  ValueMap*     _map;
   1.116 +
   1.117 + public:
   1.118 +  // implementation for abstract methods of ValueNumberingVisitor
   1.119 +  void          kill_memory()                    { _map->kill_memory(); }
   1.120 +  void          kill_field(ciField* field)       { _map->kill_field(field); }
   1.121 +  void          kill_array(ValueType* type)      { _map->kill_array(type); }
   1.122 +
   1.123 +  ValueNumberingEffects(ValueMap* map): _map(map) {}
   1.124  };
   1.125  
   1.126  

mercurial