Merge

Tue, 13 Nov 2012 15:14:27 -0500

author
coleenp
date
Tue, 13 Nov 2012 15:14:27 -0500
changeset 4279
24e193d2a007
parent 4278
070d523b96a7
parent 4277
e4f764ddb06a
child 4280
80e866b1d053
child 4285
49cbd3e25ba9

Merge

     1.1 --- a/src/share/vm/classfile/symbolTable.hpp	Mon Nov 12 16:15:05 2012 -0500
     1.2 +++ b/src/share/vm/classfile/symbolTable.hpp	Tue Nov 13 15:14:27 2012 -0500
     1.3 @@ -262,19 +262,14 @@
     1.4    // The string table
     1.5    static StringTable* the_table() { return _the_table; }
     1.6  
     1.7 +  // Size of one bucket in the string table.  Used when checking for rollover.
     1.8 +  static uint bucket_size() { return sizeof(HashtableBucket<mtSymbol>); }
     1.9 +
    1.10    static void create_table() {
    1.11      assert(_the_table == NULL, "One string table allowed.");
    1.12      _the_table = new StringTable();
    1.13    }
    1.14  
    1.15 -  static void create_table(HashtableBucket<mtSymbol>* t, int length,
    1.16 -                           int number_of_entries) {
    1.17 -    assert(_the_table == NULL, "One string table allowed.");
    1.18 -    assert((size_t)length == StringTableSize * sizeof(HashtableBucket<mtSymbol>),
    1.19 -           "bad shared string size.");
    1.20 -    _the_table = new StringTable(t, number_of_entries);
    1.21 -  }
    1.22 -
    1.23    // GC support
    1.24    //   Delete pointers to otherwise-unreachable objects.
    1.25    static void unlink(BoolObjectClosure* cl);
     2.1 --- a/src/share/vm/runtime/arguments.cpp	Mon Nov 12 16:15:05 2012 -0500
     2.2 +++ b/src/share/vm/runtime/arguments.cpp	Tue Nov 13 15:14:27 2012 -0500
     2.3 @@ -24,6 +24,7 @@
     2.4  
     2.5  #include "precompiled.hpp"
     2.6  #include "classfile/javaAssertions.hpp"
     2.7 +#include "classfile/symbolTable.hpp"
     2.8  #include "compiler/compilerOracle.hpp"
     2.9  #include "memory/allocation.inline.hpp"
    2.10  #include "memory/cardTableRS.hpp"
    2.11 @@ -1844,6 +1845,11 @@
    2.12    status = status && verify_percentage(MinHeapFreeRatio, "MinHeapFreeRatio");
    2.13    status = status && verify_percentage(MaxHeapFreeRatio, "MaxHeapFreeRatio");
    2.14  
    2.15 +  // Divide by bucket size to prevent a large size from causing rollover when
    2.16 +  // calculating amount of memory needed to be allocated for the String table.
    2.17 +  status = status && verify_interval(StringTableSize, defaultStringTableSize,
    2.18 +    (max_uintx / StringTable::bucket_size()), "StringTable size");
    2.19 +
    2.20    if (MinHeapFreeRatio > MaxHeapFreeRatio) {
    2.21      jio_fprintf(defaultStream::error_stream(),
    2.22                  "MinHeapFreeRatio (" UINTX_FORMAT ") must be less than or "
     3.1 --- a/src/share/vm/runtime/globals.hpp	Mon Nov 12 16:15:05 2012 -0500
     3.2 +++ b/src/share/vm/runtime/globals.hpp	Tue Nov 13 15:14:27 2012 -0500
     3.3 @@ -3593,7 +3593,7 @@
     3.4    diagnostic(bool, PrintDTraceDOF, false,                                   \
     3.5               "Print the DTrace DOF passed to the system for JSDT probes")   \
     3.6                                                                              \
     3.7 -  product(uintx, StringTableSize, 1009,                                     \
     3.8 +  product(uintx, StringTableSize, defaultStringTableSize,                   \
     3.9            "Number of buckets in the interned String table")                 \
    3.10                                                                              \
    3.11    develop(bool, TraceDefaultMethods, false,                                 \
     4.1 --- a/src/share/vm/runtime/os.cpp	Mon Nov 12 16:15:05 2012 -0500
     4.2 +++ b/src/share/vm/runtime/os.cpp	Tue Nov 13 15:14:27 2012 -0500
     4.3 @@ -576,7 +576,9 @@
     4.4      // if NULL is returned the calling functions assume out of memory.
     4.5      size = 1;
     4.6    }
     4.7 -
     4.8 +  if (size > size + space_before + space_after) { // Check for rollover.
     4.9 +    return NULL;
    4.10 +  }
    4.11    NOT_PRODUCT(if (MallocVerifyInterval > 0) check_heap());
    4.12    u_char* ptr = (u_char*)::malloc(size + space_before + space_after);
    4.13  
     5.1 --- a/src/share/vm/utilities/globalDefinitions.hpp	Mon Nov 12 16:15:05 2012 -0500
     5.2 +++ b/src/share/vm/utilities/globalDefinitions.hpp	Tue Nov 13 15:14:27 2012 -0500
     5.3 @@ -328,6 +328,12 @@
     5.4  
     5.5  
     5.6  //----------------------------------------------------------------------------------------------------
     5.7 +// Minimum StringTableSize value
     5.8 +
     5.9 +const int defaultStringTableSize=1009;
    5.10 +
    5.11 +
    5.12 +//----------------------------------------------------------------------------------------------------
    5.13  // HotSwap - for JVMTI   aka Class File Replacement and PopFrame
    5.14  //
    5.15  // Determines whether on-the-fly class replacement and frame popping are enabled.

mercurial