mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8161218: Better bytecode loading
Reviewed-by: acorn, mschoene, ctornqvi
This commit is contained in:
parent
2ec4f5a76a
commit
6beed1f844
1 changed files with 2 additions and 8 deletions
|
@ -541,19 +541,13 @@ void ErrorContext::stackmap_details(outputStream* ss, const Method* method) cons
|
||||||
stack_map_frame* sm_frame = sm_table->entries();
|
stack_map_frame* sm_frame = sm_table->entries();
|
||||||
streamIndentor si2(ss);
|
streamIndentor si2(ss);
|
||||||
int current_offset = -1;
|
int current_offset = -1;
|
||||||
// Subtract two from StackMapAttribute length because the length includes
|
address end_of_sm_table = (address)sm_table + method->stackmap_data()->length();
|
||||||
// two bytes for number of table entries.
|
|
||||||
size_t sm_table_space = method->stackmap_data()->length() - 2;
|
|
||||||
for (u2 i = 0; i < sm_table->number_of_entries(); ++i) {
|
for (u2 i = 0; i < sm_table->number_of_entries(); ++i) {
|
||||||
ss->indent();
|
ss->indent();
|
||||||
size_t sm_frame_size = sm_frame->size();
|
if (!sm_frame->verify((address)sm_frame, end_of_sm_table)) {
|
||||||
// If the size of the next stackmap exceeds the length of the entire
|
|
||||||
// stackmap table then print a truncated message and return.
|
|
||||||
if (sm_frame_size > sm_table_space) {
|
|
||||||
sm_frame->print_truncated(ss, current_offset);
|
sm_frame->print_truncated(ss, current_offset);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sm_table_space -= sm_frame_size;
|
|
||||||
sm_frame->print_on(ss, current_offset);
|
sm_frame->print_on(ss, current_offset);
|
||||||
ss->cr();
|
ss->cr();
|
||||||
current_offset += sm_frame->offset_delta();
|
current_offset += sm_frame->offset_delta();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue