1 /* |
1 /* |
2 * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
77 // Easy to compute, so fill them in now. |
77 // Easy to compute, so fill them in now. |
78 _max_stack = h_m()->max_stack(); |
78 _max_stack = h_m()->max_stack(); |
79 _max_locals = h_m()->max_locals(); |
79 _max_locals = h_m()->max_locals(); |
80 _code_size = h_m()->code_size(); |
80 _code_size = h_m()->code_size(); |
81 _intrinsic_id = h_m()->intrinsic_id(); |
81 _intrinsic_id = h_m()->intrinsic_id(); |
82 _handler_count = h_m()->exception_table()->length() / 4; |
82 _handler_count = h_m()->exception_table_length(); |
83 _uses_monitors = h_m()->access_flags().has_monitor_bytecodes(); |
83 _uses_monitors = h_m()->access_flags().has_monitor_bytecodes(); |
84 _balanced_monitors = !_uses_monitors || h_m()->access_flags().is_monitor_matching(); |
84 _balanced_monitors = !_uses_monitors || h_m()->access_flags().is_monitor_matching(); |
85 _is_c1_compilable = !h_m()->is_not_c1_compilable(); |
85 _is_c1_compilable = !h_m()->is_not_c1_compilable(); |
86 _is_c2_compilable = !h_m()->is_not_c2_compilable(); |
86 _is_c2_compilable = !h_m()->is_not_c2_compilable(); |
87 // Lazy fields, filled in on demand. Require allocation. |
87 // Lazy fields, filled in on demand. Require allocation. |
196 } |
196 } |
197 } |
197 } |
198 } |
198 } |
199 |
199 |
200 // And load the exception table. |
200 // And load the exception table. |
201 typeArrayOop exc_table = me->exception_table(); |
201 ExceptionTable exc_table(me); |
202 |
202 |
203 // Allocate one extra spot in our list of exceptions. This |
203 // Allocate one extra spot in our list of exceptions. This |
204 // last entry will be used to represent the possibility that |
204 // last entry will be used to represent the possibility that |
205 // an exception escapes the method. See ciExceptionHandlerStream |
205 // an exception escapes the method. See ciExceptionHandlerStream |
206 // for details. |
206 // for details. |
207 _exception_handlers = |
207 _exception_handlers = |
208 (ciExceptionHandler**)arena->Amalloc(sizeof(ciExceptionHandler*) |
208 (ciExceptionHandler**)arena->Amalloc(sizeof(ciExceptionHandler*) |
209 * (_handler_count + 1)); |
209 * (_handler_count + 1)); |
210 if (_handler_count > 0) { |
210 if (_handler_count > 0) { |
211 for (int i=0; i<_handler_count; i++) { |
211 for (int i=0; i<_handler_count; i++) { |
212 int base = i*4; |
|
213 _exception_handlers[i] = new (arena) ciExceptionHandler( |
212 _exception_handlers[i] = new (arena) ciExceptionHandler( |
214 holder(), |
213 holder(), |
215 /* start */ exc_table->int_at(base), |
214 /* start */ exc_table.start_pc(i), |
216 /* limit */ exc_table->int_at(base+1), |
215 /* limit */ exc_table.end_pc(i), |
217 /* goto pc */ exc_table->int_at(base+2), |
216 /* goto pc */ exc_table.handler_pc(i), |
218 /* cp index */ exc_table->int_at(base+3)); |
217 /* cp index */ exc_table.catch_type_index(i)); |
219 } |
218 } |
220 } |
219 } |
221 |
220 |
222 // Put an entry at the end of our list to represent the possibility |
221 // Put an entry at the end of our list to represent the possibility |
223 // of exceptional exit. |
222 // of exceptional exit. |