Merge

Thu, 22 May 2014 11:09:06 -0700

author
asaha
date
Thu, 22 May 2014 11:09:06 -0700
changeset 6779
364b73402247
parent 6663
382a82b0a3e7
parent 6778
7e4ae023277b
child 6781
da65bbf6f89e

Merge

.hgtags file | annotate | diff | comparison | revisions
make/hotspot_version file | annotate | diff | comparison | revisions
src/os/bsd/vm/os_bsd.cpp file | annotate | diff | comparison | revisions
src/os/linux/vm/os_linux.cpp file | annotate | diff | comparison | revisions
src/os/solaris/vm/os_solaris.cpp file | annotate | diff | comparison | revisions
src/os/windows/vm/os_windows.cpp file | annotate | diff | comparison | revisions
src/share/vm/classfile/classFileParser.cpp file | annotate | diff | comparison | revisions
src/share/vm/classfile/verifier.cpp file | annotate | diff | comparison | revisions
src/share/vm/compiler/compileBroker.cpp file | annotate | diff | comparison | revisions
src/share/vm/oops/klassVtable.cpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/os.hpp file | annotate | diff | comparison | revisions
src/share/vm/utilities/vmError.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/.hgtags	Tue May 13 23:17:52 2014 -0700
     1.2 +++ b/.hgtags	Thu May 22 11:09:06 2014 -0700
     1.3 @@ -428,6 +428,7 @@
     1.4  e5561d89fe8bfc79cd6c8fcc36d270cc6a49ec6e jdk8u5-b02
     1.5  2f9eb9fcab6c42c8c84ddb44170ea33235116d84 jdk8u5-b03
     1.6  5ac720d47ab83f8eb2f5fe3641667823a0298f41 jdk8u5-b04
     1.7 +b90de55aca30678ab0fec05d6a61bb3468b783d2 jdk8u11-b00
     1.8  b90de55aca30678ab0fec05d6a61bb3468b783d2 jdk8u5-b05
     1.9  956c0e048ef29ee9a8026fb05858abe64b4e0ceb jdk8u5-b06
    1.10  46fa2940e6861df18a107b6b83a2df85239e5ec7 jdk8u5-b07
    1.11 @@ -437,6 +438,15 @@
    1.12  17a75e692af397532e2b296b24f6b9b6c239c633 jdk8u5-b11
    1.13  9b289963cb9a14636fbe8faaa2dd6d3678464a7b jdk8u5-b12
    1.14  8a67179106085689906732013a282efeeb9bd5f4 jdk8u5-b13
    1.15 +f0d759a6a2309a1c149d530b29db24eda885f267 jdk8u11-b01
    1.16 +3c079aebb516765784dd8097887daadda5a76ac1 jdk8u11-b02
    1.17 +0037e964ce486c009984171f004259263628079f jdk8u11-b03
    1.18 +4c40343ecdb33fe046833fe4b8970fd29859c4ad jdk8u11-b04
    1.19 +a4d44dfb7d30eea54bc172e4429a655454ae0bbf jdk8u11-b05
    1.20 +b73ee2b9027c4183e520b2c0884d785ef9e539cf jdk8u11-b06
    1.21 +561045d225990b8423af11fd80d2d704954c89c2 jdk8u11-b07
    1.22 +af747c288b0f379448bebf56e2982f50caac6972 jdk8u11-b08
    1.23 +34de1e8eeabbcc6e690f92766fd619beb9f3f049 jdk8u11-b09
    1.24  412d3b5fe90e54c0ff9d9ac7374b98607c561d5a hs25.20-b01
    1.25  4638c4d7ff106db0f29ef7f18b128dd7e69bc470 hs25.20-b02
    1.26  e56d11f8cc2158d4280f80e56d196193349c150a hs25.20-b03
     2.1 --- a/src/os/bsd/vm/os_bsd.cpp	Tue May 13 23:17:52 2014 -0700
     2.2 +++ b/src/os/bsd/vm/os_bsd.cpp	Thu May 22 11:09:06 2014 -0700
     2.3 @@ -1,5 +1,5 @@
     2.4  /*
     2.5 - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
     2.6 + * Copyright (c) 1999, 2014, 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 @@ -1129,10 +1129,6 @@
    2.11    ::abort();
    2.12  }
    2.13  
    2.14 -// unused on bsd for now.
    2.15 -void os::set_error_file(const char *logfile) {}
    2.16 -
    2.17 -
    2.18  // This method is a copy of JDK's sysGetLastErrorString
    2.19  // from src/solaris/hpi/src/system_md.c
    2.20  
    2.21 @@ -1787,6 +1783,7 @@
    2.22          // determine if this is a legacy image or modules image
    2.23          // modules image doesn't have "jre" subdirectory
    2.24          len = strlen(buf);
    2.25 +        assert(len < buflen, "Ran out of buffer space");
    2.26          jrelib_p = buf + len;
    2.27  
    2.28          // Add the appropriate library subdir
    2.29 @@ -1820,7 +1817,7 @@
    2.30      }
    2.31    }
    2.32  
    2.33 -  strcpy(saved_jvm_path, buf);
    2.34 +  strncpy(saved_jvm_path, buf, MAXPATHLEN);
    2.35  }
    2.36  
    2.37  void os::print_jni_name_prefix_on(outputStream* st, int args_size) {
     3.1 --- a/src/os/linux/vm/os_linux.cpp	Tue May 13 23:17:52 2014 -0700
     3.2 +++ b/src/os/linux/vm/os_linux.cpp	Thu May 22 11:09:06 2014 -0700
     3.3 @@ -1548,9 +1548,6 @@
     3.4    ::abort();
     3.5  }
     3.6  
     3.7 -// unused on linux for now.
     3.8 -void os::set_error_file(const char *logfile) {}
     3.9 -
    3.10  
    3.11  // This method is a copy of JDK's sysGetLastErrorString
    3.12  // from src/solaris/hpi/src/system_md.c
    3.13 @@ -2339,6 +2336,7 @@
    3.14          // determine if this is a legacy image or modules image
    3.15          // modules image doesn't have "jre" subdirectory
    3.16          len = strlen(buf);
    3.17 +        assert(len < buflen, "Ran out of buffer room");
    3.18          jrelib_p = buf + len;
    3.19          snprintf(jrelib_p, buflen-len, "/jre/lib/%s", cpu_arch);
    3.20          if (0 != access(buf, F_OK)) {
    3.21 @@ -2359,7 +2357,7 @@
    3.22      }
    3.23    }
    3.24  
    3.25 -  strcpy(saved_jvm_path, buf);
    3.26 +  strncpy(saved_jvm_path, buf, MAXPATHLEN);
    3.27  }
    3.28  
    3.29  void os::print_jni_name_prefix_on(outputStream* st, int args_size) {
     4.1 --- a/src/os/solaris/vm/os_solaris.cpp	Tue May 13 23:17:52 2014 -0700
     4.2 +++ b/src/os/solaris/vm/os_solaris.cpp	Thu May 22 11:09:06 2014 -0700
     4.3 @@ -1741,9 +1741,6 @@
     4.4    ::abort(); // dump core (for debugging)
     4.5  }
     4.6  
     4.7 -// unused
     4.8 -void os::set_error_file(const char *logfile) {}
     4.9 -
    4.10  // DLL functions
    4.11  
    4.12  const char* os::dll_file_extension() { return ".so"; }
    4.13 @@ -2387,6 +2384,7 @@
    4.14          // determine if this is a legacy image or modules image
    4.15          // modules image doesn't have "jre" subdirectory
    4.16          len = strlen(buf);
    4.17 +        assert(len < buflen, "Ran out of buffer space");
    4.18          jrelib_p = buf + len;
    4.19          snprintf(jrelib_p, buflen-len, "/jre/lib/%s", cpu_arch);
    4.20          if (0 != access(buf, F_OK)) {
    4.21 @@ -2405,7 +2403,7 @@
    4.22      }
    4.23    }
    4.24  
    4.25 -  strcpy(saved_jvm_path, buf);
    4.26 +  strncpy(saved_jvm_path, buf, MAXPATHLEN);
    4.27  }
    4.28  
    4.29  
     5.1 --- a/src/os/windows/vm/os_windows.cpp	Tue May 13 23:17:52 2014 -0700
     5.2 +++ b/src/os/windows/vm/os_windows.cpp	Thu May 22 11:09:06 2014 -0700
     5.3 @@ -1,5 +1,5 @@
     5.4  /*
     5.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     5.6 + * Copyright (c) 1997, 2014, 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 @@ -1819,7 +1819,8 @@
    5.11       // libjvm.so is installed there (append a fake suffix
    5.12       // hotspot/libjvm.so).
    5.13       char* java_home_var = ::getenv("JAVA_HOME");
    5.14 -     if (java_home_var != NULL && java_home_var[0] != 0) {
    5.15 +     if (java_home_var != NULL && java_home_var[0] != 0 &&
    5.16 +         strlen(java_home_var) < (size_t)buflen) {
    5.17  
    5.18          strncpy(buf, java_home_var, buflen);
    5.19  
    5.20 @@ -1837,9 +1838,9 @@
    5.21    }
    5.22  
    5.23    if(buf[0] == '\0') {
    5.24 -  GetModuleFileName(vm_lib_handle, buf, buflen);
    5.25 -  }
    5.26 -  strcpy(saved_jvm_path, buf);
    5.27 +    GetModuleFileName(vm_lib_handle, buf, buflen);
    5.28 +  }
    5.29 +  strncpy(saved_jvm_path, buf, MAX_PATH);
    5.30  }
    5.31  
    5.32  
    5.33 @@ -2290,19 +2291,8 @@
    5.34        }
    5.35  
    5.36  */
    5.37 -#endif //_WIN64
    5.38 -
    5.39 -
    5.40 -// Fatal error reporting is single threaded so we can make this a
    5.41 -// static and preallocated.  If it's more than MAX_PATH silently ignore
    5.42 -// it.
    5.43 -static char saved_error_file[MAX_PATH] = {0};
    5.44 -
    5.45 -void os::set_error_file(const char *logfile) {
    5.46 -  if (strlen(logfile) <= MAX_PATH) {
    5.47 -    strncpy(saved_error_file, logfile, MAX_PATH);
    5.48 -  }
    5.49 -}
    5.50 +#endif // _WIN64
    5.51 +
    5.52  
    5.53  static inline void report_error(Thread* t, DWORD exception_code,
    5.54                                  address addr, void* siginfo, void* context) {
     6.1 --- a/src/share/vm/classfile/classFileParser.cpp	Tue May 13 23:17:52 2014 -0700
     6.2 +++ b/src/share/vm/classfile/classFileParser.cpp	Thu May 22 11:09:06 2014 -0700
     6.3 @@ -931,7 +931,7 @@
     6.4              "Wrong size %u for field's Signature attribute in class file %s",
     6.5              attribute_length, CHECK);
     6.6          }
     6.7 -        generic_signature_index = cfs->get_u2(CHECK);
     6.8 +        generic_signature_index = parse_generic_signature_attribute(CHECK);
     6.9        } else if (attribute_name == vmSymbols::tag_runtime_visible_annotations()) {
    6.10          runtime_visible_annotations_length = attribute_length;
    6.11          runtime_visible_annotations = cfs->get_u1_buffer();
    6.12 @@ -2305,8 +2305,7 @@
    6.13              "Invalid Signature attribute length %u in class file %s",
    6.14              method_attribute_length, CHECK_(nullHandle));
    6.15          }
    6.16 -        cfs->guarantee_more(2, CHECK_(nullHandle));  // generic_signature_index
    6.17 -        generic_signature_index = cfs->get_u2_fast();
    6.18 +        generic_signature_index = parse_generic_signature_attribute(CHECK_(nullHandle));
    6.19        } else if (method_attribute_name == vmSymbols::tag_runtime_visible_annotations()) {
    6.20          runtime_visible_annotations_length = method_attribute_length;
    6.21          runtime_visible_annotations = cfs->get_u1_buffer();
    6.22 @@ -2616,6 +2615,17 @@
    6.23    return method_ordering;
    6.24  }
    6.25  
    6.26 +// Parse generic_signature attribute for methods and fields
    6.27 +u2 ClassFileParser::parse_generic_signature_attribute(TRAPS) {
    6.28 +  ClassFileStream* cfs = stream();
    6.29 +  cfs->guarantee_more(2, CHECK_0);  // generic_signature_index
    6.30 +  u2 generic_signature_index = cfs->get_u2_fast();
    6.31 +  check_property(
    6.32 +    valid_symbol_at(generic_signature_index),
    6.33 +    "Invalid Signature attribute at constant pool index %u in class file %s",
    6.34 +    generic_signature_index, CHECK_0);
    6.35 +  return generic_signature_index;
    6.36 +}
    6.37  
    6.38  void ClassFileParser::parse_classfile_sourcefile_attribute(TRAPS) {
    6.39    ClassFileStream* cfs = stream();
    6.40 @@ -2770,18 +2780,19 @@
    6.41    ClassFileStream* cfs = stream();
    6.42    u1* current_start = cfs->current();
    6.43  
    6.44 -  cfs->guarantee_more(2, CHECK);  // length
    6.45 -  int attribute_array_length = cfs->get_u2_fast();
    6.46 -
    6.47 -  guarantee_property(_max_bootstrap_specifier_index < attribute_array_length,
    6.48 -                     "Short length on BootstrapMethods in class file %s",
    6.49 -                     CHECK);
    6.50 -
    6.51    guarantee_property(attribute_byte_length > sizeof(u2),
    6.52                       "Invalid BootstrapMethods attribute length %u in class file %s",
    6.53                       attribute_byte_length,
    6.54                       CHECK);
    6.55  
    6.56 +  cfs->guarantee_more(attribute_byte_length, CHECK);
    6.57 +
    6.58 +  int attribute_array_length = cfs->get_u2_fast();
    6.59 +
    6.60 +  guarantee_property(_max_bootstrap_specifier_index < attribute_array_length,
    6.61 +                     "Short length on BootstrapMethods in class file %s",
    6.62 +                     CHECK);
    6.63 +
    6.64    // The attribute contains a counted array of counted tuples of shorts,
    6.65    // represending bootstrap specifiers:
    6.66    //    length*{bootstrap_method_index, argument_count*{argument_index}}
     7.1 --- a/src/share/vm/classfile/classFileParser.hpp	Tue May 13 23:17:52 2014 -0700
     7.2 +++ b/src/share/vm/classfile/classFileParser.hpp	Thu May 22 11:09:06 2014 -0700
     7.3 @@ -1,5 +1,5 @@
     7.4  /*
     7.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     7.6 + * Copyright (c) 1997, 2014, 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 @@ -266,6 +266,7 @@
    7.11    u1* parse_stackmap_table(u4 code_attribute_length, TRAPS);
    7.12  
    7.13    // Classfile attribute parsing
    7.14 +  u2 parse_generic_signature_attribute(TRAPS);
    7.15    void parse_classfile_sourcefile_attribute(TRAPS);
    7.16    void parse_classfile_source_debug_extension_attribute(int length, TRAPS);
    7.17    u2   parse_classfile_inner_classes_attribute(u1* inner_classes_attribute_start,
     8.1 --- a/src/share/vm/classfile/stackMapTable.cpp	Tue May 13 23:17:52 2014 -0700
     8.2 +++ b/src/share/vm/classfile/stackMapTable.cpp	Thu May 22 11:09:06 2014 -0700
     8.3 @@ -1,5 +1,5 @@
     8.4  /*
     8.5 - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
     8.6 + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
     8.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     8.8   *
     8.9   * This code is free software; you can redistribute it and/or modify it
    8.10 @@ -134,6 +134,7 @@
    8.11    }
    8.12    // check if uninitialized objects exist on backward branches
    8.13    check_new_object(frame, target, CHECK_VERIFY(frame->verifier()));
    8.14 +  frame->verifier()->update_furthest_jump(target);
    8.15  }
    8.16  
    8.17  void StackMapTable::check_new_object(
     9.1 --- a/src/share/vm/classfile/verifier.cpp	Tue May 13 23:17:52 2014 -0700
     9.2 +++ b/src/share/vm/classfile/verifier.cpp	Thu May 22 11:09:06 2014 -0700
     9.3 @@ -632,6 +632,9 @@
     9.4    bool no_control_flow = false; // Set to true when there is no direct control
     9.5                                  // flow from current instruction to the next
     9.6                                  // instruction in sequence
     9.7 +
     9.8 +  set_furthest_jump(0);
     9.9 +
    9.10    Bytecodes::Code opcode;
    9.11    while (!bcs.is_last_bytecode()) {
    9.12      // Check for recursive re-verification before each bytecode.
    9.13 @@ -2245,6 +2248,29 @@
    9.14            "Bad <init> method call");
    9.15        return;
    9.16      }
    9.17 +
    9.18 +    // Make sure that this call is not jumped over.
    9.19 +    if (bci < furthest_jump()) {
    9.20 +      verify_error(ErrorContext::bad_code(bci),
    9.21 +                   "Bad <init> method call from inside of a branch");
    9.22 +      return;
    9.23 +    }
    9.24 +
    9.25 +    // Make sure that this call is not done from within a TRY block because
    9.26 +    // that can result in returning an incomplete object.  Simply checking
    9.27 +    // (bci >= start_pc) also ensures that this call is not done after a TRY
    9.28 +    // block.  That is also illegal because this call must be the first Java
    9.29 +    // statement in the constructor.
    9.30 +    ExceptionTable exhandlers(_method());
    9.31 +    int exlength = exhandlers.length();
    9.32 +    for(int i = 0; i < exlength; i++) {
    9.33 +      if (bci >= exhandlers.start_pc(i)) {
    9.34 +        verify_error(ErrorContext::bad_code(bci),
    9.35 +                     "Bad <init> method call from after the start of a try block");
    9.36 +        return;
    9.37 +      }
    9.38 +    }
    9.39 +
    9.40      current_frame->initialize_object(type, current_type());
    9.41      *this_uninit = true;
    9.42    } else if (type.is_uninitialized()) {
    9.43 @@ -2280,8 +2306,12 @@
    9.44          ref_class_type.name(), CHECK_VERIFY(this));
    9.45        Method* m = InstanceKlass::cast(ref_klass)->uncached_lookup_method(
    9.46          vmSymbols::object_initializer_name(),
    9.47 -        cp->signature_ref_at(bcs->get_index_u2()),
    9.48 -        Klass::normal);
    9.49 +        cp->signature_ref_at(bcs->get_index_u2()), Klass::normal);
    9.50 +      if (m == NULL) {
    9.51 +        verify_error(ErrorContext::bad_code(bci),
    9.52 +            "Call to missing <init> method");
    9.53 +        return;
    9.54 +      }
    9.55        instanceKlassHandle mh(THREAD, m->method_holder());
    9.56        if (m->is_protected() && !mh->is_same_class_package(_klass())) {
    9.57          bool assignable = current_type().is_assignable_from(
    10.1 --- a/src/share/vm/classfile/verifier.hpp	Tue May 13 23:17:52 2014 -0700
    10.2 +++ b/src/share/vm/classfile/verifier.hpp	Thu May 22 11:09:06 2014 -0700
    10.3 @@ -1,5 +1,5 @@
    10.4  /*
    10.5 - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
    10.6 + * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
    10.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    10.8   *
    10.9   * This code is free software; you can redistribute it and/or modify it
   10.10 @@ -258,6 +258,9 @@
   10.11  
   10.12    ErrorContext _error_context;  // contains information about an error
   10.13  
   10.14 +  // Used to detect illegal jumps over calls to super() nd this() in ctors.
   10.15 +  int32_t _furthest_jump;
   10.16 +
   10.17    void verify_method(methodHandle method, TRAPS);
   10.18    char* generate_code_data(methodHandle m, u4 code_length, TRAPS);
   10.19    void verify_exception_handler_table(u4 code_length, char* code_data,
   10.20 @@ -403,6 +406,20 @@
   10.21    Symbol* create_temporary_symbol(const char *s, int length, TRAPS);
   10.22  
   10.23    TypeOrigin ref_ctx(const char* str, TRAPS);
   10.24 +
   10.25 +  // Keep track of the furthest branch done in a method to make sure that
   10.26 +  // there are no branches over calls to super() or this() from inside of
   10.27 +  // a constructor.
   10.28 +  int32_t furthest_jump() { return _furthest_jump; }
   10.29 +
   10.30 +  void set_furthest_jump(int32_t target) {
   10.31 +    _furthest_jump = target;
   10.32 +  }
   10.33 +
   10.34 +  void update_furthest_jump(int32_t target) {
   10.35 +    if (target > _furthest_jump) _furthest_jump = target;
   10.36 +  }
   10.37 +
   10.38  };
   10.39  
   10.40  inline int ClassVerifier::change_sig_to_verificationType(
    11.1 --- a/src/share/vm/compiler/compileBroker.cpp	Tue May 13 23:17:52 2014 -0700
    11.2 +++ b/src/share/vm/compiler/compileBroker.cpp	Thu May 22 11:09:06 2014 -0700
    11.3 @@ -1,5 +1,5 @@
    11.4  /*
    11.5 - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
    11.6 + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
    11.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    11.8   *
    11.9   * This code is free software; you can redistribute it and/or modify it
   11.10 @@ -2089,6 +2089,7 @@
   11.11    ResourceMark rm;
   11.12    char* method_name = method->name()->as_C_string();
   11.13    strncpy(_last_method_compiled, method_name, CompileBroker::name_buffer_length);
   11.14 +  _last_method_compiled[CompileBroker::name_buffer_length - 1] = '\0'; // ensure null terminated
   11.15    char current_method[CompilerCounters::cmname_buffer_length];
   11.16    size_t maxLen = CompilerCounters::cmname_buffer_length;
   11.17  
    12.1 --- a/src/share/vm/oops/klassVtable.cpp	Tue May 13 23:17:52 2014 -0700
    12.2 +++ b/src/share/vm/oops/klassVtable.cpp	Thu May 22 11:09:06 2014 -0700
    12.3 @@ -249,6 +249,17 @@
    12.4  // For bytecodes not produced by javac together it is possible that a method does not override
    12.5  // the superclass's method, but might indirectly override a super-super class's vtable entry
    12.6  // If none found, return a null superk, else return the superk of the method this does override
    12.7 +// For public and protected methods: if they override a superclass, they will
    12.8 +// also be overridden themselves appropriately.
    12.9 +// Private methods do not override and are not overridden.
   12.10 +// Package Private methods are trickier:
   12.11 +// e.g. P1.A, pub m
   12.12 +// P2.B extends A, package private m
   12.13 +// P1.C extends B, public m
   12.14 +// P1.C.m needs to override P1.A.m and can not override P2.B.m
   12.15 +// Therefore: all package private methods need their own vtable entries for
   12.16 +// them to be the root of an inheritance overriding decision
   12.17 +// Package private methods may also override other vtable entries
   12.18  InstanceKlass* klassVtable::find_transitive_override(InstanceKlass* initialsuper, methodHandle target_method,
   12.19                              int vtable_index, Handle target_loader, Symbol* target_classname, Thread * THREAD) {
   12.20    InstanceKlass* superk = initialsuper;
   12.21 @@ -396,8 +407,11 @@
   12.22                               target_classname, THREAD))
   12.23                               != (InstanceKlass*)NULL))))
   12.24          {
   12.25 -        // overriding, so no new entry
   12.26 -        allocate_new = false;
   12.27 +        // Package private methods always need a new entry to root their own
   12.28 +        // overriding. They may also override other methods.
   12.29 +        if (!target_method()->is_package_private()) {
   12.30 +          allocate_new = false;
   12.31 +        }
   12.32  
   12.33          if (checkconstraints) {
   12.34          // Override vtable entry if passes loader constraint check
   12.35 @@ -541,8 +555,9 @@
   12.36                                           AccessFlags class_flags,
   12.37                                           TRAPS) {
   12.38    if (class_flags.is_interface()) {
   12.39 -    // Interfaces do not use vtables, so there is no point to assigning
   12.40 -    // a vtable index to any of their methods.  If we refrain from doing this,
   12.41 +    // Interfaces do not use vtables, except for java.lang.Object methods,
   12.42 +    // so there is no point to assigning
   12.43 +    // a vtable index to any of their local methods.  If we refrain from doing this,
   12.44      // we can use Method::_vtable_index to hold the itable index
   12.45      return false;
   12.46    }
   12.47 @@ -580,6 +595,12 @@
   12.48      return true;
   12.49    }
   12.50  
   12.51 +  // Package private methods always need a new entry to root their own
   12.52 +  // overriding. This allows transitive overriding to work.
   12.53 +  if (target_method()->is_package_private()) {
   12.54 +    return true;
   12.55 +  }
   12.56 +
   12.57    // search through the super class hierarchy to see if we need
   12.58    // a new entry
   12.59    ResourceMark rm;
    13.1 --- a/src/share/vm/runtime/os.hpp	Tue May 13 23:17:52 2014 -0700
    13.2 +++ b/src/share/vm/runtime/os.hpp	Thu May 22 11:09:06 2014 -0700
    13.3 @@ -1,5 +1,5 @@
    13.4  /*
    13.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
    13.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
    13.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    13.8   *
    13.9   * This code is free software; you can redistribute it and/or modify it
   13.10 @@ -477,9 +477,6 @@
   13.11    // run cmd in a separate process and return its exit code; or -1 on failures
   13.12    static int fork_and_exec(char *cmd);
   13.13  
   13.14 -  // Set file to send error reports.
   13.15 -  static void set_error_file(const char *logfile);
   13.16 -
   13.17    // os::exit() is merged with vm_exit()
   13.18    // static void exit(int num);
   13.19  
    14.1 --- a/src/share/vm/utilities/events.cpp	Tue May 13 23:17:52 2014 -0700
    14.2 +++ b/src/share/vm/utilities/events.cpp	Thu May 22 11:09:06 2014 -0700
    14.3 @@ -1,5 +1,5 @@
    14.4  /*
    14.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
    14.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
    14.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    14.8   *
    14.9   * This code is free software; you can redistribute it and/or modify it
   14.10 @@ -82,7 +82,7 @@
   14.11      va_start(ap, format);
   14.12      // Save a copy of begin message and log it.
   14.13      _buffer.printv(format, ap);
   14.14 -    Events::log(NULL, _buffer);
   14.15 +    Events::log(NULL, "%s", (const char*)_buffer);
   14.16      va_end(ap);
   14.17    }
   14.18  }
   14.19 @@ -91,6 +91,6 @@
   14.20    if (LogEvents) {
   14.21      // Append " done" to the begin message and log it
   14.22      _buffer.append(" done");
   14.23 -    Events::log(NULL, _buffer);
   14.24 +    Events::log(NULL, "%s", (const char*)_buffer);
   14.25    }
   14.26  }
    15.1 --- a/src/share/vm/utilities/vmError.cpp	Tue May 13 23:17:52 2014 -0700
    15.2 +++ b/src/share/vm/utilities/vmError.cpp	Thu May 22 11:09:06 2014 -0700
    15.3 @@ -1,5 +1,5 @@
    15.4  /*
    15.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
    15.6 + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
    15.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    15.8   *
    15.9   * This code is free software; you can redistribute it and/or modify it
   15.10 @@ -986,7 +986,6 @@
   15.11        if (fd != -1) {
   15.12          out.print_raw("# An error report file with more information is saved as:\n# ");
   15.13          out.print_raw_cr(buffer);
   15.14 -        os::set_error_file(buffer);
   15.15  
   15.16          log.set_fd(fd);
   15.17        } else {

mercurial