190 } |
190 } |
191 |
191 |
192 return buf; |
192 return buf; |
193 } |
193 } |
194 |
194 |
195 int Method::fast_exception_handler_bci_for(KlassHandle ex_klass, int throw_bci, TRAPS) { |
195 int Method::fast_exception_handler_bci_for(methodHandle mh, KlassHandle ex_klass, int throw_bci, TRAPS) { |
196 // exception table holds quadruple entries of the form (beg_bci, end_bci, handler_bci, klass_index) |
196 // exception table holds quadruple entries of the form (beg_bci, end_bci, handler_bci, klass_index) |
197 // access exception table |
197 // access exception table |
198 ExceptionTable table(this); |
198 ExceptionTable table(mh()); |
199 int length = table.length(); |
199 int length = table.length(); |
200 // iterate through all entries sequentially |
200 // iterate through all entries sequentially |
201 constantPoolHandle pool(THREAD, constants()); |
201 constantPoolHandle pool(THREAD, mh->constants()); |
202 for (int i = 0; i < length; i ++) { |
202 for (int i = 0; i < length; i ++) { |
203 //reacquire the table in case a GC happened |
203 //reacquire the table in case a GC happened |
204 ExceptionTable table(this); |
204 ExceptionTable table(mh()); |
205 int beg_bci = table.start_pc(i); |
205 int beg_bci = table.start_pc(i); |
206 int end_bci = table.end_pc(i); |
206 int end_bci = table.end_pc(i); |
207 assert(beg_bci <= end_bci, "inconsistent exception table"); |
207 assert(beg_bci <= end_bci, "inconsistent exception table"); |
208 if (beg_bci <= throw_bci && throw_bci < end_bci) { |
208 if (beg_bci <= throw_bci && throw_bci < end_bci) { |
209 // exception handler bci range covers throw_bci => investigate further |
209 // exception handler bci range covers throw_bci => investigate further |