105 // of the set and replacing any element with the same entry address. 106 void insert_jsr_record(JsrRecord* record); 107 108 // Remove the JsrRecord with the given return address from the JsrSet. 109 void remove_jsr_record(int return_address); 110 111 public: 112 JsrSet(Arena* arena, int default_len = 4); 113 114 // Copy this JsrSet. 115 void copy_into(JsrSet* jsrs); 116 117 // Is this JsrSet compatible with some other JsrSet? 118 bool is_compatible_with(JsrSet* other); 119 120 // Apply the effect of a single bytecode to the JsrSet. 121 void apply_control(ciTypeFlow* analyzer, 122 ciBytecodeStream* str, 123 StateVector* state); 124 125 // What is the cardinality of this set? 126 int size() const { return _set->length(); } 127 128 void print_on(outputStream* st) const PRODUCT_RETURN; 129 }; 130 131 class LocalSet VALUE_OBJ_CLASS_SPEC { 132 private: 133 enum Constants { max = 63 }; 134 uint64_t _bits; 135 public: 136 LocalSet() : _bits(0) {} 137 void add(uint32_t i) { if (i < (uint32_t)max) _bits |= (1LL << i); } 138 void add(LocalSet* ls) { _bits |= ls->_bits; } 139 bool test(uint32_t i) const { return i < (uint32_t)max ? (_bits>>i)&1U : true; } 140 void clear() { _bits = 0; } 141 void print_on(outputStream* st, int limit) const PRODUCT_RETURN; 142 }; 143 144 // Used as a combined index for locals and temps 613 compute_exceptions(); 614 } 615 return _exc_klasses; 616 } 617 618 // Is this Block compatible with a given JsrSet? 619 bool is_compatible_with(JsrSet* other) { 620 return _jsrs->is_compatible_with(other); 621 } 622 623 // Copy the value of our state vector into another. 624 void copy_state_into(StateVector* copy) const { 625 _state->copy_into(copy); 626 } 627 628 // Copy the value of our JsrSet into another 629 void copy_jsrs_into(JsrSet* copy) const { 630 _jsrs->copy_into(copy); 631 } 632 633 // Meets the start state of this block with another state, destructively 634 // modifying this one. Returns true if any modification takes place. 635 bool meet(const StateVector* incoming) { 636 return state()->meet(incoming); 637 } 638 639 // Ditto, except that the incoming state is coming from an 640 // exception path. This means the stack is replaced by the 641 // appropriate exception type. 642 bool meet_exception(ciInstanceKlass* exc, const StateVector* incoming) { 643 return state()->meet_exception(exc, incoming); 644 } 645 646 // Work list manipulation 647 void set_next(Block* block) { _next = block; } 648 Block* next() const { return _next; } 649 650 void set_on_work_list(bool c) { _on_work_list = c; } 651 bool is_on_work_list() const { return _on_work_list; } 652 | 105 // of the set and replacing any element with the same entry address. 106 void insert_jsr_record(JsrRecord* record); 107 108 // Remove the JsrRecord with the given return address from the JsrSet. 109 void remove_jsr_record(int return_address); 110 111 public: 112 JsrSet(Arena* arena, int default_len = 4); 113 114 // Copy this JsrSet. 115 void copy_into(JsrSet* jsrs); 116 117 // Is this JsrSet compatible with some other JsrSet? 118 bool is_compatible_with(JsrSet* other); 119 120 // Apply the effect of a single bytecode to the JsrSet. 121 void apply_control(ciTypeFlow* analyzer, 122 ciBytecodeStream* str, 123 StateVector* state); 124 125 // Bring this JsrSet into agreement with this state by removing 126 // any JsrRecords that refer to addresses no longer mentioned in 127 // the state. 128 void apply_state(StateVector* state); 129 130 // What is the cardinality of this set? 131 int size() const { return _set->length(); } 132 133 void print_on(outputStream* st) const PRODUCT_RETURN; 134 }; 135 136 class LocalSet VALUE_OBJ_CLASS_SPEC { 137 private: 138 enum Constants { max = 63 }; 139 uint64_t _bits; 140 public: 141 LocalSet() : _bits(0) {} 142 void add(uint32_t i) { if (i < (uint32_t)max) _bits |= (1LL << i); } 143 void add(LocalSet* ls) { _bits |= ls->_bits; } 144 bool test(uint32_t i) const { return i < (uint32_t)max ? (_bits>>i)&1U : true; } 145 void clear() { _bits = 0; } 146 void print_on(outputStream* st, int limit) const PRODUCT_RETURN; 147 }; 148 149 // Used as a combined index for locals and temps 618 compute_exceptions(); 619 } 620 return _exc_klasses; 621 } 622 623 // Is this Block compatible with a given JsrSet? 624 bool is_compatible_with(JsrSet* other) { 625 return _jsrs->is_compatible_with(other); 626 } 627 628 // Copy the value of our state vector into another. 629 void copy_state_into(StateVector* copy) const { 630 _state->copy_into(copy); 631 } 632 633 // Copy the value of our JsrSet into another 634 void copy_jsrs_into(JsrSet* copy) const { 635 _jsrs->copy_into(copy); 636 } 637 638 // Remove dead address from the state and also from the JsrSet. 639 // The reduces useless cloning for complex jsr/ret constructs. 640 bool delete_dead_addresses(); 641 642 // Meets the start state of this block with another state, destructively 643 // modifying this one. Returns true if any modification takes place. 644 bool meet(const StateVector* incoming) { 645 return state()->meet(incoming); 646 } 647 648 // Ditto, except that the incoming state is coming from an 649 // exception path. This means the stack is replaced by the 650 // appropriate exception type. 651 bool meet_exception(ciInstanceKlass* exc, const StateVector* incoming) { 652 return state()->meet_exception(exc, incoming); 653 } 654 655 // Work list manipulation 656 void set_next(Block* block) { _next = block; } 657 Block* next() const { return _next; } 658 659 void set_on_work_list(bool c) { _on_work_list = c; } 660 bool is_on_work_list() const { return _on_work_list; } 661 |