Merge

Tue, 20 Dec 2016 13:04:01 -0800

author
asaha
date
Tue, 20 Dec 2016 13:04:01 -0800
changeset 8781
c938960d9345
parent 8780
2d5100bddeb8
parent 8738
5ee58c7d3938
child 8782
923de3f490e5
child 8915
978b8a997f71

Merge

.hgtags file | annotate | diff | comparison | revisions
     1.1 --- a/.hgtags	Tue Dec 13 12:24:14 2016 -0800
     1.2 +++ b/.hgtags	Tue Dec 20 13:04:01 2016 -0800
     1.3 @@ -930,10 +930,20 @@
     1.4  c2c4db2a42a215c98a4f027edb8bbb00dd62d9b9 jdk8u112-b14
     1.5  b28d012a24cab8f4ceeee0c9d3252969757423ed jdk8u112-b15
     1.6  e134dc1879b72124e478be01680b0646a2fbf585 jdk8u112-b16
     1.7 +87440ed4e1de7753a436f957d35555d8b4e26f1d jdk8u112-b31
     1.8  3b0e5f01891f5ebbf67797b1aae786196f1bb4f6 jdk8u121-b00
     1.9  251a2493b1857f2ff4f11eab2dfd8b2fe8ed441b jdk8u121-b01
    1.10  70c4a50f576a01ec975d0a02b3642ee33db39ed8 jdk8u121-b02
    1.11  fa3bb4153a28b45a7a80cbf1058979b8f1c8b104 jdk8u121-b03
    1.12  35cff8508ca15dc18c598501cab160aee7220d44 jdk8u121-b04
    1.13 +f71447f104ce7b018a08bf1cf385438525744d13 jdk8u121-b05
    1.14 +49a2fc91c46f3d73aac7dbd420a4a007fe453ef8 jdk8u121-b06
    1.15 +f31c7533cfcb55acfb8dc5b31779d3a64708f5ce jdk8u121-b07
    1.16 +02a3d0dcbeddd8507d9a4b1f5a9f83aca75e5acb jdk8u121-b08
    1.17 +8cae1bdbd73cb1a84afad07a8e18467f56560bc4 jdk8u121-b09
    1.18 +f26f6895c9dfb32dfb4c228d69b371d8ab118536 jdk8u121-b10
    1.19 +11f91811e4d7e5ddfaf938dcf386ec8fe5bf7b7c jdk8u121-b11
    1.20 +b132b08b28bf23a26329928cf6b4ffda5857f4d3 jdk8u121-b12
    1.21 +90f94521c3515e5f27af0ab9b31d036e88bb322a jdk8u121-b13
    1.22  c0a1ba0df20fda10ddb8599e888eb56ad98b3874 jdk8u131-b00
    1.23  692bc6b674dcab72453de08ee9da0856a7e41c0f jdk8u141-b00
     2.1 --- a/src/share/vm/classfile/stackMapFrame.cpp	Tue Dec 13 12:24:14 2016 -0800
     2.2 +++ b/src/share/vm/classfile/stackMapFrame.cpp	Tue Dec 20 13:04:01 2016 -0800
     2.3 @@ -1,5 +1,5 @@
     2.4  /*
     2.5 - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
     2.6 + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
     2.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     2.8   *
     2.9   * This code is free software; you can redistribute it and/or modify it
    2.10 @@ -155,47 +155,8 @@
    2.11    return i;
    2.12  }
    2.13  
    2.14 -bool StackMapFrame::has_flag_match_exception(
    2.15 -    const StackMapFrame* target) const {
    2.16 -  // We allow flags of {UninitThis} to assign to {} if-and-only-if the
    2.17 -  // target frame does not depend upon the current type.
    2.18 -  // This is slightly too strict, as we need only enforce that the
    2.19 -  // slots that were initialized by the <init> (the things that were
    2.20 -  // UninitializedThis before initialize_object() converted them) are unused.
    2.21 -  // However we didn't save that information so we'll enforce this upon
    2.22 -  // anything that might have been initialized.  This is a rare situation
    2.23 -  // and javac never generates code that would end up here, but some profilers
    2.24 -  // (such as NetBeans) might, when adding exception handlers in <init>
    2.25 -  // methods to cover the invokespecial instruction.  See 7020118.
    2.26 -
    2.27 -  assert(max_locals() == target->max_locals() &&
    2.28 -         stack_size() == target->stack_size(), "StackMap sizes must match");
    2.29 -
    2.30 -  VerificationType top = VerificationType::top_type();
    2.31 -  VerificationType this_type = verifier()->current_type();
    2.32 -
    2.33 -  if (!flag_this_uninit() || target->flags() != 0) {
    2.34 -    return false;
    2.35 -  }
    2.36 -
    2.37 -  for (int i = 0; i < target->locals_size(); ++i) {
    2.38 -    if (locals()[i] == this_type && target->locals()[i] != top) {
    2.39 -      return false;
    2.40 -    }
    2.41 -  }
    2.42 -
    2.43 -  for (int i = 0; i < target->stack_size(); ++i) {
    2.44 -    if (stack()[i] == this_type && target->stack()[i] != top) {
    2.45 -      return false;
    2.46 -    }
    2.47 -  }
    2.48 -
    2.49 -  return true;
    2.50 -}
    2.51 -
    2.52  bool StackMapFrame::is_assignable_to(
    2.53 -    const StackMapFrame* target, bool is_exception_handler,
    2.54 -    ErrorContext* ctx, TRAPS) const {
    2.55 +    const StackMapFrame* target, ErrorContext* ctx, TRAPS) const {
    2.56    if (_max_locals != target->max_locals()) {
    2.57      *ctx = ErrorContext::locals_size_mismatch(
    2.58          _offset, (StackMapFrame*)this, (StackMapFrame*)target);
    2.59 @@ -226,8 +187,7 @@
    2.60      return false;
    2.61    }
    2.62  
    2.63 -  bool match_flags = (_flags | target->flags()) == target->flags();
    2.64 -  if (match_flags || is_exception_handler && has_flag_match_exception(target)) {
    2.65 +  if ((_flags | target->flags()) == target->flags()) {
    2.66      return true;
    2.67    } else {
    2.68      *ctx = ErrorContext::bad_flags(target->offset(),
     3.1 --- a/src/share/vm/classfile/stackMapFrame.hpp	Tue Dec 13 12:24:14 2016 -0800
     3.2 +++ b/src/share/vm/classfile/stackMapFrame.hpp	Tue Dec 20 13:04:01 2016 -0800
     3.3 @@ -1,5 +1,5 @@
     3.4  /*
     3.5 - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
     3.6 + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
     3.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3.8   *
     3.9   * This code is free software; you can redistribute it and/or modify it
    3.10 @@ -167,8 +167,7 @@
    3.11  
    3.12    // Return true if this stack map frame is assignable to target.
    3.13    bool is_assignable_to(
    3.14 -      const StackMapFrame* target, bool is_exception_handler,
    3.15 -      ErrorContext* ctx, TRAPS) const;
    3.16 +      const StackMapFrame* target, ErrorContext* ctx, TRAPS) const;
    3.17  
    3.18    inline void set_mark() {
    3.19  #ifdef ASSERT
    3.20 @@ -290,8 +289,6 @@
    3.21    int is_assignable_to(
    3.22      VerificationType* src, VerificationType* target, int32_t len, TRAPS) const;
    3.23  
    3.24 -  bool has_flag_match_exception(const StackMapFrame* target) const;
    3.25 -
    3.26    TypeOrigin stack_top_ctx();
    3.27  
    3.28    void print_on(outputStream* str) const;
     4.1 --- a/src/share/vm/classfile/stackMapTable.cpp	Tue Dec 13 12:24:14 2016 -0800
     4.2 +++ b/src/share/vm/classfile/stackMapTable.cpp	Tue Dec 20 13:04:01 2016 -0800
     4.3 @@ -1,5 +1,5 @@
     4.4  /*
     4.5 - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
     4.6 + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
     4.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4.8   *
     4.9   * This code is free software; you can redistribute it and/or modify it
    4.10 @@ -70,26 +70,25 @@
    4.11  
    4.12  bool StackMapTable::match_stackmap(
    4.13      StackMapFrame* frame, int32_t target,
    4.14 -    bool match, bool update, bool handler, ErrorContext* ctx, TRAPS) const {
    4.15 +    bool match, bool update, ErrorContext* ctx, TRAPS) const {
    4.16    int index = get_index_from_offset(target);
    4.17 -  return match_stackmap(frame, target, index, match, update, handler, ctx, THREAD);
    4.18 +  return match_stackmap(frame, target, index, match, update, ctx, THREAD);
    4.19  }
    4.20  
    4.21  // Match and/or update current_frame to the frame in stackmap table with
    4.22  // specified offset and frame index. Return true if the two frames match.
    4.23 -// handler is true if the frame in stackmap_table is for an exception handler.
    4.24  //
    4.25 -// The values of match and update are:                  _match__update__handler
    4.26 +// The values of match and update are:                  _match__update
    4.27  //
    4.28 -// checking a branch target:                             true   false   false
    4.29 -// checking an exception handler:                        true   false   true
    4.30 +// checking a branch target:                             true   false
    4.31 +// checking an exception handler:                        true   false
    4.32  // linear bytecode verification following an
    4.33 -// unconditional branch:                                 false  true    false
    4.34 +// unconditional branch:                                 false  true
    4.35  // linear bytecode verification not following an
    4.36 -// unconditional branch:                                 true   true    false
    4.37 +// unconditional branch:                                 true   true
    4.38  bool StackMapTable::match_stackmap(
    4.39      StackMapFrame* frame, int32_t target, int32_t frame_index,
    4.40 -    bool match, bool update, bool handler, ErrorContext* ctx, TRAPS) const {
    4.41 +    bool match, bool update, ErrorContext* ctx, TRAPS) const {
    4.42    if (frame_index < 0 || frame_index >= _frame_count) {
    4.43      *ctx = ErrorContext::missing_stackmap(frame->offset());
    4.44      frame->verifier()->verify_error(
    4.45 @@ -102,7 +101,7 @@
    4.46    if (match) {
    4.47      // Has direct control flow from last instruction, need to match the two
    4.48      // frames.
    4.49 -    result = frame->is_assignable_to(stackmap_frame, handler,
    4.50 +    result = frame->is_assignable_to(stackmap_frame,
    4.51          ctx, CHECK_VERIFY_(frame->verifier(), result));
    4.52    }
    4.53    if (update) {
    4.54 @@ -126,7 +125,7 @@
    4.55      StackMapFrame* frame, int32_t target, TRAPS) const {
    4.56    ErrorContext ctx;
    4.57    bool match = match_stackmap(
    4.58 -    frame, target, true, false, false, &ctx, CHECK_VERIFY(frame->verifier()));
    4.59 +    frame, target, true, false, &ctx, CHECK_VERIFY(frame->verifier()));
    4.60    if (!match || (target < 0 || target >= _code_length)) {
    4.61      frame->verifier()->verify_error(ctx,
    4.62          "Inconsistent stackmap frames at branch target %d", target);
     5.1 --- a/src/share/vm/classfile/stackMapTable.hpp	Tue Dec 13 12:24:14 2016 -0800
     5.2 +++ b/src/share/vm/classfile/stackMapTable.hpp	Tue Dec 20 13:04:01 2016 -0800
     5.3 @@ -1,5 +1,5 @@
     5.4  /*
     5.5 - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
     5.6 + * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
     5.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5.8   *
     5.9   * This code is free software; you can redistribute it and/or modify it
    5.10 @@ -74,12 +74,12 @@
    5.11    // specified offset. Return true if the two frames match.
    5.12    bool match_stackmap(
    5.13      StackMapFrame* current_frame, int32_t offset,
    5.14 -    bool match, bool update, bool handler, ErrorContext* ctx, TRAPS) const;
    5.15 +    bool match, bool update, ErrorContext* ctx, TRAPS) const;
    5.16    // Match and/or update current_frame to the frame in stackmap table with
    5.17    // specified offset and frame index. Return true if the two frames match.
    5.18    bool match_stackmap(
    5.19      StackMapFrame* current_frame, int32_t offset, int32_t frame_index,
    5.20 -    bool match, bool update, bool handler, ErrorContext* ctx, TRAPS) const;
    5.21 +    bool match, bool update, ErrorContext* ctx, TRAPS) const;
    5.22  
    5.23    // Check jump instructions. Make sure there are no uninitialized
    5.24    // instances on backward branch.
     6.1 --- a/src/share/vm/classfile/verifier.cpp	Tue Dec 13 12:24:14 2016 -0800
     6.2 +++ b/src/share/vm/classfile/verifier.cpp	Tue Dec 20 13:04:01 2016 -0800
     6.3 @@ -1814,7 +1814,7 @@
     6.4        // If matched, current_frame will be updated by this method.
     6.5        bool matches = stackmap_table->match_stackmap(
     6.6          current_frame, this_offset, stackmap_index,
     6.7 -        !no_control_flow, true, false, &ctx, CHECK_VERIFY_(this, 0));
     6.8 +        !no_control_flow, true, &ctx, CHECK_VERIFY_(this, 0));
     6.9        if (!matches) {
    6.10          // report type error
    6.11          verify_error(ctx, "Instruction type does not match stack map");
    6.12 @@ -1861,7 +1861,7 @@
    6.13        }
    6.14        ErrorContext ctx;
    6.15        bool matches = stackmap_table->match_stackmap(
    6.16 -        new_frame, handler_pc, true, false, true, &ctx, CHECK_VERIFY(this));
    6.17 +        new_frame, handler_pc, true, false, &ctx, CHECK_VERIFY(this));
    6.18        if (!matches) {
    6.19          verify_error(ctx, "Stack map does not match the one at "
    6.20              "exception handler %d", handler_pc);
     7.1 --- a/test/runtime/handlerInTry/LoadHandlerInTry.java	Tue Dec 13 12:24:14 2016 -0800
     7.2 +++ b/test/runtime/handlerInTry/LoadHandlerInTry.java	Tue Dec 20 13:04:01 2016 -0800
     7.3 @@ -1,5 +1,5 @@
     7.4  /*
     7.5 - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
     7.6 + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
     7.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     7.8   *
     7.9   * This code is free software; you can redistribute it and/or modify it
    7.10 @@ -24,7 +24,7 @@
    7.11  /*
    7.12   * @test
    7.13   * @bug 8075118
    7.14 - * @summary Allow a ctor to call super() from a switch bytecode.
    7.15 + * @summary JVM stuck in infinite loop during verification
    7.16   * @compile HandlerInTry.jasm
    7.17   * @compile IsolatedHandlerInTry.jasm
    7.18   * @run main/othervm -Xverify:all LoadHandlerInTry
    7.19 @@ -70,9 +70,10 @@
    7.20          System.out.println("Regression test for bug 8075118");
    7.21          try {
    7.22              Class newClass = Class.forName("HandlerInTry");
    7.23 -        } catch (Exception e) {
    7.24 -            System.out.println("Failed: Exception was thrown: " + e.toString());
    7.25 -            throw e;
    7.26 +            throw new RuntimeException(
    7.27 +                 "Failed to throw VerifyError for HandlerInTry");
    7.28 +        } catch (java.lang.VerifyError e) {
    7.29 +            System.out.println("Passed: VerifyError exception was thrown");
    7.30          }
    7.31  
    7.32          try {

mercurial