1.1 --- a/src/share/vm/ci/bcEscapeAnalyzer.hpp Wed Jul 14 14:29:14 2010 -0700 1.2 +++ b/src/share/vm/ci/bcEscapeAnalyzer.hpp Wed Jul 14 14:47:34 2010 -0700 1.3 @@ -22,9 +22,6 @@ 1.4 * 1.5 */ 1.6 1.7 -define_array(ciObjectArray, ciObject*); 1.8 -define_stack(ciObjectList, ciObjectArray); 1.9 - 1.10 // This class implements a fast, conservative analysis of effect of methods 1.11 // on the escape state of their arguments. The analysis is at the bytecode 1.12 // level. 1.13 @@ -34,18 +31,17 @@ 1.14 1.15 class BCEscapeAnalyzer : public ResourceObj { 1.16 private: 1.17 + Arena* _arena; // ciEnv arena 1.18 + 1.19 bool _conservative; // If true, return maximally 1.20 // conservative results. 1.21 ciMethod* _method; 1.22 ciMethodData* _methodData; 1.23 int _arg_size; 1.24 - 1.25 - intStack _stack; 1.26 - 1.27 - BitMap _arg_local; 1.28 - BitMap _arg_stack; 1.29 - BitMap _arg_returned; 1.30 - BitMap _dirty; 1.31 + VectorSet _arg_local; 1.32 + VectorSet _arg_stack; 1.33 + VectorSet _arg_returned; 1.34 + VectorSet _dirty; 1.35 enum{ ARG_OFFSET_MAX = 31}; 1.36 uint *_arg_modified; 1.37 1.38 @@ -54,7 +50,7 @@ 1.39 bool _allocated_escapes; 1.40 bool _unknown_modified; 1.41 1.42 - ciObjectList _dependencies; 1.43 + GrowableArray<ciObject *> _dependencies; 1.44 1.45 ciMethodBlocks *_methodBlocks; 1.46 1.47 @@ -68,20 +64,10 @@ 1.48 private: 1.49 // helper functions 1.50 bool is_argument(int i) { return i >= 0 && i < _arg_size; } 1.51 - 1.52 - void raw_push(int i) { _stack.push(i); } 1.53 - int raw_pop() { return _stack.is_empty() ? -1 : _stack.pop(); } 1.54 - void apush(int i) { raw_push(i); } 1.55 - void spush() { raw_push(-1); } 1.56 - void lpush() { spush(); spush(); } 1.57 - int apop() { return raw_pop(); } 1.58 - void spop() { assert(_stack.is_empty() || _stack.top() == -1, ""); raw_pop(); } 1.59 - void lpop() { spop(); spop(); } 1.60 - 1.61 void set_returned(ArgumentMap vars); 1.62 bool is_argument(ArgumentMap vars); 1.63 bool is_arg_stack(ArgumentMap vars); 1.64 - void clear_bits(ArgumentMap vars, BitMap &bs); 1.65 + void clear_bits(ArgumentMap vars, VectorSet &bs); 1.66 void set_method_escape(ArgumentMap vars); 1.67 void set_global_escape(ArgumentMap vars); 1.68 void set_dirty(ArgumentMap vars); 1.69 @@ -116,25 +102,25 @@ 1.70 ciMethodData* methodData() const { return _methodData; } 1.71 BCEscapeAnalyzer* parent() const { return _parent; } 1.72 int level() const { return _level; } 1.73 - ciObjectList* dependencies() { return &_dependencies; } 1.74 + GrowableArray<ciObject *>* dependencies() { return &_dependencies; } 1.75 bool has_dependencies() const { return !_dependencies.is_empty(); } 1.76 1.77 // retrieval of interprocedural escape information 1.78 1.79 // The given argument does not escape the callee. 1.80 bool is_arg_local(int i) const { 1.81 - return !_conservative && _arg_local.at(i); 1.82 + return !_conservative && _arg_local.test(i); 1.83 } 1.84 1.85 // The given argument escapes the callee, but does not become globally 1.86 // reachable. 1.87 bool is_arg_stack(int i) const { 1.88 - return !_conservative && _arg_stack.at(i); 1.89 + return !_conservative && _arg_stack.test(i); 1.90 } 1.91 1.92 // The given argument does not escape globally, and may be returned. 1.93 bool is_arg_returned(int i) const { 1.94 - return !_conservative && _arg_returned.at(i); } 1.95 + return !_conservative && _arg_returned.test(i); } 1.96 1.97 // True iff only input arguments are returned. 1.98 bool is_return_local() const {