--- old/src/share/vm/opto/callnode.hpp Fri Jul 24 10:17:20 2009 +++ new/src/share/vm/opto/callnode.hpp Fri Jul 24 10:17:20 2009 @@ -178,6 +178,13 @@ // This provides a way to map the optimized program back into the interpreter, // or to let the GC mark the stack. class JVMState : public ResourceObj { +public: + typedef enum { + Reexecute_Undefined = -1, // not defined -- will be translated into false later + Reexecute_False = 0, // false -- do not reexecute + Reexecute_True = 1 // true -- reexecute the bytecode + } ReexecuteState; //Reexecute State + private: JVMState* _caller; // List pointer for forming scope chains uint _depth; // One mroe than caller depth, or one. @@ -188,10 +195,12 @@ uint _endoff; // Offset to end of input edge mapping uint _sp; // Jave Expression Stack Pointer for this state int _bci; // Byte Code Index of this JVM point + ReexecuteState _reexecute; // Whether this bytecode need to be re-executed ciMethod* _method; // Method Pointer SafePointNode* _map; // Map node associated with this scope public: friend class Compile; + friend class PreserveReexecuteState; // Because JVMState objects live over the entire lifetime of the // Compile object, they are allocated into the comp_arena, which @@ -222,16 +231,18 @@ bool is_mon(uint i) const { return i >= _monoff && i < _scloff; } bool is_scl(uint i) const { return i >= _scloff && i < _endoff; } - uint sp() const { return _sp; } - int bci() const { return _bci; } - bool has_method() const { return _method != NULL; } - ciMethod* method() const { assert(has_method(), ""); return _method; } - JVMState* caller() const { return _caller; } - SafePointNode* map() const { return _map; } - uint depth() const { return _depth; } - uint debug_start() const; // returns locoff of root caller - uint debug_end() const; // returns endoff of self - uint debug_size() const { + uint sp() const { return _sp; } + int bci() const { return _bci; } + bool should_reexecute() const { return _reexecute==Reexecute_True; } + bool is_reexecute_undefined() const { return _reexecute==Reexecute_Undefined; } + bool has_method() const { return _method != NULL; } + ciMethod* method() const { assert(has_method(), ""); return _method; } + JVMState* caller() const { return _caller; } + SafePointNode* map() const { return _map; } + uint depth() const { return _depth; } + uint debug_start() const; // returns locoff of root caller + uint debug_end() const; // returns endoff of self + uint debug_size() const { return loc_size() + sp() + mon_size() + scl_size(); } uint debug_depth() const; // returns sum of debug_size values at all depths @@ -267,7 +278,10 @@ } void set_map(SafePointNode *map) { _map = map; } void set_sp(uint sp) { _sp = sp; } - void set_bci(int bci) { _bci = bci; } + //Note: _reexecute should always be undefined when a new _bci is set + void set_bci(int bci) {assert(_reexecute==Reexecute_Undefined || _bci==bci, "sanity check"); _bci = bci; } + void set_should_reexecute(bool reexec) {_reexecute = reexec ? Reexecute_True : Reexecute_False;} + void set_reexecute_undefined() {_reexecute = Reexecute_Undefined; } // Miscellaneous utility functions JVMState* clone_deep(Compile* C) const; // recursively clones caller chain