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