comparison src/share/vm/classfile/verifier.cpp @ 23974:f13e777eb255

Merge with jdk8u111-b14
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Wed, 16 Nov 2016 12:32:54 -0800
parents dd9cc155639c e4525db27263
children 9b69cec6d01b
comparison
equal deleted inserted replaced
23792:3953f8820df8 23974:f13e777eb255
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
508 // two bytes for number of table entries.
509 size_t sm_table_space = method->stackmap_data()->length() - 2;
507 for (u2 i = 0; i < sm_table->number_of_entries(); ++i) { 510 for (u2 i = 0; i < sm_table->number_of_entries(); ++i) {
508 ss->indent(); 511 ss->indent();
512 size_t sm_frame_size = sm_frame->size();
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);
517 return;
518 }
519 sm_table_space -= sm_frame_size;
509 sm_frame->print_on(ss, current_offset); 520 sm_frame->print_on(ss, current_offset);
510 ss->cr(); 521 ss->cr();
511 current_offset += sm_frame->offset_delta(); 522 current_offset += sm_frame->offset_delta();
512 sm_frame = sm_frame->next(); 523 sm_frame = sm_frame->next();
513 } 524 }
2321 case Bytecodes::_if_acmpne: 2332 case Bytecodes::_if_acmpne:
2322 case Bytecodes::_ifnull: 2333 case Bytecodes::_ifnull:
2323 case Bytecodes::_ifnonnull: 2334 case Bytecodes::_ifnonnull:
2324 target = bcs.dest(); 2335 target = bcs.dest();
2325 if (visited_branches->contains(bci)) { 2336 if (visited_branches->contains(bci)) {
2326 if (bci_stack->is_empty()) return true; 2337 if (bci_stack->is_empty()) {
2327 // Pop a bytecode starting offset and scan from there. 2338 if (handler_stack->is_empty()) {
2328 bcs.set_start(bci_stack->pop()); 2339 return true;
2340 } else {
2341 // Parse the catch handlers for try blocks containing athrow.
2342 bcs.set_start(handler_stack->pop());
2343 }
2344 } else {
2345 // Pop a bytecode starting offset and scan from there.
2346 bcs.set_start(bci_stack->pop());
2347 }
2329 } else { 2348 } else {
2330 if (target > bci) { // forward branch 2349 if (target > bci) { // forward branch
2331 if (target >= code_length) return false; 2350 if (target >= code_length) return false;
2332 // Push the branch target onto the stack. 2351 // Push the branch target onto the stack.
2333 bci_stack->push(target); 2352 bci_stack->push(target);
2346 2365
2347 case Bytecodes::_goto: 2366 case Bytecodes::_goto:
2348 case Bytecodes::_goto_w: 2367 case Bytecodes::_goto_w:
2349 target = (opcode == Bytecodes::_goto ? bcs.dest() : bcs.dest_w()); 2368 target = (opcode == Bytecodes::_goto ? bcs.dest() : bcs.dest_w());
2350 if (visited_branches->contains(bci)) { 2369 if (visited_branches->contains(bci)) {
2351 if (bci_stack->is_empty()) return true; 2370 if (bci_stack->is_empty()) {
2352 // Been here before, pop new starting offset from stack. 2371 if (handler_stack->is_empty()) {
2353 bcs.set_start(bci_stack->pop()); 2372 return true;
2373 } else {
2374 // Parse the catch handlers for try blocks containing athrow.
2375 bcs.set_start(handler_stack->pop());
2376 }
2377 } else {
2378 // Been here before, pop new starting offset from stack.
2379 bcs.set_start(bci_stack->pop());
2380 }
2354 } else { 2381 } else {
2355 if (target >= code_length) return false; 2382 if (target >= code_length) return false;
2356 // Continue scanning from the target onward. 2383 // Continue scanning from the target onward.
2357 bcs.set_start(target); 2384 bcs.set_start(target);
2358 // Record target so we don't branch here again. 2385 // Record target so we don't branch here again.