src/share/vm/classfile/stackMapTable.cpp

changeset 6866
2993491d47df
parent 6761
aff11567504c
child 6872
c77d5db18942
     1.1 --- a/src/share/vm/classfile/stackMapTable.cpp	Tue Aug 05 13:36:03 2014 +0100
     1.2 +++ b/src/share/vm/classfile/stackMapTable.cpp	Sat Aug 02 16:28:59 2014 -0400
     1.3 @@ -70,24 +70,26 @@
     1.4  
     1.5  bool StackMapTable::match_stackmap(
     1.6      StackMapFrame* frame, int32_t target,
     1.7 -    bool match, bool update, ErrorContext* ctx, TRAPS) const {
     1.8 +    bool match, bool update, bool handler, ErrorContext* ctx, TRAPS) const {
     1.9    int index = get_index_from_offset(target);
    1.10 -  return match_stackmap(frame, target, index, match, update, ctx, THREAD);
    1.11 +  return match_stackmap(frame, target, index, match, update, handler, ctx, THREAD);
    1.12  }
    1.13  
    1.14  // Match and/or update current_frame to the frame in stackmap table with
    1.15  // specified offset and frame index. Return true if the two frames match.
    1.16 +// handler is true if the frame in stackmap_table is for an exception handler.
    1.17  //
    1.18 -// The values of match and update are:                  _match__update_
    1.19 +// The values of match and update are:                  _match__update__handler
    1.20  //
    1.21 -// checking a branch target/exception handler:           true   false
    1.22 +// checking a branch target:                             true   false   false
    1.23 +// checking an exception handler:                        true   false   true
    1.24  // linear bytecode verification following an
    1.25 -// unconditional branch:                                 false  true
    1.26 +// unconditional branch:                                 false  true    false
    1.27  // linear bytecode verification not following an
    1.28 -// unconditional branch:                                 true   true
    1.29 +// unconditional branch:                                 true   true    false
    1.30  bool StackMapTable::match_stackmap(
    1.31      StackMapFrame* frame, int32_t target, int32_t frame_index,
    1.32 -    bool match, bool update, ErrorContext* ctx, TRAPS) const {
    1.33 +    bool match, bool update, bool handler, ErrorContext* ctx, TRAPS) const {
    1.34    if (frame_index < 0 || frame_index >= _frame_count) {
    1.35      *ctx = ErrorContext::missing_stackmap(frame->offset());
    1.36      frame->verifier()->verify_error(
    1.37 @@ -98,11 +100,9 @@
    1.38    StackMapFrame *stackmap_frame = _frame_array[frame_index];
    1.39    bool result = true;
    1.40    if (match) {
    1.41 -    // when checking handler target, match == true && update == false
    1.42 -    bool is_exception_handler = !update;
    1.43      // Has direct control flow from last instruction, need to match the two
    1.44      // frames.
    1.45 -    result = frame->is_assignable_to(stackmap_frame, is_exception_handler,
    1.46 +    result = frame->is_assignable_to(stackmap_frame, handler,
    1.47          ctx, CHECK_VERIFY_(frame->verifier(), result));
    1.48    }
    1.49    if (update) {
    1.50 @@ -126,7 +126,7 @@
    1.51      StackMapFrame* frame, int32_t target, TRAPS) const {
    1.52    ErrorContext ctx;
    1.53    bool match = match_stackmap(
    1.54 -    frame, target, true, false, &ctx, CHECK_VERIFY(frame->verifier()));
    1.55 +    frame, target, true, false, false, &ctx, CHECK_VERIFY(frame->verifier()));
    1.56    if (!match || (target < 0 || target >= _code_length)) {
    1.57      frame->verifier()->verify_error(ctx,
    1.58          "Inconsistent stackmap frames at branch target %d", target);
    1.59 @@ -134,7 +134,6 @@
    1.60    }
    1.61    // check if uninitialized objects exist on backward branches
    1.62    check_new_object(frame, target, CHECK_VERIFY(frame->verifier()));
    1.63 -  frame->verifier()->update_furthest_jump(target);
    1.64  }
    1.65  
    1.66  void StackMapTable::check_new_object(

mercurial