1.1 --- a/src/share/vm/opto/callnode.hpp Fri Jul 31 12:04:07 2009 -0700 1.2 +++ b/src/share/vm/opto/callnode.hpp Fri Jul 31 17:12:33 2009 -0700 1.3 @@ -178,6 +178,13 @@ 1.4 // This provides a way to map the optimized program back into the interpreter, 1.5 // or to let the GC mark the stack. 1.6 class JVMState : public ResourceObj { 1.7 +public: 1.8 + typedef enum { 1.9 + Reexecute_Undefined = -1, // not defined -- will be translated into false later 1.10 + Reexecute_False = 0, // false -- do not reexecute 1.11 + Reexecute_True = 1 // true -- reexecute the bytecode 1.12 + } ReexecuteState; //Reexecute State 1.13 + 1.14 private: 1.15 JVMState* _caller; // List pointer for forming scope chains 1.16 uint _depth; // One mroe than caller depth, or one. 1.17 @@ -188,10 +195,12 @@ 1.18 uint _endoff; // Offset to end of input edge mapping 1.19 uint _sp; // Jave Expression Stack Pointer for this state 1.20 int _bci; // Byte Code Index of this JVM point 1.21 + ReexecuteState _reexecute; // Whether this bytecode need to be re-executed 1.22 ciMethod* _method; // Method Pointer 1.23 SafePointNode* _map; // Map node associated with this scope 1.24 public: 1.25 friend class Compile; 1.26 + friend class PreserveReexecuteState; 1.27 1.28 // Because JVMState objects live over the entire lifetime of the 1.29 // Compile object, they are allocated into the comp_arena, which 1.30 @@ -222,16 +231,18 @@ 1.31 bool is_mon(uint i) const { return i >= _monoff && i < _scloff; } 1.32 bool is_scl(uint i) const { return i >= _scloff && i < _endoff; } 1.33 1.34 - uint sp() const { return _sp; } 1.35 - int bci() const { return _bci; } 1.36 - bool has_method() const { return _method != NULL; } 1.37 - ciMethod* method() const { assert(has_method(), ""); return _method; } 1.38 - JVMState* caller() const { return _caller; } 1.39 - SafePointNode* map() const { return _map; } 1.40 - uint depth() const { return _depth; } 1.41 - uint debug_start() const; // returns locoff of root caller 1.42 - uint debug_end() const; // returns endoff of self 1.43 - uint debug_size() const { 1.44 + uint sp() const { return _sp; } 1.45 + int bci() const { return _bci; } 1.46 + bool should_reexecute() const { return _reexecute==Reexecute_True; } 1.47 + bool is_reexecute_undefined() const { return _reexecute==Reexecute_Undefined; } 1.48 + bool has_method() const { return _method != NULL; } 1.49 + ciMethod* method() const { assert(has_method(), ""); return _method; } 1.50 + JVMState* caller() const { return _caller; } 1.51 + SafePointNode* map() const { return _map; } 1.52 + uint depth() const { return _depth; } 1.53 + uint debug_start() const; // returns locoff of root caller 1.54 + uint debug_end() const; // returns endoff of self 1.55 + uint debug_size() const { 1.56 return loc_size() + sp() + mon_size() + scl_size(); 1.57 } 1.58 uint debug_depth() const; // returns sum of debug_size values at all depths 1.59 @@ -267,7 +278,9 @@ 1.60 } 1.61 void set_map(SafePointNode *map) { _map = map; } 1.62 void set_sp(uint sp) { _sp = sp; } 1.63 - void set_bci(int bci) { _bci = bci; } 1.64 + // _reexecute is initialized to "undefined" for a new bci 1.65 + void set_bci(int bci) {if(_bci != bci)_reexecute=Reexecute_Undefined; _bci = bci; } 1.66 + void set_should_reexecute(bool reexec) {_reexecute = reexec ? Reexecute_True : Reexecute_False;} 1.67 1.68 // Miscellaneous utility functions 1.69 JVMState* clone_deep(Compile* C) const; // recursively clones caller chain