Mon, 17 Feb 2020 09:29:32 +0000
Merge
test/runtime/RedefineTests/test8178870.sh | file | annotate | diff | comparison | revisions |
1.1 --- a/.hgtags Mon Feb 17 08:53:34 2020 +0000 1.2 +++ b/.hgtags Mon Feb 17 09:29:32 2020 +0000 1.3 @@ -1289,6 +1289,11 @@ 1.4 775e2bf92114e41365cc6baf1480c818454256a4 jdk8u242-b02 1.5 ee19c358e3b8deeda2f64d660a0870df7b1abd49 jdk8u242-b03 1.6 20258ba5a788da55485c0648bcc073f8ad2c26ef jdk8u242-b04 1.7 +2c1e9fab6964647f4eeffe55fe5592da6399a3ce jdk8u242-b05 1.8 +81ddc1072b923330f84c0ace3124226f63877582 jdk8u242-b06 1.9 +8b80409d5840142a27e274d33948f483a6406a50 jdk8u242-b07 1.10 +7c9f6b5f8d119dc1ba3c5536595ce3ae7414599d jdk8u242-b08 1.11 +7c9f6b5f8d119dc1ba3c5536595ce3ae7414599d jdk8u242-ga 1.12 8c0733543544bbcd32c4404630d764d280299056 jdk8u252-b00 1.13 a67e9c6edcdd73cb860a16990f0905e102c282d7 jdk8u252-b01 1.14 5bd3b8c0555292a967ea3b4c39a220d0c2cf40ad jdk8u252-b02
2.1 --- a/THIRD_PARTY_README Mon Feb 17 08:53:34 2020 +0000 2.2 +++ b/THIRD_PARTY_README Mon Feb 17 09:29:32 2020 +0000 2.3 @@ -1334,11 +1334,13 @@ 2.4 2.5 -------------------------------------------------------------------------------- 2.6 2.7 -%% This notice is provided with respect to Joni v1.1.9, which may be 2.8 +%% This notice is provided with respect to Joni v2.1.16, which may be 2.9 included with JRE 8, JDK 8, and OpenJDK 8. 2.10 2.11 --- begin of LICENSE --- 2.12 2.13 +Copyright (c) 2017 JRuby Team 2.14 + 2.15 Permission is hereby granted, free of charge, to any person obtaining a copy 2.16 of this software and associated documentation files (the "Software"), to deal 2.17 in the Software without restriction, including without limitation the rights
3.1 --- a/src/cpu/sparc/vm/vm_version_sparc.cpp Mon Feb 17 08:53:34 2020 +0000 3.2 +++ b/src/cpu/sparc/vm/vm_version_sparc.cpp Mon Feb 17 09:29:32 2020 +0000 3.3 @@ -286,35 +286,35 @@ 3.4 3.5 // SPARC T4 and above should have support for AES instructions 3.6 if (has_aes()) { 3.7 - if (UseVIS > 2) { // AES intrinsics use MOVxTOd/MOVdTOx which are VIS3 3.8 - if (FLAG_IS_DEFAULT(UseAES)) { 3.9 - FLAG_SET_DEFAULT(UseAES, true); 3.10 + if (FLAG_IS_DEFAULT(UseAES)) { 3.11 + FLAG_SET_DEFAULT(UseAES, true); 3.12 + } 3.13 + if (!UseAES) { 3.14 + if (UseAESIntrinsics && !FLAG_IS_DEFAULT(UseAESIntrinsics)) { 3.15 + warning("AES intrinsics require UseAES flag to be enabled. Intrinsics will be disabled."); 3.16 } 3.17 - if (FLAG_IS_DEFAULT(UseAESIntrinsics)) { 3.18 - FLAG_SET_DEFAULT(UseAESIntrinsics, true); 3.19 - } 3.20 - // we disable both the AES flags if either of them is disabled on the command line 3.21 - if (!UseAES || !UseAESIntrinsics) { 3.22 - FLAG_SET_DEFAULT(UseAES, false); 3.23 + FLAG_SET_DEFAULT(UseAESIntrinsics, false); 3.24 + } else { 3.25 + // The AES intrinsic stubs require AES instruction support (of course) 3.26 + // but also require VIS3 mode or higher for instructions it use. 3.27 + if (UseVIS > 2) { 3.28 + if (FLAG_IS_DEFAULT(UseAESIntrinsics)) { 3.29 + FLAG_SET_DEFAULT(UseAESIntrinsics, true); 3.30 + } 3.31 + } else { 3.32 + if (UseAESIntrinsics && !FLAG_IS_DEFAULT(UseAESIntrinsics)) { 3.33 + warning("SPARC AES intrinsics require VIS3 instructions. Intrinsics will be disabled."); 3.34 + } 3.35 FLAG_SET_DEFAULT(UseAESIntrinsics, false); 3.36 } 3.37 - } else { 3.38 - if (UseAES || UseAESIntrinsics) { 3.39 - warning("SPARC AES intrinsics require VIS3 instruction support. Intrinsics will be disabled."); 3.40 - if (UseAES) { 3.41 - FLAG_SET_DEFAULT(UseAES, false); 3.42 - } 3.43 - if (UseAESIntrinsics) { 3.44 - FLAG_SET_DEFAULT(UseAESIntrinsics, false); 3.45 - } 3.46 - } 3.47 } 3.48 } else if (UseAES || UseAESIntrinsics) { 3.49 - warning("AES instructions are not available on this CPU"); 3.50 - if (UseAES) { 3.51 + if (UseAES && !FLAG_IS_DEFAULT(UseAES)) { 3.52 + warning("AES instructions are not available on this CPU"); 3.53 FLAG_SET_DEFAULT(UseAES, false); 3.54 } 3.55 - if (UseAESIntrinsics) { 3.56 + if (UseAESIntrinsics && !FLAG_IS_DEFAULT(UseAESIntrinsics)) { 3.57 + warning("AES intrinsics are not available on this CPU"); 3.58 FLAG_SET_DEFAULT(UseAESIntrinsics, false); 3.59 } 3.60 }
4.1 --- a/src/cpu/x86/vm/vm_version_x86.cpp Mon Feb 17 08:53:34 2020 +0000 4.2 +++ b/src/cpu/x86/vm/vm_version_x86.cpp Mon Feb 17 09:29:32 2020 +0000 4.3 @@ -553,12 +553,36 @@ 4.4 // Use AES instructions if available. 4.5 if (supports_aes()) { 4.6 if (FLAG_IS_DEFAULT(UseAES)) { 4.7 - UseAES = true; 4.8 + FLAG_SET_DEFAULT(UseAES, true); 4.9 } 4.10 - } else if (UseAES) { 4.11 - if (!FLAG_IS_DEFAULT(UseAES)) 4.12 + if (!UseAES) { 4.13 + if (UseAESIntrinsics && !FLAG_IS_DEFAULT(UseAESIntrinsics)) { 4.14 + warning("AES intrinsics require UseAES flag to be enabled. Intrinsics will be disabled."); 4.15 + } 4.16 + FLAG_SET_DEFAULT(UseAESIntrinsics, false); 4.17 + } else { 4.18 + if (UseSSE > 2) { 4.19 + if (FLAG_IS_DEFAULT(UseAESIntrinsics)) { 4.20 + FLAG_SET_DEFAULT(UseAESIntrinsics, true); 4.21 + } 4.22 + } else { 4.23 + // The AES intrinsic stubs require AES instruction support (of course) 4.24 + // but also require sse3 mode or higher for instructions it use. 4.25 + if (UseAESIntrinsics && !FLAG_IS_DEFAULT(UseAESIntrinsics)) { 4.26 + warning("X86 AES intrinsics require SSE3 instructions or higher. Intrinsics will be disabled."); 4.27 + } 4.28 + FLAG_SET_DEFAULT(UseAESIntrinsics, false); 4.29 + } 4.30 + } 4.31 + } else if (UseAES || UseAESIntrinsics) { 4.32 + if (UseAES && !FLAG_IS_DEFAULT(UseAES)) { 4.33 warning("AES instructions are not available on this CPU"); 4.34 - FLAG_SET_DEFAULT(UseAES, false); 4.35 + FLAG_SET_DEFAULT(UseAES, false); 4.36 + } 4.37 + if (UseAESIntrinsics && !FLAG_IS_DEFAULT(UseAESIntrinsics)) { 4.38 + warning("AES intrinsics are not available on this CPU"); 4.39 + FLAG_SET_DEFAULT(UseAESIntrinsics, false); 4.40 + } 4.41 } 4.42 4.43 // Use CLMUL instructions if available. 4.44 @@ -582,18 +606,6 @@ 4.45 FLAG_SET_DEFAULT(UseCRC32Intrinsics, false); 4.46 } 4.47 4.48 - // The AES intrinsic stubs require AES instruction support (of course) 4.49 - // but also require sse3 mode for instructions it use. 4.50 - if (UseAES && (UseSSE > 2)) { 4.51 - if (FLAG_IS_DEFAULT(UseAESIntrinsics)) { 4.52 - UseAESIntrinsics = true; 4.53 - } 4.54 - } else if (UseAESIntrinsics) { 4.55 - if (!FLAG_IS_DEFAULT(UseAESIntrinsics)) 4.56 - warning("AES intrinsics are not available on this CPU"); 4.57 - FLAG_SET_DEFAULT(UseAESIntrinsics, false); 4.58 - } 4.59 - 4.60 // GHASH/GCM intrinsics 4.61 if (UseCLMUL && (UseSSE > 2)) { 4.62 if (FLAG_IS_DEFAULT(UseGHASHIntrinsics)) {
5.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp Mon Feb 17 08:53:34 2020 +0000 5.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.cpp Mon Feb 17 09:29:32 2020 +0000 5.3 @@ -161,6 +161,8 @@ 5.4 } 5.5 _dictionary->set_par_lock(&_parDictionaryAllocLock); 5.6 } 5.7 + 5.8 + _used_stable = 0; 5.9 } 5.10 5.11 // Like CompactibleSpace forward() but always calls cross_threshold() to 5.12 @@ -377,6 +379,14 @@ 5.13 return capacity() - free(); 5.14 } 5.15 5.16 +size_t CompactibleFreeListSpace::used_stable() const { 5.17 + return _used_stable; 5.18 +} 5.19 + 5.20 +void CompactibleFreeListSpace::recalculate_used_stable() { 5.21 + _used_stable = used(); 5.22 +} 5.23 + 5.24 size_t CompactibleFreeListSpace::free() const { 5.25 // "MT-safe, but not MT-precise"(TM), if you will: i.e. 5.26 // if you do this while the structures are in flux you 5.27 @@ -1218,6 +1228,13 @@ 5.28 debug_only(fc->mangleAllocated(size)); 5.29 } 5.30 5.31 + // During GC we do not need to recalculate the stable used value for 5.32 + // every allocation in old gen. It is done once at the end of GC instead 5.33 + // for performance reasons. 5.34 + if (!Universe::heap()->is_gc_active()) { 5.35 + recalculate_used_stable(); 5.36 + } 5.37 + 5.38 return res; 5.39 } 5.40
6.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp Mon Feb 17 08:53:34 2020 +0000 6.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp Mon Feb 17 09:29:32 2020 +0000 6.3 @@ -148,6 +148,9 @@ 6.4 // Used to keep track of limit of sweep for the space 6.5 HeapWord* _sweep_limit; 6.6 6.7 + // Stable value of used(). 6.8 + size_t _used_stable; 6.9 + 6.10 // Support for compacting cms 6.11 HeapWord* cross_threshold(HeapWord* start, HeapWord* end); 6.12 HeapWord* forward(oop q, size_t size, CompactPoint* cp, HeapWord* compact_top); 6.13 @@ -343,6 +346,17 @@ 6.14 // which overestimates the region by returning the entire 6.15 // committed region (this is safe, but inefficient). 6.16 6.17 + // Returns monotonically increasing stable used space bytes for CMS. 6.18 + // This is required for jstat and other memory monitoring tools 6.19 + // that might otherwise see inconsistent used space values during a garbage 6.20 + // collection, promotion or allocation into compactibleFreeListSpace. 6.21 + // The value returned by this function might be smaller than the 6.22 + // actual value. 6.23 + size_t used_stable() const; 6.24 + // Recalculate and cache the current stable used() value. Only to be called 6.25 + // in places where we can be sure that the result is stable. 6.26 + void recalculate_used_stable(); 6.27 + 6.28 // Returns a subregion of the space containing all the objects in 6.29 // the space. 6.30 MemRegion used_region() const {
7.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Mon Feb 17 08:53:34 2020 +0000 7.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Mon Feb 17 09:29:32 2020 +0000 7.3 @@ -869,6 +869,10 @@ 7.4 return _cmsSpace->max_alloc_in_words() * HeapWordSize; 7.5 } 7.6 7.7 +size_t ConcurrentMarkSweepGeneration::used_stable() const { 7.8 + return cmsSpace()->used_stable(); 7.9 +} 7.10 + 7.11 size_t ConcurrentMarkSweepGeneration::max_available() const { 7.12 return free() + _virtual_space.uncommitted_size(); 7.13 } 7.14 @@ -1955,6 +1959,8 @@ 7.15 FreelistLocker z(this); 7.16 MetaspaceGC::compute_new_size(); 7.17 _cmsGen->compute_new_size_free_list(); 7.18 + // recalculate CMS used space after CMS collection 7.19 + _cmsGen->cmsSpace()->recalculate_used_stable(); 7.20 } 7.21 7.22 // A work method used by foreground collection to determine 7.23 @@ -2768,6 +2774,7 @@ 7.24 7.25 _capacity_at_prologue = capacity(); 7.26 _used_at_prologue = used(); 7.27 + _cmsSpace->recalculate_used_stable(); 7.28 7.29 // Delegate to CMScollector which knows how to coordinate between 7.30 // this and any other CMS generations that it is responsible for 7.31 @@ -2837,6 +2844,7 @@ 7.32 _eden_chunk_index = 0; 7.33 7.34 size_t cms_used = _cmsGen->cmsSpace()->used(); 7.35 + _cmsGen->cmsSpace()->recalculate_used_stable(); 7.36 7.37 // update performance counters - this uses a special version of 7.38 // update_counters() that allows the utilization to be passed as a 7.39 @@ -3672,6 +3680,7 @@ 7.40 _collectorState = Marking; 7.41 } 7.42 SpecializationStats::print(); 7.43 + _cmsGen->cmsSpace()->recalculate_used_stable(); 7.44 } 7.45 7.46 void CMSCollector::checkpointRootsInitialWork(bool asynch) { 7.47 @@ -5066,10 +5075,12 @@ 7.48 Mutex::_no_safepoint_check_flag); 7.49 assert(!init_mark_was_synchronous, "but that's impossible!"); 7.50 checkpointRootsFinalWork(asynch, clear_all_soft_refs, false); 7.51 + _cmsGen->cmsSpace()->recalculate_used_stable(); 7.52 } else { 7.53 // already have all the locks 7.54 checkpointRootsFinalWork(asynch, clear_all_soft_refs, 7.55 init_mark_was_synchronous); 7.56 + _cmsGen->cmsSpace()->recalculate_used_stable(); 7.57 } 7.58 verify_work_stacks_empty(); 7.59 verify_overflow_empty(); 7.60 @@ -6368,6 +6379,10 @@ 7.61 // Update heap occupancy information which is used as 7.62 // input to soft ref clearing policy at the next gc. 7.63 Universe::update_heap_info_at_gc(); 7.64 + 7.65 + // recalculate CMS used space after CMS collection 7.66 + _cmsGen->cmsSpace()->recalculate_used_stable(); 7.67 + 7.68 _collectorState = Resizing; 7.69 } 7.70 } else { 7.71 @@ -6467,6 +6482,7 @@ 7.72 // Gather statistics on the young generation collection. 7.73 collector()->stats().record_gc0_end(used()); 7.74 } 7.75 + _cmsSpace->recalculate_used_stable(); 7.76 } 7.77 7.78 CMSAdaptiveSizePolicy* ConcurrentMarkSweepGeneration::size_policy() {
8.1 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp Mon Feb 17 08:53:34 2020 +0000 8.2 +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp Mon Feb 17 09:29:32 2020 +0000 8.3 @@ -1190,6 +1190,7 @@ 8.4 double occupancy() const { return ((double)used())/((double)capacity()); } 8.5 size_t contiguous_available() const; 8.6 size_t unsafe_max_alloc_nogc() const; 8.7 + size_t used_stable() const; 8.8 8.9 // over-rides 8.10 MemRegion used_region() const;
9.1 --- a/src/share/vm/gc_implementation/shared/gSpaceCounters.hpp Mon Feb 17 08:53:34 2020 +0000 9.2 +++ b/src/share/vm/gc_implementation/shared/gSpaceCounters.hpp Mon Feb 17 09:29:32 2020 +0000 9.3 @@ -63,7 +63,7 @@ 9.4 } 9.5 9.6 inline void update_used() { 9.7 - _used->set_value(_gen->used()); 9.8 + _used->set_value(_gen->used_stable()); 9.9 } 9.10 9.11 // special version of update_used() to allow the used value to be 9.12 @@ -107,7 +107,7 @@ 9.13 GenerationUsedHelper(Generation* g) : _gen(g) { } 9.14 9.15 inline jlong take_sample() { 9.16 - return _gen->used(); 9.17 + return _gen->used_stable(); 9.18 } 9.19 }; 9.20
10.1 --- a/src/share/vm/memory/generation.cpp Mon Feb 17 08:53:34 2020 +0000 10.2 +++ b/src/share/vm/memory/generation.cpp Mon Feb 17 09:29:32 2020 +0000 10.3 @@ -68,6 +68,12 @@ 10.4 return gch->_gen_specs[level()]; 10.5 } 10.6 10.7 +// This is for CMS. It returns stable monotonic used space size. 10.8 +// Remove this when CMS is removed. 10.9 +size_t Generation::used_stable() const { 10.10 + return used(); 10.11 +} 10.12 + 10.13 size_t Generation::max_capacity() const { 10.14 return reserved().byte_size(); 10.15 }
11.1 --- a/src/share/vm/memory/generation.hpp Mon Feb 17 08:53:34 2020 +0000 11.2 +++ b/src/share/vm/memory/generation.hpp Mon Feb 17 09:29:32 2020 +0000 11.3 @@ -168,6 +168,7 @@ 11.4 virtual size_t capacity() const = 0; // The maximum number of object bytes the 11.5 // generation can currently hold. 11.6 virtual size_t used() const = 0; // The number of used bytes in the gen. 11.7 + virtual size_t used_stable() const; // The number of used bytes for memory monitoring tools. 11.8 virtual size_t free() const = 0; // The number of free bytes in the gen. 11.9 11.10 // Support for java.lang.Runtime.maxMemory(); see CollectedHeap.
12.1 --- a/src/share/vm/oops/instanceKlass.cpp Mon Feb 17 08:53:34 2020 +0000 12.2 +++ b/src/share/vm/oops/instanceKlass.cpp Mon Feb 17 09:29:32 2020 +0000 12.3 @@ -294,6 +294,7 @@ 12.4 set_has_unloaded_dependent(false); 12.5 set_init_state(InstanceKlass::allocated); 12.6 set_init_thread(NULL); 12.7 + set_init_state(allocated); 12.8 set_reference_type(rt); 12.9 set_oop_map_cache(NULL); 12.10 set_jni_ids(NULL); 12.11 @@ -978,11 +979,13 @@ 12.12 oop init_lock = this_oop->init_lock(); 12.13 if (init_lock != NULL) { 12.14 ObjectLocker ol(init_lock, THREAD); 12.15 + this_oop->set_init_thread(NULL); // reset _init_thread before changing _init_state 12.16 this_oop->set_init_state(state); 12.17 this_oop->fence_and_clear_init_lock(); 12.18 ol.notify_all(CHECK); 12.19 } else { 12.20 assert(init_lock != NULL, "The initialization state should never be set twice"); 12.21 + this_oop->set_init_thread(NULL); // reset _init_thread before changing _init_state 12.22 this_oop->set_init_state(state); 12.23 } 12.24 } 12.25 @@ -3602,6 +3605,7 @@ 12.26 bool good_state = is_shared() ? (_init_state <= state) 12.27 : (_init_state < state); 12.28 assert(good_state || state == allocated, "illegal state transition"); 12.29 + assert(_init_thread == NULL, "should be cleared before state change"); 12.30 _init_state = (u1)state; 12.31 } 12.32 #endif
13.1 --- a/src/share/vm/oops/instanceKlass.hpp Mon Feb 17 08:53:34 2020 +0000 13.2 +++ b/src/share/vm/oops/instanceKlass.hpp Mon Feb 17 09:29:32 2020 +0000 13.3 @@ -241,7 +241,7 @@ 13.4 u2 _misc_flags; 13.5 u2 _minor_version; // minor version number of class file 13.6 u2 _major_version; // major version number of class file 13.7 - Thread* _init_thread; // Pointer to current thread doing initialization (to handle recusive initialization) 13.8 + Thread* _init_thread; // Pointer to current thread doing initialization (to handle recursive initialization) 13.9 int _vtable_len; // length of Java vtable (in words) 13.10 int _itable_len; // length of Java itable (in words) 13.11 OopMapCache* volatile _oop_map_cache; // OopMapCache for all methods in the klass (allocated lazily)
14.1 --- a/src/share/vm/oops/klassVtable.cpp Mon Feb 17 08:53:34 2020 +0000 14.2 +++ b/src/share/vm/oops/klassVtable.cpp Mon Feb 17 09:29:32 2020 +0000 14.3 @@ -289,22 +289,25 @@ 14.4 int vtable_index, Handle target_loader, Symbol* target_classname, Thread * THREAD) { 14.5 InstanceKlass* superk = initialsuper; 14.6 while (superk != NULL && superk->super() != NULL) { 14.7 - InstanceKlass* supersuperklass = InstanceKlass::cast(superk->super()); 14.8 - klassVtable* ssVtable = supersuperklass->vtable(); 14.9 + klassVtable* ssVtable = (superk->super())->vtable(); 14.10 if (vtable_index < ssVtable->length()) { 14.11 Method* super_method = ssVtable->method_at(vtable_index); 14.12 + // get the class holding the matching method 14.13 + // make sure you use that class for is_override 14.14 + InstanceKlass* supermethodholder = super_method->method_holder(); 14.15 #ifndef PRODUCT 14.16 Symbol* name= target_method()->name(); 14.17 Symbol* signature = target_method()->signature(); 14.18 assert(super_method->name() == name && super_method->signature() == signature, "vtable entry name/sig mismatch"); 14.19 #endif 14.20 - if (supersuperklass->is_override(super_method, target_loader, target_classname, THREAD)) { 14.21 + 14.22 + if (supermethodholder->is_override(super_method, target_loader, target_classname, THREAD)) { 14.23 #ifndef PRODUCT 14.24 if (PrintVtables && Verbose) { 14.25 ResourceMark rm(THREAD); 14.26 char* sig = target_method()->name_and_sig_as_C_string(); 14.27 tty->print("transitive overriding superclass %s with %s::%s index %d, original flags: ", 14.28 - supersuperklass->internal_name(), 14.29 + supermethodholder->internal_name(), 14.30 _klass->internal_name(), sig, vtable_index); 14.31 super_method->access_flags().print_on(tty); 14.32 if (super_method->is_default_method()) { 14.33 @@ -656,7 +659,7 @@ 14.34 14.35 // search through the super class hierarchy to see if we need 14.36 // a new entry 14.37 - ResourceMark rm; 14.38 + ResourceMark rm(THREAD); 14.39 Symbol* name = target_method()->name(); 14.40 Symbol* signature = target_method()->signature(); 14.41 Klass* k = super;
15.1 --- a/src/share/vm/services/memoryPool.hpp Mon Feb 17 08:53:34 2020 +0000 15.2 +++ b/src/share/vm/services/memoryPool.hpp Mon Feb 17 09:29:32 2020 +0000 15.3 @@ -198,7 +198,7 @@ 15.4 bool support_usage_threshold); 15.5 15.6 MemoryUsage get_memory_usage(); 15.7 - size_t used_in_bytes() { return _space->used(); } 15.8 + size_t used_in_bytes() { return _space->used_stable(); } 15.9 }; 15.10 #endif // INCLUDE_ALL_GCS 15.11
16.1 --- a/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java Mon Feb 17 08:53:34 2020 +0000 16.2 +++ b/test/compiler/classUnloading/anonymousClass/TestAnonymousClassUnloading.java Mon Feb 17 09:29:32 2020 +0000 16.3 @@ -22,9 +22,10 @@ 16.4 */ 16.5 16.6 import sun.hotspot.WhiteBox; 16.7 +import sun.misc.IOUtils; 16.8 import sun.misc.Unsafe; 16.9 -import sun.misc.IOUtils; 16.10 16.11 +import java.io.IOException; 16.12 import java.lang.reflect.Method; 16.13 import java.net.URL; 16.14 import java.net.URLConnection; 16.15 @@ -108,7 +109,13 @@ 16.16 // (1) Load an anonymous version of this class using the corresponding Unsafe method 16.17 URL classUrl = TestAnonymousClassUnloading.class.getResource("TestAnonymousClassUnloading.class"); 16.18 URLConnection connection = classUrl.openConnection(); 16.19 - byte[] classBytes = IOUtils.readFully(connection.getInputStream(), connection.getContentLength(), true); 16.20 + 16.21 + int length = connection.getContentLength(); 16.22 + byte[] classBytes = IOUtils.readAllBytes(connection.getInputStream()); 16.23 + if (length != -1 && classBytes.length != length) { 16.24 + throw new IOException("Expected:" + length + ", actual: " + classBytes.length); 16.25 + } 16.26 + 16.27 Class<?> anonymousClass = UNSAFE.defineAnonymousClass(TestAnonymousClassUnloading.class, classBytes, null); 16.28 16.29 // (2) Make sure all paths of doWork are profiled and compiled
17.1 --- a/test/runtime/8003720/VictimClassLoader.java Mon Feb 17 08:53:34 2020 +0000 17.2 +++ b/test/runtime/8003720/VictimClassLoader.java Mon Feb 17 09:29:32 2020 +0000 17.3 @@ -22,6 +22,8 @@ 17.4 * 17.5 */ 17.6 17.7 +import sun.misc.IOUtils; 17.8 + 17.9 public class VictimClassLoader extends ClassLoader { 17.10 public static long counter = 0; 17.11 17.12 @@ -72,8 +74,10 @@ 17.13 } 17.14 17.15 static byte[] readFully(java.io.InputStream in, int len) throws java.io.IOException { 17.16 - // Warning here: 17.17 - return sun.misc.IOUtils.readFully(in, len, true); 17.18 + byte[] b = IOUtils.readAllBytes(in); 17.19 + if (len != -1 && b.length != len) 17.20 + throw new java.io.IOException("Expected:" + len + ", actual:" + b.length); 17.21 + return b; 17.22 } 17.23 17.24 public void finalize() {
18.1 --- a/test/runtime/RedefineTests/test8178870.sh Mon Feb 17 08:53:34 2020 +0000 18.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 18.3 @@ -1,87 +0,0 @@ 18.4 -#!/bin/sh 18.5 - 18.6 -# 18.7 -# Copyright (c) 2019, Red Hat, Inc. All rights reserved. 18.8 -# 18.9 -# This code is free software; you can redistribute it and/or modify it 18.10 -# under the terms of the GNU General Public License version 2 only, as 18.11 -# published by the Free Software Foundation. 18.12 -# 18.13 -# This code is distributed in the hope that it will be useful, but WITHOUT 18.14 -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 18.15 -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 18.16 -# version 2 for more details (a copy is included in the LICENSE file that 18.17 -# accompanied this code). 18.18 -# 18.19 -# You should have received a copy of the GNU General Public License version 18.20 -# 2 along with this work; if not, write to the Free Software Foundation, 18.21 -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18.22 -# 18.23 -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 18.24 -# or visit www.oracle.com if you need additional information or have any 18.25 -# questions. 18.26 -# 18.27 -# 18.28 - 18.29 -## @test test.sh 18.30 -## @bug 8178870 18.31 -## @summary test instrumentation.retransformClasses 18.32 -## @run shell test.sh 18.33 - 18.34 -if [ "${TESTSRC}" = "" ] 18.35 -then 18.36 - TESTSRC=${PWD} 18.37 - echo "TESTSRC not set. Using "${TESTSRC}" as default" 18.38 -fi 18.39 -echo "TESTSRC=${TESTSRC}" 18.40 -## Adding common setup Variables for running shell tests. 18.41 -. ${TESTSRC}/../../test_env.sh 18.42 - 18.43 -LIB_SRC=${TESTSRC}/../../testlibrary/ 18.44 - 18.45 -# set platform-dependent variables 18.46 -OS=`uname -s` 18.47 -echo "Testing on " $OS 18.48 -case "$OS" in 18.49 - Linux) 18.50 - cc_cmd=`which gcc` 18.51 - if [ "x$cc_cmd" == "x" ]; then 18.52 - echo "WARNING: gcc not found. Cannot execute test." 2>&1 18.53 - exit 0; 18.54 - fi 18.55 - ;; 18.56 - Solaris) 18.57 - cc_cmd=`which cc` 18.58 - if [ "x$cc_cmd" == "x" ]; then 18.59 - echo "WARNING: cc not found. Cannot execute test." 2>&1 18.60 - exit 0; 18.61 - fi 18.62 - ;; 18.63 - *) 18.64 - echo "Test passed. Only on Linux and Solaris" 18.65 - exit 0; 18.66 - ;; 18.67 -esac 18.68 - 18.69 -THIS_DIR=. 18.70 - 18.71 -cp ${TESTSRC}/RedefineDoubleDelete.java ${THIS_DIR} 18.72 -mkdir -p ${THIS_DIR}/classes 18.73 -${TESTJAVA}/bin/javac -sourcepath ${LIB_SRC} -d ${THIS_DIR}/classes ${LIB_SRC}RedefineClassHelper.java 18.74 -${TESTJAVA}/bin/javac -cp .:${THIS_DIR}/classes:${TESTJAVA}/lib/tools.jar -d ${THIS_DIR} RedefineDoubleDelete.java 18.75 - 18.76 -$cc_cmd -fPIC -shared -o ${THIS_DIR}${FS}libRedefineDoubleDelete.so \ 18.77 - -I${TESTJAVA}/include -I${TESTJAVA}/include/linux \ 18.78 - ${TESTSRC}/libRedefineDoubleDelete.c 18.79 - 18.80 -LD_LIBRARY_PATH=${THIS_DIR} 18.81 -echo LD_LIBRARY_PATH = ${LD_LIBRARY_PATH} 18.82 -export LD_LIBRARY_PATH 18.83 - 18.84 -# Install redefineagent.jar 18.85 -${TESTJAVA}/bin${FS}java -cp ${THIS_DIR}/classes RedefineClassHelper 18.86 - 18.87 -echo 18.88 -echo ${TESTJAVA}/bin/java -agentlib:RedefineDoubleDelete RedefineDoubleDelete 18.89 -${TESTJAVA}/bin/java -cp .:${THIS_DIR}${FS}classes -javaagent:redefineagent.jar -agentlib:RedefineDoubleDelete RedefineDoubleDelete 18.90 -