Mercurial > hg > graal-jvmci-8
comparison src/share/vm/classfile/verifier.cpp @ 24061:b4b7e6bb414d
8161218: Better bytecode loading
Reviewed-by: acorn, mschoene, ctornqvi
Contributed-by: harold.seigel@oracle.com
author | shshahma |
---|---|
date | Tue, 26 Jul 2016 08:23:25 -0400 |
parents | 72a298cbc071 |
children | 02a3d0dcbedd |
comparison
equal
deleted
inserted
replaced
24060:5c22c4afdafb | 24061:b4b7e6bb414d |
---|---|
502 stack_map_table* sm_table = | 502 stack_map_table* sm_table = |
503 stack_map_table::at((address)data->adr_at(0)); | 503 stack_map_table::at((address)data->adr_at(0)); |
504 stack_map_frame* sm_frame = sm_table->entries(); | 504 stack_map_frame* sm_frame = sm_table->entries(); |
505 streamIndentor si2(ss); | 505 streamIndentor si2(ss); |
506 int current_offset = -1; | 506 int current_offset = -1; |
507 // Subtract two from StackMapAttribute length because the length includes | 507 address end_of_sm_table = (address)sm_table + method->stackmap_data()->length(); |
508 // two bytes for number of table entries. | |
509 size_t sm_table_space = method->stackmap_data()->length() - 2; | |
510 for (u2 i = 0; i < sm_table->number_of_entries(); ++i) { | 508 for (u2 i = 0; i < sm_table->number_of_entries(); ++i) { |
511 ss->indent(); | 509 ss->indent(); |
512 size_t sm_frame_size = sm_frame->size(); | 510 if (!sm_frame->verify((address)sm_frame, end_of_sm_table)) { |
513 // If the size of the next stackmap exceeds the length of the entire | |
514 // stackmap table then print a truncated message and return. | |
515 if (sm_frame_size > sm_table_space) { | |
516 sm_frame->print_truncated(ss, current_offset); | 511 sm_frame->print_truncated(ss, current_offset); |
517 return; | 512 return; |
518 } | 513 } |
519 sm_table_space -= sm_frame_size; | |
520 sm_frame->print_on(ss, current_offset); | 514 sm_frame->print_on(ss, current_offset); |
521 ss->cr(); | 515 ss->cr(); |
522 current_offset += sm_frame->offset_delta(); | 516 current_offset += sm_frame->offset_delta(); |
523 sm_frame = sm_frame->next(); | 517 sm_frame = sm_frame->next(); |
524 } | 518 } |