From 0410c05b22f05c0e007ca92c2428381ec8846e46 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Wed, 18 Nov 2015 11:31:59 +0100 Subject: [PATCH 001/146] 8143215: gcc 4.1.2: fix three issues breaking the build Also fix some more recent introduced missing casts. Reviewed-by: stuefe, simonis, kbarrett, tschatzl --- .../vm/gc/cms/concurrentMarkSweepGeneration.cpp | 2 +- hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp | 14 +++++++++----- hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp | 1 + hotspot/src/share/vm/gc/g1/g1IHOPControl.cpp | 15 ++++++++++----- hotspot/src/share/vm/gc/shared/gcTraceSend.cpp | 4 ++-- 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp index 92ede42baef..f112552d0ff 100644 --- a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp +++ b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp @@ -2730,7 +2730,7 @@ class CMSPhaseAccounting: public StackObj { public: // Not MT-safe; so do not pass around these StackObj's // where they may be accessed by other threads. - jlong wallclock_millis() { + double wallclock_millis() { return TimeHelper::counter_to_millis(os::elapsed_counter() - _trace_time.start_time()); } }; diff --git a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp index 4e603475391..0f435abe90a 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp @@ -291,6 +291,10 @@ double G1CollectorPolicy::get_new_prediction(TruncatedSeq const* seq) const { return _predictor.get_new_prediction(seq); } +size_t G1CollectorPolicy::get_new_size_prediction(TruncatedSeq const* seq) const { + return (size_t)get_new_prediction(seq); +} + void G1CollectorPolicy::initialize_alignments() { _space_alignment = HeapRegion::GrainBytes; size_t card_table_alignment = CardTableRS::ct_max_alignment_constraint(); @@ -477,7 +481,7 @@ bool G1CollectorPolicy::predict_will_fit(uint young_length, // (100 + TargetPLABWastePct) represents the increase in expected bytes during // copying due to anticipated waste in the PLABs. double safety_factor = (100.0 / G1ConfidencePercent) * (100 + TargetPLABWastePct) / 100.0; - size_t expected_bytes_to_copy = safety_factor * bytes_to_copy; + size_t expected_bytes_to_copy = (size_t)(safety_factor * bytes_to_copy); if (expected_bytes_to_copy > free_bytes) { // end condition 3: out-of-space @@ -524,7 +528,7 @@ uint G1CollectorPolicy::calculate_young_list_desired_max_length() const { } uint G1CollectorPolicy::update_young_list_max_and_target_length() { - return update_young_list_max_and_target_length(get_new_prediction(_rs_lengths_seq)); + return update_young_list_max_and_target_length(get_new_size_prediction(_rs_lengths_seq)); } uint G1CollectorPolicy::update_young_list_max_and_target_length(size_t rs_lengths) { @@ -629,7 +633,7 @@ G1CollectorPolicy::calculate_young_list_target_length(size_t rs_lengths, double target_pause_time_ms = _mmu_tracker->max_gc_time() * 1000.0; double survivor_regions_evac_time = predict_survivor_regions_evac_time(); - size_t pending_cards = (size_t) get_new_prediction(_pending_cards_seq); + size_t pending_cards = get_new_size_prediction(_pending_cards_seq); size_t adj_rs_lengths = rs_lengths + predict_rs_length_diff(); size_t scanned_cards = predict_young_card_num(adj_rs_lengths); double base_time_ms = @@ -732,7 +736,7 @@ void G1CollectorPolicy::revise_young_list_target_length_if_necessary() { } void G1CollectorPolicy::update_rs_lengths_prediction() { - update_rs_lengths_prediction(get_new_prediction(_rs_lengths_seq)); + update_rs_lengths_prediction(get_new_size_prediction(_rs_lengths_seq)); } void G1CollectorPolicy::update_rs_lengths_prediction(size_t prediction) { @@ -1345,7 +1349,7 @@ void G1CollectorPolicy::adjust_concurrent_refinement(double update_rs_time, } size_t G1CollectorPolicy::predict_rs_length_diff() const { - return (size_t) get_new_prediction(_rs_length_diff_seq); + return get_new_size_prediction(_rs_length_diff_seq); } double G1CollectorPolicy::predict_alloc_rate_ms() const { diff --git a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp index d0687a1c1e6..d742f852a49 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp @@ -179,6 +179,7 @@ class G1CollectorPolicy: public CollectorPolicy { G1Predictions _predictor; double get_new_prediction(TruncatedSeq const* seq) const; + size_t get_new_size_prediction(TruncatedSeq const* seq) const; // either equal to the number of parallel threads, if ParallelGCThreads // has been set, or 1 otherwise diff --git a/hotspot/src/share/vm/gc/g1/g1IHOPControl.cpp b/hotspot/src/share/vm/gc/g1/g1IHOPControl.cpp index 705d3af6fd7..0cf5dab9448 100644 --- a/hotspot/src/share/vm/gc/g1/g1IHOPControl.cpp +++ b/hotspot/src/share/vm/gc/g1/g1IHOPControl.cpp @@ -138,7 +138,7 @@ size_t G1AdaptiveIHOPControl::actual_target_threshold() const { double safe_total_heap_percentage = MIN2((double)(_heap_reserve_percent + _heap_waste_percent), 100.0); - return MIN2( + return (size_t)MIN2( G1CollectedHeap::heap()->max_capacity() * (100.0 - safe_total_heap_percentage) / 100.0, _target_occupancy * (100.0 - _heap_waste_percent) / 100.0 ); @@ -153,10 +153,13 @@ size_t G1AdaptiveIHOPControl::get_conc_mark_start_threshold() { if (have_enough_data_for_prediction()) { double pred_marking_time = _predictor->get_new_prediction(&_marking_times_s); double pred_promotion_rate = _predictor->get_new_prediction(&_allocation_rate_s); + size_t pred_promotion_size = (size_t)(pred_marking_time * pred_promotion_rate); size_t predicted_needed_bytes_during_marking = - (pred_marking_time * pred_promotion_rate + - _last_unrestrained_young_size); // In reality we would need the maximum size of the young gen during marking. This is a conservative estimate. + pred_promotion_size + + // In reality we would need the maximum size of the young gen during + // marking. This is a conservative estimate. + _last_unrestrained_young_size; size_t internal_threshold = actual_target_threshold(); size_t predicted_initiating_threshold = predicted_needed_bytes_during_marking < internal_threshold ? @@ -165,11 +168,13 @@ size_t G1AdaptiveIHOPControl::get_conc_mark_start_threshold() { return predicted_initiating_threshold; } else { // Use the initial value. - return _initial_ihop_percent * _target_occupancy / 100.0; + return (size_t)(_initial_ihop_percent * _target_occupancy / 100.0); } } -void G1AdaptiveIHOPControl::update_allocation_info(double allocation_time_s, size_t allocated_bytes, size_t additional_buffer_size) { +void G1AdaptiveIHOPControl::update_allocation_info(double allocation_time_s, + size_t allocated_bytes, + size_t additional_buffer_size) { G1IHOPControl::update_allocation_info(allocation_time_s, allocated_bytes, additional_buffer_size); double allocation_rate = (double) allocated_bytes / allocation_time_s; diff --git a/hotspot/src/share/vm/gc/shared/gcTraceSend.cpp b/hotspot/src/share/vm/gc/shared/gcTraceSend.cpp index 5c6b5ad2284..07c8f32e5dd 100644 --- a/hotspot/src/share/vm/gc/shared/gcTraceSend.cpp +++ b/hotspot/src/share/vm/gc/shared/gcTraceSend.cpp @@ -278,7 +278,7 @@ void G1NewTracer::send_basic_ihop_statistics(size_t threshold, evt.set_gcId(GCId::current()); evt.set_threshold(threshold); evt.set_targetOccupancy(target_occupancy); - evt.set_thresholdPercentage(target_occupancy > 0 ? threshold * 100.0 / target_occupancy : 0.0); + evt.set_thresholdPercentage(target_occupancy > 0 ? (threshold * 100 / target_occupancy) : 0); evt.set_currentOccupancy(current_occupancy); evt.set_lastAllocationSize(last_allocation_size); evt.set_lastAllocationDuration(last_allocation_duration); @@ -299,7 +299,7 @@ void G1NewTracer::send_adaptive_ihop_statistics(size_t threshold, if (evt.should_commit()) { evt.set_gcId(GCId::current()); evt.set_threshold(threshold); - evt.set_thresholdPercentage(internal_target_occupancy > 0 ? threshold * 100.0 / internal_target_occupancy : 0.0); + evt.set_thresholdPercentage(internal_target_occupancy > 0 ? (threshold * 100 / internal_target_occupancy) : 0); evt.set_internalTargetOccupancy(internal_target_occupancy); evt.set_currentOccupancy(current_occupancy); evt.set_additionalBufferSize(additional_buffer_size); From 2c277c0986ac6e5ef52ebb57fe73880eb0801c7c Mon Sep 17 00:00:00 2001 From: Jaroslav Bachorik Date: Tue, 24 Nov 2015 16:07:40 +0100 Subject: [PATCH 002/146] 8138677: IllegalAccessException Class sun.usagetracker.UsageTrackerClient$4 (module java.base) can not access a member of class java.lang.management.ManagementFactory (module java.management) Reviewed-by: alanb, mchung, dholmes, erikj, ihse --- hotspot/make/share/makefiles/mapfile-vers | 1 + hotspot/src/share/vm/prims/jvm.cpp | 29 +++++++ hotspot/src/share/vm/prims/jvm.h | 7 ++ hotspot/src/share/vm/services/jmm.h | 6 -- hotspot/src/share/vm/services/management.cpp | 86 -------------------- 5 files changed, 37 insertions(+), 92 deletions(-) diff --git a/hotspot/make/share/makefiles/mapfile-vers b/hotspot/make/share/makefiles/mapfile-vers index 9672bfe3fc9..2085a98b459 100644 --- a/hotspot/make/share/makefiles/mapfile-vers +++ b/hotspot/make/share/makefiles/mapfile-vers @@ -111,6 +111,7 @@ JVM_GetSystemPackages; JVM_GetTemporaryDirectory; JVM_GetVersionInfo; + JVM_GetVmArguments; JVM_Halt; JVM_HoldsLock; JVM_IHashCode; diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp index 463b42180d2..c867df135c1 100644 --- a/hotspot/src/share/vm/prims/jvm.cpp +++ b/hotspot/src/share/vm/prims/jvm.cpp @@ -3723,6 +3723,35 @@ JVM_ENTRY(void, JVM_GetVersionInfo(JNIEnv* env, jvm_version_info* info, size_t i } JVM_END +// Returns an array of java.lang.String objects containing the input arguments to the VM. +JVM_ENTRY(jobjectArray, JVM_GetVmArguments(JNIEnv *env)) + ResourceMark rm(THREAD); + + if (Arguments::num_jvm_args() == 0 && Arguments::num_jvm_flags() == 0) { + return NULL; + } + + char** vm_flags = Arguments::jvm_flags_array(); + char** vm_args = Arguments::jvm_args_array(); + int num_flags = Arguments::num_jvm_flags(); + int num_args = Arguments::num_jvm_args(); + + instanceKlassHandle ik (THREAD, SystemDictionary::String_klass()); + objArrayOop r = oopFactory::new_objArray(ik(), num_args + num_flags, CHECK_NULL); + objArrayHandle result_h(THREAD, r); + + int index = 0; + for (int j = 0; j < num_flags; j++, index++) { + Handle h = java_lang_String::create_from_platform_dependent_str(vm_flags[j], CHECK_NULL); + result_h->obj_at_put(index, h()); + } + for (int i = 0; i < num_args; i++, index++) { + Handle h = java_lang_String::create_from_platform_dependent_str(vm_args[i], CHECK_NULL); + result_h->obj_at_put(index, h()); + } + return (jobjectArray) JNIHandles::make_local(env, result_h()); +JVM_END + JVM_ENTRY_NO_ENV(jint, JVM_FindSignal(const char *name)) return os::get_signal_number(name); JVM_END diff --git a/hotspot/src/share/vm/prims/jvm.h b/hotspot/src/share/vm/prims/jvm.h index 5a14f7cfcf7..2e995cabf4d 100644 --- a/hotspot/src/share/vm/prims/jvm.h +++ b/hotspot/src/share/vm/prims/jvm.h @@ -141,6 +141,10 @@ JVM_ArrayCopy(JNIEnv *env, jclass ignored, jobject src, jint src_pos, JNIEXPORT jobject JNICALL JVM_InitProperties(JNIEnv *env, jobject p); +/* + * java.lang.Runtime + */ + JNIEXPORT void JNICALL JVM_Halt(jint code); @@ -188,6 +192,9 @@ JVM_FindLibraryEntry(void *handle, const char *name); JNIEXPORT jboolean JNICALL JVM_IsSupportedJNIVersion(jint version); +JNIEXPORT jobjectArray JNICALL +JVM_GetVmArguments(JNIEnv *env); + /* * java.lang.Throwable */ diff --git a/hotspot/src/share/vm/services/jmm.h b/hotspot/src/share/vm/services/jmm.h index 40dfb4e7325..0362e794d10 100644 --- a/hotspot/src/share/vm/services/jmm.h +++ b/hotspot/src/share/vm/services/jmm.h @@ -227,16 +227,10 @@ typedef struct jmmInterface_1_ { jint (JNICALL *GetOptionalSupport) (JNIEnv *env, jmmOptionalSupport* support_ptr); - /* This is used by JDK 6 and earlier. - * For JDK 7 and after, use GetInputArgumentArray. - */ - jobject (JNICALL *GetInputArguments) (JNIEnv *env); - jint (JNICALL *GetThreadInfo) (JNIEnv *env, jlongArray ids, jint maxDepth, jobjectArray infoArray); - jobjectArray (JNICALL *GetInputArgumentArray) (JNIEnv *env); jobjectArray (JNICALL *GetMemoryPools) (JNIEnv* env, jobject mgr); diff --git a/hotspot/src/share/vm/services/management.cpp b/hotspot/src/share/vm/services/management.cpp index cbd759df389..892ce92fe7e 100644 --- a/hotspot/src/share/vm/services/management.cpp +++ b/hotspot/src/share/vm/services/management.cpp @@ -473,90 +473,6 @@ JVM_LEAF(jint, jmm_GetOptionalSupport(JNIEnv *env, jmmOptionalSupport* support)) return 0; JVM_END -// Returns a java.lang.String object containing the input arguments to the VM. -JVM_ENTRY(jobject, jmm_GetInputArguments(JNIEnv *env)) - ResourceMark rm(THREAD); - - if (Arguments::num_jvm_args() == 0 && Arguments::num_jvm_flags() == 0) { - return NULL; - } - - char** vm_flags = Arguments::jvm_flags_array(); - char** vm_args = Arguments::jvm_args_array(); - int num_flags = Arguments::num_jvm_flags(); - int num_args = Arguments::num_jvm_args(); - - size_t length = 1; // null terminator - int i; - for (i = 0; i < num_flags; i++) { - length += strlen(vm_flags[i]); - } - for (i = 0; i < num_args; i++) { - length += strlen(vm_args[i]); - } - // add a space between each argument - length += num_flags + num_args - 1; - - // Return the list of input arguments passed to the VM - // and preserve the order that the VM processes. - char* args = NEW_RESOURCE_ARRAY(char, length); - args[0] = '\0'; - // concatenate all jvm_flags - if (num_flags > 0) { - strcat(args, vm_flags[0]); - for (i = 1; i < num_flags; i++) { - strcat(args, " "); - strcat(args, vm_flags[i]); - } - } - - if (num_args > 0 && num_flags > 0) { - // append a space if args already contains one or more jvm_flags - strcat(args, " "); - } - - // concatenate all jvm_args - if (num_args > 0) { - strcat(args, vm_args[0]); - for (i = 1; i < num_args; i++) { - strcat(args, " "); - strcat(args, vm_args[i]); - } - } - - Handle hargs = java_lang_String::create_from_platform_dependent_str(args, CHECK_NULL); - return JNIHandles::make_local(env, hargs()); -JVM_END - -// Returns an array of java.lang.String object containing the input arguments to the VM. -JVM_ENTRY(jobjectArray, jmm_GetInputArgumentArray(JNIEnv *env)) - ResourceMark rm(THREAD); - - if (Arguments::num_jvm_args() == 0 && Arguments::num_jvm_flags() == 0) { - return NULL; - } - - char** vm_flags = Arguments::jvm_flags_array(); - char** vm_args = Arguments::jvm_args_array(); - int num_flags = Arguments::num_jvm_flags(); - int num_args = Arguments::num_jvm_args(); - - instanceKlassHandle ik (THREAD, SystemDictionary::String_klass()); - objArrayOop r = oopFactory::new_objArray(ik(), num_args + num_flags, CHECK_NULL); - objArrayHandle result_h(THREAD, r); - - int index = 0; - for (int j = 0; j < num_flags; j++, index++) { - Handle h = java_lang_String::create_from_platform_dependent_str(vm_flags[j], CHECK_NULL); - result_h->obj_at_put(index, h()); - } - for (int i = 0; i < num_args; i++, index++) { - Handle h = java_lang_String::create_from_platform_dependent_str(vm_args[i], CHECK_NULL); - result_h->obj_at_put(index, h()); - } - return (jobjectArray) JNIHandles::make_local(env, result_h()); -JVM_END - // Returns an array of java/lang/management/MemoryPoolMXBean object // one for each memory pool if obj == null; otherwise returns // an array of memory pools for a given memory manager if @@ -2291,9 +2207,7 @@ const struct jmmInterface_1_ jmm_interface = { NULL, jmm_GetVersion, jmm_GetOptionalSupport, - jmm_GetInputArguments, jmm_GetThreadInfo, - jmm_GetInputArgumentArray, jmm_GetMemoryPools, jmm_GetMemoryManagers, jmm_GetMemoryPoolUsage, From f648ec7dccd990038c84107f0959cc03b23e46bd Mon Sep 17 00:00:00 2001 From: Alexander Harlap Date: Thu, 3 Dec 2015 15:37:52 -0500 Subject: [PATCH 003/146] 8141123: Cleanup in FreeIdSet Some members of FreeIdSet should be size_t instead of ints. Also remove unused code Reviewed-by: tschatzl, kbarrett, tbenson --- hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp | 2 +- hotspot/src/share/vm/gc/shared/workgroup.cpp | 116 +++--------------- hotspot/src/share/vm/gc/shared/workgroup.hpp | 37 ++---- 3 files changed, 31 insertions(+), 124 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp b/hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp index 7eb460394a3..3869a648af9 100644 --- a/hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp +++ b/hotspot/src/share/vm/gc/g1/dirtyCardQueue.cpp @@ -112,7 +112,7 @@ void DirtyCardQueueSet::initialize(CardTableEntryClosure* cl, fl_owner); set_buffer_size(G1UpdateBufferSize); _shared_dirty_card_queue.set_lock(lock); - _free_ids = new FreeIdSet((int) num_par_ids(), _cbl_mon); + _free_ids = new FreeIdSet(num_par_ids(), _cbl_mon); } void DirtyCardQueueSet::handle_zero_index_for_thread(JavaThread* t) { diff --git a/hotspot/src/share/vm/gc/shared/workgroup.cpp b/hotspot/src/share/vm/gc/shared/workgroup.cpp index 22e231ffc0c..0fea9e88eb3 100644 --- a/hotspot/src/share/vm/gc/shared/workgroup.cpp +++ b/hotspot/src/share/vm/gc/shared/workgroup.cpp @@ -500,122 +500,42 @@ bool SequentialSubTasksDone::all_tasks_completed() { return false; } -bool FreeIdSet::_stat_init = false; -FreeIdSet* FreeIdSet::_sets[NSets]; -bool FreeIdSet::_safepoint; - -FreeIdSet::FreeIdSet(int sz, Monitor* mon) : - _sz(sz), _mon(mon), _hd(0), _waiters(0), _index(-1), _claimed(0) +FreeIdSet::FreeIdSet(uint size, Monitor* mon) : + _size(size), _mon(mon), _hd(0), _waiters(0), _claimed(0) { - _ids = NEW_C_HEAP_ARRAY(int, sz, mtInternal); - for (int i = 0; i < sz; i++) _ids[i] = i+1; - _ids[sz-1] = end_of_list; // end of list. - if (_stat_init) { - for (int j = 0; j < NSets; j++) _sets[j] = NULL; - _stat_init = true; + guarantee(size != 0, "must be"); + _ids = NEW_C_HEAP_ARRAY(uint, size, mtGC); + for (uint i = 0; i < size - 1; i++) { + _ids[i] = i+1; } - // Add to sets. (This should happen while the system is still single-threaded.) - for (int j = 0; j < NSets; j++) { - if (_sets[j] == NULL) { - _sets[j] = this; - _index = j; - break; - } - } - guarantee(_index != -1, "Too many FreeIdSets in use!"); + _ids[size-1] = end_of_list; // end of list. } FreeIdSet::~FreeIdSet() { - _sets[_index] = NULL; - FREE_C_HEAP_ARRAY(int, _ids); + FREE_C_HEAP_ARRAY(uint, _ids); } -void FreeIdSet::set_safepoint(bool b) { - _safepoint = b; - if (b) { - for (int j = 0; j < NSets; j++) { - if (_sets[j] != NULL && _sets[j]->_waiters > 0) { - Monitor* mon = _sets[j]->_mon; - mon->lock_without_safepoint_check(); - mon->notify_all(); - mon->unlock(); - } - } - } -} - -#define FID_STATS 0 - -int FreeIdSet::claim_par_id() { -#if FID_STATS - thread_t tslf = thr_self(); - tty->print("claim_par_id[%d]: sz = %d, claimed = %d\n", tslf, _sz, _claimed); -#endif +uint FreeIdSet::claim_par_id() { MutexLockerEx x(_mon, Mutex::_no_safepoint_check_flag); - while (!_safepoint && _hd == end_of_list) { + while (_hd == end_of_list) { _waiters++; -#if FID_STATS - if (_waiters > 5) { - tty->print("claim_par_id waiting[%d]: %d waiters, %d claimed.\n", - tslf, _waiters, _claimed); - } -#endif _mon->wait(Mutex::_no_safepoint_check_flag); _waiters--; } - if (_hd == end_of_list) { -#if FID_STATS - tty->print("claim_par_id[%d]: returning EOL.\n", tslf); -#endif - return -1; - } else { - int res = _hd; - _hd = _ids[res]; - _ids[res] = claimed; // For debugging. - _claimed++; -#if FID_STATS - tty->print("claim_par_id[%d]: returning %d, claimed = %d.\n", - tslf, res, _claimed); -#endif - return res; - } + uint res = _hd; + _hd = _ids[res]; + _ids[res] = claimed; // For debugging. + _claimed++; + return res; } -bool FreeIdSet::claim_perm_id(int i) { - assert(0 <= i && i < _sz, "Out of range."); - MutexLockerEx x(_mon, Mutex::_no_safepoint_check_flag); - int prev = end_of_list; - int cur = _hd; - while (cur != end_of_list) { - if (cur == i) { - if (prev == end_of_list) { - _hd = _ids[cur]; - } else { - _ids[prev] = _ids[cur]; - } - _ids[cur] = claimed; - _claimed++; - return true; - } else { - prev = cur; - cur = _ids[cur]; - } - } - return false; - -} - -void FreeIdSet::release_par_id(int id) { +void FreeIdSet::release_par_id(uint id) { MutexLockerEx x(_mon, Mutex::_no_safepoint_check_flag); assert(_ids[id] == claimed, "Precondition."); _ids[id] = _hd; _hd = id; _claimed--; -#if FID_STATS - tty->print("[%d] release_par_id(%d), waiters =%d, claimed = %d.\n", - thr_self(), id, _waiters, _claimed); -#endif - if (_waiters > 0) - // Notify all would be safer, but this is OK, right? + if (_waiters > 0) { _mon->notify_all(); + } } diff --git a/hotspot/src/share/vm/gc/shared/workgroup.hpp b/hotspot/src/share/vm/gc/shared/workgroup.hpp index fa72ad440ed..8c0dde8b396 100644 --- a/hotspot/src/share/vm/gc/shared/workgroup.hpp +++ b/hotspot/src/share/vm/gc/shared/workgroup.hpp @@ -379,42 +379,29 @@ public: }; // Represents a set of free small integer ids. -class FreeIdSet : public CHeapObj { +class FreeIdSet : public CHeapObj { enum { - end_of_list = -1, - claimed = -2 + end_of_list = UINT_MAX, + claimed = UINT_MAX - 1 }; - int _sz; + uint _size; Monitor* _mon; - int* _ids; - int _hd; - int _waiters; - int _claimed; - - static bool _safepoint; - typedef FreeIdSet* FreeIdSetPtr; - static const int NSets = 10; - static FreeIdSetPtr _sets[NSets]; - static bool _stat_init; - int _index; + uint* _ids; + uint _hd; + uint _waiters; + uint _claimed; public: - FreeIdSet(int sz, Monitor* mon); + FreeIdSet(uint size, Monitor* mon); ~FreeIdSet(); - static void set_safepoint(bool b); - - // Attempt to claim the given id permanently. Returns "true" iff - // successful. - bool claim_perm_id(int i); - // Returns an unclaimed parallel id (waiting for one to be released if - // necessary). Returns "-1" if a GC wakes up a wait for an id. - int claim_par_id(); + // necessary). + uint claim_par_id(); - void release_par_id(int id); + void release_par_id(uint id); }; #endif // SHARE_VM_GC_SHARED_WORKGROUP_HPP From e62c706965e086ff6f73e5dd13b21c59dc93fc65 Mon Sep 17 00:00:00 2001 From: Jon Masamitsu Date: Tue, 24 Nov 2015 15:56:40 -0800 Subject: [PATCH 004/146] 8133023: ParallelGCThreads is not calculated correctly Reviewed-by: kbarrett, tschatzl, sangheki, dholmes --- hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp | 7 ++++--- hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp | 2 ++ hotspot/src/share/vm/runtime/os.cpp | 4 ++++ hotspot/src/share/vm/runtime/vm_version.hpp | 11 +++++++++++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp index e6a79435447..6891ca56998 100644 --- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp @@ -35,7 +35,10 @@ const char* VM_Version::_features_str = ""; unsigned int VM_Version::_L2_data_cache_line_size = 0; void VM_Version::initialize() { - _features = determine_features(); + + assert(_features != VM_Version::unknown_m, "System pre-initialization is not complete."); + guarantee(VM_Version::has_v9(), "only SPARC v9 is supported"); + PrefetchCopyIntervalInBytes = prefetch_copy_interval_in_bytes(); PrefetchScanIntervalInBytes = prefetch_scan_interval_in_bytes(); PrefetchFieldsAhead = prefetch_fields_ahead(); @@ -60,8 +63,6 @@ void VM_Version::initialize() { FLAG_SET_DEFAULT(AllocatePrefetchStyle, 1); } - guarantee(VM_Version::has_v9(), "only SPARC v9 is supported"); - UseSSE = 0; // Only on x86 and x64 _supports_cx8 = has_v9(); diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp index c21a6ee13d5..db2d77e1bc1 100644 --- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp @@ -127,6 +127,8 @@ public: // Initialization static void initialize(); + static void init_before_ergo() { _features = determine_features(); } + // Instruction support static bool has_v8() { return (_features & v8_instructions_m) != 0; } static bool has_v9() { return (_features & v9_instructions_m) != 0; } diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp index 1eb8323c464..5c0ebf54c79 100644 --- a/hotspot/src/share/vm/runtime/os.cpp +++ b/hotspot/src/share/vm/runtime/os.cpp @@ -315,6 +315,10 @@ void os::init_before_ergo() { // We need to initialize large page support here because ergonomics takes some // decisions depending on large page support and the calculated large page size. large_page_init(); + + // VM version initialization identifies some characteristics of the + // the platform that are used during ergonomic decisions. + VM_Version::init_before_ergo(); } void os::signal_init() { diff --git a/hotspot/src/share/vm/runtime/vm_version.hpp b/hotspot/src/share/vm/runtime/vm_version.hpp index 7977a2cbcb5..4e12c00bba5 100644 --- a/hotspot/src/share/vm/runtime/vm_version.hpp +++ b/hotspot/src/share/vm/runtime/vm_version.hpp @@ -56,6 +56,12 @@ class Abstract_VM_Version: AllStatic { unsigned int dem, unsigned int switch_pt); public: + // Called as part of the runtime services initialization which is + // called from the management module initialization (via init_globals()) + // after argument parsing and attaching of the main thread has + // occurred. Examines a variety of the hardware capabilities of + // the platform to determine which features can be used to execute the + // program. static void initialize(); // This allows for early initialization of VM_Version information @@ -65,6 +71,11 @@ class Abstract_VM_Version: AllStatic { // need to specialize this define VM_Version::early_initialize(). static void early_initialize() { } + // Called to initialize VM variables needing initialization + // after command line parsing. Platforms that need to specialize + // this should define VM_Version::init_before_ergo(). + static void init_before_ergo() {} + // Name static const char* vm_name(); // Vendor From b97ff269d0cc7c79a82f6b319f0fe6f020fbe4e2 Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Tue, 1 Dec 2015 12:17:18 +0100 Subject: [PATCH 005/146] 8143930: C1 LinearScan asserts when compiling two back-to-back CompareAndSwapLongs Refactor CAS code to decrease register pressure in c1 Reviewed-by: kvn, shade --- .../src/cpu/x86/vm/c1_LIRGenerator_x86.cpp | 26 +++---- .../intrinsics/unsafe/UnsafeTwoCASLong.java | 77 +++++++++++++++++++ 2 files changed, 90 insertions(+), 13 deletions(-) create mode 100644 hotspot/test/compiler/intrinsics/unsafe/UnsafeTwoCASLong.java diff --git a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp index 8303fe989c8..e7ba64b69e6 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp @@ -736,19 +736,6 @@ void LIRGenerator::do_CompareAndSwap(Intrinsic* x, ValueType* type) { obj.load_item(); offset.load_nonconstant(); - if (type == objectType) { - cmp.load_item_force(FrameMap::rax_oop_opr); - val.load_item(); - } else if (type == intType) { - cmp.load_item_force(FrameMap::rax_opr); - val.load_item(); - } else if (type == longType) { - cmp.load_item_force(FrameMap::long0_opr); - val.load_item_force(FrameMap::long1_opr); - } else { - ShouldNotReachHere(); - } - LIR_Opr addr = new_pointer_register(); LIR_Address* a; if(offset.result()->is_constant()) { @@ -785,6 +772,19 @@ void LIRGenerator::do_CompareAndSwap(Intrinsic* x, ValueType* type) { true /* do_load */, false /* patch */, NULL); } + if (type == objectType) { + cmp.load_item_force(FrameMap::rax_oop_opr); + val.load_item(); + } else if (type == intType) { + cmp.load_item_force(FrameMap::rax_opr); + val.load_item(); + } else if (type == longType) { + cmp.load_item_force(FrameMap::long0_opr); + val.load_item_force(FrameMap::long1_opr); + } else { + ShouldNotReachHere(); + } + LIR_Opr ill = LIR_OprFact::illegalOpr; // for convenience if (type == objectType) __ cas_obj(addr, cmp.result(), val.result(), ill, ill); diff --git a/hotspot/test/compiler/intrinsics/unsafe/UnsafeTwoCASLong.java b/hotspot/test/compiler/intrinsics/unsafe/UnsafeTwoCASLong.java new file mode 100644 index 00000000000..224d22ca42c --- /dev/null +++ b/hotspot/test/compiler/intrinsics/unsafe/UnsafeTwoCASLong.java @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* + * @test + * @bug 8143930 + * @summary C1 LinearScan asserts when compiling two back-to-back CompareAndSwapLongs + * @modules java.base/jdk.internal.misc + * @run testng/othervm -Diters=200000 -XX:TieredStopAtLevel=1 UnsafeTwoCASLong + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class UnsafeTwoCASLong { + static final int ITERS = Integer.getInteger("iters", 1); + static final jdk.internal.misc.Unsafe UNSAFE; + static final long V_OFFSET; + + static { + try { + Field f = jdk.internal.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (jdk.internal.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field vField = UnsafeTwoCASLong.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + long v; + + @Test + public void testFieldInstance() { + UnsafeTwoCASLong t = new UnsafeTwoCASLong(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + static void testAccess(Object base, long offset) { + UNSAFE.compareAndSwapLong(base, offset, 1L, 2L); + UNSAFE.compareAndSwapLong(base, offset, 2L, 1L); + } + +} + From 7925eb298bb356873c48c820f9741aa391979bad Mon Sep 17 00:00:00 2001 From: Roland Westrelin Date: Wed, 2 Dec 2015 15:13:42 +0100 Subject: [PATCH 006/146] 8134883: C1 hard crash in range check elimination in Nashorn test262parallel C1's range check elimination breaks with a non-natural loop that has an exception handler as one entry Reviewed-by: iveresov --- hotspot/src/share/vm/c1/c1_IR.cpp | 7 +- .../TestRangeCheckExceptionHandlerLoop.jasm | 89 +++++++++++++++++++ ...estRangeCheckExceptionHandlerLoopMain.java | 41 +++++++++ 3 files changed, 134 insertions(+), 3 deletions(-) create mode 100644 hotspot/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoop.jasm create mode 100644 hotspot/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoopMain.java diff --git a/hotspot/src/share/vm/c1/c1_IR.cpp b/hotspot/src/share/vm/c1/c1_IR.cpp index 6b015b44d85..105d27fcc0c 100644 --- a/hotspot/src/share/vm/c1/c1_IR.cpp +++ b/hotspot/src/share/vm/c1/c1_IR.cpp @@ -579,11 +579,8 @@ void ComputeLinearScanOrder::count_edges(BlockBegin* cur, BlockBegin* parent) { assert(is_visited(cur), "block must be visisted when block is active"); assert(parent != NULL, "must have parent"); - cur->set(BlockBegin::linear_scan_loop_header_flag); cur->set(BlockBegin::backward_branch_target_flag); - parent->set(BlockBegin::linear_scan_loop_end_flag); - // When a loop header is also the start of an exception handler, then the backward branch is // an exception edge. Because such edges are usually critical edges which cannot be split, the // loop must be excluded here from processing. @@ -592,6 +589,10 @@ void ComputeLinearScanOrder::count_edges(BlockBegin* cur, BlockBegin* parent) { _iterative_dominators = true; return; } + + cur->set(BlockBegin::linear_scan_loop_header_flag); + parent->set(BlockBegin::linear_scan_loop_end_flag); + assert(parent->number_of_sux() == 1 && parent->sux_at(0) == cur, "loop end blocks must have one successor (critical edges are split)"); diff --git a/hotspot/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoop.jasm b/hotspot/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoop.jasm new file mode 100644 index 00000000000..2befe6db091 --- /dev/null +++ b/hotspot/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoop.jasm @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +super public class TestRangeCheckExceptionHandlerLoop + version 51:0 +{ + + +public Method "":"()V" + stack 1 locals 1 +{ + aload_0; + invokespecial Method java/lang/Object."":"()V"; + return; +} + +/* This method has an irreducible loop, with 2 entries, one is the exception handler + + static void test(boolean flag, int[] array, Exception exception) throws Exception { + int i = 0; + if (flag) { + try { + throw exception; + } catch(Exception e) { + array[i] = 0; + i++; + } + } + if (i < 10) { + throw exception; // caught by exception handler above as well + } + } +*/ +public static Method test:"(Z[ILjava/lang/Exception;)V" + throws java/lang/Exception + stack 3 locals 5 +{ + iconst_0; + istore_3; + iload_0; + ifeq L17; + try t0; + aload_2; + athrow; + endtry t0; + catch t0 java/lang/Exception; + catch t1 java/lang/Exception; + stack_frame_type full; + locals_map int, class "[I", class java/lang/Exception, int; + stack_map class java/lang/Exception; + astore 4; + aload_1; + iload_3; + iconst_0; + iastore; + iinc 3, 1; + L17: stack_frame_type same; + iload_3; + bipush 10; + if_icmpge L25; + try t1; + aload_2; + athrow; + endtry t1; + L25: stack_frame_type same; + return; +} +} // end Class TestRangeCheckExceptionHandlerLoop diff --git a/hotspot/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoopMain.java b/hotspot/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoopMain.java new file mode 100644 index 00000000000..3eac3231571 --- /dev/null +++ b/hotspot/test/compiler/rangechecks/TestRangeCheckExceptionHandlerLoopMain.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* + * @test + * @bug 8134883 + * @summary C1's range check elimination breaks with a non-natural loop that an exception handler as one entry + * @compile TestRangeCheckExceptionHandlerLoop.jasm + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestRangeCheckExceptionHandlerLoopMain + */ + +public class TestRangeCheckExceptionHandlerLoopMain { + public static void main(String[] args) throws Exception { + Exception exception = new Exception(); + int[] array = new int[10]; + for (int i = 0; i < 20000; i++) { + TestRangeCheckExceptionHandlerLoop.test(false, array, exception); + } + } +} From 67caeeaa08ca5174d6ca672c3a9004ecc43e0b69 Mon Sep 17 00:00:00 2001 From: Fei Yang Date: Mon, 7 Dec 2015 21:23:02 +0800 Subject: [PATCH 007/146] 8144587: aarch64: generate vectorized MLA/MLS instructions Add support for MLA/MLS (vector) instructions Reviewed-by: roland --- hotspot/src/cpu/aarch64/vm/aarch64.ad | 118 ++++++++++++++++++ .../src/cpu/aarch64/vm/assembler_aarch64.hpp | 2 + 2 files changed, 120 insertions(+) diff --git a/hotspot/src/cpu/aarch64/vm/aarch64.ad b/hotspot/src/cpu/aarch64/vm/aarch64.ad index 75b598e902c..b6a1a242038 100644 --- a/hotspot/src/cpu/aarch64/vm/aarch64.ad +++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad @@ -15318,6 +15318,124 @@ instruct vmul2D(vecX dst, vecX src1, vecX src2) ins_pipe(pipe_class_default); %} +// --------------------------------- MLA -------------------------------------- + +instruct vmla4S(vecD dst, vecD src1, vecD src2) +%{ + predicate(n->as_Vector()->length() == 2 || + n->as_Vector()->length() == 4); + match(Set dst (AddVS dst (MulVS src1 src2))); + ins_cost(INSN_COST); + format %{ "mlav $dst,$src1,$src2\t# vector (4H)" %} + ins_encode %{ + __ mlav(as_FloatRegister($dst$$reg), __ T4H, + as_FloatRegister($src1$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_class_default); +%} + +instruct vmla8S(vecX dst, vecX src1, vecX src2) +%{ + predicate(n->as_Vector()->length() == 8); + match(Set dst (AddVS dst (MulVS src1 src2))); + ins_cost(INSN_COST); + format %{ "mlav $dst,$src1,$src2\t# vector (8H)" %} + ins_encode %{ + __ mlav(as_FloatRegister($dst$$reg), __ T8H, + as_FloatRegister($src1$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_class_default); +%} + +instruct vmla2I(vecD dst, vecD src1, vecD src2) +%{ + predicate(n->as_Vector()->length() == 2); + match(Set dst (AddVI dst (MulVI src1 src2))); + ins_cost(INSN_COST); + format %{ "mlav $dst,$src1,$src2\t# vector (2S)" %} + ins_encode %{ + __ mlav(as_FloatRegister($dst$$reg), __ T2S, + as_FloatRegister($src1$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_class_default); +%} + +instruct vmla4I(vecX dst, vecX src1, vecX src2) +%{ + predicate(n->as_Vector()->length() == 4); + match(Set dst (AddVI dst (MulVI src1 src2))); + ins_cost(INSN_COST); + format %{ "mlav $dst,$src1,$src2\t# vector (4S)" %} + ins_encode %{ + __ mlav(as_FloatRegister($dst$$reg), __ T4S, + as_FloatRegister($src1$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_class_default); +%} + +// --------------------------------- MLS -------------------------------------- + +instruct vmls4S(vecD dst, vecD src1, vecD src2) +%{ + predicate(n->as_Vector()->length() == 2 || + n->as_Vector()->length() == 4); + match(Set dst (SubVS dst (MulVS src1 src2))); + ins_cost(INSN_COST); + format %{ "mlsv $dst,$src1,$src2\t# vector (4H)" %} + ins_encode %{ + __ mlsv(as_FloatRegister($dst$$reg), __ T4H, + as_FloatRegister($src1$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_class_default); +%} + +instruct vmls8S(vecX dst, vecX src1, vecX src2) +%{ + predicate(n->as_Vector()->length() == 8); + match(Set dst (SubVS dst (MulVS src1 src2))); + ins_cost(INSN_COST); + format %{ "mlsv $dst,$src1,$src2\t# vector (8H)" %} + ins_encode %{ + __ mlsv(as_FloatRegister($dst$$reg), __ T8H, + as_FloatRegister($src1$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_class_default); +%} + +instruct vmls2I(vecD dst, vecD src1, vecD src2) +%{ + predicate(n->as_Vector()->length() == 2); + match(Set dst (SubVI dst (MulVI src1 src2))); + ins_cost(INSN_COST); + format %{ "mlsv $dst,$src1,$src2\t# vector (2S)" %} + ins_encode %{ + __ mlsv(as_FloatRegister($dst$$reg), __ T2S, + as_FloatRegister($src1$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_class_default); +%} + +instruct vmls4I(vecX dst, vecX src1, vecX src2) +%{ + predicate(n->as_Vector()->length() == 4); + match(Set dst (SubVI dst (MulVI src1 src2))); + ins_cost(INSN_COST); + format %{ "mlsv $dst,$src1,$src2\t# vector (4S)" %} + ins_encode %{ + __ mlsv(as_FloatRegister($dst$$reg), __ T4S, + as_FloatRegister($src1$$reg), + as_FloatRegister($src2$$reg)); + %} + ins_pipe(pipe_class_default); +%} + // --------------------------------- DIV -------------------------------------- instruct vdiv2F(vecD dst, vecD src1, vecD src2) diff --git a/hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp index dcd99c341ce..76fdf876f90 100644 --- a/hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp @@ -2041,6 +2041,8 @@ public: INSN(addv, 0, 0b100001); INSN(subv, 1, 0b100001); INSN(mulv, 0, 0b100111); + INSN(mlav, 0, 0b100101); + INSN(mlsv, 1, 0b100101); INSN(sshl, 0, 0b010001); INSN(ushl, 1, 0b010001); From 73acd1827545f9011b44b86ab69c56b7302b4d46 Mon Sep 17 00:00:00 2001 From: Paul Sandoz Date: Thu, 3 Dec 2015 11:18:34 +0100 Subject: [PATCH 008/146] 8144223: Move j.l.invoke.{ForceInline, DontInline, Stable} to jdk.internal.vm.annotation package Reviewed-by: jrose, vlivanov, mchung, roland --- .../src/jdk/vm/ci/hotspot/Stable.java | 2 +- hotspot/src/share/vm/classfile/classFileParser.cpp | 6 +++--- hotspot/src/share/vm/classfile/vmSymbols.hpp | 6 +++--- .../test/compiler/jsr292/NonInlinedCall/GCTest.java | 3 +++ .../compiler/jsr292/NonInlinedCall/InvokeTest.java | 3 +++ .../compiler/jsr292/NonInlinedCall/RedefineTest.java | 3 ++- hotspot/test/compiler/stable/TestStableBoolean.java | 2 ++ hotspot/test/compiler/stable/TestStableByte.java | 2 ++ hotspot/test/compiler/stable/TestStableChar.java | 2 ++ hotspot/test/compiler/stable/TestStableDouble.java | 2 ++ hotspot/test/compiler/stable/TestStableFloat.java | 2 ++ hotspot/test/compiler/stable/TestStableInt.java | 2 ++ hotspot/test/compiler/stable/TestStableLong.java | 2 ++ .../compiler/stable/TestStableMemoryBarrier.java | 2 ++ hotspot/test/compiler/stable/TestStableObject.java | 2 ++ hotspot/test/compiler/stable/TestStableShort.java | 2 ++ .../test/compiler/unsafe/UnsafeGetConstantField.java | 12 +++++++++--- 17 files changed, 44 insertions(+), 11 deletions(-) diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/Stable.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/Stable.java index e386dc0ca77..f313238bf41 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/Stable.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/Stable.java @@ -29,7 +29,7 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** - * This annotation functions as an alias for the java.lang.invoke.Stable annotation within JVMCI + * This annotation functions as an alias for the jdk.internal.vm.annotation.Stable annotation within JVMCI * code. It is specially recognized during class file parsing in the same way as that annotation. */ @Target(ElementType.FIELD) diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp index aa788362bc7..184744e5481 100644 --- a/hotspot/src/share/vm/classfile/classFileParser.cpp +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp @@ -1733,11 +1733,11 @@ ClassFileParser::AnnotationCollector::annotation_index(ClassLoaderData* loader_d if (_location != _in_method) break; // only allow for methods if (!privileged) break; // only allow in privileged code return _method_CallerSensitive; - case vmSymbols::VM_SYMBOL_ENUM_NAME(java_lang_invoke_ForceInline_signature): + case vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_internal_vm_annotation_ForceInline_signature): if (_location != _in_method) break; // only allow for methods if (!privileged) break; // only allow in privileged code return _method_ForceInline; - case vmSymbols::VM_SYMBOL_ENUM_NAME(java_lang_invoke_DontInline_signature): + case vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_internal_vm_annotation_DontInline_signature): if (_location != _in_method) break; // only allow for methods if (!privileged) break; // only allow in privileged code return _method_DontInline; @@ -1763,7 +1763,7 @@ ClassFileParser::AnnotationCollector::annotation_index(ClassLoaderData* loader_d if (!privileged) break; // only allow in privileged code return _field_Stable; #endif - case vmSymbols::VM_SYMBOL_ENUM_NAME(java_lang_invoke_Stable_signature): + case vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_internal_vm_annotation_Stable_signature): if (_location != _in_field) break; // only allow for fields if (!privileged) break; // only allow in privileged code return _field_Stable; diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp index e651ad00ed9..2c1f2572e85 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp @@ -268,6 +268,9 @@ \ /* Intrinsic Annotation (JDK 9 and above) */ \ template(jdk_internal_HotSpotIntrinsicCandidate_signature, "Ljdk/internal/HotSpotIntrinsicCandidate;") \ + template(jdk_internal_vm_annotation_ForceInline_signature, "Ljdk/internal/vm/annotation/ForceInline;") \ + template(jdk_internal_vm_annotation_DontInline_signature, "Ljdk/internal/vm/annotation/DontInline;") \ + template(jdk_internal_vm_annotation_Stable_signature, "Ljdk/internal/vm/annotation/Stable;") \ \ /* Support for JSR 292 & invokedynamic (JDK 1.7 and above) */ \ template(java_lang_invoke_CallSite, "java/lang/invoke/CallSite") \ @@ -286,10 +289,7 @@ template(java_lang_invoke_MethodHandleNatives, "java/lang/invoke/MethodHandleNatives") \ template(java_lang_invoke_MethodHandleNatives_CallSiteContext, "java/lang/invoke/MethodHandleNatives$CallSiteContext") \ template(java_lang_invoke_LambdaForm, "java/lang/invoke/LambdaForm") \ - template(java_lang_invoke_ForceInline_signature, "Ljava/lang/invoke/ForceInline;") \ - template(java_lang_invoke_DontInline_signature, "Ljava/lang/invoke/DontInline;") \ template(java_lang_invoke_InjectedProfile_signature, "Ljava/lang/invoke/InjectedProfile;") \ - template(java_lang_invoke_Stable_signature, "Ljava/lang/invoke/Stable;") \ template(java_lang_invoke_LambdaForm_Compiled_signature, "Ljava/lang/invoke/LambdaForm$Compiled;") \ template(java_lang_invoke_LambdaForm_Hidden_signature, "Ljava/lang/invoke/LambdaForm$Hidden;") \ template(java_lang_invoke_MethodHandleNatives_CallSiteContext_signature, "Ljava/lang/invoke/MethodHandleNatives$CallSiteContext;") \ diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java index 0a325734db4..8be925b00d6 100644 --- a/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java @@ -41,6 +41,9 @@ package java.lang.invoke; import sun.hotspot.WhiteBox; +import jdk.internal.vm.annotation.DontInline; +import jdk.internal.vm.annotation.Stable; + import java.lang.ref.*; import static jdk.test.lib.Asserts.*; diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java index 687ef7242a7..8ab6031b575 100644 --- a/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java @@ -43,6 +43,9 @@ package java.lang.invoke; import sun.hotspot.WhiteBox; + +import jdk.internal.vm.annotation.DontInline; + import static jdk.test.lib.Asserts.*; public class InvokeTest { diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java index 54ce2221390..2da0f4bd70b 100644 --- a/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java @@ -44,6 +44,7 @@ import sun.hotspot.WhiteBox; import sun.misc.Unsafe; import jdk.internal.org.objectweb.asm.*; +import jdk.internal.vm.annotation.DontInline; import java.lang.instrument.ClassDefinition; import java.lang.instrument.Instrumentation; @@ -73,7 +74,7 @@ public class RedefineTest { cw.visit(52, ACC_PUBLIC | ACC_SUPER, NAME, null, "java/lang/Object", null); { mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "f", "()I", null, null); - mv.visitAnnotation("Ljava/lang/invoke/DontInline;", true); + mv.visitAnnotation("Ljdk/internal/vm/annotation/DontInline;", true); mv.visitCode(); mv.visitLdcInsn(r); mv.visitInsn(IRETURN); diff --git a/hotspot/test/compiler/stable/TestStableBoolean.java b/hotspot/test/compiler/stable/TestStableBoolean.java index 767055752b1..168ddf48da7 100644 --- a/hotspot/test/compiler/stable/TestStableBoolean.java +++ b/hotspot/test/compiler/stable/TestStableBoolean.java @@ -82,6 +82,8 @@ */ package java.lang.invoke; +import jdk.internal.vm.annotation.Stable; + import java.lang.reflect.InvocationTargetException; public class TestStableBoolean { diff --git a/hotspot/test/compiler/stable/TestStableByte.java b/hotspot/test/compiler/stable/TestStableByte.java index 9201cd09794..694205e8e55 100644 --- a/hotspot/test/compiler/stable/TestStableByte.java +++ b/hotspot/test/compiler/stable/TestStableByte.java @@ -82,6 +82,8 @@ */ package java.lang.invoke; +import jdk.internal.vm.annotation.Stable; + import java.lang.reflect.InvocationTargetException; public class TestStableByte { diff --git a/hotspot/test/compiler/stable/TestStableChar.java b/hotspot/test/compiler/stable/TestStableChar.java index f1a2e9f5842..d92dfb67c73 100644 --- a/hotspot/test/compiler/stable/TestStableChar.java +++ b/hotspot/test/compiler/stable/TestStableChar.java @@ -82,6 +82,8 @@ */ package java.lang.invoke; +import jdk.internal.vm.annotation.Stable; + import java.lang.reflect.InvocationTargetException; public class TestStableChar { diff --git a/hotspot/test/compiler/stable/TestStableDouble.java b/hotspot/test/compiler/stable/TestStableDouble.java index 54ff453cd66..5e55a0f8597 100644 --- a/hotspot/test/compiler/stable/TestStableDouble.java +++ b/hotspot/test/compiler/stable/TestStableDouble.java @@ -82,6 +82,8 @@ */ package java.lang.invoke; +import jdk.internal.vm.annotation.Stable; + import java.lang.reflect.InvocationTargetException; public class TestStableDouble { diff --git a/hotspot/test/compiler/stable/TestStableFloat.java b/hotspot/test/compiler/stable/TestStableFloat.java index 00a90591092..04acead22ef 100644 --- a/hotspot/test/compiler/stable/TestStableFloat.java +++ b/hotspot/test/compiler/stable/TestStableFloat.java @@ -82,6 +82,8 @@ */ package java.lang.invoke; +import jdk.internal.vm.annotation.Stable; + import java.lang.reflect.InvocationTargetException; public class TestStableFloat { diff --git a/hotspot/test/compiler/stable/TestStableInt.java b/hotspot/test/compiler/stable/TestStableInt.java index 5a052a15dec..2837bd3d1a5 100644 --- a/hotspot/test/compiler/stable/TestStableInt.java +++ b/hotspot/test/compiler/stable/TestStableInt.java @@ -82,6 +82,8 @@ */ package java.lang.invoke; +import jdk.internal.vm.annotation.Stable; + import java.lang.reflect.InvocationTargetException; public class TestStableInt { diff --git a/hotspot/test/compiler/stable/TestStableLong.java b/hotspot/test/compiler/stable/TestStableLong.java index a859a6b20d7..b6c2fbb0be6 100644 --- a/hotspot/test/compiler/stable/TestStableLong.java +++ b/hotspot/test/compiler/stable/TestStableLong.java @@ -82,6 +82,8 @@ */ package java.lang.invoke; +import jdk.internal.vm.annotation.Stable; + import java.lang.reflect.InvocationTargetException; public class TestStableLong { diff --git a/hotspot/test/compiler/stable/TestStableMemoryBarrier.java b/hotspot/test/compiler/stable/TestStableMemoryBarrier.java index 6a1e1f6d149..4d3a223463c 100644 --- a/hotspot/test/compiler/stable/TestStableMemoryBarrier.java +++ b/hotspot/test/compiler/stable/TestStableMemoryBarrier.java @@ -36,6 +36,8 @@ */ package java.lang.invoke; +import jdk.internal.vm.annotation.Stable; + import java.lang.reflect.InvocationTargetException; public class TestStableMemoryBarrier { diff --git a/hotspot/test/compiler/stable/TestStableObject.java b/hotspot/test/compiler/stable/TestStableObject.java index 38b8c1ce9df..b61736b6e32 100644 --- a/hotspot/test/compiler/stable/TestStableObject.java +++ b/hotspot/test/compiler/stable/TestStableObject.java @@ -83,6 +83,8 @@ */ package java.lang.invoke; +import jdk.internal.vm.annotation.Stable; + import java.lang.reflect.InvocationTargetException; public class TestStableObject { diff --git a/hotspot/test/compiler/stable/TestStableShort.java b/hotspot/test/compiler/stable/TestStableShort.java index 57e52cfa0d4..1b0f127785c 100644 --- a/hotspot/test/compiler/stable/TestStableShort.java +++ b/hotspot/test/compiler/stable/TestStableShort.java @@ -82,6 +82,8 @@ */ package java.lang.invoke; +import jdk.internal.vm.annotation.Stable; + import java.lang.reflect.InvocationTargetException; public class TestStableShort { diff --git a/hotspot/test/compiler/unsafe/UnsafeGetConstantField.java b/hotspot/test/compiler/unsafe/UnsafeGetConstantField.java index bd2b28db674..8c144143d62 100644 --- a/hotspot/test/compiler/unsafe/UnsafeGetConstantField.java +++ b/hotspot/test/compiler/unsafe/UnsafeGetConstantField.java @@ -40,10 +40,16 @@ */ package java.lang.invoke; -import jdk.internal.org.objectweb.asm.*; -import jdk.test.lib.Asserts; -import jdk.test.lib.Utils; +import jdk.internal.vm.annotation.DontInline; +import jdk.internal.vm.annotation.Stable; import jdk.internal.misc.Unsafe; +import jdk.internal.org.objectweb.asm.ClassWriter; +import jdk.internal.org.objectweb.asm.FieldVisitor; +import jdk.internal.org.objectweb.asm.MethodVisitor; +import jdk.internal.org.objectweb.asm.Opcodes; +import jdk.internal.org.objectweb.asm.Type; +import jdk.test.lib.Asserts; + import static jdk.internal.org.objectweb.asm.Opcodes.*; public class UnsafeGetConstantField { From c64b2175e7f4aac94f48bc8e26e9d8db73b9fc9b Mon Sep 17 00:00:00 2001 From: Andreas Eriksson Date: Fri, 4 Dec 2015 14:06:38 +0100 Subject: [PATCH 009/146] 6869327: Add new C2 flag to keep safepoints in counted loops Reviewed-by: kvn, shade --- hotspot/src/share/vm/opto/c2_globals.hpp | 3 + hotspot/src/share/vm/opto/loopnode.cpp | 96 +++++++++++-------- hotspot/src/share/vm/opto/loopnode.hpp | 5 +- .../loopopts/UseCountedLoopSafepoints.java | 68 +++++++++++++ 4 files changed, 129 insertions(+), 43 deletions(-) create mode 100644 hotspot/test/compiler/loopopts/UseCountedLoopSafepoints.java diff --git a/hotspot/src/share/vm/opto/c2_globals.hpp b/hotspot/src/share/vm/opto/c2_globals.hpp index 0001104c001..6a08d42f052 100644 --- a/hotspot/src/share/vm/opto/c2_globals.hpp +++ b/hotspot/src/share/vm/opto/c2_globals.hpp @@ -213,6 +213,9 @@ notproduct(bool, TraceProfileTripCount, false, \ "Trace profile loop trip count information") \ \ + product(bool, UseCountedLoopSafepoints, false, \ + "Force counted loops to keep a safepoint") \ + \ product(bool, UseLoopPredicate, true, \ "Generate a predicate to select fast/slow loop versions") \ \ diff --git a/hotspot/src/share/vm/opto/loopnode.cpp b/hotspot/src/share/vm/opto/loopnode.cpp index 953364397ab..db0b3c83c84 100644 --- a/hotspot/src/share/vm/opto/loopnode.cpp +++ b/hotspot/src/share/vm/opto/loopnode.cpp @@ -690,14 +690,16 @@ bool PhaseIdealLoop::is_counted_loop( Node *x, IdealLoopTree *loop ) { } // LoopLimitCheck - // Check for SafePoint on backedge and remove - Node *sfpt = x->in(LoopNode::LoopBackControl); - if (sfpt->Opcode() == Op_SafePoint && is_deleteable_safept(sfpt)) { - lazy_replace( sfpt, iftrue ); - if (loop->_safepts != NULL) { - loop->_safepts->yank(sfpt); + if (!UseCountedLoopSafepoints) { + // Check for SafePoint on backedge and remove + Node *sfpt = x->in(LoopNode::LoopBackControl); + if (sfpt->Opcode() == Op_SafePoint && is_deleteable_safept(sfpt)) { + lazy_replace( sfpt, iftrue ); + if (loop->_safepts != NULL) { + loop->_safepts->yank(sfpt); + } + loop->_tail = iftrue; } - loop->_tail = iftrue; } // Build a canonical trip test. @@ -786,12 +788,14 @@ bool PhaseIdealLoop::is_counted_loop( Node *x, IdealLoopTree *loop ) { lazy_replace( x, l ); set_idom(l, init_control, dom_depth(x)); - // Check for immediately preceding SafePoint and remove - Node *sfpt2 = le->in(0); - if (sfpt2->Opcode() == Op_SafePoint && is_deleteable_safept(sfpt2)) { - lazy_replace( sfpt2, sfpt2->in(TypeFunc::Control)); - if (loop->_safepts != NULL) { - loop->_safepts->yank(sfpt2); + if (!UseCountedLoopSafepoints) { + // Check for immediately preceding SafePoint and remove + Node *sfpt2 = le->in(0); + if (sfpt2->Opcode() == Op_SafePoint && is_deleteable_safept(sfpt2)) { + lazy_replace( sfpt2, sfpt2->in(TypeFunc::Control)); + if (loop->_safepts != NULL) { + loop->_safepts->yank(sfpt2); + } } } @@ -1813,6 +1817,33 @@ void PhaseIdealLoop::replace_parallel_iv(IdealLoopTree *loop) { } } +void IdealLoopTree::remove_safepoints(PhaseIdealLoop* phase, bool keep_one) { + // Look for a safepoint on the idom-path. + Node* keep = NULL; + if (keep_one) { + // Keep one if possible + for (Node* i = tail(); i != _head; i = phase->idom(i)) { + if (i->Opcode() == Op_SafePoint && phase->get_loop(i) == this) { + keep = i; + break; // Found one + } + } + } + + // Delete other safepoints in this loop. + Node_List* sfpts = _safepts; + if (sfpts != NULL) { + assert(keep == NULL || keep->Opcode() == Op_SafePoint, "not safepoint"); + for (uint i = 0; i < sfpts->size(); i++) { + Node* n = sfpts->at(i); + assert(phase->get_loop(n) == this, ""); + if (n != keep && phase->is_deleteable_safept(n)) { + phase->lazy_replace(n, n->in(TypeFunc::Control)); + } + } + } +} + //------------------------------counted_loop----------------------------------- // Convert to counted loops where possible void IdealLoopTree::counted_loop( PhaseIdealLoop *phase ) { @@ -1824,42 +1855,23 @@ void IdealLoopTree::counted_loop( PhaseIdealLoop *phase ) { if (_head->is_CountedLoop() || phase->is_counted_loop(_head, this)) { - _has_sfpt = 1; // Indicate we do not need a safepoint here - // Look for safepoints to remove. - Node_List* sfpts = _safepts; - if (sfpts != NULL) { - for (uint i = 0; i < sfpts->size(); i++) { - Node* n = sfpts->at(i); - assert(phase->get_loop(n) == this, ""); - if (phase->is_deleteable_safept(n)) { - phase->lazy_replace(n, n->in(TypeFunc::Control)); - } - } + if (!UseCountedLoopSafepoints) { + // Indicate we do not need a safepoint here + _has_sfpt = 1; } + // Remove safepoints + bool keep_one_sfpt = !(_has_call || _has_sfpt); + remove_safepoints(phase, keep_one_sfpt); + // Look for induction variables phase->replace_parallel_iv(this); } else if (_parent != NULL && !_irreducible) { - // Not a counted loop. - // Look for a safepoint on the idom-path. - Node* sfpt = tail(); - for (; sfpt != _head; sfpt = phase->idom(sfpt)) { - if (sfpt->Opcode() == Op_SafePoint && phase->get_loop(sfpt) == this) - break; // Found one - } - // Delete other safepoints in this loop. - Node_List* sfpts = _safepts; - if (sfpts != NULL && sfpt != _head && sfpt->Opcode() == Op_SafePoint) { - for (uint i = 0; i < sfpts->size(); i++) { - Node* n = sfpts->at(i); - assert(phase->get_loop(n) == this, ""); - if (n != sfpt && phase->is_deleteable_safept(n)) { - phase->lazy_replace(n, n->in(TypeFunc::Control)); - } - } - } + // Not a counted loop. Keep one safepoint. + bool keep_one_sfpt = true; + remove_safepoints(phase, keep_one_sfpt); } // Recursively diff --git a/hotspot/src/share/vm/opto/loopnode.hpp b/hotspot/src/share/vm/opto/loopnode.hpp index fd736bbf426..59cfc690c7e 100644 --- a/hotspot/src/share/vm/opto/loopnode.hpp +++ b/hotspot/src/share/vm/opto/loopnode.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -429,6 +429,9 @@ public: // encountered. void allpaths_check_safepts(VectorSet &visited, Node_List &stack); + // Remove safepoints from loop. Optionally keeping one. + void remove_safepoints(PhaseIdealLoop* phase, bool keep_one); + // Convert to counted loops where possible void counted_loop( PhaseIdealLoop *phase ); diff --git a/hotspot/test/compiler/loopopts/UseCountedLoopSafepoints.java b/hotspot/test/compiler/loopopts/UseCountedLoopSafepoints.java new file mode 100644 index 00000000000..c769b5b5aba --- /dev/null +++ b/hotspot/test/compiler/loopopts/UseCountedLoopSafepoints.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/** + * @test + * @bug 6869327 + * @summary Test that C2 flag UseCountedLoopSafepoints ensures a safepoint is kept in a CountedLoop + * @library /testlibrary + * @modules java.base + * @run main UseCountedLoopSafepoints + */ + +import java.util.concurrent.atomic.AtomicLong; +import jdk.test.lib.ProcessTools; +import jdk.test.lib.OutputAnalyzer; + +public class UseCountedLoopSafepoints { + private static final AtomicLong _num = new AtomicLong(0); + + // Uses the fact that an EnableBiasedLocking vmop will be started + // after 500ms, while we are still in the loop. If there is a + // safepoint in the counted loop, then we will reach safepoint + // very quickly. Otherwise SafepointTimeout will be hit. + public static void main (String args[]) throws Exception { + if (args.length == 1) { + final int loops = Integer.parseInt(args[0]); + for (int i = 0; i < loops; i++) { + _num.addAndGet(1); + } + } else { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-XX:+IgnoreUnrecognizedVMOptions", + "-XX:-TieredCompilation", + "-XX:+UseBiasedLocking", + "-XX:BiasedLockingStartupDelay=500", + "-XX:+SafepointTimeout", + "-XX:SafepointTimeoutDelay=2000", + "-XX:+UseCountedLoopSafepoints", + "UseCountedLoopSafepoints", + "2000000000" + ); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldNotContain("Timeout detected"); + output.shouldHaveExitValue(0); + } + } +} From 0fba365de2b950d02c586068f86d12509cede415 Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Fri, 4 Dec 2015 16:23:39 +0100 Subject: [PATCH 010/146] 8136445: Performance issue with Nashorn and C2's global code motion Reviewed-by: kvn --- hotspot/src/share/vm/opto/block.hpp | 6 +-- hotspot/src/share/vm/opto/gcm.cpp | 63 +++++++++++++++++------------ 2 files changed, 41 insertions(+), 28 deletions(-) diff --git a/hotspot/src/share/vm/opto/block.hpp b/hotspot/src/share/vm/opto/block.hpp index ad30a167130..d84529deb88 100644 --- a/hotspot/src/share/vm/opto/block.hpp +++ b/hotspot/src/share/vm/opto/block.hpp @@ -419,12 +419,12 @@ class PhaseCFG : public Phase { void global_code_motion(); // Schedule Nodes early in their basic blocks. - bool schedule_early(VectorSet &visited, Node_List &roots); + bool schedule_early(VectorSet &visited, Node_Stack &roots); // For each node, find the latest block it can be scheduled into // and then select the cheapest block between the latest and earliest // block to place the node. - void schedule_late(VectorSet &visited, Node_List &stack); + void schedule_late(VectorSet &visited, Node_Stack &stack); // Compute the (backwards) latency of a node from a single use int latency_from_use(Node *n, const Node *def, Node *use); @@ -433,7 +433,7 @@ class PhaseCFG : public Phase { void partial_latency_of_defs(Node *n); // Compute the instruction global latency with a backwards walk - void compute_latencies_backwards(VectorSet &visited, Node_List &stack); + void compute_latencies_backwards(VectorSet &visited, Node_Stack &stack); // Pick a block between early and late that is a cheaper alternative // to late. Helper for schedule_late. diff --git a/hotspot/src/share/vm/opto/gcm.cpp b/hotspot/src/share/vm/opto/gcm.cpp index 70c17ad8b1c..833be199daa 100644 --- a/hotspot/src/share/vm/opto/gcm.cpp +++ b/hotspot/src/share/vm/opto/gcm.cpp @@ -228,18 +228,19 @@ static Block* find_deepest_input(Node* n, const PhaseCFG* cfg) { // Find the earliest Block any instruction can be placed in. Some instructions // are pinned into Blocks. Unpinned instructions can appear in last block in // which all their inputs occur. -bool PhaseCFG::schedule_early(VectorSet &visited, Node_List &roots) { +bool PhaseCFG::schedule_early(VectorSet &visited, Node_Stack &roots) { // Allocate stack with enough space to avoid frequent realloc - Node_Stack nstack(roots.Size() + 8); + Node_Stack nstack(roots.size() + 8); // _root will be processed among C->top() inputs - roots.push(C->top()); + roots.push(C->top(), 0); visited.set(C->top()->_idx); while (roots.size() != 0) { // Use local variables nstack_top_n & nstack_top_i to cache values // on stack's top. - Node* parent_node = roots.pop(); + Node* parent_node = roots.node(); uint input_index = 0; + roots.pop(); while (true) { if (input_index == 0) { @@ -286,7 +287,7 @@ bool PhaseCFG::schedule_early(VectorSet &visited, Node_List &roots) { break; } else if (!is_visited) { // Visit this guy later, using worklist - roots.push(in); + roots.push(in, 0); } } @@ -791,23 +792,23 @@ private: public: // Constructor for the iterator - Node_Backward_Iterator(Node *root, VectorSet &visited, Node_List &stack, PhaseCFG &cfg); + Node_Backward_Iterator(Node *root, VectorSet &visited, Node_Stack &stack, PhaseCFG &cfg); // Postincrement operator to iterate over the nodes Node *next(); private: VectorSet &_visited; - Node_List &_stack; + Node_Stack &_stack; PhaseCFG &_cfg; }; // Constructor for the Node_Backward_Iterator -Node_Backward_Iterator::Node_Backward_Iterator( Node *root, VectorSet &visited, Node_List &stack, PhaseCFG &cfg) +Node_Backward_Iterator::Node_Backward_Iterator( Node *root, VectorSet &visited, Node_Stack &stack, PhaseCFG &cfg) : _visited(visited), _stack(stack), _cfg(cfg) { // The stack should contain exactly the root stack.clear(); - stack.push(root); + stack.push(root, root->outcnt()); // Clear the visited bits visited.Clear(); @@ -820,12 +821,14 @@ Node *Node_Backward_Iterator::next() { if ( !_stack.size() ) return NULL; - // '_stack' is emulating a real _stack. The 'visit-all-users' loop has been - // made stateless, so I do not need to record the index 'i' on my _stack. - // Instead I visit all users each time, scanning for unvisited users. // I visit unvisited not-anti-dependence users first, then anti-dependent - // children next. - Node *self = _stack.pop(); + // children next. I iterate backwards to support removal of nodes. + // The stack holds states consisting of 3 values: + // current Def node, flag which indicates 1st/2nd pass, index of current out edge + Node *self = (Node*)(((uintptr_t)_stack.node()) & ~1); + bool iterate_anti_dep = (((uintptr_t)_stack.node()) & 1); + uint idx = MIN2(_stack.index(), self->outcnt()); // Support removal of nodes. + _stack.pop(); // I cycle here when I am entering a deeper level of recursion. // The key variable 'self' was set prior to jumping here. @@ -841,9 +844,9 @@ Node *Node_Backward_Iterator::next() { Node *unvisited = NULL; // Unvisited anti-dependent Node, if any // Scan for unvisited nodes - for (DUIterator_Fast imax, i = self->fast_outs(imax); i < imax; i++) { + while (idx > 0) { // For all uses, schedule late - Node* n = self->fast_out(i); // Use + Node* n = self->raw_out(--idx); // Use // Skip already visited children if ( _visited.test(n->_idx) ) @@ -863,19 +866,31 @@ Node *Node_Backward_Iterator::next() { unvisited = n; // Found unvisited // Check for possible-anti-dependent - if( !n->needs_anti_dependence_check() ) - break; // Not visited, not anti-dep; schedule it NOW + // 1st pass: No such nodes, 2nd pass: Only such nodes. + if (n->needs_anti_dependence_check() == iterate_anti_dep) { + unvisited = n; // Found unvisited + break; + } } // Did I find an unvisited not-anti-dependent Node? - if ( !unvisited ) + if (!unvisited) { + if (!iterate_anti_dep) { + // 2nd pass: Iterate over nodes which needs_anti_dependence_check. + iterate_anti_dep = true; + idx = self->outcnt(); + continue; + } break; // All done with children; post-visit 'self' + } // Visit the unvisited Node. Contains the obvious push to // indicate I'm entering a deeper level of recursion. I push the // old state onto the _stack and set a new state and loop (recurse). - _stack.push(self); + _stack.push((Node*)((uintptr_t)self | (uintptr_t)iterate_anti_dep), idx); self = unvisited; + iterate_anti_dep = false; + idx = self->outcnt(); } // End recursion loop return self; @@ -883,7 +898,7 @@ Node *Node_Backward_Iterator::next() { //------------------------------ComputeLatenciesBackwards---------------------- // Compute the latency of all the instructions. -void PhaseCFG::compute_latencies_backwards(VectorSet &visited, Node_List &stack) { +void PhaseCFG::compute_latencies_backwards(VectorSet &visited, Node_Stack &stack) { #ifndef PRODUCT if (trace_opto_pipelining()) tty->print("\n#---- ComputeLatenciesBackwards ----\n"); @@ -1157,7 +1172,7 @@ Block* PhaseCFG::hoist_to_cheaper_block(Block* LCA, Block* early, Node* self) { // dominator tree of all USES of a value. Pick the block with the least // loop nesting depth that is lowest in the dominator tree. extern const char must_clone[]; -void PhaseCFG::schedule_late(VectorSet &visited, Node_List &stack) { +void PhaseCFG::schedule_late(VectorSet &visited, Node_Stack &stack) { #ifndef PRODUCT if (trace_opto_pipelining()) tty->print("\n#---- schedule_late ----\n"); @@ -1313,9 +1328,7 @@ void PhaseCFG::global_code_motion() { // instructions are pinned into Blocks. Unpinned instructions can // appear in last block in which all their inputs occur. visited.Clear(); - Node_List stack(arena); - // Pre-grow the list - stack.map((C->live_nodes() >> 1) + 16, NULL); + Node_Stack stack(arena, (C->live_nodes() >> 2) + 16); // pre-grow if (!schedule_early(visited, stack)) { // Bailout without retry C->record_method_not_compilable("early schedule failed"); From 8c5da27f19d26be9b4f727c7ff4a17f99a25a520 Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Fri, 4 Dec 2015 16:38:04 +0100 Subject: [PATCH 011/146] 8144019: PPC64 C1: Introduce Client Compiler Reviewed-by: goetz --- hotspot/make/aix/Makefile | 6 +- hotspot/make/aix/makefiles/fastdebug.make | 2 +- hotspot/make/aix/makefiles/tiered.make | 32 + hotspot/make/linux/Makefile | 8 - hotspot/src/cpu/ppc/vm/assembler_ppc.cpp | 5 +- hotspot/src/cpu/ppc/vm/assembler_ppc.hpp | 68 +- .../src/cpu/ppc/vm/assembler_ppc.inline.hpp | 10 +- hotspot/src/cpu/ppc/vm/c1_CodeStubs_ppc.cpp | 527 +++ hotspot/src/cpu/ppc/vm/c1_Defs_ppc.hpp | 76 + hotspot/src/cpu/ppc/vm/c1_FpuStackSim_ppc.hpp | 32 + hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.cpp | 394 +++ hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.hpp | 202 ++ .../src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp | 3133 +++++++++++++++++ .../src/cpu/ppc/vm/c1_LIRAssembler_ppc.hpp | 69 + .../src/cpu/ppc/vm/c1_LIRGenerator_ppc.cpp | 1429 ++++++++ hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.cpp | 34 + hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.hpp | 73 + .../src/cpu/ppc/vm/c1_MacroAssembler_ppc.cpp | 486 +++ .../src/cpu/ppc/vm/c1_MacroAssembler_ppc.hpp | 93 + hotspot/src/cpu/ppc/vm/c1_Runtime1_ppc.cpp | 1020 ++++++ hotspot/src/cpu/ppc/vm/c1_globals_ppc.hpp | 68 + hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp | 2 +- hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp | 8 +- hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp | 15 +- hotspot/src/cpu/ppc/vm/frame_ppc.cpp | 37 +- hotspot/src/cpu/ppc/vm/frame_ppc.hpp | 5 +- hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp | 3 - .../src/cpu/ppc/vm/globalDefinitions_ppc.hpp | 3 + hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp | 59 +- hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp | 4 +- hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp | 393 ++- hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp | 47 +- .../cpu/ppc/vm/macroAssembler_ppc.inline.hpp | 48 +- hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp | 7 +- hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp | 55 +- hotspot/src/cpu/ppc/vm/nativeInst_ppc.hpp | 123 +- hotspot/src/cpu/ppc/vm/ppc.ad | 194 +- hotspot/src/cpu/ppc/vm/register_ppc.hpp | 6 + hotspot/src/cpu/ppc/vm/relocInfo_ppc.cpp | 4 +- hotspot/src/cpu/ppc/vm/runtime_ppc.cpp | 40 +- hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp | 72 +- hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp | 624 +++- .../src/cpu/ppc/vm/stubRoutines_ppc_64.cpp | 2 +- .../cpu/ppc/vm/templateInterpreter_ppc.cpp | 26 +- .../cpu/ppc/vm/templateInterpreter_ppc.hpp | 2 - .../src/cpu/ppc/vm/templateTable_ppc_64.cpp | 32 +- hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp | 40 +- hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp | 3 - hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp | 20 +- hotspot/src/os/aix/vm/c1_globals_aix.hpp | 37 + 50 files changed, 9055 insertions(+), 623 deletions(-) create mode 100644 hotspot/make/aix/makefiles/tiered.make create mode 100644 hotspot/src/cpu/ppc/vm/c1_CodeStubs_ppc.cpp create mode 100644 hotspot/src/cpu/ppc/vm/c1_Defs_ppc.hpp create mode 100644 hotspot/src/cpu/ppc/vm/c1_FpuStackSim_ppc.hpp create mode 100644 hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.cpp create mode 100644 hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.hpp create mode 100644 hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp create mode 100644 hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.hpp create mode 100644 hotspot/src/cpu/ppc/vm/c1_LIRGenerator_ppc.cpp create mode 100644 hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.cpp create mode 100644 hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.hpp create mode 100644 hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.cpp create mode 100644 hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.hpp create mode 100644 hotspot/src/cpu/ppc/vm/c1_Runtime1_ppc.cpp create mode 100644 hotspot/src/cpu/ppc/vm/c1_globals_ppc.hpp create mode 100644 hotspot/src/os/aix/vm/c1_globals_aix.hpp diff --git a/hotspot/make/aix/Makefile b/hotspot/make/aix/Makefile index 4e0db05251c..77e54d08dc0 100644 --- a/hotspot/make/aix/Makefile +++ b/hotspot/make/aix/Makefile @@ -1,6 +1,6 @@ # # Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. -# Copyright 2012, 2013 SAP AG. All rights reserved. +# Copyright 2012, 2015 SAP AG. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -61,10 +61,6 @@ ifndef CC_INTERP FORCE_TIERED=1 endif endif -# C1 is not ported on ppc64(le), so we cannot build a tiered VM: -ifneq (,$(filter $(ARCH),ppc64 pp64le)) - FORCE_TIERED=0 -endif ifdef LP64 ifeq ("$(filter $(LP64_ARCH),$(BUILDARCH))","") diff --git a/hotspot/make/aix/makefiles/fastdebug.make b/hotspot/make/aix/makefiles/fastdebug.make index 33bf50940b9..d7feb025617 100644 --- a/hotspot/make/aix/makefiles/fastdebug.make +++ b/hotspot/make/aix/makefiles/fastdebug.make @@ -68,5 +68,5 @@ MAPFILE = $(GAMMADIR)/make/aix/makefiles/mapfile-vers-debug LFLAGS_QIPA= VERSION = optimized -SYSDEFS += -DASSERT -DFASTDEBUG +SYSDEFS += -DASSERT PICFLAGS = DEFAULT diff --git a/hotspot/make/aix/makefiles/tiered.make b/hotspot/make/aix/makefiles/tiered.make new file mode 100644 index 00000000000..992d59d5241 --- /dev/null +++ b/hotspot/make/aix/makefiles/tiered.make @@ -0,0 +1,32 @@ +# +# Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright 2012, 2015 SAP AG. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# +# + +# Sets make macros for making tiered version of VM + +TYPE=TIERED + +VM_SUBDIR = server + +CFLAGS += -DCOMPILER2 -DCOMPILER1 diff --git a/hotspot/make/linux/Makefile b/hotspot/make/linux/Makefile index 52aa0305f7a..dba28625eec 100644 --- a/hotspot/make/linux/Makefile +++ b/hotspot/make/linux/Makefile @@ -57,14 +57,6 @@ ifndef CC_INTERP FORCE_TIERED=1 endif endif -# C1 is not ported on ppc64, so we cannot build a tiered VM: -# Notice: after 8046471 ARCH will be 'ppc' for top-level ppc64 builds but -# 'ppc64' for HotSpot-only ppc64 builds. Need to detect both variants here! -ifneq (,$(findstring $(ARCH), ppc ppc64)) - ifeq ($(ARCH_DATA_MODEL), 64) - FORCE_TIERED=0 - endif -endif ifdef LP64 ifeq ("$(filter $(LP64_ARCH),$(BUILDARCH))","") diff --git a/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp index 56564ac7ea7..66e4f08c3d4 100644 --- a/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.cpp @@ -53,9 +53,6 @@ int AbstractAssembler::code_fill_byte() { return 0x00; // illegal instruction 0x00000000 } -void Assembler::print_instruction(int inst) { - Unimplemented(); -} // Patch instruction `inst' at offset `inst_pos' to refer to // `dest_pos' and return the resulting instruction. We should have @@ -484,7 +481,7 @@ int Assembler::add_const_optimized(Register d, Register s, long x, Register tmp, if (d != s) { mr(d, s); } return 0; } - if (return_simm16_rest) { + if (return_simm16_rest && (d == s)) { return xd; } addi(d, s, xd); diff --git a/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp index 6c7103aefa4..41cb7a16316 100644 --- a/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp @@ -31,10 +31,37 @@ // Address is an abstraction used to represent a memory location // as used in assembler instructions. // PPC instructions grok either baseReg + indexReg or baseReg + disp. -// So far we do not use this as simplification by this class is low -// on PPC with its simple addressing mode. Use RegisterOrConstant to -// represent an offset. class Address VALUE_OBJ_CLASS_SPEC { + private: + Register _base; // Base register. + Register _index; // Index register. + intptr_t _disp; // Displacement. + + public: + Address(Register b, Register i, address d = 0) + : _base(b), _index(i), _disp((intptr_t)d) { + assert(i == noreg || d == 0, "can't have both"); + } + + Address(Register b, address d = 0) + : _base(b), _index(noreg), _disp((intptr_t)d) {} + + Address(Register b, intptr_t d) + : _base(b), _index(noreg), _disp(d) {} + + Address(Register b, RegisterOrConstant roc) + : _base(b), _index(noreg), _disp(0) { + if (roc.is_constant()) _disp = roc.as_constant(); else _index = roc.as_register(); + } + + Address() + : _base(noreg), _index(noreg), _disp(0) {} + + // accessors + Register base() const { return _base; } + Register index() const { return _index; } + int disp() const { return (int)_disp; } + bool is_const() const { return _base == noreg && _index == noreg; } }; class AddressLiteral VALUE_OBJ_CLASS_SPEC { @@ -164,10 +191,14 @@ struct FunctionDescriptor VALUE_OBJ_CLASS_SPEC { }; #endif + +// The PPC Assembler: Pure assembler doing NO optimizations on the +// instruction level; i.e., what you write is what you get. The +// Assembler is generating code into a CodeBuffer. + class Assembler : public AbstractAssembler { protected: // Displacement routines - static void print_instruction(int inst); static int patched_branch(int dest_pos, int inst, int inst_pos); static int branch_destination(int inst, int pos); @@ -839,41 +870,38 @@ class Assembler : public AbstractAssembler { enum Predict { pt = 1, pn = 0 }; // pt = predict taken - // instruction must start at passed address + // Instruction must start at passed address. static int instr_len(unsigned char *instr) { return BytesPerInstWord; } - // instruction must be left-justified in argument - static int instr_len(unsigned long instr) { return BytesPerInstWord; } - // longest instructions static int instr_maxlen() { return BytesPerInstWord; } // Test if x is within signed immediate range for nbits. static bool is_simm(int x, unsigned int nbits) { assert(0 < nbits && nbits < 32, "out of bounds"); - const int min = -( ((int)1) << nbits-1 ); - const int maxplus1 = ( ((int)1) << nbits-1 ); + const int min = -(((int)1) << nbits-1); + const int maxplus1 = (((int)1) << nbits-1); return min <= x && x < maxplus1; } static bool is_simm(jlong x, unsigned int nbits) { assert(0 < nbits && nbits < 64, "out of bounds"); - const jlong min = -( ((jlong)1) << nbits-1 ); - const jlong maxplus1 = ( ((jlong)1) << nbits-1 ); + const jlong min = -(((jlong)1) << nbits-1); + const jlong maxplus1 = (((jlong)1) << nbits-1); return min <= x && x < maxplus1; } - // Test if x is within unsigned immediate range for nbits + // Test if x is within unsigned immediate range for nbits. static bool is_uimm(int x, unsigned int nbits) { assert(0 < nbits && nbits < 32, "out of bounds"); - const int maxplus1 = ( ((int)1) << nbits ); - return 0 <= x && x < maxplus1; + const unsigned int maxplus1 = (((unsigned int)1) << nbits); + return (unsigned int)x < maxplus1; } static bool is_uimm(jlong x, unsigned int nbits) { assert(0 < nbits && nbits < 64, "out of bounds"); - const jlong maxplus1 = ( ((jlong)1) << nbits ); - return 0 <= x && x < maxplus1; + const julong maxplus1 = (((julong)1) << nbits); + return (julong)x < maxplus1; } protected: @@ -1376,8 +1404,11 @@ class Assembler : public AbstractAssembler { inline void orc( Register a, Register s, Register b); inline void orc_( Register a, Register s, Register b); inline void extsb( Register a, Register s); + inline void extsb_( Register a, Register s); inline void extsh( Register a, Register s); + inline void extsh_( Register a, Register s); inline void extsw( Register a, Register s); + inline void extsw_( Register a, Register s); // extended mnemonics inline void nop(); @@ -1767,6 +1798,8 @@ class Assembler : public AbstractAssembler { inline void smt_yield(); inline void smt_mdoio(); inline void smt_mdoom(); + // >= Power8 + inline void smt_miso(); // trap instructions inline void twi_0(Register a); // for load with acquire semantics use load+twi_0+isync (trap can't occur) @@ -2168,6 +2201,7 @@ class Assembler : public AbstractAssembler { inline void load_const(Register d, void* a, Register tmp = noreg); inline void load_const(Register d, Label& L, Register tmp = noreg); inline void load_const(Register d, AddressLiteral& a, Register tmp = noreg); + inline void load_const32(Register d, int i); // load signed int (patchable) // Load a 64 bit constant, optimized, not identifyable. // Tmp can be used to increase ILP. Set return_simm16_rest = true to get a diff --git a/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp index e860dac7d43..2a4b03f760b 100644 --- a/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp +++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp @@ -206,8 +206,11 @@ inline void Assembler::andc_( Register a, Register s, Register b) { emit_in inline void Assembler::orc( Register a, Register s, Register b) { emit_int32(ORC_OPCODE | rta(a) | rs(s) | rb(b) | rc(0)); } inline void Assembler::orc_( Register a, Register s, Register b) { emit_int32(ORC_OPCODE | rta(a) | rs(s) | rb(b) | rc(1)); } inline void Assembler::extsb( Register a, Register s) { emit_int32(EXTSB_OPCODE | rta(a) | rs(s) | rc(0)); } +inline void Assembler::extsb_( Register a, Register s) { emit_int32(EXTSB_OPCODE | rta(a) | rs(s) | rc(1)); } inline void Assembler::extsh( Register a, Register s) { emit_int32(EXTSH_OPCODE | rta(a) | rs(s) | rc(0)); } +inline void Assembler::extsh_( Register a, Register s) { emit_int32(EXTSH_OPCODE | rta(a) | rs(s) | rc(1)); } inline void Assembler::extsw( Register a, Register s) { emit_int32(EXTSW_OPCODE | rta(a) | rs(s) | rc(0)); } +inline void Assembler::extsw_( Register a, Register s) { emit_int32(EXTSW_OPCODE | rta(a) | rs(s) | rc(1)); } // extended mnemonics inline void Assembler::nop() { Assembler::ori(R0, R0, 0); } @@ -609,6 +612,8 @@ inline void Assembler::smt_prio_high() { Assembler::or_unchecked(R3, R3, inline void Assembler::smt_yield() { Assembler::or_unchecked(R27, R27, R27); } inline void Assembler::smt_mdoio() { Assembler::or_unchecked(R29, R29, R29); } inline void Assembler::smt_mdoom() { Assembler::or_unchecked(R30, R30, R30); } +// >= Power8 +inline void Assembler::smt_miso() { Assembler::or_unchecked(R26, R26, R26); } inline void Assembler::twi_0(Register a) { twi_unchecked(0, a, 0);} @@ -967,12 +972,15 @@ inline void Assembler::load_const(Register d, Label& L, Register tmp) { // Load a 64 bit constant encoded by an AddressLiteral. patchable. inline void Assembler::load_const(Register d, AddressLiteral& a, Register tmp) { - assert(d != R0, "R0 not allowed"); // First relocate (we don't change the offset in the RelocationHolder, // just pass a.rspec()), then delegate to load_const(Register, long). relocate(a.rspec()); load_const(d, (long)a.value(), tmp); } +inline void Assembler::load_const32(Register d, int i) { + lis(d, i >> 16); + ori(d, d, i & 0xFFFF); +} #endif // CPU_PPC_VM_ASSEMBLER_PPC_INLINE_HPP diff --git a/hotspot/src/cpu/ppc/vm/c1_CodeStubs_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_CodeStubs_ppc.cpp new file mode 100644 index 00000000000..a19c7b7de11 --- /dev/null +++ b/hotspot/src/cpu/ppc/vm/c1_CodeStubs_ppc.cpp @@ -0,0 +1,527 @@ +/* + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "c1/c1_CodeStubs.hpp" +#include "c1/c1_FrameMap.hpp" +#include "c1/c1_LIRAssembler.hpp" +#include "c1/c1_MacroAssembler.hpp" +#include "c1/c1_Runtime1.hpp" +#include "nativeInst_ppc.hpp" +#include "runtime/sharedRuntime.hpp" +#include "utilities/macros.hpp" +#include "vmreg_ppc.inline.hpp" +#if INCLUDE_ALL_GCS +#include "gc/g1/g1SATBCardTableModRefBS.hpp" +#endif // INCLUDE_ALL_GCS + +#define __ ce->masm()-> + + +RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, + bool throw_index_out_of_bounds_exception) + : _throw_index_out_of_bounds_exception(throw_index_out_of_bounds_exception) + , _index(index) { + assert(info != NULL, "must have info"); + _info = new CodeEmitInfo(info); +} + +void RangeCheckStub::emit_code(LIR_Assembler* ce) { + __ bind(_entry); + + if (_info->deoptimize_on_exception()) { + address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id); + // May be used by optimizations like LoopInvariantCodeMotion or RangeCheckEliminator. + DEBUG_ONLY( __ untested("RangeCheckStub: predicate_failed_trap_id"); ) + //__ load_const_optimized(R0, a); + __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(a)); + __ mtctr(R0); + __ bctrl(); + ce->add_call_info_here(_info); + ce->verify_oop_map(_info); + debug_only(__ illtrap()); + return; + } + + address stub = _throw_index_out_of_bounds_exception ? Runtime1::entry_for(Runtime1::throw_index_exception_id) + : Runtime1::entry_for(Runtime1::throw_range_check_failed_id); + //__ load_const_optimized(R0, stub); + __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub)); + __ mtctr(R0); + + Register index = R0; // pass in R0 + if (_index->is_register()) { + __ extsw(index, _index->as_register()); + } else { + __ load_const_optimized(index, _index->as_jint()); + } + + __ bctrl(); + ce->add_call_info_here(_info); + ce->verify_oop_map(_info); + debug_only(__ illtrap()); +} + + +PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) { + _info = new CodeEmitInfo(info); +} + +void PredicateFailedStub::emit_code(LIR_Assembler* ce) { + __ bind(_entry); + address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id); + //__ load_const_optimized(R0, a); + __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(a)); + __ mtctr(R0); + __ bctrl(); + ce->add_call_info_here(_info); + ce->verify_oop_map(_info); + debug_only(__ illtrap()); +} + + +void CounterOverflowStub::emit_code(LIR_Assembler* ce) { + __ bind(_entry); + + // Parameter 1: bci + __ load_const_optimized(R0, _bci); + __ std(R0, -16, R1_SP); + + // Parameter 2: Method* + Metadata *m = _method->as_constant_ptr()->as_metadata(); + AddressLiteral md = __ constant_metadata_address(m); // Notify OOP recorder (don't need the relocation). + __ load_const_optimized(R0, md.value()); + __ std(R0, -8, R1_SP); + + address a = Runtime1::entry_for(Runtime1::counter_overflow_id); + //__ load_const_optimized(R0, a); + __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(a)); + __ mtctr(R0); + __ bctrl(); + ce->add_call_info_here(_info); + ce->verify_oop_map(_info); + + __ b(_continuation); +} + + +void DivByZeroStub::emit_code(LIR_Assembler* ce) { + if (_offset != -1) { + ce->compilation()->implicit_exception_table()->append(_offset, __ offset()); + } + __ bind(_entry); + address stub = Runtime1::entry_for(Runtime1::throw_div0_exception_id); + //__ load_const_optimized(R0, stub); + __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub)); + __ mtctr(R0); + __ bctrl(); + ce->add_call_info_here(_info); + ce->verify_oop_map(_info); + debug_only(__ illtrap()); +} + + +void ImplicitNullCheckStub::emit_code(LIR_Assembler* ce) { + address a; + if (_info->deoptimize_on_exception()) { + // Deoptimize, do not throw the exception, because it is probably wrong to do it here. + a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id); + } else { + a = Runtime1::entry_for(Runtime1::throw_null_pointer_exception_id); + } + + if (ImplicitNullChecks || TrapBasedNullChecks) { + ce->compilation()->implicit_exception_table()->append(_offset, __ offset()); + } + __ bind(_entry); + //__ load_const_optimized(R0, a); + __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(a)); + __ mtctr(R0); + __ bctrl(); + ce->add_call_info_here(_info); + ce->verify_oop_map(_info); + debug_only(__ illtrap()); +} + + +// Implementation of SimpleExceptionStub +void SimpleExceptionStub::emit_code(LIR_Assembler* ce) { + __ bind(_entry); + address stub = Runtime1::entry_for(_stub); + //__ load_const_optimized(R0, stub); + __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub)); + if (_obj->is_valid()) { __ mr_if_needed(/*tmp1 in do_CheckCast*/ R4_ARG2, _obj->as_register()); } + __ mtctr(R0); + __ bctrl(); + ce->add_call_info_here(_info); + debug_only( __ illtrap(); ) +} + + +// Implementation of NewInstanceStub +NewInstanceStub::NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, Runtime1::StubID stub_id) { + _result = result; + _klass = klass; + _klass_reg = klass_reg; + _info = new CodeEmitInfo(info); + assert(stub_id == Runtime1::new_instance_id || + stub_id == Runtime1::fast_new_instance_id || + stub_id == Runtime1::fast_new_instance_init_check_id, + "need new_instance id"); + _stub_id = stub_id; +} + +void NewInstanceStub::emit_code(LIR_Assembler* ce) { + __ bind(_entry); + + address entry = Runtime1::entry_for(_stub_id); + //__ load_const_optimized(R0, entry); + __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(entry)); + __ mtctr(R0); + __ bctrl(); + ce->add_call_info_here(_info); + ce->verify_oop_map(_info); + __ b(_continuation); +} + + +// Implementation of NewTypeArrayStub +NewTypeArrayStub::NewTypeArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info) { + _klass_reg = klass_reg; + _length = length; + _result = result; + _info = new CodeEmitInfo(info); +} + +void NewTypeArrayStub::emit_code(LIR_Assembler* ce) { + __ bind(_entry); + + address entry = Runtime1::entry_for(Runtime1::new_type_array_id); + //__ load_const_optimized(R0, entry); + __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(entry)); + __ mr_if_needed(/*op->tmp1()->as_register()*/ R5_ARG3, _length->as_register()); // already sign-extended + __ mtctr(R0); + __ bctrl(); + ce->add_call_info_here(_info); + ce->verify_oop_map(_info); + __ b(_continuation); +} + + +// Implementation of NewObjectArrayStub +NewObjectArrayStub::NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info) { + _klass_reg = klass_reg; + _length = length; + _result = result; + _info = new CodeEmitInfo(info); +} + +void NewObjectArrayStub::emit_code(LIR_Assembler* ce) { + __ bind(_entry); + + address entry = Runtime1::entry_for(Runtime1::new_object_array_id); + //__ load_const_optimized(R0, entry); + __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(entry)); + __ mr_if_needed(/*op->tmp1()->as_register()*/ R5_ARG3, _length->as_register()); // already sign-extended + __ mtctr(R0); + __ bctrl(); + ce->add_call_info_here(_info); + ce->verify_oop_map(_info); + __ b(_continuation); +} + + +// Implementation of MonitorAccessStubs +MonitorEnterStub::MonitorEnterStub(LIR_Opr obj_reg, LIR_Opr lock_reg, CodeEmitInfo* info) + : MonitorAccessStub(obj_reg, lock_reg) { + _info = new CodeEmitInfo(info); +} + +void MonitorEnterStub::emit_code(LIR_Assembler* ce) { + __ bind(_entry); + address stub = Runtime1::entry_for(ce->compilation()->has_fpu_code() ? Runtime1::monitorenter_id : Runtime1::monitorenter_nofpu_id); + //__ load_const_optimized(R0, stub); + __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub)); + __ mr_if_needed(/*scratch_opr()->as_register()*/ R4_ARG2, _obj_reg->as_register()); + assert(_lock_reg->as_register() == R5_ARG3, ""); + __ mtctr(R0); + __ bctrl(); + ce->add_call_info_here(_info); + ce->verify_oop_map(_info); + __ b(_continuation); +} + +void MonitorExitStub::emit_code(LIR_Assembler* ce) { + __ bind(_entry); + if (_compute_lock) { + ce->monitor_address(_monitor_ix, _lock_reg); + } + address stub = Runtime1::entry_for(ce->compilation()->has_fpu_code() ? Runtime1::monitorexit_id : Runtime1::monitorexit_nofpu_id); + //__ load_const_optimized(R0, stub); + __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub)); + assert(_lock_reg->as_register() == R4_ARG2, ""); + __ mtctr(R0); + __ bctrl(); + __ b(_continuation); +} + + +// Implementation of patching: +// - Copy the code at given offset to an inlined buffer (first the bytes, then the number of bytes). +// - Replace original code with a call to the stub. +// At Runtime: +// - call to stub, jump to runtime +// - in runtime: preserve all registers (especially objects, i.e., source and destination object) +// - in runtime: after initializing class, restore original code, reexecute instruction + +int PatchingStub::_patch_info_offset = -(5 * BytesPerInstWord); + +void PatchingStub::align_patch_site(MacroAssembler* ) { + // Patch sites on ppc are always properly aligned. +} + +#ifdef ASSERT +inline void compare_with_patch_site(address template_start, address pc_start, int bytes_to_copy) { + address start = template_start; + for (int i = 0; i < bytes_to_copy; i++) { + address ptr = (address)(pc_start + i); + int a_byte = (*ptr) & 0xFF; + assert(a_byte == *start++, "should be the same code"); + } +} +#endif + +void PatchingStub::emit_code(LIR_Assembler* ce) { + // copy original code here + assert(NativeGeneralJump::instruction_size <= _bytes_to_copy && _bytes_to_copy <= 0xFF, + "not enough room for call"); + assert((_bytes_to_copy & 0x3) == 0, "must copy a multiple of four bytes"); + + Label call_patch; + + int being_initialized_entry = __ offset(); + + if (_id == load_klass_id) { + // Produce a copy of the load klass instruction for use by the being initialized case. + AddressLiteral addrlit((address)NULL, metadata_Relocation::spec(_index)); + __ load_const(_obj, addrlit, R0); + DEBUG_ONLY( compare_with_patch_site(__ code_section()->start() + being_initialized_entry, _pc_start, _bytes_to_copy); ) + } else if (_id == load_mirror_id || _id == load_appendix_id) { + // Produce a copy of the load mirror instruction for use by the being initialized case. + AddressLiteral addrlit((address)NULL, oop_Relocation::spec(_index)); + __ load_const(_obj, addrlit, R0); + DEBUG_ONLY( compare_with_patch_site(__ code_section()->start() + being_initialized_entry, _pc_start, _bytes_to_copy); ) + } else { + // Make a copy the code which is going to be patched. + for (int i = 0; i < _bytes_to_copy; i++) { + address ptr = (address)(_pc_start + i); + int a_byte = (*ptr) & 0xFF; + __ emit_int8 (a_byte); + } + } + + address end_of_patch = __ pc(); + int bytes_to_skip = 0; + if (_id == load_mirror_id) { + int offset = __ offset(); + __ block_comment(" being_initialized check"); + + // Static field accesses have special semantics while the class + // initializer is being run so we emit a test which can be used to + // check that this code is being executed by the initializing + // thread. + assert(_obj != noreg, "must be a valid register"); + assert(_index >= 0, "must have oop index"); + __ mr(R0, _obj); // spill + __ ld(_obj, java_lang_Class::klass_offset_in_bytes(), _obj); + __ ld(_obj, in_bytes(InstanceKlass::init_thread_offset()), _obj); + __ cmpd(CCR0, _obj, R16_thread); + __ mr(_obj, R0); // restore + __ bne(CCR0, call_patch); + + // Load_klass patches may execute the patched code before it's + // copied back into place so we need to jump back into the main + // code of the nmethod to continue execution. + __ b(_patch_site_continuation); + + // Make sure this extra code gets skipped. + bytes_to_skip += __ offset() - offset; + } + + // Now emit the patch record telling the runtime how to find the + // pieces of the patch. We only need 3 bytes but it has to be + // aligned as an instruction so emit 4 bytes. + int sizeof_patch_record = 4; + bytes_to_skip += sizeof_patch_record; + + // Emit the offsets needed to find the code to patch. + int being_initialized_entry_offset = __ offset() - being_initialized_entry + sizeof_patch_record; + + // Emit the patch record. We need to emit a full word, so emit an extra empty byte. + __ emit_int8(0); + __ emit_int8(being_initialized_entry_offset); + __ emit_int8(bytes_to_skip); + __ emit_int8(_bytes_to_copy); + address patch_info_pc = __ pc(); + assert(patch_info_pc - end_of_patch == bytes_to_skip, "incorrect patch info"); + + address entry = __ pc(); + NativeGeneralJump::insert_unconditional((address)_pc_start, entry); + address target = NULL; + relocInfo::relocType reloc_type = relocInfo::none; + switch (_id) { + case access_field_id: target = Runtime1::entry_for(Runtime1::access_field_patching_id); break; + case load_klass_id: target = Runtime1::entry_for(Runtime1::load_klass_patching_id); + reloc_type = relocInfo::metadata_type; break; + case load_mirror_id: target = Runtime1::entry_for(Runtime1::load_mirror_patching_id); + reloc_type = relocInfo::oop_type; break; + case load_appendix_id: target = Runtime1::entry_for(Runtime1::load_appendix_patching_id); + reloc_type = relocInfo::oop_type; break; + default: ShouldNotReachHere(); + } + __ bind(call_patch); + + __ block_comment("patch entry point"); + //__ load_const(R0, target); + mtctr + bctrl must have size -_patch_info_offset + __ load_const32(R0, MacroAssembler::offset_to_global_toc(target)); + __ add(R0, R29_TOC, R0); + __ mtctr(R0); + __ bctrl(); + assert(_patch_info_offset == (patch_info_pc - __ pc()), "must not change"); + ce->add_call_info_here(_info); + __ b(_patch_site_entry); + if (_id == load_klass_id || _id == load_mirror_id || _id == load_appendix_id) { + CodeSection* cs = __ code_section(); + address pc = (address)_pc_start; + RelocIterator iter(cs, pc, pc + 1); + relocInfo::change_reloc_info_for_address(&iter, (address) pc, reloc_type, relocInfo::none); + } +} + + +void DeoptimizeStub::emit_code(LIR_Assembler* ce) { + __ bind(_entry); + address stub = Runtime1::entry_for(Runtime1::deoptimize_id); + //__ load_const_optimized(R0, stub); + __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub)); + __ mtctr(R0); + + __ load_const_optimized(R0, _trap_request); // Pass trap request in R0. + __ bctrl(); + ce->add_call_info_here(_info); + debug_only(__ illtrap()); +} + + +void ArrayCopyStub::emit_code(LIR_Assembler* ce) { + //---------------slow case: call to native----------------- + __ bind(_entry); + __ mr(R3_ARG1, src()->as_register()); + __ extsw(R4_ARG2, src_pos()->as_register()); + __ mr(R5_ARG3, dst()->as_register()); + __ extsw(R6_ARG4, dst_pos()->as_register()); + __ extsw(R7_ARG5, length()->as_register()); + + ce->emit_static_call_stub(); + + bool success = ce->emit_trampoline_stub_for_call(SharedRuntime::get_resolve_static_call_stub()); + if (!success) { return; } + + __ relocate(relocInfo::static_call_type); + // Note: At this point we do not have the address of the trampoline + // stub, and the entry point might be too far away for bl, so __ pc() + // serves as dummy and the bl will be patched later. + __ code()->set_insts_mark(); + __ bl(__ pc()); + ce->add_call_info_here(info()); + ce->verify_oop_map(info()); + +#ifndef PRODUCT + const address counter = (address)&Runtime1::_arraycopy_slowcase_cnt; + const Register tmp = R3, tmp2 = R4; + int simm16_offs = __ load_const_optimized(tmp, counter, tmp2, true); + __ lwz(tmp2, simm16_offs, tmp); + __ addi(tmp2, tmp2, 1); + __ stw(tmp2, simm16_offs, tmp); +#endif + + __ b(_continuation); +} + + +/////////////////////////////////////////////////////////////////////////////////// +#if INCLUDE_ALL_GCS + +void G1PreBarrierStub::emit_code(LIR_Assembler* ce) { + // At this point we know that marking is in progress. + // If do_load() is true then we have to emit the + // load of the previous value; otherwise it has already + // been loaded into _pre_val. + + __ bind(_entry); + + assert(pre_val()->is_register(), "Precondition."); + Register pre_val_reg = pre_val()->as_register(); + + if (do_load()) { + ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false /*wide*/, false /*unaligned*/); + } + + __ cmpdi(CCR0, pre_val_reg, 0); + __ bc_far_optimized(Assembler::bcondCRbiIs1, __ bi0(CCR0, Assembler::equal), _continuation); + + address stub = Runtime1::entry_for(Runtime1::Runtime1::g1_pre_barrier_slow_id); + //__ load_const_optimized(R0, stub); + __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub)); + __ std(pre_val_reg, -8, R1_SP); // Pass pre_val on stack. + __ mtctr(R0); + __ bctrl(); + __ b(_continuation); +} + +void G1PostBarrierStub::emit_code(LIR_Assembler* ce) { + __ bind(_entry); + + assert(addr()->is_register(), "Precondition."); + assert(new_val()->is_register(), "Precondition."); + Register addr_reg = addr()->as_pointer_register(); + Register new_val_reg = new_val()->as_register(); + + __ cmpdi(CCR0, new_val_reg, 0); + __ bc_far_optimized(Assembler::bcondCRbiIs1, __ bi0(CCR0, Assembler::equal), _continuation); + + address stub = Runtime1::entry_for(Runtime1::Runtime1::g1_post_barrier_slow_id); + //__ load_const_optimized(R0, stub); + __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub)); + __ mtctr(R0); + __ mr(R0, addr_reg); // Pass addr in R0. + __ bctrl(); + __ b(_continuation); +} + +#endif // INCLUDE_ALL_GCS +/////////////////////////////////////////////////////////////////////////////////// + +#undef __ diff --git a/hotspot/src/cpu/ppc/vm/c1_Defs_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_Defs_ppc.hpp new file mode 100644 index 00000000000..73edcaba207 --- /dev/null +++ b/hotspot/src/cpu/ppc/vm/c1_Defs_ppc.hpp @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef CPU_PPC_VM_C1_DEFS_PPC_HPP +#define CPU_PPC_VM_C1_DEFS_PPC_HPP + +// Native word offsets from memory address. +enum { +#if defined(VM_LITTLE_ENDIAN) + pd_lo_word_offset_in_bytes = 0, + pd_hi_word_offset_in_bytes = BytesPerInt +#else + pd_lo_word_offset_in_bytes = BytesPerInt, + pd_hi_word_offset_in_bytes = 0 +#endif +}; + + +// Explicit rounding operations are not required to implement the strictFP mode. +enum { + pd_strict_fp_requires_explicit_rounding = false +}; + + +// registers +enum { + pd_nof_cpu_regs_frame_map = 32, // Number of registers used during code emission. + pd_nof_caller_save_cpu_regs_frame_map = 27, // Number of cpu registers killed by calls. (At least R3_ARG1 ... R10_ARG8, but using all like C2.) + pd_nof_cpu_regs_reg_alloc = 27, // Number of registers that are visible to register allocator. + pd_nof_cpu_regs_linearscan = 32, // Number of registers visible linear scan. + pd_first_callee_saved_reg = pd_nof_caller_save_cpu_regs_frame_map, + pd_last_callee_saved_reg = pd_nof_cpu_regs_reg_alloc - 1, + pd_first_cpu_reg = 0, + pd_last_cpu_reg = pd_nof_cpu_regs_reg_alloc - 1, + + pd_nof_fpu_regs_frame_map = 32, // Number of registers used during code emission. + pd_nof_caller_save_fpu_regs_frame_map = 32, // Number of fpu registers killed by calls. + pd_nof_fpu_regs_reg_alloc = 32, // Number of registers that are visible to register allocator. + pd_nof_fpu_regs_linearscan = 32, // Number of registers visible to linear scan. + pd_first_fpu_reg = pd_nof_cpu_regs_frame_map, + pd_last_fpu_reg = pd_nof_cpu_regs_frame_map + pd_nof_fpu_regs_reg_alloc - 1, + + pd_nof_xmm_regs_linearscan = 0, + pd_nof_caller_save_xmm_regs = 0, + pd_first_xmm_reg = -1, + pd_last_xmm_reg = -1 +}; + +// For debug info: a float value in a register is saved in single precision by runtime stubs. +enum { + pd_float_saved_as_double = true +}; + +#endif // CPU_PPC_VM_C1_DEFS_PPC_HPP diff --git a/hotspot/src/cpu/ppc/vm/c1_FpuStackSim_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_FpuStackSim_ppc.hpp new file mode 100644 index 00000000000..19f85034ba9 --- /dev/null +++ b/hotspot/src/cpu/ppc/vm/c1_FpuStackSim_ppc.hpp @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef CPU_PPC_VM_C1_FPUSTACKSIM_PPC_HPP +#define CPU_PPC_VM_C1_FPUSTACKSIM_PPC_HPP + +// No FPU stack on PPC. +class FpuStackSim; + +#endif // CPU_PPC_VM_C1_FPUSTACKSIM_PPC_HPP diff --git a/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.cpp new file mode 100644 index 00000000000..90afc7873ce --- /dev/null +++ b/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.cpp @@ -0,0 +1,394 @@ +/* + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "c1/c1_FrameMap.hpp" +#include "c1/c1_LIR.hpp" +#include "runtime/sharedRuntime.hpp" +#include "vmreg_ppc.inline.hpp" + + +const int FrameMap::pd_c_runtime_reserved_arg_size = 7; + + +LIR_Opr FrameMap::map_to_opr(BasicType type, VMRegPair* reg, bool outgoing) { + LIR_Opr opr = LIR_OprFact::illegalOpr; + VMReg r_1 = reg->first(); + VMReg r_2 = reg->second(); + if (r_1->is_stack()) { + // Convert stack slot to an SP offset. + // The calling convention does not count the SharedRuntime::out_preserve_stack_slots() value + // so we must add it in here. + int st_off = (r_1->reg2stack() + SharedRuntime::out_preserve_stack_slots()) * VMRegImpl::stack_slot_size; + opr = LIR_OprFact::address(new LIR_Address(SP_opr, st_off + STACK_BIAS, type)); + } else if (r_1->is_Register()) { + Register reg = r_1->as_Register(); + //if (outgoing) { + // assert(!reg->is_in(), "should be using I regs"); + //} else { + // assert(!reg->is_out(), "should be using O regs"); + //} + if (r_2->is_Register() && (type == T_LONG || type == T_DOUBLE)) { + opr = as_long_opr(reg); + } else if (type == T_OBJECT || type == T_ARRAY) { + opr = as_oop_opr(reg); + } else { + opr = as_opr(reg); + } + } else if (r_1->is_FloatRegister()) { + assert(type == T_DOUBLE || type == T_FLOAT, "wrong type"); + FloatRegister f = r_1->as_FloatRegister(); + if (type == T_DOUBLE) { + opr = as_double_opr(f); + } else { + opr = as_float_opr(f); + } + } + return opr; +} + +// FrameMap +//-------------------------------------------------------- + +FloatRegister FrameMap::_fpu_regs [FrameMap::nof_fpu_regs]; + +LIR_Opr FrameMap::R0_opr; +LIR_Opr FrameMap::R1_opr; +LIR_Opr FrameMap::R2_opr; +LIR_Opr FrameMap::R3_opr; +LIR_Opr FrameMap::R4_opr; +LIR_Opr FrameMap::R5_opr; +LIR_Opr FrameMap::R6_opr; +LIR_Opr FrameMap::R7_opr; +LIR_Opr FrameMap::R8_opr; +LIR_Opr FrameMap::R9_opr; +LIR_Opr FrameMap::R10_opr; +LIR_Opr FrameMap::R11_opr; +LIR_Opr FrameMap::R12_opr; +LIR_Opr FrameMap::R13_opr; +LIR_Opr FrameMap::R14_opr; +LIR_Opr FrameMap::R15_opr; +LIR_Opr FrameMap::R16_opr; +LIR_Opr FrameMap::R17_opr; +LIR_Opr FrameMap::R18_opr; +LIR_Opr FrameMap::R19_opr; +LIR_Opr FrameMap::R20_opr; +LIR_Opr FrameMap::R21_opr; +LIR_Opr FrameMap::R22_opr; +LIR_Opr FrameMap::R23_opr; +LIR_Opr FrameMap::R24_opr; +LIR_Opr FrameMap::R25_opr; +LIR_Opr FrameMap::R26_opr; +LIR_Opr FrameMap::R27_opr; +LIR_Opr FrameMap::R28_opr; +LIR_Opr FrameMap::R29_opr; +LIR_Opr FrameMap::R30_opr; +LIR_Opr FrameMap::R31_opr; + +LIR_Opr FrameMap::R0_oop_opr; +//LIR_Opr FrameMap::R1_oop_opr; +LIR_Opr FrameMap::R2_oop_opr; +LIR_Opr FrameMap::R3_oop_opr; +LIR_Opr FrameMap::R4_oop_opr; +LIR_Opr FrameMap::R5_oop_opr; +LIR_Opr FrameMap::R6_oop_opr; +LIR_Opr FrameMap::R7_oop_opr; +LIR_Opr FrameMap::R8_oop_opr; +LIR_Opr FrameMap::R9_oop_opr; +LIR_Opr FrameMap::R10_oop_opr; +LIR_Opr FrameMap::R11_oop_opr; +LIR_Opr FrameMap::R12_oop_opr; +//LIR_Opr FrameMap::R13_oop_opr; +LIR_Opr FrameMap::R14_oop_opr; +LIR_Opr FrameMap::R15_oop_opr; +//LIR_Opr FrameMap::R16_oop_opr; +LIR_Opr FrameMap::R17_oop_opr; +LIR_Opr FrameMap::R18_oop_opr; +LIR_Opr FrameMap::R19_oop_opr; +LIR_Opr FrameMap::R20_oop_opr; +LIR_Opr FrameMap::R21_oop_opr; +LIR_Opr FrameMap::R22_oop_opr; +LIR_Opr FrameMap::R23_oop_opr; +LIR_Opr FrameMap::R24_oop_opr; +LIR_Opr FrameMap::R25_oop_opr; +LIR_Opr FrameMap::R26_oop_opr; +LIR_Opr FrameMap::R27_oop_opr; +LIR_Opr FrameMap::R28_oop_opr; +//LIR_Opr FrameMap::R29_oop_opr; +LIR_Opr FrameMap::R30_oop_opr; +LIR_Opr FrameMap::R31_oop_opr; + +LIR_Opr FrameMap::R0_metadata_opr; +//LIR_Opr FrameMap::R1_metadata_opr; +LIR_Opr FrameMap::R2_metadata_opr; +LIR_Opr FrameMap::R3_metadata_opr; +LIR_Opr FrameMap::R4_metadata_opr; +LIR_Opr FrameMap::R5_metadata_opr; +LIR_Opr FrameMap::R6_metadata_opr; +LIR_Opr FrameMap::R7_metadata_opr; +LIR_Opr FrameMap::R8_metadata_opr; +LIR_Opr FrameMap::R9_metadata_opr; +LIR_Opr FrameMap::R10_metadata_opr; +LIR_Opr FrameMap::R11_metadata_opr; +LIR_Opr FrameMap::R12_metadata_opr; +//LIR_Opr FrameMap::R13_metadata_opr; +LIR_Opr FrameMap::R14_metadata_opr; +LIR_Opr FrameMap::R15_metadata_opr; +//LIR_Opr FrameMap::R16_metadata_opr; +LIR_Opr FrameMap::R17_metadata_opr; +LIR_Opr FrameMap::R18_metadata_opr; +LIR_Opr FrameMap::R19_metadata_opr; +LIR_Opr FrameMap::R20_metadata_opr; +LIR_Opr FrameMap::R21_metadata_opr; +LIR_Opr FrameMap::R22_metadata_opr; +LIR_Opr FrameMap::R23_metadata_opr; +LIR_Opr FrameMap::R24_metadata_opr; +LIR_Opr FrameMap::R25_metadata_opr; +LIR_Opr FrameMap::R26_metadata_opr; +LIR_Opr FrameMap::R27_metadata_opr; +LIR_Opr FrameMap::R28_metadata_opr; +//LIR_Opr FrameMap::R29_metadata_opr; +LIR_Opr FrameMap::R30_metadata_opr; +LIR_Opr FrameMap::R31_metadata_opr; + +LIR_Opr FrameMap::SP_opr; + +LIR_Opr FrameMap::R0_long_opr; +LIR_Opr FrameMap::R3_long_opr; + +LIR_Opr FrameMap::F1_opr; +LIR_Opr FrameMap::F1_double_opr; + +LIR_Opr FrameMap::_caller_save_cpu_regs[] = { 0, }; +LIR_Opr FrameMap::_caller_save_fpu_regs[] = { 0, }; + +FloatRegister FrameMap::nr2floatreg (int rnr) { + assert(_init_done, "tables not initialized"); + debug_only(fpu_range_check(rnr);) + return _fpu_regs[rnr]; +} + + +// Returns true if reg could be smashed by a callee. +bool FrameMap::is_caller_save_register (LIR_Opr reg) { + if (reg->is_single_fpu() || reg->is_double_fpu()) { return true; } + if (reg->is_double_cpu()) { + return is_caller_save_register(reg->as_register_lo()) || + is_caller_save_register(reg->as_register_hi()); + } + return is_caller_save_register(reg->as_register()); +} + + +bool FrameMap::is_caller_save_register (Register r) { + // not visible to allocator: R0: scratch, R1: SP + // r->encoding() < 2 + nof_caller_save_cpu_regs(); + return true; // Currently all regs are caller save. +} + + +void FrameMap::initialize() { + assert(!_init_done, "once"); + + int i = 0; + + // Put generally available registers at the beginning (allocated, saved for GC). + for (int j = 0; j < nof_cpu_regs; ++j) { + Register rj = as_Register(j); + if (reg_needs_save(rj)) { + map_register(i++, rj); + } + } + assert(i == nof_cpu_regs_reg_alloc, "number of allocated registers"); + + // The following registers are not normally available. + for (int j = 0; j < nof_cpu_regs; ++j) { + Register rj = as_Register(j); + if (!reg_needs_save(rj)) { + map_register(i++, rj); + } + } + assert(i == nof_cpu_regs, "number of CPU registers"); + + for (i = 0; i < nof_fpu_regs; i++) { + _fpu_regs[i] = as_FloatRegister(i); + } + + _init_done = true; + + R0_opr = as_opr(R0); + R1_opr = as_opr(R1); + R2_opr = as_opr(R2); + R3_opr = as_opr(R3); + R4_opr = as_opr(R4); + R5_opr = as_opr(R5); + R6_opr = as_opr(R6); + R7_opr = as_opr(R7); + R8_opr = as_opr(R8); + R9_opr = as_opr(R9); + R10_opr = as_opr(R10); + R11_opr = as_opr(R11); + R12_opr = as_opr(R12); + R13_opr = as_opr(R13); + R14_opr = as_opr(R14); + R15_opr = as_opr(R15); + R16_opr = as_opr(R16); + R17_opr = as_opr(R17); + R18_opr = as_opr(R18); + R19_opr = as_opr(R19); + R20_opr = as_opr(R20); + R21_opr = as_opr(R21); + R22_opr = as_opr(R22); + R23_opr = as_opr(R23); + R24_opr = as_opr(R24); + R25_opr = as_opr(R25); + R26_opr = as_opr(R26); + R27_opr = as_opr(R27); + R28_opr = as_opr(R28); + R29_opr = as_opr(R29); + R30_opr = as_opr(R30); + R31_opr = as_opr(R31); + + R0_oop_opr = as_oop_opr(R0); + //R1_oop_opr = as_oop_opr(R1); + R2_oop_opr = as_oop_opr(R2); + R3_oop_opr = as_oop_opr(R3); + R4_oop_opr = as_oop_opr(R4); + R5_oop_opr = as_oop_opr(R5); + R6_oop_opr = as_oop_opr(R6); + R7_oop_opr = as_oop_opr(R7); + R8_oop_opr = as_oop_opr(R8); + R9_oop_opr = as_oop_opr(R9); + R10_oop_opr = as_oop_opr(R10); + R11_oop_opr = as_oop_opr(R11); + R12_oop_opr = as_oop_opr(R12); + //R13_oop_opr = as_oop_opr(R13); + R14_oop_opr = as_oop_opr(R14); + R15_oop_opr = as_oop_opr(R15); + //R16_oop_opr = as_oop_opr(R16); + R17_oop_opr = as_oop_opr(R17); + R18_oop_opr = as_oop_opr(R18); + R19_oop_opr = as_oop_opr(R19); + R20_oop_opr = as_oop_opr(R20); + R21_oop_opr = as_oop_opr(R21); + R22_oop_opr = as_oop_opr(R22); + R23_oop_opr = as_oop_opr(R23); + R24_oop_opr = as_oop_opr(R24); + R25_oop_opr = as_oop_opr(R25); + R26_oop_opr = as_oop_opr(R26); + R27_oop_opr = as_oop_opr(R27); + R28_oop_opr = as_oop_opr(R28); + //R29_oop_opr = as_oop_opr(R29); + R30_oop_opr = as_oop_opr(R30); + R31_oop_opr = as_oop_opr(R31); + + R0_metadata_opr = as_metadata_opr(R0); + //R1_metadata_opr = as_metadata_opr(R1); + R2_metadata_opr = as_metadata_opr(R2); + R3_metadata_opr = as_metadata_opr(R3); + R4_metadata_opr = as_metadata_opr(R4); + R5_metadata_opr = as_metadata_opr(R5); + R6_metadata_opr = as_metadata_opr(R6); + R7_metadata_opr = as_metadata_opr(R7); + R8_metadata_opr = as_metadata_opr(R8); + R9_metadata_opr = as_metadata_opr(R9); + R10_metadata_opr = as_metadata_opr(R10); + R11_metadata_opr = as_metadata_opr(R11); + R12_metadata_opr = as_metadata_opr(R12); + //R13_metadata_opr = as_metadata_opr(R13); + R14_metadata_opr = as_metadata_opr(R14); + R15_metadata_opr = as_metadata_opr(R15); + //R16_metadata_opr = as_metadata_opr(R16); + R17_metadata_opr = as_metadata_opr(R17); + R18_metadata_opr = as_metadata_opr(R18); + R19_metadata_opr = as_metadata_opr(R19); + R20_metadata_opr = as_metadata_opr(R20); + R21_metadata_opr = as_metadata_opr(R21); + R22_metadata_opr = as_metadata_opr(R22); + R23_metadata_opr = as_metadata_opr(R23); + R24_metadata_opr = as_metadata_opr(R24); + R25_metadata_opr = as_metadata_opr(R25); + R26_metadata_opr = as_metadata_opr(R26); + R27_metadata_opr = as_metadata_opr(R27); + R28_metadata_opr = as_metadata_opr(R28); + //R29_metadata_opr = as_metadata_opr(R29); + R30_metadata_opr = as_metadata_opr(R30); + R31_metadata_opr = as_metadata_opr(R31); + + SP_opr = as_pointer_opr(R1_SP); + + R0_long_opr = LIR_OprFact::double_cpu(cpu_reg2rnr(R0), cpu_reg2rnr(R0)); + R3_long_opr = LIR_OprFact::double_cpu(cpu_reg2rnr(R3), cpu_reg2rnr(R3)); + + F1_opr = as_float_opr(F1); + F1_double_opr = as_double_opr(F1); + + // All the allocated cpu regs are caller saved. + for (int i = 0; i < max_nof_caller_save_cpu_regs; i++) { + _caller_save_cpu_regs[i] = LIR_OprFact::single_cpu(i); + } + + // All the fpu regs are caller saved. + for (int i = 0; i < nof_caller_save_fpu_regs; i++) { + _caller_save_fpu_regs[i] = LIR_OprFact::single_fpu(i); + } +} + + +Address FrameMap::make_new_address(ByteSize sp_offset) const { + return Address(R1_SP, STACK_BIAS + in_bytes(sp_offset)); +} + + +VMReg FrameMap::fpu_regname (int n) { + return as_FloatRegister(n)->as_VMReg(); +} + + +LIR_Opr FrameMap::stack_pointer() { + return SP_opr; +} + + +// JSR 292 +// On PPC64, there is no need to save the SP, because neither +// method handle intrinsics, nor compiled lambda forms modify it. +LIR_Opr FrameMap::method_handle_invoke_SP_save_opr() { + return LIR_OprFact::illegalOpr; +} + + +bool FrameMap::validate_frame() { + int max_offset = in_bytes(framesize_in_bytes()); + int java_index = 0; + for (int i = 0; i < _incoming_arguments->length(); i++) { + LIR_Opr opr = _incoming_arguments->at(i); + if (opr->is_stack()) { + max_offset = MAX2(_argument_locations->at(java_index), max_offset); + } + java_index += type2size[opr->type()]; + } + return Assembler::is_simm16(max_offset + STACK_BIAS); +} diff --git a/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.hpp new file mode 100644 index 00000000000..5eee5ffca1f --- /dev/null +++ b/hotspot/src/cpu/ppc/vm/c1_FrameMap_ppc.hpp @@ -0,0 +1,202 @@ +/* + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef CPU_PPC_VM_C1_FRAMEMAP_PPC_HPP +#define CPU_PPC_VM_C1_FRAMEMAP_PPC_HPP + + public: + + enum { + nof_reg_args = 8, // Registers R3-R10 are available for parameter passing. + first_available_sp_in_frame = frame::jit_out_preserve_size, + frame_pad_in_bytes = 0 + }; + + static const int pd_c_runtime_reserved_arg_size; + + static LIR_Opr R0_opr; + static LIR_Opr R1_opr; + static LIR_Opr R2_opr; + static LIR_Opr R3_opr; + static LIR_Opr R4_opr; + static LIR_Opr R5_opr; + static LIR_Opr R6_opr; + static LIR_Opr R7_opr; + static LIR_Opr R8_opr; + static LIR_Opr R9_opr; + static LIR_Opr R10_opr; + static LIR_Opr R11_opr; + static LIR_Opr R12_opr; + static LIR_Opr R13_opr; + static LIR_Opr R14_opr; + static LIR_Opr R15_opr; + static LIR_Opr R16_opr; + static LIR_Opr R17_opr; + static LIR_Opr R18_opr; + static LIR_Opr R19_opr; + static LIR_Opr R20_opr; + static LIR_Opr R21_opr; + static LIR_Opr R22_opr; + static LIR_Opr R23_opr; + static LIR_Opr R24_opr; + static LIR_Opr R25_opr; + static LIR_Opr R26_opr; + static LIR_Opr R27_opr; + static LIR_Opr R28_opr; + static LIR_Opr R29_opr; + static LIR_Opr R30_opr; + static LIR_Opr R31_opr; + + static LIR_Opr R0_oop_opr; + //R1: Stack pointer. Not an oop. + static LIR_Opr R2_oop_opr; + static LIR_Opr R3_oop_opr; + static LIR_Opr R4_oop_opr; + static LIR_Opr R5_oop_opr; + static LIR_Opr R6_oop_opr; + static LIR_Opr R7_oop_opr; + static LIR_Opr R8_oop_opr; + static LIR_Opr R9_oop_opr; + static LIR_Opr R10_oop_opr; + static LIR_Opr R11_oop_opr; + static LIR_Opr R12_oop_opr; + //R13: System thread register. Not usable. + static LIR_Opr R14_oop_opr; + static LIR_Opr R15_oop_opr; + //R16: Java thread register. Not an oop. + static LIR_Opr R17_oop_opr; + static LIR_Opr R18_oop_opr; + static LIR_Opr R19_oop_opr; + static LIR_Opr R20_oop_opr; + static LIR_Opr R21_oop_opr; + static LIR_Opr R22_oop_opr; + static LIR_Opr R23_oop_opr; + static LIR_Opr R24_oop_opr; + static LIR_Opr R25_oop_opr; + static LIR_Opr R26_oop_opr; + static LIR_Opr R27_oop_opr; + static LIR_Opr R28_oop_opr; + static LIR_Opr R29_oop_opr; + //R29: TOC register. Not an oop. + static LIR_Opr R30_oop_opr; + static LIR_Opr R31_oop_opr; + + static LIR_Opr R0_metadata_opr; + //R1: Stack pointer. Not metadata. + static LIR_Opr R2_metadata_opr; + static LIR_Opr R3_metadata_opr; + static LIR_Opr R4_metadata_opr; + static LIR_Opr R5_metadata_opr; + static LIR_Opr R6_metadata_opr; + static LIR_Opr R7_metadata_opr; + static LIR_Opr R8_metadata_opr; + static LIR_Opr R9_metadata_opr; + static LIR_Opr R10_metadata_opr; + static LIR_Opr R11_metadata_opr; + static LIR_Opr R12_metadata_opr; + //R13: System thread register. Not usable. + static LIR_Opr R14_metadata_opr; + static LIR_Opr R15_metadata_opr; + //R16: Java thread register. Not metadata. + static LIR_Opr R17_metadata_opr; + static LIR_Opr R18_metadata_opr; + static LIR_Opr R19_metadata_opr; + static LIR_Opr R20_metadata_opr; + static LIR_Opr R21_metadata_opr; + static LIR_Opr R22_metadata_opr; + static LIR_Opr R23_metadata_opr; + static LIR_Opr R24_metadata_opr; + static LIR_Opr R25_metadata_opr; + static LIR_Opr R26_metadata_opr; + static LIR_Opr R27_metadata_opr; + static LIR_Opr R28_metadata_opr; + //R29: TOC register. Not metadata. + static LIR_Opr R30_metadata_opr; + static LIR_Opr R31_metadata_opr; + + static LIR_Opr SP_opr; + + static LIR_Opr R0_long_opr; + static LIR_Opr R3_long_opr; + + static LIR_Opr F1_opr; + static LIR_Opr F1_double_opr; + + private: + static FloatRegister _fpu_regs [nof_fpu_regs]; + + static LIR_Opr as_long_single_opr(Register r) { + return LIR_OprFact::double_cpu(cpu_reg2rnr(r), cpu_reg2rnr(r)); + } + static LIR_Opr as_long_pair_opr(Register r) { + return LIR_OprFact::double_cpu(cpu_reg2rnr(r->successor()), cpu_reg2rnr(r)); + } + + public: + +#ifdef _LP64 + static LIR_Opr as_long_opr(Register r) { + return as_long_single_opr(r); + } + static LIR_Opr as_pointer_opr(Register r) { + return as_long_single_opr(r); + } +#else + static LIR_Opr as_long_opr(Register r) { + Unimplemented(); return 0; +// return as_long_pair_opr(r); + } + static LIR_Opr as_pointer_opr(Register r) { + Unimplemented(); return 0; +// return as_opr(r); + } +#endif + static LIR_Opr as_float_opr(FloatRegister r) { + return LIR_OprFact::single_fpu(r->encoding()); + } + static LIR_Opr as_double_opr(FloatRegister r) { + return LIR_OprFact::double_fpu(r->encoding()); + } + + static FloatRegister nr2floatreg (int rnr); + + static VMReg fpu_regname (int n); + + static bool is_caller_save_register(LIR_Opr reg); + static bool is_caller_save_register(Register r); + + static int nof_caller_save_cpu_regs() { return pd_nof_caller_save_cpu_regs_frame_map; } + static int last_cpu_reg() { return pd_last_cpu_reg; } + + // Registers which need to be saved in the frames (e.g. for GC). + // Register usage: + // R0: scratch + // R1: sp + // R13: system thread id + // R16: java thread + // R29: global TOC + static bool reg_needs_save(Register r) { return r != R0 && r != R1 && r != R13 && r != R16 && r != R29; } + +#endif // CPU_PPC_VM_C1_FRAMEMAP_PPC_HPP diff --git a/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp new file mode 100644 index 00000000000..8a64bab4be4 --- /dev/null +++ b/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.cpp @@ -0,0 +1,3133 @@ +/* + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "c1/c1_Compilation.hpp" +#include "c1/c1_LIRAssembler.hpp" +#include "c1/c1_MacroAssembler.hpp" +#include "c1/c1_Runtime1.hpp" +#include "c1/c1_ValueStack.hpp" +#include "ci/ciArrayKlass.hpp" +#include "ci/ciInstance.hpp" +#include "gc/shared/collectedHeap.hpp" +#include "gc/shared/barrierSet.hpp" +#include "gc/shared/cardTableModRefBS.hpp" +#include "nativeInst_ppc.hpp" +#include "oops/objArrayKlass.hpp" +#include "runtime/sharedRuntime.hpp" + +#define __ _masm-> + + +const ConditionRegister LIR_Assembler::BOOL_RESULT = CCR5; + + +bool LIR_Assembler::is_small_constant(LIR_Opr opr) { + Unimplemented(); return false; // Currently not used on this platform. +} + + +LIR_Opr LIR_Assembler::receiverOpr() { + return FrameMap::R3_oop_opr; +} + + +LIR_Opr LIR_Assembler::osrBufferPointer() { + return FrameMap::R3_opr; +} + + +// This specifies the stack pointer decrement needed to build the frame. +int LIR_Assembler::initial_frame_size_in_bytes() const { + return in_bytes(frame_map()->framesize_in_bytes()); +} + + +// Inline cache check: the inline cached class is in inline_cache_reg; +// we fetch the class of the receiver and compare it with the cached class. +// If they do not match we jump to slow case. +int LIR_Assembler::check_icache() { + int offset = __ offset(); + __ inline_cache_check(R3_ARG1, R19_inline_cache_reg); + return offset; +} + + +void LIR_Assembler::osr_entry() { + // On-stack-replacement entry sequence: + // + // 1. Create a new compiled activation. + // 2. Initialize local variables in the compiled activation. The expression + // stack must be empty at the osr_bci; it is not initialized. + // 3. Jump to the continuation address in compiled code to resume execution. + + // OSR entry point + offsets()->set_value(CodeOffsets::OSR_Entry, code_offset()); + BlockBegin* osr_entry = compilation()->hir()->osr_entry(); + ValueStack* entry_state = osr_entry->end()->state(); + int number_of_locks = entry_state->locks_size(); + + // Create a frame for the compiled activation. + __ build_frame(initial_frame_size_in_bytes(), bang_size_in_bytes()); + + // OSR buffer is + // + // locals[nlocals-1..0] + // monitors[number_of_locks-1..0] + // + // Locals is a direct copy of the interpreter frame so in the osr buffer + // the first slot in the local array is the last local from the interpreter + // and the last slot is local[0] (receiver) from the interpreter. + // + // Similarly with locks. The first lock slot in the osr buffer is the nth lock + // from the interpreter frame, the nth lock slot in the osr buffer is 0th lock + // in the interpreter frame (the method lock if a sync method). + + // Initialize monitors in the compiled activation. + // R3: pointer to osr buffer + // + // All other registers are dead at this point and the locals will be + // copied into place by code emitted in the IR. + + Register OSR_buf = osrBufferPointer()->as_register(); + { assert(frame::interpreter_frame_monitor_size() == BasicObjectLock::size(), "adjust code below"); + int monitor_offset = BytesPerWord * method()->max_locals() + + (2 * BytesPerWord) * (number_of_locks - 1); + // SharedRuntime::OSR_migration_begin() packs BasicObjectLocks in + // the OSR buffer using 2 word entries: first the lock and then + // the oop. + for (int i = 0; i < number_of_locks; i++) { + int slot_offset = monitor_offset - ((i * 2) * BytesPerWord); +#ifdef ASSERT + // Verify the interpreter's monitor has a non-null object. + { + Label L; + __ ld(R0, slot_offset + 1*BytesPerWord, OSR_buf); + __ cmpdi(CCR0, R0, 0); + __ bne(CCR0, L); + __ stop("locked object is NULL"); + __ bind(L); + } +#endif // ASSERT + // Copy the lock field into the compiled activation. + Address ml = frame_map()->address_for_monitor_lock(i), + mo = frame_map()->address_for_monitor_object(i); + assert(ml.index() == noreg && mo.index() == noreg, "sanity"); + __ ld(R0, slot_offset + 0, OSR_buf); + __ std(R0, ml.disp(), ml.base()); + __ ld(R0, slot_offset + 1*BytesPerWord, OSR_buf); + __ std(R0, mo.disp(), mo.base()); + } + } +} + + +int LIR_Assembler::emit_exception_handler() { + // If the last instruction is a call (typically to do a throw which + // is coming at the end after block reordering) the return address + // must still point into the code area in order to avoid assertion + // failures when searching for the corresponding bci => add a nop + // (was bug 5/14/1999 - gri). + __ nop(); + + // Generate code for the exception handler. + address handler_base = __ start_a_stub(exception_handler_size); + + if (handler_base == NULL) { + // Not enough space left for the handler. + bailout("exception handler overflow"); + return -1; + } + + int offset = code_offset(); + address entry_point = CAST_FROM_FN_PTR(address, Runtime1::entry_for(Runtime1::handle_exception_from_callee_id)); + //__ load_const_optimized(R0, entry_point); + __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(entry_point)); + __ mtctr(R0); + __ bctr(); + + guarantee(code_offset() - offset <= exception_handler_size, "overflow"); + __ end_a_stub(); + + return offset; +} + + +// Emit the code to remove the frame from the stack in the exception +// unwind path. +int LIR_Assembler::emit_unwind_handler() { + _masm->block_comment("Unwind handler"); + + int offset = code_offset(); + bool preserve_exception = method()->is_synchronized() || compilation()->env()->dtrace_method_probes(); + const Register Rexception = R3 /*LIRGenerator::exceptionOopOpr()*/, Rexception_save = R31; + + // Fetch the exception from TLS and clear out exception related thread state. + __ ld(Rexception, in_bytes(JavaThread::exception_oop_offset()), R16_thread); + __ li(R0, 0); + __ std(R0, in_bytes(JavaThread::exception_oop_offset()), R16_thread); + __ std(R0, in_bytes(JavaThread::exception_pc_offset()), R16_thread); + + __ bind(_unwind_handler_entry); + __ verify_not_null_oop(Rexception); + if (preserve_exception) { __ mr(Rexception_save, Rexception); } + + // Perform needed unlocking + MonitorExitStub* stub = NULL; + if (method()->is_synchronized()) { + monitor_address(0, FrameMap::R4_opr); + stub = new MonitorExitStub(FrameMap::R4_opr, true, 0); + __ unlock_object(R5, R6, R4, *stub->entry()); + __ bind(*stub->continuation()); + } + + if (compilation()->env()->dtrace_method_probes()) { + Unimplemented(); + } + + // Dispatch to the unwind logic. + address unwind_stub = Runtime1::entry_for(Runtime1::unwind_exception_id); + //__ load_const_optimized(R0, unwind_stub); + __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(unwind_stub)); + if (preserve_exception) { __ mr(Rexception, Rexception_save); } + __ mtctr(R0); + __ bctr(); + + // Emit the slow path assembly. + if (stub != NULL) { + stub->emit_code(this); + } + + return offset; +} + + +int LIR_Assembler::emit_deopt_handler() { + // If the last instruction is a call (typically to do a throw which + // is coming at the end after block reordering) the return address + // must still point into the code area in order to avoid assertion + // failures when searching for the corresponding bci => add a nop + // (was bug 5/14/1999 - gri). + __ nop(); + + // Generate code for deopt handler. + address handler_base = __ start_a_stub(deopt_handler_size); + + if (handler_base == NULL) { + // Not enough space left for the handler. + bailout("deopt handler overflow"); + return -1; + } + + int offset = code_offset(); + __ bl64_patchable(SharedRuntime::deopt_blob()->unpack(), relocInfo::runtime_call_type); + + guarantee(code_offset() - offset <= deopt_handler_size, "overflow"); + __ end_a_stub(); + + return offset; +} + + +void LIR_Assembler::jobject2reg(jobject o, Register reg) { + if (o == NULL) { + __ li(reg, 0); + } else { + AddressLiteral addrlit = __ constant_oop_address(o); + __ load_const(reg, addrlit, (reg != R0) ? R0 : noreg); + } +} + + +void LIR_Assembler::jobject2reg_with_patching(Register reg, CodeEmitInfo *info) { + // Allocate a new index in table to hold the object once it's been patched. + int oop_index = __ oop_recorder()->allocate_oop_index(NULL); + PatchingStub* patch = new PatchingStub(_masm, patching_id(info), oop_index); + + AddressLiteral addrlit((address)NULL, oop_Relocation::spec(oop_index)); + __ load_const(reg, addrlit, R0); + + patching_epilog(patch, lir_patch_normal, reg, info); +} + + +void LIR_Assembler::metadata2reg(Metadata* o, Register reg) { + AddressLiteral md = __ constant_metadata_address(o); // Notify OOP recorder (don't need the relocation) + __ load_const_optimized(reg, md.value(), (reg != R0) ? R0 : noreg); +} + + +void LIR_Assembler::klass2reg_with_patching(Register reg, CodeEmitInfo *info) { + // Allocate a new index in table to hold the klass once it's been patched. + int index = __ oop_recorder()->allocate_metadata_index(NULL); + PatchingStub* patch = new PatchingStub(_masm, PatchingStub::load_klass_id, index); + + AddressLiteral addrlit((address)NULL, metadata_Relocation::spec(index)); + assert(addrlit.rspec().type() == relocInfo::metadata_type, "must be an metadata reloc"); + __ load_const(reg, addrlit, R0); + + patching_epilog(patch, lir_patch_normal, reg, info); +} + + +void LIR_Assembler::emit_op3(LIR_Op3* op) { + const bool is_int = op->result_opr()->is_single_cpu(); + Register Rdividend = is_int ? op->in_opr1()->as_register() : op->in_opr1()->as_register_lo(); + Register Rdivisor = noreg; + Register Rscratch = op->in_opr3()->as_register(); + Register Rresult = is_int ? op->result_opr()->as_register() : op->result_opr()->as_register_lo(); + long divisor = -1; + + if (op->in_opr2()->is_register()) { + Rdivisor = is_int ? op->in_opr2()->as_register() : op->in_opr2()->as_register_lo(); + } else { + divisor = is_int ? op->in_opr2()->as_constant_ptr()->as_jint() + : op->in_opr2()->as_constant_ptr()->as_jlong(); + } + + assert(Rdividend != Rscratch, ""); + assert(Rdivisor != Rscratch, ""); + assert(op->code() == lir_idiv || op->code() == lir_irem, "Must be irem or idiv"); + + if (Rdivisor == noreg) { + if (divisor == 1) { // stupid, but can happen + if (op->code() == lir_idiv) { + __ mr_if_needed(Rresult, Rdividend); + } else { + __ li(Rresult, 0); + } + + } else if (is_power_of_2(divisor)) { + // Convert division by a power of two into some shifts and logical operations. + int log2 = log2_intptr(divisor); + + // Round towards 0. + if (divisor == 2) { + if (is_int) { + __ srwi(Rscratch, Rdividend, 31); + } else { + __ srdi(Rscratch, Rdividend, 63); + } + } else { + if (is_int) { + __ srawi(Rscratch, Rdividend, 31); + } else { + __ sradi(Rscratch, Rdividend, 63); + } + __ clrldi(Rscratch, Rscratch, 64-log2); + } + __ add(Rscratch, Rdividend, Rscratch); + + if (op->code() == lir_idiv) { + if (is_int) { + __ srawi(Rresult, Rscratch, log2); + } else { + __ sradi(Rresult, Rscratch, log2); + } + } else { // lir_irem + __ clrrdi(Rscratch, Rscratch, log2); + __ sub(Rresult, Rdividend, Rscratch); + } + + } else if (divisor == -1) { + if (op->code() == lir_idiv) { + __ neg(Rresult, Rdividend); + } else { + __ li(Rresult, 0); + } + + } else { + __ load_const_optimized(Rscratch, divisor); + if (op->code() == lir_idiv) { + if (is_int) { + __ divw(Rresult, Rdividend, Rscratch); // Can't divide minint/-1. + } else { + __ divd(Rresult, Rdividend, Rscratch); // Can't divide minint/-1. + } + } else { + assert(Rscratch != R0, "need both"); + if (is_int) { + __ divw(R0, Rdividend, Rscratch); // Can't divide minint/-1. + __ mullw(Rscratch, R0, Rscratch); + } else { + __ divd(R0, Rdividend, Rscratch); // Can't divide minint/-1. + __ mulld(Rscratch, R0, Rscratch); + } + __ sub(Rresult, Rdividend, Rscratch); + } + + } + return; + } + + Label regular, done; + if (is_int) { + __ cmpwi(CCR0, Rdivisor, -1); + } else { + __ cmpdi(CCR0, Rdivisor, -1); + } + __ bne(CCR0, regular); + if (op->code() == lir_idiv) { + __ neg(Rresult, Rdividend); + __ b(done); + __ bind(regular); + if (is_int) { + __ divw(Rresult, Rdividend, Rdivisor); // Can't divide minint/-1. + } else { + __ divd(Rresult, Rdividend, Rdivisor); // Can't divide minint/-1. + } + } else { // lir_irem + __ li(Rresult, 0); + __ b(done); + __ bind(regular); + if (is_int) { + __ divw(Rscratch, Rdividend, Rdivisor); // Can't divide minint/-1. + __ mullw(Rscratch, Rscratch, Rdivisor); + } else { + __ divd(Rscratch, Rdividend, Rdivisor); // Can't divide minint/-1. + __ mulld(Rscratch, Rscratch, Rdivisor); + } + __ sub(Rresult, Rdividend, Rscratch); + } + __ bind(done); +} + + +void LIR_Assembler::emit_opBranch(LIR_OpBranch* op) { +#ifdef ASSERT + assert(op->block() == NULL || op->block()->label() == op->label(), "wrong label"); + if (op->block() != NULL) _branch_target_blocks.append(op->block()); + if (op->ublock() != NULL) _branch_target_blocks.append(op->ublock()); + assert(op->info() == NULL, "shouldn't have CodeEmitInfo"); +#endif + + Label *L = op->label(); + if (op->cond() == lir_cond_always) { + __ b(*L); + } else { + Label done; + bool is_unordered = false; + if (op->code() == lir_cond_float_branch) { + assert(op->ublock() != NULL, "must have unordered successor"); + is_unordered = true; + } else { + assert(op->code() == lir_branch, "just checking"); + } + + bool positive = false; + Assembler::Condition cond = Assembler::equal; + switch (op->cond()) { + case lir_cond_equal: positive = true ; cond = Assembler::equal ; is_unordered = false; break; + case lir_cond_notEqual: positive = false; cond = Assembler::equal ; is_unordered = false; break; + case lir_cond_less: positive = true ; cond = Assembler::less ; break; + case lir_cond_belowEqual: assert(op->code() != lir_cond_float_branch, ""); // fallthru + case lir_cond_lessEqual: positive = false; cond = Assembler::greater; break; + case lir_cond_greater: positive = true ; cond = Assembler::greater; break; + case lir_cond_aboveEqual: assert(op->code() != lir_cond_float_branch, ""); // fallthru + case lir_cond_greaterEqual: positive = false; cond = Assembler::less ; break; + default: ShouldNotReachHere(); + } + int bo = positive ? Assembler::bcondCRbiIs1 : Assembler::bcondCRbiIs0; + int bi = Assembler::bi0(BOOL_RESULT, cond); + if (is_unordered) { + if (positive) { + if (op->ublock() == op->block()) { + __ bc_far_optimized(Assembler::bcondCRbiIs1, __ bi0(BOOL_RESULT, Assembler::summary_overflow), *L); + } + } else { + if (op->ublock() != op->block()) { __ bso(BOOL_RESULT, done); } + } + } + __ bc_far_optimized(bo, bi, *L); + __ bind(done); + } +} + + +void LIR_Assembler::emit_opConvert(LIR_OpConvert* op) { + Bytecodes::Code code = op->bytecode(); + LIR_Opr src = op->in_opr(), + dst = op->result_opr(); + + switch(code) { + case Bytecodes::_i2l: { + __ extsw(dst->as_register_lo(), src->as_register()); + break; + } + case Bytecodes::_l2i: { + __ mr_if_needed(dst->as_register(), src->as_register_lo()); // high bits are garbage + break; + } + case Bytecodes::_i2b: { + __ extsb(dst->as_register(), src->as_register()); + break; + } + case Bytecodes::_i2c: { + __ clrldi(dst->as_register(), src->as_register(), 64-16); + break; + } + case Bytecodes::_i2s: { + __ extsh(dst->as_register(), src->as_register()); + break; + } + case Bytecodes::_i2d: + case Bytecodes::_l2d: { + __ fcfid(dst->as_double_reg(), src->as_double_reg()); // via mem + break; + } + case Bytecodes::_i2f: { + FloatRegister rdst = dst->as_float_reg(); + FloatRegister rsrc = src->as_double_reg(); // via mem + if (VM_Version::has_fcfids()) { + __ fcfids(rdst, rsrc); + } else { + __ fcfid(rdst, rsrc); + __ frsp(rdst, rdst); + } + break; + } + case Bytecodes::_l2f: { // >= Power7 + assert(VM_Version::has_fcfids(), "fcfid+frsp needs fixup code to avoid rounding incompatibility"); + __ fcfids(dst->as_float_reg(), src->as_double_reg()); // via mem + break; + } + case Bytecodes::_f2d: { + __ fmr_if_needed(dst->as_double_reg(), src->as_float_reg()); + break; + } + case Bytecodes::_d2f: { + __ frsp(dst->as_float_reg(), src->as_double_reg()); + break; + } + case Bytecodes::_d2i: + case Bytecodes::_f2i: { + FloatRegister rsrc = (code == Bytecodes::_d2i) ? src->as_double_reg() : src->as_float_reg(); + Address addr = frame_map()->address_for_slot(dst->double_stack_ix()); + Label L; + // Result must be 0 if value is NaN; test by comparing value to itself. + __ fcmpu(CCR0, rsrc, rsrc); + __ li(R0, 0); // 0 in case of NAN + __ std(R0, addr.disp(), addr.base()); + __ bso(CCR0, L); + __ fctiwz(rsrc, rsrc); // USE_KILL + __ stfd(rsrc, addr.disp(), addr.base()); + __ bind(L); + break; + } + case Bytecodes::_d2l: + case Bytecodes::_f2l: { + FloatRegister rsrc = (code == Bytecodes::_d2l) ? src->as_double_reg() : src->as_float_reg(); + Address addr = frame_map()->address_for_slot(dst->double_stack_ix()); + Label L; + // Result must be 0 if value is NaN; test by comparing value to itself. + __ fcmpu(CCR0, rsrc, rsrc); + __ li(R0, 0); // 0 in case of NAN + __ std(R0, addr.disp(), addr.base()); + __ bso(CCR0, L); + __ fctidz(rsrc, rsrc); // USE_KILL + __ stfd(rsrc, addr.disp(), addr.base()); + __ bind(L); + break; + } + + default: ShouldNotReachHere(); + } +} + + +void LIR_Assembler::align_call(LIR_Code) { + // do nothing since all instructions are word aligned on ppc +} + + +bool LIR_Assembler::emit_trampoline_stub_for_call(address target, Register Rtoc) { + int start_offset = __ offset(); + // Put the entry point as a constant into the constant pool. + const address entry_point_toc_addr = __ address_constant(target, RelocationHolder::none); + if (entry_point_toc_addr == NULL) { + bailout("const section overflow"); + return false; + } + const int entry_point_toc_offset = __ offset_to_method_toc(entry_point_toc_addr); + + // Emit the trampoline stub which will be related to the branch-and-link below. + address stub = __ emit_trampoline_stub(entry_point_toc_offset, start_offset, Rtoc); + if (!stub) { + bailout("no space for trampoline stub"); + return false; + } + return true; +} + + +void LIR_Assembler::call(LIR_OpJavaCall* op, relocInfo::relocType rtype) { + assert(rtype==relocInfo::opt_virtual_call_type || rtype==relocInfo::static_call_type, "unexpected rtype"); + + bool success = emit_trampoline_stub_for_call(op->addr()); + if (!success) { return; } + + __ relocate(rtype); + // Note: At this point we do not have the address of the trampoline + // stub, and the entry point might be too far away for bl, so __ pc() + // serves as dummy and the bl will be patched later. + __ code()->set_insts_mark(); + __ bl(__ pc()); + add_call_info(code_offset(), op->info()); +} + + +void LIR_Assembler::ic_call(LIR_OpJavaCall* op) { + __ calculate_address_from_global_toc(R2_TOC, __ method_toc()); + + // Virtual call relocation will point to ic load. + address virtual_call_meta_addr = __ pc(); + // Load a clear inline cache. + AddressLiteral empty_ic((address) Universe::non_oop_word()); + bool success = __ load_const_from_method_toc(R19_inline_cache_reg, empty_ic, R2_TOC); + if (!success) { + bailout("const section overflow"); + return; + } + // Call to fixup routine. Fixup routine uses ScopeDesc info + // to determine who we intended to call. + __ relocate(virtual_call_Relocation::spec(virtual_call_meta_addr)); + + success = emit_trampoline_stub_for_call(op->addr(), R2_TOC); + if (!success) { return; } + + // Note: At this point we do not have the address of the trampoline + // stub, and the entry point might be too far away for bl, so __ pc() + // serves as dummy and the bl will be patched later. + __ bl(__ pc()); + add_call_info(code_offset(), op->info()); +} + + +void LIR_Assembler::vtable_call(LIR_OpJavaCall* op) { + ShouldNotReachHere(); // ic_call is used instead. +} + + +void LIR_Assembler::explicit_null_check(Register addr, CodeEmitInfo* info) { + ImplicitNullCheckStub* stub = new ImplicitNullCheckStub(code_offset(), info); + __ null_check(addr, stub->entry()); + append_code_stub(stub); +} + + +// Attention: caller must encode oop if needed +int LIR_Assembler::store(LIR_Opr from_reg, Register base, int offset, BasicType type, bool wide, bool unaligned) { + int store_offset; + if (!Assembler::is_simm16(offset)) { + // For offsets larger than a simm16 we setup the offset. + assert(wide && !from_reg->is_same_register(FrameMap::R0_opr), "large offset only supported in special case"); + __ load_const_optimized(R0, offset); + store_offset = store(from_reg, base, R0, type, wide); + } else { + store_offset = code_offset(); + switch (type) { + case T_BOOLEAN: // fall through + case T_BYTE : __ stb(from_reg->as_register(), offset, base); break; + case T_CHAR : + case T_SHORT : __ sth(from_reg->as_register(), offset, base); break; + case T_INT : __ stw(from_reg->as_register(), offset, base); break; + case T_LONG : __ std(from_reg->as_register_lo(), offset, base); break; + case T_ADDRESS: + case T_METADATA: __ std(from_reg->as_register(), offset, base); break; + case T_ARRAY : // fall through + case T_OBJECT: + { + if (UseCompressedOops && !wide) { + // Encoding done in caller + __ stw(from_reg->as_register(), offset, base); + } else { + __ std(from_reg->as_register(), offset, base); + } + __ verify_oop(from_reg->as_register()); + break; + } + case T_FLOAT : __ stfs(from_reg->as_float_reg(), offset, base); break; + case T_DOUBLE: __ stfd(from_reg->as_double_reg(), offset, base); break; + default : ShouldNotReachHere(); + } + } + return store_offset; +} + + +// Attention: caller must encode oop if needed +int LIR_Assembler::store(LIR_Opr from_reg, Register base, Register disp, BasicType type, bool wide) { + int store_offset = code_offset(); + switch (type) { + case T_BOOLEAN: // fall through + case T_BYTE : __ stbx(from_reg->as_register(), base, disp); break; + case T_CHAR : + case T_SHORT : __ sthx(from_reg->as_register(), base, disp); break; + case T_INT : __ stwx(from_reg->as_register(), base, disp); break; + case T_LONG : +#ifdef _LP64 + __ stdx(from_reg->as_register_lo(), base, disp); +#else + Unimplemented(); +#endif + break; + case T_ADDRESS: + __ stdx(from_reg->as_register(), base, disp); + break; + case T_ARRAY : // fall through + case T_OBJECT: + { + if (UseCompressedOops && !wide) { + // Encoding done in caller. + __ stwx(from_reg->as_register(), base, disp); + } else { + __ stdx(from_reg->as_register(), base, disp); + } + __ verify_oop(from_reg->as_register()); // kills R0 + break; + } + case T_FLOAT : __ stfsx(from_reg->as_float_reg(), base, disp); break; + case T_DOUBLE: __ stfdx(from_reg->as_double_reg(), base, disp); break; + default : ShouldNotReachHere(); + } + return store_offset; +} + + +int LIR_Assembler::load(Register base, int offset, LIR_Opr to_reg, BasicType type, bool wide, bool unaligned) { + int load_offset; + if (!Assembler::is_simm16(offset)) { + // For offsets larger than a simm16 we setup the offset. + __ load_const_optimized(R0, offset); + load_offset = load(base, R0, to_reg, type, wide); + } else { + load_offset = code_offset(); + switch(type) { + case T_BOOLEAN: // fall through + case T_BYTE : __ lbz(to_reg->as_register(), offset, base); + __ extsb(to_reg->as_register(), to_reg->as_register()); break; + case T_CHAR : __ lhz(to_reg->as_register(), offset, base); break; + case T_SHORT : __ lha(to_reg->as_register(), offset, base); break; + case T_INT : __ lwa(to_reg->as_register(), offset, base); break; + case T_LONG : __ ld(to_reg->as_register_lo(), offset, base); break; + case T_METADATA: __ ld(to_reg->as_register(), offset, base); break; + case T_ADDRESS: + if (offset == oopDesc::klass_offset_in_bytes() && UseCompressedClassPointers) { + __ lwz(to_reg->as_register(), offset, base); + __ decode_klass_not_null(to_reg->as_register()); + } else { + __ ld(to_reg->as_register(), offset, base); + } + break; + case T_ARRAY : // fall through + case T_OBJECT: + { + if (UseCompressedOops && !wide) { + __ lwz(to_reg->as_register(), offset, base); + __ decode_heap_oop(to_reg->as_register()); + } else { + __ ld(to_reg->as_register(), offset, base); + } + __ verify_oop(to_reg->as_register()); + break; + } + case T_FLOAT: __ lfs(to_reg->as_float_reg(), offset, base); break; + case T_DOUBLE: __ lfd(to_reg->as_double_reg(), offset, base); break; + default : ShouldNotReachHere(); + } + } + return load_offset; +} + + +int LIR_Assembler::load(Register base, Register disp, LIR_Opr to_reg, BasicType type, bool wide) { + int load_offset = code_offset(); + switch(type) { + case T_BOOLEAN: // fall through + case T_BYTE : __ lbzx(to_reg->as_register(), base, disp); + __ extsb(to_reg->as_register(), to_reg->as_register()); break; + case T_CHAR : __ lhzx(to_reg->as_register(), base, disp); break; + case T_SHORT : __ lhax(to_reg->as_register(), base, disp); break; + case T_INT : __ lwax(to_reg->as_register(), base, disp); break; + case T_ADDRESS: __ ldx(to_reg->as_register(), base, disp); break; + case T_ARRAY : // fall through + case T_OBJECT: + { + if (UseCompressedOops && !wide) { + __ lwzx(to_reg->as_register(), base, disp); + __ decode_heap_oop(to_reg->as_register()); + } else { + __ ldx(to_reg->as_register(), base, disp); + } + __ verify_oop(to_reg->as_register()); + break; + } + case T_FLOAT: __ lfsx(to_reg->as_float_reg() , base, disp); break; + case T_DOUBLE: __ lfdx(to_reg->as_double_reg(), base, disp); break; + case T_LONG : +#ifdef _LP64 + __ ldx(to_reg->as_register_lo(), base, disp); +#else + Unimplemented(); +#endif + break; + default : ShouldNotReachHere(); + } + return load_offset; +} + + +void LIR_Assembler::const2stack(LIR_Opr src, LIR_Opr dest) { + LIR_Const* c = src->as_constant_ptr(); + Register src_reg = R0; + switch (c->type()) { + case T_INT: + case T_FLOAT: { + int value = c->as_jint_bits(); + __ load_const_optimized(src_reg, value); + Address addr = frame_map()->address_for_slot(dest->single_stack_ix()); + __ stw(src_reg, addr.disp(), addr.base()); + break; + } + case T_ADDRESS: { + int value = c->as_jint_bits(); + __ load_const_optimized(src_reg, value); + Address addr = frame_map()->address_for_slot(dest->single_stack_ix()); + __ std(src_reg, addr.disp(), addr.base()); + break; + } + case T_OBJECT: { + jobject2reg(c->as_jobject(), src_reg); + Address addr = frame_map()->address_for_slot(dest->single_stack_ix()); + __ std(src_reg, addr.disp(), addr.base()); + break; + } + case T_LONG: + case T_DOUBLE: { + int value = c->as_jlong_bits(); + __ load_const_optimized(src_reg, value); + Address addr = frame_map()->address_for_double_slot(dest->double_stack_ix()); + __ std(src_reg, addr.disp(), addr.base()); + break; + } + default: + Unimplemented(); + } +} + + +void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmitInfo* info, bool wide) { + LIR_Const* c = src->as_constant_ptr(); + LIR_Address* addr = dest->as_address_ptr(); + Register base = addr->base()->as_pointer_register(); + LIR_Opr tmp = LIR_OprFact::illegalOpr; + int offset = -1; + // Null check for large offsets in LIRGenerator::do_StoreField. + bool needs_explicit_null_check = !ImplicitNullChecks; + + if (info != NULL && needs_explicit_null_check) { + explicit_null_check(base, info); + } + + switch (c->type()) { + case T_FLOAT: type = T_INT; + case T_INT: + case T_ADDRESS: { + tmp = FrameMap::R0_opr; + __ load_const_optimized(tmp->as_register(), c->as_jint_bits()); + break; + } + case T_DOUBLE: type = T_LONG; + case T_LONG: { + tmp = FrameMap::R0_long_opr; + __ load_const_optimized(tmp->as_register_lo(), c->as_jlong_bits()); + break; + } + case T_OBJECT: { + tmp = FrameMap::R0_opr; + if (UseCompressedOops && !wide && c->as_jobject() != NULL) { + AddressLiteral oop_addr = __ constant_oop_address(c->as_jobject()); + __ lis(R0, oop_addr.value() >> 16); // Don't care about sign extend (will use stw). + __ relocate(oop_addr.rspec(), /*compressed format*/ 1); + __ ori(R0, R0, oop_addr.value() & 0xffff); + } else { + jobject2reg(c->as_jobject(), R0); + } + break; + } + default: + Unimplemented(); + } + + // Handle either reg+reg or reg+disp address. + if (addr->index()->is_valid()) { + assert(addr->disp() == 0, "must be zero"); + offset = store(tmp, base, addr->index()->as_pointer_register(), type, wide); + } else { + assert(Assembler::is_simm16(addr->disp()), "can't handle larger addresses"); + offset = store(tmp, base, addr->disp(), type, wide, false); + } + + if (info != NULL) { + assert(offset != -1, "offset should've been set"); + if (!needs_explicit_null_check) { + add_debug_info_for_null_check(offset, info); + } + } +} + + +void LIR_Assembler::const2reg(LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_code, CodeEmitInfo* info) { + LIR_Const* c = src->as_constant_ptr(); + LIR_Opr to_reg = dest; + + switch (c->type()) { + case T_INT: { + assert(patch_code == lir_patch_none, "no patching handled here"); + __ load_const_optimized(dest->as_register(), c->as_jint(), R0); + break; + } + case T_ADDRESS: { + assert(patch_code == lir_patch_none, "no patching handled here"); + __ load_const_optimized(dest->as_register(), c->as_jint(), R0); // Yes, as_jint ... + break; + } + case T_LONG: { + assert(patch_code == lir_patch_none, "no patching handled here"); + __ load_const_optimized(dest->as_register_lo(), c->as_jlong(), R0); + break; + } + + case T_OBJECT: { + if (patch_code == lir_patch_none) { + jobject2reg(c->as_jobject(), to_reg->as_register()); + } else { + jobject2reg_with_patching(to_reg->as_register(), info); + } + break; + } + + case T_METADATA: + { + if (patch_code == lir_patch_none) { + metadata2reg(c->as_metadata(), to_reg->as_register()); + } else { + klass2reg_with_patching(to_reg->as_register(), info); + } + } + break; + + case T_FLOAT: + { + if (to_reg->is_single_fpu()) { + address const_addr = __ float_constant(c->as_jfloat()); + if (const_addr == NULL) { + bailout("const section overflow"); + break; + } + RelocationHolder rspec = internal_word_Relocation::spec(const_addr); + __ relocate(rspec); + __ load_const(R0, const_addr); + __ lfsx(to_reg->as_float_reg(), R0); + } else { + assert(to_reg->is_single_cpu(), "Must be a cpu register."); + __ load_const_optimized(to_reg->as_register(), jint_cast(c->as_jfloat()), R0); + } + } + break; + + case T_DOUBLE: + { + if (to_reg->is_double_fpu()) { + address const_addr = __ double_constant(c->as_jdouble()); + if (const_addr == NULL) { + bailout("const section overflow"); + break; + } + RelocationHolder rspec = internal_word_Relocation::spec(const_addr); + __ relocate(rspec); + __ load_const(R0, const_addr); + __ lfdx(to_reg->as_double_reg(), R0); + } else { + assert(to_reg->is_double_cpu(), "Must be a long register."); + __ load_const_optimized(to_reg->as_register_lo(), jlong_cast(c->as_jdouble()), R0); + } + } + break; + + default: + ShouldNotReachHere(); + } +} + + +Address LIR_Assembler::as_Address(LIR_Address* addr) { + Unimplemented(); return Address(); +} + + +inline RegisterOrConstant index_or_disp(LIR_Address* addr) { + if (addr->index()->is_illegal()) { + return (RegisterOrConstant)(addr->disp()); + } else { + return (RegisterOrConstant)(addr->index()->as_pointer_register()); + } +} + + +void LIR_Assembler::stack2stack(LIR_Opr src, LIR_Opr dest, BasicType type) { + const Register tmp = R0; + switch (type) { + case T_INT: + case T_FLOAT: { + Address from = frame_map()->address_for_slot(src->single_stack_ix()); + Address to = frame_map()->address_for_slot(dest->single_stack_ix()); + __ lwz(tmp, from.disp(), from.base()); + __ stw(tmp, to.disp(), to.base()); + break; + } + case T_ADDRESS: + case T_OBJECT: { + Address from = frame_map()->address_for_slot(src->single_stack_ix()); + Address to = frame_map()->address_for_slot(dest->single_stack_ix()); + __ ld(tmp, from.disp(), from.base()); + __ std(tmp, to.disp(), to.base()); + break; + } + case T_LONG: + case T_DOUBLE: { + Address from = frame_map()->address_for_double_slot(src->double_stack_ix()); + Address to = frame_map()->address_for_double_slot(dest->double_stack_ix()); + __ ld(tmp, from.disp(), from.base()); + __ std(tmp, to.disp(), to.base()); + break; + } + + default: + ShouldNotReachHere(); + } +} + + +Address LIR_Assembler::as_Address_hi(LIR_Address* addr) { + Unimplemented(); return Address(); +} + + +Address LIR_Assembler::as_Address_lo(LIR_Address* addr) { + Unimplemented(); return Address(); +} + + +void LIR_Assembler::mem2reg(LIR_Opr src_opr, LIR_Opr dest, BasicType type, + LIR_PatchCode patch_code, CodeEmitInfo* info, bool wide, bool unaligned) { + + assert(type != T_METADATA, "load of metadata ptr not supported"); + LIR_Address* addr = src_opr->as_address_ptr(); + LIR_Opr to_reg = dest; + + Register src = addr->base()->as_pointer_register(); + Register disp_reg = noreg; + int disp_value = addr->disp(); + bool needs_patching = (patch_code != lir_patch_none); + // null check for large offsets in LIRGenerator::do_LoadField + bool needs_explicit_null_check = !os::zero_page_read_protected() || !ImplicitNullChecks; + + if (info != NULL && needs_explicit_null_check) { + explicit_null_check(src, info); + } + + if (addr->base()->type() == T_OBJECT) { + __ verify_oop(src); + } + + PatchingStub* patch = NULL; + if (needs_patching) { + patch = new PatchingStub(_masm, PatchingStub::access_field_id); + assert(!to_reg->is_double_cpu() || + patch_code == lir_patch_none || + patch_code == lir_patch_normal, "patching doesn't match register"); + } + + if (addr->index()->is_illegal()) { + if (!Assembler::is_simm16(disp_value)) { + if (needs_patching) { + __ load_const32(R0, 0); // patchable int + } else { + __ load_const_optimized(R0, disp_value); + } + disp_reg = R0; + } + } else { + disp_reg = addr->index()->as_pointer_register(); + assert(disp_value == 0, "can't handle 3 operand addresses"); + } + + // Remember the offset of the load. The patching_epilog must be done + // before the call to add_debug_info, otherwise the PcDescs don't get + // entered in increasing order. + int offset; + + if (disp_reg == noreg) { + assert(Assembler::is_simm16(disp_value), "should have set this up"); + offset = load(src, disp_value, to_reg, type, wide, unaligned); + } else { + assert(!unaligned, "unexpected"); + offset = load(src, disp_reg, to_reg, type, wide); + } + + if (patch != NULL) { + patching_epilog(patch, patch_code, src, info); + } + if (info != NULL && !needs_explicit_null_check) { + add_debug_info_for_null_check(offset, info); + } +} + + +void LIR_Assembler::stack2reg(LIR_Opr src, LIR_Opr dest, BasicType type) { + Address addr; + if (src->is_single_word()) { + addr = frame_map()->address_for_slot(src->single_stack_ix()); + } else if (src->is_double_word()) { + addr = frame_map()->address_for_double_slot(src->double_stack_ix()); + } + + bool unaligned = (addr.disp() - STACK_BIAS) % 8 != 0; + load(addr.base(), addr.disp(), dest, dest->type(), true /*wide*/, unaligned); +} + + +void LIR_Assembler::reg2stack(LIR_Opr from_reg, LIR_Opr dest, BasicType type, bool pop_fpu_stack) { + Address addr; + if (dest->is_single_word()) { + addr = frame_map()->address_for_slot(dest->single_stack_ix()); + } else if (dest->is_double_word()) { + addr = frame_map()->address_for_slot(dest->double_stack_ix()); + } + bool unaligned = (addr.disp() - STACK_BIAS) % 8 != 0; + store(from_reg, addr.base(), addr.disp(), from_reg->type(), true /*wide*/, unaligned); +} + + +void LIR_Assembler::reg2reg(LIR_Opr from_reg, LIR_Opr to_reg) { + if (from_reg->is_float_kind() && to_reg->is_float_kind()) { + if (from_reg->is_double_fpu()) { + // double to double moves + assert(to_reg->is_double_fpu(), "should match"); + __ fmr_if_needed(to_reg->as_double_reg(), from_reg->as_double_reg()); + } else { + // float to float moves + assert(to_reg->is_single_fpu(), "should match"); + __ fmr_if_needed(to_reg->as_float_reg(), from_reg->as_float_reg()); + } + } else if (!from_reg->is_float_kind() && !to_reg->is_float_kind()) { + if (from_reg->is_double_cpu()) { + __ mr_if_needed(to_reg->as_pointer_register(), from_reg->as_pointer_register()); + } else if (to_reg->is_double_cpu()) { + // int to int moves + __ mr_if_needed(to_reg->as_register_lo(), from_reg->as_register()); + } else { + // int to int moves + __ mr_if_needed(to_reg->as_register(), from_reg->as_register()); + } + } else { + ShouldNotReachHere(); + } + if (to_reg->type() == T_OBJECT || to_reg->type() == T_ARRAY) { + __ verify_oop(to_reg->as_register()); + } +} + + +void LIR_Assembler::reg2mem(LIR_Opr from_reg, LIR_Opr dest, BasicType type, + LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack, + bool wide, bool unaligned) { + assert(type != T_METADATA, "store of metadata ptr not supported"); + LIR_Address* addr = dest->as_address_ptr(); + + Register src = addr->base()->as_pointer_register(); + Register disp_reg = noreg; + int disp_value = addr->disp(); + bool needs_patching = (patch_code != lir_patch_none); + bool compress_oop = (type == T_ARRAY || type == T_OBJECT) && UseCompressedOops && !wide && + Universe::narrow_oop_mode() != Universe::UnscaledNarrowOop; + bool load_disp = addr->index()->is_illegal() && !Assembler::is_simm16(disp_value); + bool use_R29 = compress_oop && load_disp; // Avoid register conflict, also do null check before killing R29. + // Null check for large offsets in LIRGenerator::do_StoreField. + bool needs_explicit_null_check = !ImplicitNullChecks || use_R29; + + if (info != NULL && needs_explicit_null_check) { + explicit_null_check(src, info); + } + + if (addr->base()->is_oop_register()) { + __ verify_oop(src); + } + + PatchingStub* patch = NULL; + if (needs_patching) { + patch = new PatchingStub(_masm, PatchingStub::access_field_id); + assert(!from_reg->is_double_cpu() || + patch_code == lir_patch_none || + patch_code == lir_patch_normal, "patching doesn't match register"); + } + + if (addr->index()->is_illegal()) { + if (load_disp) { + disp_reg = use_R29 ? R29_TOC : R0; + if (needs_patching) { + __ load_const32(disp_reg, 0); // patchable int + } else { + __ load_const_optimized(disp_reg, disp_value); + } + } + } else { + disp_reg = addr->index()->as_pointer_register(); + assert(disp_value == 0, "can't handle 3 operand addresses"); + } + + // remember the offset of the store. The patching_epilog must be done + // before the call to add_debug_info_for_null_check, otherwise the PcDescs don't get + // entered in increasing order. + int offset; + + if (compress_oop) { + Register co = __ encode_heap_oop(R0, from_reg->as_register()); + from_reg = FrameMap::as_opr(co); + } + + if (disp_reg == noreg) { + assert(Assembler::is_simm16(disp_value), "should have set this up"); + offset = store(from_reg, src, disp_value, type, wide, unaligned); + } else { + assert(!unaligned, "unexpected"); + offset = store(from_reg, src, disp_reg, type, wide); + } + + if (use_R29) { + __ load_const_optimized(R29_TOC, MacroAssembler::global_toc(), R0); // reinit + } + + if (patch != NULL) { + patching_epilog(patch, patch_code, src, info); + } + + if (info != NULL && !needs_explicit_null_check) { + add_debug_info_for_null_check(offset, info); + } +} + + +void LIR_Assembler::return_op(LIR_Opr result) { + const Register return_pc = R11; + const Register polling_page = R12; + + // Pop the stack before the safepoint code. + int frame_size = initial_frame_size_in_bytes(); + if (Assembler::is_simm(frame_size, 16)) { + __ addi(R1_SP, R1_SP, frame_size); + } else { + __ pop_frame(); + } + + if (LoadPollAddressFromThread) { + // TODO: PPC port __ ld(polling_page, in_bytes(JavaThread::poll_address_offset()), R16_thread); + Unimplemented(); + } else { + __ load_const_optimized(polling_page, (long)(address) os::get_polling_page(), R0); // TODO: PPC port: get_standard_polling_page() + } + + // Restore return pc relative to callers' sp. + __ ld(return_pc, _abi(lr), R1_SP); + // Move return pc to LR. + __ mtlr(return_pc); + + // We need to mark the code position where the load from the safepoint + // polling page was emitted as relocInfo::poll_return_type here. + __ relocate(relocInfo::poll_return_type); + __ load_from_polling_page(polling_page); + + // Return. + __ blr(); +} + + +int LIR_Assembler::safepoint_poll(LIR_Opr tmp, CodeEmitInfo* info) { + + if (LoadPollAddressFromThread) { + const Register poll_addr = tmp->as_register(); + // TODO: PPC port __ ld(poll_addr, in_bytes(JavaThread::poll_address_offset()), R16_thread); + Unimplemented(); + __ relocate(relocInfo::poll_type); // XXX + guarantee(info != NULL, "Shouldn't be NULL"); + int offset = __ offset(); + add_debug_info_for_branch(info); + __ load_from_polling_page(poll_addr); + return offset; + } + + __ load_const_optimized(tmp->as_register(), (intptr_t)os::get_polling_page(), R0); // TODO: PPC port: get_standard_polling_page() + if (info != NULL) { + add_debug_info_for_branch(info); + } + int offset = __ offset(); + __ relocate(relocInfo::poll_type); + __ load_from_polling_page(tmp->as_register()); + + return offset; +} + + +void LIR_Assembler::emit_static_call_stub() { + address call_pc = __ pc(); + address stub = __ start_a_stub(max_static_call_stub_size); + if (stub == NULL) { + bailout("static call stub overflow"); + return; + } + + // For java_to_interp stubs we use R11_scratch1 as scratch register + // and in call trampoline stubs we use R12_scratch2. This way we + // can distinguish them (see is_NativeCallTrampolineStub_at()). + const Register reg_scratch = R11_scratch1; + + // Create a static stub relocation which relates this stub + // with the call instruction at insts_call_instruction_offset in the + // instructions code-section. + int start = __ offset(); + __ relocate(static_stub_Relocation::spec(call_pc)); + + // Now, create the stub's code: + // - load the TOC + // - load the inline cache oop from the constant pool + // - load the call target from the constant pool + // - call + __ calculate_address_from_global_toc(reg_scratch, __ method_toc()); + AddressLiteral ic = __ allocate_metadata_address((Metadata *)NULL); + bool success = __ load_const_from_method_toc(R19_inline_cache_reg, ic, reg_scratch, /*fixed_size*/ true); + + if (ReoptimizeCallSequences) { + __ b64_patchable((address)-1, relocInfo::none); + } else { + AddressLiteral a((address)-1); + success = success && __ load_const_from_method_toc(reg_scratch, a, reg_scratch, /*fixed_size*/ true); + __ mtctr(reg_scratch); + __ bctr(); + } + if (!success) { + bailout("const section overflow"); + return; + } + + assert(__ offset() - start <= max_static_call_stub_size, "stub too big"); + __ end_a_stub(); +} + + +void LIR_Assembler::comp_op(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Op2* op) { + bool unsigned_comp = (condition == lir_cond_belowEqual || condition == lir_cond_aboveEqual); + if (opr1->is_single_fpu()) { + __ fcmpu(BOOL_RESULT, opr1->as_float_reg(), opr2->as_float_reg()); + } else if (opr1->is_double_fpu()) { + __ fcmpu(BOOL_RESULT, opr1->as_double_reg(), opr2->as_double_reg()); + } else if (opr1->is_single_cpu()) { + if (opr2->is_constant()) { + switch (opr2->as_constant_ptr()->type()) { + case T_INT: + { + jint con = opr2->as_constant_ptr()->as_jint(); + if (unsigned_comp) { + if (Assembler::is_uimm(con, 16)) { + __ cmplwi(BOOL_RESULT, opr1->as_register(), con); + } else { + __ load_const_optimized(R0, con); + __ cmplw(BOOL_RESULT, opr1->as_register(), R0); + } + } else { + if (Assembler::is_simm(con, 16)) { + __ cmpwi(BOOL_RESULT, opr1->as_register(), con); + } else { + __ load_const_optimized(R0, con); + __ cmpw(BOOL_RESULT, opr1->as_register(), R0); + } + } + } + break; + + case T_OBJECT: + // There are only equal/notequal comparisons on objects. + { + assert(condition == lir_cond_equal || condition == lir_cond_notEqual, "oops"); + jobject con = opr2->as_constant_ptr()->as_jobject(); + if (con == NULL) { + __ cmpdi(BOOL_RESULT, opr1->as_register(), 0); + } else { + jobject2reg(con, R0); + __ cmpd(BOOL_RESULT, opr1->as_register(), R0); + } + } + break; + + default: + ShouldNotReachHere(); + break; + } + } else { + if (opr2->is_address()) { + DEBUG_ONLY( Unimplemented(); ) // Seems to be unused at the moment. + LIR_Address *addr = opr2->as_address_ptr(); + BasicType type = addr->type(); + if (type == T_OBJECT) { __ ld(R0, index_or_disp(addr), addr->base()->as_register()); } + else { __ lwa(R0, index_or_disp(addr), addr->base()->as_register()); } + __ cmpd(BOOL_RESULT, opr1->as_register(), R0); + } else { + if (unsigned_comp) { + __ cmplw(BOOL_RESULT, opr1->as_register(), opr2->as_register()); + } else { + __ cmpw(BOOL_RESULT, opr1->as_register(), opr2->as_register()); + } + } + } + } else if (opr1->is_double_cpu()) { + if (opr2->is_constant()) { + jlong con = opr2->as_constant_ptr()->as_jlong(); + if (unsigned_comp) { + if (Assembler::is_uimm(con, 16)) { + __ cmpldi(BOOL_RESULT, opr1->as_register_lo(), con); + } else { + __ load_const_optimized(R0, con); + __ cmpld(BOOL_RESULT, opr1->as_register_lo(), R0); + } + } else { + if (Assembler::is_simm(con, 16)) { + __ cmpdi(BOOL_RESULT, opr1->as_register_lo(), con); + } else { + __ load_const_optimized(R0, con); + __ cmpd(BOOL_RESULT, opr1->as_register_lo(), R0); + } + } + } else if (opr2->is_register()) { + if (unsigned_comp) { + __ cmpld(BOOL_RESULT, opr1->as_register_lo(), opr2->as_register_lo()); + } else { + __ cmpd(BOOL_RESULT, opr1->as_register_lo(), opr2->as_register_lo()); + } + } else { + ShouldNotReachHere(); + } + } else if (opr1->is_address()) { + DEBUG_ONLY( Unimplemented(); ) // Seems to be unused at the moment. + LIR_Address * addr = opr1->as_address_ptr(); + BasicType type = addr->type(); + assert (opr2->is_constant(), "Checking"); + if (type == T_OBJECT) { __ ld(R0, index_or_disp(addr), addr->base()->as_register()); } + else { __ lwa(R0, index_or_disp(addr), addr->base()->as_register()); } + __ cmpdi(BOOL_RESULT, R0, opr2->as_constant_ptr()->as_jint()); + } else { + ShouldNotReachHere(); + } +} + + +void LIR_Assembler::comp_fl2i(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr dst, LIR_Op2* op){ + const Register Rdst = dst->as_register(); + Label done; + if (code == lir_cmp_fd2i || code == lir_ucmp_fd2i) { + bool is_unordered_less = (code == lir_ucmp_fd2i); + if (left->is_single_fpu()) { + __ fcmpu(CCR0, left->as_float_reg(), right->as_float_reg()); + } else if (left->is_double_fpu()) { + __ fcmpu(CCR0, left->as_double_reg(), right->as_double_reg()); + } else { + ShouldNotReachHere(); + } + __ li(Rdst, is_unordered_less ? -1 : 1); + __ bso(CCR0, done); + } else if (code == lir_cmp_l2i) { + __ cmpd(CCR0, left->as_register_lo(), right->as_register_lo()); + } else { + ShouldNotReachHere(); + } + __ mfcr(R0); // set bit 32..33 as follows: <: 0b10, =: 0b00, >: 0b01 + __ srwi(Rdst, R0, 30); + __ srawi(R0, R0, 31); + __ orr(Rdst, R0, Rdst); // set result as follows: <: -1, =: 0, >: 1 + __ bind(done); +} + + +inline void load_to_reg(LIR_Assembler *lasm, LIR_Opr src, LIR_Opr dst) { + if (src->is_constant()) { + lasm->const2reg(src, dst, lir_patch_none, NULL); + } else if (src->is_register()) { + lasm->reg2reg(src, dst); + } else if (src->is_stack()) { + lasm->stack2reg(src, dst, dst->type()); + } else { + ShouldNotReachHere(); + } +} + + +void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type) { + if (opr1->is_equal(opr2) || opr1->is_same_register(opr2)) { + load_to_reg(this, opr1, result); // Condition doesn't matter. + return; + } + + bool positive = false; + Assembler::Condition cond = Assembler::equal; + switch (condition) { + case lir_cond_equal: positive = true ; cond = Assembler::equal ; break; + case lir_cond_notEqual: positive = false; cond = Assembler::equal ; break; + case lir_cond_less: positive = true ; cond = Assembler::less ; break; + case lir_cond_belowEqual: + case lir_cond_lessEqual: positive = false; cond = Assembler::greater; break; + case lir_cond_greater: positive = true ; cond = Assembler::greater; break; + case lir_cond_aboveEqual: + case lir_cond_greaterEqual: positive = false; cond = Assembler::less ; break; + default: ShouldNotReachHere(); + } + + // Try to use isel on >=Power7. + if (VM_Version::has_isel() && result->is_cpu_register()) { + bool o1_is_reg = opr1->is_cpu_register(), o2_is_reg = opr2->is_cpu_register(); + const Register result_reg = result->is_single_cpu() ? result->as_register() : result->as_register_lo(); + + // We can use result_reg to load one operand if not already in register. + Register first = o1_is_reg ? (opr1->is_single_cpu() ? opr1->as_register() : opr1->as_register_lo()) : result_reg, + second = o2_is_reg ? (opr2->is_single_cpu() ? opr2->as_register() : opr2->as_register_lo()) : result_reg; + + if (first != second) { + if (!o1_is_reg) { + load_to_reg(this, opr1, result); + } + + if (!o2_is_reg) { + load_to_reg(this, opr2, result); + } + + __ isel(result_reg, BOOL_RESULT, cond, !positive, first, second); + return; + } + } // isel + + load_to_reg(this, opr1, result); + + Label skip; + int bo = positive ? Assembler::bcondCRbiIs1 : Assembler::bcondCRbiIs0; + int bi = Assembler::bi0(BOOL_RESULT, cond); + __ bc(bo, bi, skip); + + load_to_reg(this, opr2, result); + __ bind(skip); +} + + +void LIR_Assembler::arith_op(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr dest, + CodeEmitInfo* info, bool pop_fpu_stack) { + assert(info == NULL, "unused on this code path"); + assert(left->is_register(), "wrong items state"); + assert(dest->is_register(), "wrong items state"); + + if (right->is_register()) { + if (dest->is_float_kind()) { + + FloatRegister lreg, rreg, res; + if (right->is_single_fpu()) { + lreg = left->as_float_reg(); + rreg = right->as_float_reg(); + res = dest->as_float_reg(); + switch (code) { + case lir_add: __ fadds(res, lreg, rreg); break; + case lir_sub: __ fsubs(res, lreg, rreg); break; + case lir_mul: // fall through + case lir_mul_strictfp: __ fmuls(res, lreg, rreg); break; + case lir_div: // fall through + case lir_div_strictfp: __ fdivs(res, lreg, rreg); break; + default: ShouldNotReachHere(); + } + } else { + lreg = left->as_double_reg(); + rreg = right->as_double_reg(); + res = dest->as_double_reg(); + switch (code) { + case lir_add: __ fadd(res, lreg, rreg); break; + case lir_sub: __ fsub(res, lreg, rreg); break; + case lir_mul: // fall through + case lir_mul_strictfp: __ fmul(res, lreg, rreg); break; + case lir_div: // fall through + case lir_div_strictfp: __ fdiv(res, lreg, rreg); break; + default: ShouldNotReachHere(); + } + } + + } else if (dest->is_double_cpu()) { + + Register dst_lo = dest->as_register_lo(); + Register op1_lo = left->as_pointer_register(); + Register op2_lo = right->as_pointer_register(); + + switch (code) { + case lir_add: __ add(dst_lo, op1_lo, op2_lo); break; + case lir_sub: __ sub(dst_lo, op1_lo, op2_lo); break; + case lir_mul: __ mulld(dst_lo, op1_lo, op2_lo); break; + default: ShouldNotReachHere(); + } + } else { + assert (right->is_single_cpu(), "Just Checking"); + + Register lreg = left->as_register(); + Register res = dest->as_register(); + Register rreg = right->as_register(); + switch (code) { + case lir_add: __ add (res, lreg, rreg); break; + case lir_sub: __ sub (res, lreg, rreg); break; + case lir_mul: __ mullw(res, lreg, rreg); break; + default: ShouldNotReachHere(); + } + } + } else { + assert (right->is_constant(), "must be constant"); + + if (dest->is_single_cpu()) { + Register lreg = left->as_register(); + Register res = dest->as_register(); + int simm16 = right->as_constant_ptr()->as_jint(); + + switch (code) { + case lir_sub: assert(Assembler::is_simm16(-simm16), "cannot encode"); // see do_ArithmeticOp_Int + simm16 = -simm16; + case lir_add: if (res == lreg && simm16 == 0) break; + __ addi(res, lreg, simm16); break; + case lir_mul: if (res == lreg && simm16 == 1) break; + __ mulli(res, lreg, simm16); break; + default: ShouldNotReachHere(); + } + } else { + Register lreg = left->as_pointer_register(); + Register res = dest->as_register_lo(); + long con = right->as_constant_ptr()->as_jlong(); + assert(Assembler::is_simm16(con), "must be simm16"); + + switch (code) { + case lir_sub: assert(Assembler::is_simm16(-con), "cannot encode"); // see do_ArithmeticOp_Long + con = -con; + case lir_add: if (res == lreg && con == 0) break; + __ addi(res, lreg, (int)con); break; + case lir_mul: if (res == lreg && con == 1) break; + __ mulli(res, lreg, (int)con); break; + default: ShouldNotReachHere(); + } + } + } +} + + +void LIR_Assembler::fpop() { + Unimplemented(); + // do nothing +} + + +void LIR_Assembler::intrinsic_op(LIR_Code code, LIR_Opr value, LIR_Opr thread, LIR_Opr dest, LIR_Op* op) { + switch (code) { + case lir_sqrt: { + __ fsqrt(dest->as_double_reg(), value->as_double_reg()); + break; + } + case lir_abs: { + __ fabs(dest->as_double_reg(), value->as_double_reg()); + break; + } + default: { + ShouldNotReachHere(); + break; + } + } +} + + +void LIR_Assembler::logic_op(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr dest) { + if (right->is_constant()) { // see do_LogicOp + long uimm; + Register d, l; + if (dest->is_single_cpu()) { + uimm = right->as_constant_ptr()->as_jint(); + d = dest->as_register(); + l = left->as_register(); + } else { + uimm = right->as_constant_ptr()->as_jlong(); + d = dest->as_register_lo(); + l = left->as_register_lo(); + } + long uimms = (unsigned long)uimm >> 16, + uimmss = (unsigned long)uimm >> 32; + + switch (code) { + case lir_logic_and: + if (uimmss != 0 || (uimms != 0 && (uimm & 0xFFFF) != 0) || is_power_of_2_long(uimm)) { + __ andi(d, l, uimm); // special cases + } else if (uimms != 0) { __ andis_(d, l, uimms); } + else { __ andi_(d, l, uimm); } + break; + + case lir_logic_or: + if (uimms != 0) { assert((uimm & 0xFFFF) == 0, "sanity"); __ oris(d, l, uimms); } + else { __ ori(d, l, uimm); } + break; + + case lir_logic_xor: + if (uimm == -1) { __ nand(d, l, l); } // special case + else if (uimms != 0) { assert((uimm & 0xFFFF) == 0, "sanity"); __ xoris(d, l, uimms); } + else { __ xori(d, l, uimm); } + break; + + default: ShouldNotReachHere(); + } + } else { + assert(right->is_register(), "right should be in register"); + + if (dest->is_single_cpu()) { + switch (code) { + case lir_logic_and: __ andr(dest->as_register(), left->as_register(), right->as_register()); break; + case lir_logic_or: __ orr (dest->as_register(), left->as_register(), right->as_register()); break; + case lir_logic_xor: __ xorr(dest->as_register(), left->as_register(), right->as_register()); break; + default: ShouldNotReachHere(); + } + } else { + Register l = (left->is_single_cpu() && left->is_oop_register()) ? left->as_register() : + left->as_register_lo(); + Register r = (right->is_single_cpu() && right->is_oop_register()) ? right->as_register() : + right->as_register_lo(); + + switch (code) { + case lir_logic_and: __ andr(dest->as_register_lo(), l, r); break; + case lir_logic_or: __ orr (dest->as_register_lo(), l, r); break; + case lir_logic_xor: __ xorr(dest->as_register_lo(), l, r); break; + default: ShouldNotReachHere(); + } + } + } +} + + +int LIR_Assembler::shift_amount(BasicType t) { + int elem_size = type2aelembytes(t); + switch (elem_size) { + case 1 : return 0; + case 2 : return 1; + case 4 : return 2; + case 8 : return 3; + } + ShouldNotReachHere(); + return -1; +} + + +void LIR_Assembler::throw_op(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmitInfo* info) { + info->add_register_oop(exceptionOop); + + // Reuse the debug info from the safepoint poll for the throw op itself. + address pc_for_athrow = __ pc(); + int pc_for_athrow_offset = __ offset(); + //RelocationHolder rspec = internal_word_Relocation::spec(pc_for_athrow); + //__ relocate(rspec); + //__ load_const(exceptionPC->as_register(), pc_for_athrow, R0); + __ calculate_address_from_global_toc(exceptionPC->as_register(), pc_for_athrow, true, true, /*add_relocation*/ true); + add_call_info(pc_for_athrow_offset, info); // for exception handler + + address stub = Runtime1::entry_for(compilation()->has_fpu_code() ? Runtime1::handle_exception_id + : Runtime1::handle_exception_nofpu_id); + //__ load_const_optimized(R0, stub); + __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub)); + __ mtctr(R0); + __ bctr(); +} + + +void LIR_Assembler::unwind_op(LIR_Opr exceptionOop) { + // Note: Not used with EnableDebuggingOnDemand. + assert(exceptionOop->as_register() == R3, "should match"); + __ b(_unwind_handler_entry); +} + + +void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) { + Register src = op->src()->as_register(); + Register dst = op->dst()->as_register(); + Register src_pos = op->src_pos()->as_register(); + Register dst_pos = op->dst_pos()->as_register(); + Register length = op->length()->as_register(); + Register tmp = op->tmp()->as_register(); + Register tmp2 = R0; + + int flags = op->flags(); + ciArrayKlass* default_type = op->expected_type(); + BasicType basic_type = default_type != NULL ? default_type->element_type()->basic_type() : T_ILLEGAL; + if (basic_type == T_ARRAY) basic_type = T_OBJECT; + + // Set up the arraycopy stub information. + ArrayCopyStub* stub = op->stub(); + const int frame_resize = frame::abi_reg_args_size - sizeof(frame::jit_abi); // C calls need larger frame. + + // Always do stub if no type information is available. It's ok if + // the known type isn't loaded since the code sanity checks + // in debug mode and the type isn't required when we know the exact type + // also check that the type is an array type. + if (op->expected_type() == NULL) { + assert(src->is_nonvolatile() && src_pos->is_nonvolatile() && dst->is_nonvolatile() && dst_pos->is_nonvolatile() && + length->is_nonvolatile(), "must preserve"); + // 3 parms are int. Convert to long. + __ mr(R3_ARG1, src); + __ extsw(R4_ARG2, src_pos); + __ mr(R5_ARG3, dst); + __ extsw(R6_ARG4, dst_pos); + __ extsw(R7_ARG5, length); + address copyfunc_addr = StubRoutines::generic_arraycopy(); + + if (copyfunc_addr == NULL) { // Use C version if stub was not generated. + address entry = CAST_FROM_FN_PTR(address, Runtime1::arraycopy); + __ call_c_with_frame_resize(entry, frame_resize); + } else { +#ifndef PRODUCT + if (PrintC1Statistics) { + address counter = (address)&Runtime1::_generic_arraycopystub_cnt; + int simm16_offs = __ load_const_optimized(tmp, counter, tmp2, true); + __ lwz(R11_scratch1, simm16_offs, tmp); + __ addi(R11_scratch1, R11_scratch1, 1); + __ stw(R11_scratch1, simm16_offs, tmp); + } +#endif + __ call_c_with_frame_resize(copyfunc_addr, /*stub does not need resized frame*/ 0); + + __ nand(tmp, R3_RET, R3_RET); + __ subf(length, tmp, length); + __ add(src_pos, tmp, src_pos); + __ add(dst_pos, tmp, dst_pos); + } + + __ cmpwi(CCR0, R3_RET, 0); + __ bc_far_optimized(Assembler::bcondCRbiIs1, __ bi0(CCR0, Assembler::less), *stub->entry()); + __ bind(*stub->continuation()); + return; + } + + assert(default_type != NULL && default_type->is_array_klass(), "must be true at this point"); + Label cont, slow, copyfunc; + + bool simple_check_flag_set = flags & (LIR_OpArrayCopy::src_null_check | + LIR_OpArrayCopy::dst_null_check | + LIR_OpArrayCopy::src_pos_positive_check | + LIR_OpArrayCopy::dst_pos_positive_check | + LIR_OpArrayCopy::length_positive_check); + + // Use only one conditional branch for simple checks. + if (simple_check_flag_set) { + ConditionRegister combined_check = CCR1, tmp_check = CCR1; + + // Make sure src and dst are non-null. + if (flags & LIR_OpArrayCopy::src_null_check) { + __ cmpdi(combined_check, src, 0); + tmp_check = CCR0; + } + + if (flags & LIR_OpArrayCopy::dst_null_check) { + __ cmpdi(tmp_check, dst, 0); + if (tmp_check != combined_check) { + __ cror(combined_check, Assembler::equal, tmp_check, Assembler::equal); + } + tmp_check = CCR0; + } + + // Clear combined_check.eq if not already used. + if (tmp_check == combined_check) { + __ crandc(combined_check, Assembler::equal, combined_check, Assembler::equal); + tmp_check = CCR0; + } + + if (flags & LIR_OpArrayCopy::src_pos_positive_check) { + // Test src_pos register. + __ cmpwi(tmp_check, src_pos, 0); + __ cror(combined_check, Assembler::equal, tmp_check, Assembler::less); + } + + if (flags & LIR_OpArrayCopy::dst_pos_positive_check) { + // Test dst_pos register. + __ cmpwi(tmp_check, dst_pos, 0); + __ cror(combined_check, Assembler::equal, tmp_check, Assembler::less); + } + + if (flags & LIR_OpArrayCopy::length_positive_check) { + // Make sure length isn't negative. + __ cmpwi(tmp_check, length, 0); + __ cror(combined_check, Assembler::equal, tmp_check, Assembler::less); + } + + __ beq(combined_check, slow); + } + + // Higher 32bits must be null. + __ extsw(length, length); + + __ extsw(src_pos, src_pos); + if (flags & LIR_OpArrayCopy::src_range_check) { + __ lwz(tmp2, arrayOopDesc::length_offset_in_bytes(), src); + __ add(tmp, length, src_pos); + __ cmpld(CCR0, tmp2, tmp); + __ ble(CCR0, slow); + } + + __ extsw(dst_pos, dst_pos); + if (flags & LIR_OpArrayCopy::dst_range_check) { + __ lwz(tmp2, arrayOopDesc::length_offset_in_bytes(), dst); + __ add(tmp, length, dst_pos); + __ cmpld(CCR0, tmp2, tmp); + __ ble(CCR0, slow); + } + + int shift = shift_amount(basic_type); + + if (!(flags & LIR_OpArrayCopy::type_check)) { + __ b(cont); + } else { + // We don't know the array types are compatible. + if (basic_type != T_OBJECT) { + // Simple test for basic type arrays. + if (UseCompressedClassPointers) { + // We don't need decode because we just need to compare. + __ lwz(tmp, oopDesc::klass_offset_in_bytes(), src); + __ lwz(tmp2, oopDesc::klass_offset_in_bytes(), dst); + __ cmpw(CCR0, tmp, tmp2); + } else { + __ ld(tmp, oopDesc::klass_offset_in_bytes(), src); + __ ld(tmp2, oopDesc::klass_offset_in_bytes(), dst); + __ cmpd(CCR0, tmp, tmp2); + } + __ beq(CCR0, cont); + } else { + // For object arrays, if src is a sub class of dst then we can + // safely do the copy. + address copyfunc_addr = StubRoutines::checkcast_arraycopy(); + + const Register sub_klass = R5, super_klass = R4; // like CheckCast/InstanceOf + assert_different_registers(tmp, tmp2, sub_klass, super_klass); + + __ load_klass(sub_klass, src); + __ load_klass(super_klass, dst); + + __ check_klass_subtype_fast_path(sub_klass, super_klass, tmp, tmp2, + &cont, copyfunc_addr != NULL ? ©func : &slow, NULL); + + address slow_stc = Runtime1::entry_for(Runtime1::slow_subtype_check_id); + //__ load_const_optimized(tmp, slow_stc, tmp2); + __ calculate_address_from_global_toc(tmp, slow_stc, true, true, false); + __ mtctr(tmp); + __ bctrl(); // sets CR0 + __ beq(CCR0, cont); + + if (copyfunc_addr != NULL) { // Use stub if available. + __ bind(copyfunc); + // Src is not a sub class of dst so we have to do a + // per-element check. + int mask = LIR_OpArrayCopy::src_objarray|LIR_OpArrayCopy::dst_objarray; + if ((flags & mask) != mask) { + assert(flags & mask, "one of the two should be known to be an object array"); + + if (!(flags & LIR_OpArrayCopy::src_objarray)) { + __ load_klass(tmp, src); + } else if (!(flags & LIR_OpArrayCopy::dst_objarray)) { + __ load_klass(tmp, dst); + } + + __ lwz(tmp2, in_bytes(Klass::layout_helper_offset()), tmp); + + jint objArray_lh = Klass::array_layout_helper(T_OBJECT); + __ load_const_optimized(tmp, objArray_lh); + __ cmpw(CCR0, tmp, tmp2); + __ bne(CCR0, slow); + } + + Register src_ptr = R3_ARG1; + Register dst_ptr = R4_ARG2; + Register len = R5_ARG3; + Register chk_off = R6_ARG4; + Register super_k = R7_ARG5; + + __ addi(src_ptr, src, arrayOopDesc::base_offset_in_bytes(basic_type)); + __ addi(dst_ptr, dst, arrayOopDesc::base_offset_in_bytes(basic_type)); + if (shift == 0) { + __ add(src_ptr, src_pos, src_ptr); + __ add(dst_ptr, dst_pos, dst_ptr); + } else { + __ sldi(tmp, src_pos, shift); + __ sldi(tmp2, dst_pos, shift); + __ add(src_ptr, tmp, src_ptr); + __ add(dst_ptr, tmp2, dst_ptr); + } + + __ load_klass(tmp, dst); + __ mr(len, length); + + int ek_offset = in_bytes(ObjArrayKlass::element_klass_offset()); + __ ld(super_k, ek_offset, tmp); + + int sco_offset = in_bytes(Klass::super_check_offset_offset()); + __ lwz(chk_off, sco_offset, super_k); + + __ call_c_with_frame_resize(copyfunc_addr, /*stub does not need resized frame*/ 0); + +#ifndef PRODUCT + if (PrintC1Statistics) { + Label failed; + __ cmpwi(CCR0, R3_RET, 0); + __ bne(CCR0, failed); + address counter = (address)&Runtime1::_arraycopy_checkcast_cnt; + int simm16_offs = __ load_const_optimized(tmp, counter, tmp2, true); + __ lwz(R11_scratch1, simm16_offs, tmp); + __ addi(R11_scratch1, R11_scratch1, 1); + __ stw(R11_scratch1, simm16_offs, tmp); + __ bind(failed); + } +#endif + + __ nand(tmp, R3_RET, R3_RET); + __ cmpwi(CCR0, R3_RET, 0); + __ beq(CCR0, *stub->continuation()); + +#ifndef PRODUCT + if (PrintC1Statistics) { + address counter = (address)&Runtime1::_arraycopy_checkcast_attempt_cnt; + int simm16_offs = __ load_const_optimized(tmp, counter, tmp2, true); + __ lwz(R11_scratch1, simm16_offs, tmp); + __ addi(R11_scratch1, R11_scratch1, 1); + __ stw(R11_scratch1, simm16_offs, tmp); + } +#endif + + __ subf(length, tmp, length); + __ add(src_pos, tmp, src_pos); + __ add(dst_pos, tmp, dst_pos); + } + } + } + __ bind(slow); + __ b(*stub->entry()); + __ bind(cont); + +#ifdef ASSERT + if (basic_type != T_OBJECT || !(flags & LIR_OpArrayCopy::type_check)) { + // Sanity check the known type with the incoming class. For the + // primitive case the types must match exactly with src.klass and + // dst.klass each exactly matching the default type. For the + // object array case, if no type check is needed then either the + // dst type is exactly the expected type and the src type is a + // subtype which we can't check or src is the same array as dst + // but not necessarily exactly of type default_type. + Label known_ok, halt; + metadata2reg(op->expected_type()->constant_encoding(), tmp); + if (UseCompressedClassPointers) { + // Tmp holds the default type. It currently comes uncompressed after the + // load of a constant, so encode it. + __ encode_klass_not_null(tmp); + // Load the raw value of the dst klass, since we will be comparing + // uncompressed values directly. + __ lwz(tmp2, oopDesc::klass_offset_in_bytes(), dst); + __ cmpw(CCR0, tmp, tmp2); + if (basic_type != T_OBJECT) { + __ bne(CCR0, halt); + // Load the raw value of the src klass. + __ lwz(tmp2, oopDesc::klass_offset_in_bytes(), src); + __ cmpw(CCR0, tmp, tmp2); + __ beq(CCR0, known_ok); + } else { + __ beq(CCR0, known_ok); + __ cmpw(CCR0, src, dst); + __ beq(CCR0, known_ok); + } + } else { + __ ld(tmp2, oopDesc::klass_offset_in_bytes(), dst); + __ cmpd(CCR0, tmp, tmp2); + if (basic_type != T_OBJECT) { + __ bne(CCR0, halt); + // Load the raw value of the src klass. + __ ld(tmp2, oopDesc::klass_offset_in_bytes(), src); + __ cmpd(CCR0, tmp, tmp2); + __ beq(CCR0, known_ok); + } else { + __ beq(CCR0, known_ok); + __ cmpd(CCR0, src, dst); + __ beq(CCR0, known_ok); + } + } + __ bind(halt); + __ stop("incorrect type information in arraycopy"); + __ bind(known_ok); + } +#endif + +#ifndef PRODUCT + if (PrintC1Statistics) { + address counter = Runtime1::arraycopy_count_address(basic_type); + int simm16_offs = __ load_const_optimized(tmp, counter, tmp2, true); + __ lwz(R11_scratch1, simm16_offs, tmp); + __ addi(R11_scratch1, R11_scratch1, 1); + __ stw(R11_scratch1, simm16_offs, tmp); + } +#endif + + Register src_ptr = R3_ARG1; + Register dst_ptr = R4_ARG2; + Register len = R5_ARG3; + + __ addi(src_ptr, src, arrayOopDesc::base_offset_in_bytes(basic_type)); + __ addi(dst_ptr, dst, arrayOopDesc::base_offset_in_bytes(basic_type)); + if (shift == 0) { + __ add(src_ptr, src_pos, src_ptr); + __ add(dst_ptr, dst_pos, dst_ptr); + } else { + __ sldi(tmp, src_pos, shift); + __ sldi(tmp2, dst_pos, shift); + __ add(src_ptr, tmp, src_ptr); + __ add(dst_ptr, tmp2, dst_ptr); + } + + bool disjoint = (flags & LIR_OpArrayCopy::overlapping) == 0; + bool aligned = (flags & LIR_OpArrayCopy::unaligned) == 0; + const char *name; + address entry = StubRoutines::select_arraycopy_function(basic_type, aligned, disjoint, name, false); + + // Arraycopy stubs takes a length in number of elements, so don't scale it. + __ mr(len, length); + __ call_c_with_frame_resize(entry, /*stub does not need resized frame*/ 0); + + __ bind(*stub->continuation()); +} + + +void LIR_Assembler::shift_op(LIR_Code code, LIR_Opr left, LIR_Opr count, LIR_Opr dest, LIR_Opr tmp) { + if (dest->is_single_cpu()) { + __ rldicl(tmp->as_register(), count->as_register(), 0, 64-5); +#ifdef _LP64 + if (left->type() == T_OBJECT) { + switch (code) { + case lir_shl: __ sld(dest->as_register(), left->as_register(), tmp->as_register()); break; + case lir_shr: __ srad(dest->as_register(), left->as_register(), tmp->as_register()); break; + case lir_ushr: __ srd(dest->as_register(), left->as_register(), tmp->as_register()); break; + default: ShouldNotReachHere(); + } + } else +#endif + switch (code) { + case lir_shl: __ slw(dest->as_register(), left->as_register(), tmp->as_register()); break; + case lir_shr: __ sraw(dest->as_register(), left->as_register(), tmp->as_register()); break; + case lir_ushr: __ srw(dest->as_register(), left->as_register(), tmp->as_register()); break; + default: ShouldNotReachHere(); + } + } else { + __ rldicl(tmp->as_register(), count->as_register(), 0, 64-6); + switch (code) { + case lir_shl: __ sld(dest->as_register_lo(), left->as_register_lo(), tmp->as_register()); break; + case lir_shr: __ srad(dest->as_register_lo(), left->as_register_lo(), tmp->as_register()); break; + case lir_ushr: __ srd(dest->as_register_lo(), left->as_register_lo(), tmp->as_register()); break; + default: ShouldNotReachHere(); + } + } +} + + +void LIR_Assembler::shift_op(LIR_Code code, LIR_Opr left, jint count, LIR_Opr dest) { +#ifdef _LP64 + if (left->type() == T_OBJECT) { + count = count & 63; // Shouldn't shift by more than sizeof(intptr_t). + if (count == 0) { __ mr_if_needed(dest->as_register_lo(), left->as_register()); } + else { + switch (code) { + case lir_shl: __ sldi(dest->as_register_lo(), left->as_register(), count); break; + case lir_shr: __ sradi(dest->as_register_lo(), left->as_register(), count); break; + case lir_ushr: __ srdi(dest->as_register_lo(), left->as_register(), count); break; + default: ShouldNotReachHere(); + } + } + return; + } +#endif + + if (dest->is_single_cpu()) { + count = count & 0x1F; // Java spec + if (count == 0) { __ mr_if_needed(dest->as_register(), left->as_register()); } + else { + switch (code) { + case lir_shl: __ slwi(dest->as_register(), left->as_register(), count); break; + case lir_shr: __ srawi(dest->as_register(), left->as_register(), count); break; + case lir_ushr: __ srwi(dest->as_register(), left->as_register(), count); break; + default: ShouldNotReachHere(); + } + } + } else if (dest->is_double_cpu()) { + count = count & 63; // Java spec + if (count == 0) { __ mr_if_needed(dest->as_pointer_register(), left->as_pointer_register()); } + else { + switch (code) { + case lir_shl: __ sldi(dest->as_pointer_register(), left->as_pointer_register(), count); break; + case lir_shr: __ sradi(dest->as_pointer_register(), left->as_pointer_register(), count); break; + case lir_ushr: __ srdi(dest->as_pointer_register(), left->as_pointer_register(), count); break; + default: ShouldNotReachHere(); + } + } + } else { + ShouldNotReachHere(); + } +} + + +void LIR_Assembler::emit_alloc_obj(LIR_OpAllocObj* op) { + if (op->init_check()) { + if (!os::zero_page_read_protected() || !ImplicitNullChecks) { + explicit_null_check(op->klass()->as_register(), op->stub()->info()); + } else { + add_debug_info_for_null_check_here(op->stub()->info()); + } + __ lbz(op->tmp1()->as_register(), + in_bytes(InstanceKlass::init_state_offset()), op->klass()->as_register()); + __ cmpwi(CCR0, op->tmp1()->as_register(), InstanceKlass::fully_initialized); + __ bc_far_optimized(Assembler::bcondCRbiIs0, __ bi0(CCR0, Assembler::equal), *op->stub()->entry()); + } + __ allocate_object(op->obj()->as_register(), + op->tmp1()->as_register(), + op->tmp2()->as_register(), + op->tmp3()->as_register(), + op->header_size(), + op->object_size(), + op->klass()->as_register(), + *op->stub()->entry()); + + __ bind(*op->stub()->continuation()); + __ verify_oop(op->obj()->as_register()); +} + + +void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) { + LP64_ONLY( __ extsw(op->len()->as_register(), op->len()->as_register()); ) + if (UseSlowPath || + (!UseFastNewObjectArray && (op->type() == T_OBJECT || op->type() == T_ARRAY)) || + (!UseFastNewTypeArray && (op->type() != T_OBJECT && op->type() != T_ARRAY))) { + __ b(*op->stub()->entry()); + } else { + __ allocate_array(op->obj()->as_register(), + op->len()->as_register(), + op->tmp1()->as_register(), + op->tmp2()->as_register(), + op->tmp3()->as_register(), + arrayOopDesc::header_size(op->type()), + type2aelembytes(op->type()), + op->klass()->as_register(), + *op->stub()->entry()); + } + __ bind(*op->stub()->continuation()); +} + + +void LIR_Assembler::type_profile_helper(Register mdo, int mdo_offset_bias, + ciMethodData *md, ciProfileData *data, + Register recv, Register tmp1, Label* update_done) { + uint i; + for (i = 0; i < VirtualCallData::row_limit(); i++) { + Label next_test; + // See if the receiver is receiver[n]. + __ ld(tmp1, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_offset(i)) - mdo_offset_bias, mdo); + __ verify_klass_ptr(tmp1); + __ cmpd(CCR0, recv, tmp1); + __ bne(CCR0, next_test); + + __ ld(tmp1, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_count_offset(i)) - mdo_offset_bias, mdo); + __ addi(tmp1, tmp1, DataLayout::counter_increment); + __ std(tmp1, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_count_offset(i)) - mdo_offset_bias, mdo); + __ b(*update_done); + + __ bind(next_test); + } + + // Didn't find receiver; find next empty slot and fill it in. + for (i = 0; i < VirtualCallData::row_limit(); i++) { + Label next_test; + __ ld(tmp1, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_offset(i)) - mdo_offset_bias, mdo); + __ cmpdi(CCR0, tmp1, 0); + __ bne(CCR0, next_test); + __ li(tmp1, DataLayout::counter_increment); + __ std(recv, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_offset(i)) - mdo_offset_bias, mdo); + __ std(tmp1, md->byte_offset_of_slot(data, ReceiverTypeData::receiver_count_offset(i)) - mdo_offset_bias, mdo); + __ b(*update_done); + + __ bind(next_test); + } +} + + +void LIR_Assembler::setup_md_access(ciMethod* method, int bci, + ciMethodData*& md, ciProfileData*& data, int& mdo_offset_bias) { + md = method->method_data_or_null(); + assert(md != NULL, "Sanity"); + data = md->bci_to_data(bci); + assert(data != NULL, "need data for checkcast"); + assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check"); + if (!Assembler::is_simm16(md->byte_offset_of_slot(data, DataLayout::header_offset()) + data->size_in_bytes())) { + // The offset is large so bias the mdo by the base of the slot so + // that the ld can use simm16s to reference the slots of the data. + mdo_offset_bias = md->byte_offset_of_slot(data, DataLayout::header_offset()); + } +} + + +void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, Label* failure, Label* obj_is_null) { + Register obj = op->object()->as_register(); + Register k_RInfo = op->tmp1()->as_register(); + Register klass_RInfo = op->tmp2()->as_register(); + Register Rtmp1 = op->tmp3()->as_register(); + Register dst = op->result_opr()->as_register(); + ciKlass* k = op->klass(); + bool should_profile = op->should_profile(); + bool move_obj_to_dst = (op->code() == lir_checkcast); + // Attention: do_temp(opTypeCheck->_object) is not used, i.e. obj may be same as one of the temps. + bool reg_conflict = (obj == k_RInfo || obj == klass_RInfo || obj == Rtmp1); + bool restore_obj = move_obj_to_dst && reg_conflict; + + __ cmpdi(CCR0, obj, 0); + if (move_obj_to_dst || reg_conflict) { + __ mr_if_needed(dst, obj); + if (reg_conflict) { obj = dst; } + } + + ciMethodData* md; + ciProfileData* data; + int mdo_offset_bias = 0; + if (should_profile) { + ciMethod* method = op->profiled_method(); + assert(method != NULL, "Should have method"); + setup_md_access(method, op->profiled_bci(), md, data, mdo_offset_bias); + + Register mdo = k_RInfo; + Register data_val = Rtmp1; + Label not_null; + __ bne(CCR0, not_null); + metadata2reg(md->constant_encoding(), mdo); + __ add_const_optimized(mdo, mdo, mdo_offset_bias, R0); + __ lbz(data_val, md->byte_offset_of_slot(data, DataLayout::flags_offset()) - mdo_offset_bias, mdo); + __ ori(data_val, data_val, BitData::null_seen_byte_constant()); + __ stb(data_val, md->byte_offset_of_slot(data, DataLayout::flags_offset()) - mdo_offset_bias, mdo); + __ b(*obj_is_null); + __ bind(not_null); + } else { + __ beq(CCR0, *obj_is_null); + } + + // get object class + __ load_klass(klass_RInfo, obj); + + if (k->is_loaded()) { + metadata2reg(k->constant_encoding(), k_RInfo); + } else { + klass2reg_with_patching(k_RInfo, op->info_for_patch()); + } + + Label profile_cast_failure, failure_restore_obj, profile_cast_success; + Label *failure_target = should_profile ? &profile_cast_failure : failure; + Label *success_target = should_profile ? &profile_cast_success : success; + + if (op->fast_check()) { + assert_different_registers(klass_RInfo, k_RInfo); + __ cmpd(CCR0, k_RInfo, klass_RInfo); + if (should_profile) { + __ bne(CCR0, *failure_target); + // Fall through to success case. + } else { + __ beq(CCR0, *success); + // Fall through to failure case. + } + } else { + bool need_slow_path = true; + if (k->is_loaded()) { + if ((int) k->super_check_offset() != in_bytes(Klass::secondary_super_cache_offset())) { + need_slow_path = false; + } + // Perform the fast part of the checking logic. + __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, R0, (need_slow_path ? success_target : NULL), + failure_target, NULL, RegisterOrConstant(k->super_check_offset())); + } else { + // Perform the fast part of the checking logic. + __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, R0, success_target, failure_target); + } + if (!need_slow_path) { + if (!should_profile) { __ b(*success); } + } else { + // Call out-of-line instance of __ check_klass_subtype_slow_path(...): + address entry = Runtime1::entry_for(Runtime1::slow_subtype_check_id); + //__ load_const_optimized(Rtmp1, entry, R0); + __ calculate_address_from_global_toc(Rtmp1, entry, true, true, false); + __ mtctr(Rtmp1); + __ bctrl(); // sets CR0 + if (should_profile) { + __ bne(CCR0, *failure_target); + // Fall through to success case. + } else { + __ beq(CCR0, *success); + // Fall through to failure case. + } + } + } + + if (should_profile) { + Register mdo = k_RInfo, recv = klass_RInfo; + assert_different_registers(mdo, recv, Rtmp1); + __ bind(profile_cast_success); + metadata2reg(md->constant_encoding(), mdo); + __ add_const_optimized(mdo, mdo, mdo_offset_bias, R0); + type_profile_helper(mdo, mdo_offset_bias, md, data, recv, Rtmp1, success); + __ b(*success); + + // Cast failure case. + __ bind(profile_cast_failure); + metadata2reg(md->constant_encoding(), mdo); + __ add_const_optimized(mdo, mdo, mdo_offset_bias, R0); + __ ld(Rtmp1, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias, mdo); + __ addi(Rtmp1, Rtmp1, -DataLayout::counter_increment); + __ std(Rtmp1, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias, mdo); + } + + __ bind(*failure); + + if (restore_obj) { + __ mr(op->object()->as_register(), dst); + // Fall through to failure case. + } +} + + +void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { + LIR_Code code = op->code(); + if (code == lir_store_check) { + Register value = op->object()->as_register(); + Register array = op->array()->as_register(); + Register k_RInfo = op->tmp1()->as_register(); + Register klass_RInfo = op->tmp2()->as_register(); + Register Rtmp1 = op->tmp3()->as_register(); + bool should_profile = op->should_profile(); + + __ verify_oop(value); + CodeStub* stub = op->stub(); + // Check if it needs to be profiled. + ciMethodData* md; + ciProfileData* data; + int mdo_offset_bias = 0; + if (should_profile) { + ciMethod* method = op->profiled_method(); + assert(method != NULL, "Should have method"); + setup_md_access(method, op->profiled_bci(), md, data, mdo_offset_bias); + } + Label profile_cast_success, failure, done; + Label *success_target = should_profile ? &profile_cast_success : &done; + + __ cmpdi(CCR0, value, 0); + if (should_profile) { + Label not_null; + __ bne(CCR0, not_null); + Register mdo = k_RInfo; + Register data_val = Rtmp1; + metadata2reg(md->constant_encoding(), mdo); + __ add_const_optimized(mdo, mdo, mdo_offset_bias, R0); + __ lbz(data_val, md->byte_offset_of_slot(data, DataLayout::flags_offset()) - mdo_offset_bias, mdo); + __ ori(data_val, data_val, BitData::null_seen_byte_constant()); + __ stb(data_val, md->byte_offset_of_slot(data, DataLayout::flags_offset()) - mdo_offset_bias, mdo); + __ b(done); + __ bind(not_null); + } else { + __ beq(CCR0, done); + } + if (!os::zero_page_read_protected() || !ImplicitNullChecks) { + explicit_null_check(array, op->info_for_exception()); + } else { + add_debug_info_for_null_check_here(op->info_for_exception()); + } + __ load_klass(k_RInfo, array); + __ load_klass(klass_RInfo, value); + + // Get instance klass. + __ ld(k_RInfo, in_bytes(ObjArrayKlass::element_klass_offset()), k_RInfo); + // Perform the fast part of the checking logic. + __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, R0, success_target, &failure, NULL); + + // Call out-of-line instance of __ check_klass_subtype_slow_path(...): + const address slow_path = Runtime1::entry_for(Runtime1::slow_subtype_check_id); + //__ load_const_optimized(R0, slow_path); + __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(slow_path)); + __ mtctr(R0); + __ bctrl(); // sets CR0 + if (!should_profile) { + __ beq(CCR0, done); + __ bind(failure); + } else { + __ bne(CCR0, failure); + // Fall through to the success case. + + Register mdo = klass_RInfo, recv = k_RInfo, tmp1 = Rtmp1; + assert_different_registers(value, mdo, recv, tmp1); + __ bind(profile_cast_success); + metadata2reg(md->constant_encoding(), mdo); + __ add_const_optimized(mdo, mdo, mdo_offset_bias, R0); + __ load_klass(recv, value); + type_profile_helper(mdo, mdo_offset_bias, md, data, recv, tmp1, &done); + __ b(done); + + // Cast failure case. + __ bind(failure); + metadata2reg(md->constant_encoding(), mdo); + __ add_const_optimized(mdo, mdo, mdo_offset_bias, R0); + Address data_addr(mdo, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias); + __ ld(tmp1, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias, mdo); + __ addi(tmp1, tmp1, -DataLayout::counter_increment); + __ std(tmp1, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias, mdo); + } + __ b(*stub->entry()); + __ bind(done); + + } else if (code == lir_checkcast) { + Label success, failure; + emit_typecheck_helper(op, &success, /*fallthru*/&failure, &success); // Moves obj to dst. + __ b(*op->stub()->entry()); + __ align(32, 12); + __ bind(success); + } else if (code == lir_instanceof) { + Register dst = op->result_opr()->as_register(); + Label success, failure, done; + emit_typecheck_helper(op, &success, /*fallthru*/&failure, &failure); + __ li(dst, 0); + __ b(done); + __ align(32, 12); + __ bind(success); + __ li(dst, 1); + __ bind(done); + } else { + ShouldNotReachHere(); + } +} + + +void LIR_Assembler::emit_compare_and_swap(LIR_OpCompareAndSwap* op) { + Register addr = op->addr()->as_pointer_register(); + Register cmp_value = noreg, new_value = noreg; + bool is_64bit = false; + + if (op->code() == lir_cas_long) { + cmp_value = op->cmp_value()->as_register_lo(); + new_value = op->new_value()->as_register_lo(); + is_64bit = true; + } else if (op->code() == lir_cas_int || op->code() == lir_cas_obj) { + cmp_value = op->cmp_value()->as_register(); + new_value = op->new_value()->as_register(); + if (op->code() == lir_cas_obj) { + if (UseCompressedOops) { + Register t1 = op->tmp1()->as_register(); + Register t2 = op->tmp2()->as_register(); + cmp_value = __ encode_heap_oop(t1, cmp_value); + new_value = __ encode_heap_oop(t2, new_value); + } else { + is_64bit = true; + } + } + } else { + Unimplemented(); + } + + if (is_64bit) { + __ cmpxchgd(BOOL_RESULT, /*current_value=*/R0, cmp_value, new_value, addr, + MacroAssembler::MemBarFenceAfter, + MacroAssembler::cmpxchgx_hint_atomic_update(), + noreg, NULL, /*check without ldarx first*/true); + } else { + __ cmpxchgw(BOOL_RESULT, /*current_value=*/R0, cmp_value, new_value, addr, + MacroAssembler::MemBarFenceAfter, + MacroAssembler::cmpxchgx_hint_atomic_update(), + noreg, /*check without ldarx first*/true); + } +} + + +void LIR_Assembler::set_24bit_FPU() { + Unimplemented(); +} + +void LIR_Assembler::reset_FPU() { + Unimplemented(); +} + + +void LIR_Assembler::breakpoint() { + __ illtrap(); +} + + +void LIR_Assembler::push(LIR_Opr opr) { + Unimplemented(); +} + +void LIR_Assembler::pop(LIR_Opr opr) { + Unimplemented(); +} + + +void LIR_Assembler::monitor_address(int monitor_no, LIR_Opr dst_opr) { + Address mon_addr = frame_map()->address_for_monitor_lock(monitor_no); + Register dst = dst_opr->as_register(); + Register reg = mon_addr.base(); + int offset = mon_addr.disp(); + // Compute pointer to BasicLock. + __ add_const_optimized(dst, reg, offset); +} + + +void LIR_Assembler::emit_lock(LIR_OpLock* op) { + Register obj = op->obj_opr()->as_register(); + Register hdr = op->hdr_opr()->as_register(); + Register lock = op->lock_opr()->as_register(); + + // Obj may not be an oop. + if (op->code() == lir_lock) { + MonitorEnterStub* stub = (MonitorEnterStub*)op->stub(); + if (UseFastLocking) { + assert(BasicLock::displaced_header_offset_in_bytes() == 0, "lock_reg must point to the displaced header"); + // Add debug info for NullPointerException only if one is possible. + if (op->info() != NULL) { + if (!os::zero_page_read_protected() || !ImplicitNullChecks) { + explicit_null_check(obj, op->info()); + } else { + add_debug_info_for_null_check_here(op->info()); + } + } + __ lock_object(hdr, obj, lock, op->scratch_opr()->as_register(), *op->stub()->entry()); + } else { + // always do slow locking + // note: The slow locking code could be inlined here, however if we use + // slow locking, speed doesn't matter anyway and this solution is + // simpler and requires less duplicated code - additionally, the + // slow locking code is the same in either case which simplifies + // debugging. + __ b(*op->stub()->entry()); + } + } else { + assert (op->code() == lir_unlock, "Invalid code, expected lir_unlock"); + if (UseFastLocking) { + assert(BasicLock::displaced_header_offset_in_bytes() == 0, "lock_reg must point to the displaced header"); + __ unlock_object(hdr, obj, lock, *op->stub()->entry()); + } else { + // always do slow unlocking + // note: The slow unlocking code could be inlined here, however if we use + // slow unlocking, speed doesn't matter anyway and this solution is + // simpler and requires less duplicated code - additionally, the + // slow unlocking code is the same in either case which simplifies + // debugging. + __ b(*op->stub()->entry()); + } + } + __ bind(*op->stub()->continuation()); +} + + +void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) { + ciMethod* method = op->profiled_method(); + int bci = op->profiled_bci(); + ciMethod* callee = op->profiled_callee(); + + // Update counter for all call types. + ciMethodData* md = method->method_data_or_null(); + assert(md != NULL, "Sanity"); + ciProfileData* data = md->bci_to_data(bci); + assert(data->is_CounterData(), "need CounterData for calls"); + assert(op->mdo()->is_single_cpu(), "mdo must be allocated"); + Register mdo = op->mdo()->as_register(); +#ifdef _LP64 + assert(op->tmp1()->is_double_cpu(), "tmp1 must be allocated"); + Register tmp1 = op->tmp1()->as_register_lo(); +#else + assert(op->tmp1()->is_single_cpu(), "tmp1 must be allocated"); + Register tmp1 = op->tmp1()->as_register(); +#endif + metadata2reg(md->constant_encoding(), mdo); + int mdo_offset_bias = 0; + if (!Assembler::is_simm16(md->byte_offset_of_slot(data, CounterData::count_offset()) + + data->size_in_bytes())) { + // The offset is large so bias the mdo by the base of the slot so + // that the ld can use simm16s to reference the slots of the data. + mdo_offset_bias = md->byte_offset_of_slot(data, CounterData::count_offset()); + __ add_const_optimized(mdo, mdo, mdo_offset_bias, R0); + } + + Bytecodes::Code bc = method->java_code_at_bci(bci); + const bool callee_is_static = callee->is_loaded() && callee->is_static(); + // Perform additional virtual call profiling for invokevirtual and + // invokeinterface bytecodes. + if ((bc == Bytecodes::_invokevirtual || bc == Bytecodes::_invokeinterface) && + !callee_is_static && // Required for optimized MH invokes. + C1ProfileVirtualCalls) { + assert(op->recv()->is_single_cpu(), "recv must be allocated"); + Register recv = op->recv()->as_register(); + assert_different_registers(mdo, tmp1, recv); + assert(data->is_VirtualCallData(), "need VirtualCallData for virtual calls"); + ciKlass* known_klass = op->known_holder(); + if (C1OptimizeVirtualCallProfiling && known_klass != NULL) { + // We know the type that will be seen at this call site; we can + // statically update the MethodData* rather than needing to do + // dynamic tests on the receiver type. + + // NOTE: we should probably put a lock around this search to + // avoid collisions by concurrent compilations. + ciVirtualCallData* vc_data = (ciVirtualCallData*) data; + uint i; + for (i = 0; i < VirtualCallData::row_limit(); i++) { + ciKlass* receiver = vc_data->receiver(i); + if (known_klass->equals(receiver)) { + __ ld(tmp1, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)) - mdo_offset_bias, mdo); + __ addi(tmp1, tmp1, DataLayout::counter_increment); + __ std(tmp1, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)) - mdo_offset_bias, mdo); + return; + } + } + + // Receiver type not found in profile data; select an empty slot. + + // Note that this is less efficient than it should be because it + // always does a write to the receiver part of the + // VirtualCallData rather than just the first time. + for (i = 0; i < VirtualCallData::row_limit(); i++) { + ciKlass* receiver = vc_data->receiver(i); + if (receiver == NULL) { + metadata2reg(known_klass->constant_encoding(), tmp1); + __ std(tmp1, md->byte_offset_of_slot(data, VirtualCallData::receiver_offset(i)) - mdo_offset_bias, mdo); + + __ ld(tmp1, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)) - mdo_offset_bias, mdo); + __ addi(tmp1, tmp1, DataLayout::counter_increment); + __ std(tmp1, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)) - mdo_offset_bias, mdo); + return; + } + } + } else { + __ load_klass(recv, recv); + Label update_done; + type_profile_helper(mdo, mdo_offset_bias, md, data, recv, tmp1, &update_done); + // Receiver did not match any saved receiver and there is no empty row for it. + // Increment total counter to indicate polymorphic case. + __ ld(tmp1, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias, mdo); + __ addi(tmp1, tmp1, DataLayout::counter_increment); + __ std(tmp1, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias, mdo); + + __ bind(update_done); + } + } else { + // Static call + __ ld(tmp1, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias, mdo); + __ addi(tmp1, tmp1, DataLayout::counter_increment); + __ std(tmp1, md->byte_offset_of_slot(data, CounterData::count_offset()) - mdo_offset_bias, mdo); + } +} + + +void LIR_Assembler::align_backward_branch_target() { + __ align(32, 12); // Insert up to 3 nops to align with 32 byte boundary. +} + + +void LIR_Assembler::emit_delay(LIR_OpDelay* op) { + Unimplemented(); +} + + +void LIR_Assembler::negate(LIR_Opr left, LIR_Opr dest) { + assert(left->is_register(), "can only handle registers"); + + if (left->is_single_cpu()) { + __ neg(dest->as_register(), left->as_register()); + } else if (left->is_single_fpu()) { + __ fneg(dest->as_float_reg(), left->as_float_reg()); + } else if (left->is_double_fpu()) { + __ fneg(dest->as_double_reg(), left->as_double_reg()); + } else { + assert (left->is_double_cpu(), "Must be a long"); + __ neg(dest->as_register_lo(), left->as_register_lo()); + } +} + + +void LIR_Assembler::fxch(int i) { + Unimplemented(); +} + +void LIR_Assembler::fld(int i) { + Unimplemented(); +} + +void LIR_Assembler::ffree(int i) { + Unimplemented(); +} + + +void LIR_Assembler::rt_call(LIR_Opr result, address dest, + const LIR_OprList* args, LIR_Opr tmp, CodeEmitInfo* info) { + // Stubs: Called via rt_call, but dest is a stub address (no function descriptor). + if (dest == Runtime1::entry_for(Runtime1::register_finalizer_id) || + dest == Runtime1::entry_for(Runtime1::new_multi_array_id )) { + //__ load_const_optimized(R0, dest); + __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(dest)); + __ mtctr(R0); + __ bctrl(); + assert(info != NULL, "sanity"); + add_call_info_here(info); + return; + } + + __ call_c_with_frame_resize(dest, /*no resizing*/ 0); + if (info != NULL) { + add_call_info_here(info); + } +} + + +void LIR_Assembler::volatile_move_op(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmitInfo* info) { + ShouldNotReachHere(); // Not needed on _LP64. +} + +void LIR_Assembler::membar() { + __ fence(); +} + +void LIR_Assembler::membar_acquire() { + __ acquire(); +} + +void LIR_Assembler::membar_release() { + __ release(); +} + +void LIR_Assembler::membar_loadload() { + __ membar(Assembler::LoadLoad); +} + +void LIR_Assembler::membar_storestore() { + __ membar(Assembler::StoreStore); +} + +void LIR_Assembler::membar_loadstore() { + __ membar(Assembler::LoadStore); +} + +void LIR_Assembler::membar_storeload() { + __ membar(Assembler::StoreLoad); +} + + +void LIR_Assembler::leal(LIR_Opr addr_opr, LIR_Opr dest) { + LIR_Address* addr = addr_opr->as_address_ptr(); + assert(addr->scale() == LIR_Address::times_1, "no scaling on this platform"); + if (addr->index()->is_illegal()) { + __ add_const_optimized(dest->as_pointer_register(), addr->base()->as_pointer_register(), addr->disp()); + } else { + assert(addr->disp() == 0, "can't have both: index and disp"); + __ add(dest->as_pointer_register(), addr->index()->as_pointer_register(), addr->base()->as_pointer_register()); + } +} + + +void LIR_Assembler::get_thread(LIR_Opr result_reg) { + ShouldNotReachHere(); +} + + +#ifdef ASSERT +// Emit run-time assertion. +void LIR_Assembler::emit_assert(LIR_OpAssert* op) { + Unimplemented(); +} +#endif + + +void LIR_Assembler::peephole(LIR_List* lir) { + // Optimize instruction pairs before emitting. + LIR_OpList* inst = lir->instructions_list(); + for (int i = 1; i < inst->length(); i++) { + LIR_Op* op = inst->at(i); + + // 2 register-register-moves + if (op->code() == lir_move) { + LIR_Opr in2 = ((LIR_Op1*)op)->in_opr(), + res2 = ((LIR_Op1*)op)->result_opr(); + if (in2->is_register() && res2->is_register()) { + LIR_Op* prev = inst->at(i - 1); + if (prev && prev->code() == lir_move) { + LIR_Opr in1 = ((LIR_Op1*)prev)->in_opr(), + res1 = ((LIR_Op1*)prev)->result_opr(); + if (in1->is_same_register(res2) && in2->is_same_register(res1)) { + inst->remove_at(i); + } + } + } + } + + } + return; +} + + +void LIR_Assembler::atomic_op(LIR_Code code, LIR_Opr src, LIR_Opr data, LIR_Opr dest, LIR_Opr tmp) { + const Register Rptr = src->as_pointer_register(), + Rtmp = tmp->as_register(); + Register Rco = noreg; + if (UseCompressedOops && data->is_oop()) { + Rco = __ encode_heap_oop(Rtmp, data->as_register()); + } + + Label Lretry; + __ bind(Lretry); + + if (data->type() == T_INT) { + const Register Rold = dest->as_register(), + Rsrc = data->as_register(); + assert_different_registers(Rptr, Rtmp, Rold, Rsrc); + __ lwarx(Rold, Rptr, MacroAssembler::cmpxchgx_hint_atomic_update()); + if (code == lir_xadd) { + __ add(Rtmp, Rsrc, Rold); + __ stwcx_(Rtmp, Rptr); + } else { + __ stwcx_(Rsrc, Rptr); + } + } else if (data->is_oop()) { + assert(code == lir_xchg, "xadd for oops"); + const Register Rold = dest->as_register(); + if (UseCompressedOops) { + assert_different_registers(Rptr, Rold, Rco); + __ lwarx(Rold, Rptr, MacroAssembler::cmpxchgx_hint_atomic_update()); + __ stwcx_(Rco, Rptr); + } else { + const Register Robj = data->as_register(); + assert_different_registers(Rptr, Rold, Robj); + __ ldarx(Rold, Rptr, MacroAssembler::cmpxchgx_hint_atomic_update()); + __ stdcx_(Robj, Rptr); + } + } else if (data->type() == T_LONG) { + const Register Rold = dest->as_register_lo(), + Rsrc = data->as_register_lo(); + assert_different_registers(Rptr, Rtmp, Rold, Rsrc); + __ ldarx(Rold, Rptr, MacroAssembler::cmpxchgx_hint_atomic_update()); + if (code == lir_xadd) { + __ add(Rtmp, Rsrc, Rold); + __ stdcx_(Rtmp, Rptr); + } else { + __ stdcx_(Rsrc, Rptr); + } + } else { + ShouldNotReachHere(); + } + + if (UseStaticBranchPredictionInCompareAndSwapPPC64) { + __ bne_predict_not_taken(CCR0, Lretry); + } else { + __ bne( CCR0, Lretry); + } + + if (UseCompressedOops && data->is_oop()) { + __ decode_heap_oop(dest->as_register()); + } +} + + +void LIR_Assembler::emit_profile_type(LIR_OpProfileType* op) { + Register obj = op->obj()->as_register(); + Register tmp = op->tmp()->as_pointer_register(); + LIR_Address* mdo_addr = op->mdp()->as_address_ptr(); + ciKlass* exact_klass = op->exact_klass(); + intptr_t current_klass = op->current_klass(); + bool not_null = op->not_null(); + bool no_conflict = op->no_conflict(); + + Label Lupdate, Ldo_update, Ldone; + + bool do_null = !not_null; + bool exact_klass_set = exact_klass != NULL && ciTypeEntries::valid_ciklass(current_klass) == exact_klass; + bool do_update = !TypeEntries::is_type_unknown(current_klass) && !exact_klass_set; + + assert(do_null || do_update, "why are we here?"); + assert(!TypeEntries::was_null_seen(current_klass) || do_update, "why are we here?"); + + __ verify_oop(obj); + + if (do_null) { + if (!TypeEntries::was_null_seen(current_klass)) { + __ cmpdi(CCR0, obj, 0); + __ bne(CCR0, Lupdate); + __ ld(R0, index_or_disp(mdo_addr), mdo_addr->base()->as_pointer_register()); + __ ori(R0, R0, TypeEntries::null_seen); + if (do_update) { + __ b(Ldo_update); + } else { + __ std(R0, index_or_disp(mdo_addr), mdo_addr->base()->as_pointer_register()); + } + } else { + if (do_update) { + __ cmpdi(CCR0, obj, 0); + __ beq(CCR0, Ldone); + } + } +#ifdef ASSERT + } else { + __ cmpdi(CCR0, obj, 0); + __ bne(CCR0, Lupdate); + __ stop("unexpect null obj", 0x9652); +#endif + } + + __ bind(Lupdate); + if (do_update) { + Label Lnext; + const Register klass = R29_TOC; // kill and reload + bool klass_reg_used = false; +#ifdef ASSERT + if (exact_klass != NULL) { + Label ok; + klass_reg_used = true; + __ load_klass(klass, obj); + metadata2reg(exact_klass->constant_encoding(), R0); + __ cmpd(CCR0, klass, R0); + __ beq(CCR0, ok); + __ stop("exact klass and actual klass differ", 0x8564); + __ bind(ok); + } +#endif + + if (!no_conflict) { + if (exact_klass == NULL || TypeEntries::is_type_none(current_klass)) { + klass_reg_used = true; + if (exact_klass != NULL) { + __ ld(tmp, index_or_disp(mdo_addr), mdo_addr->base()->as_pointer_register()); + metadata2reg(exact_klass->constant_encoding(), klass); + } else { + __ load_klass(klass, obj); + __ ld(tmp, index_or_disp(mdo_addr), mdo_addr->base()->as_pointer_register()); // may kill obj + } + + // Like InterpreterMacroAssembler::profile_obj_type + __ clrrdi(R0, tmp, exact_log2(-TypeEntries::type_klass_mask)); + // Basically same as andi(R0, tmp, TypeEntries::type_klass_mask); + __ cmpd(CCR1, R0, klass); + // Klass seen before, nothing to do (regardless of unknown bit). + //beq(CCR1, do_nothing); + + __ andi_(R0, klass, TypeEntries::type_unknown); + // Already unknown. Nothing to do anymore. + //bne(CCR0, do_nothing); + __ crorc(CCR0, Assembler::equal, CCR1, Assembler::equal); // cr0 eq = cr1 eq or cr0 ne + __ beq(CCR0, Lnext); + + if (TypeEntries::is_type_none(current_klass)) { + __ clrrdi_(R0, tmp, exact_log2(-TypeEntries::type_mask)); + __ orr(R0, klass, tmp); // Combine klass and null_seen bit (only used if (tmp & type_mask)==0). + __ beq(CCR0, Ldo_update); // First time here. Set profile type. + } + + } else { + assert(ciTypeEntries::valid_ciklass(current_klass) != NULL && + ciTypeEntries::valid_ciklass(current_klass) != exact_klass, "conflict only"); + + __ ld(tmp, index_or_disp(mdo_addr), mdo_addr->base()->as_pointer_register()); + __ andi_(R0, tmp, TypeEntries::type_unknown); + // Already unknown. Nothing to do anymore. + __ bne(CCR0, Lnext); + } + + // Different than before. Cannot keep accurate profile. + __ ori(R0, tmp, TypeEntries::type_unknown); + } else { + // There's a single possible klass at this profile point + assert(exact_klass != NULL, "should be"); + __ ld(tmp, index_or_disp(mdo_addr), mdo_addr->base()->as_pointer_register()); + + if (TypeEntries::is_type_none(current_klass)) { + klass_reg_used = true; + metadata2reg(exact_klass->constant_encoding(), klass); + + __ clrrdi(R0, tmp, exact_log2(-TypeEntries::type_klass_mask)); + // Basically same as andi(R0, tmp, TypeEntries::type_klass_mask); + __ cmpd(CCR1, R0, klass); + // Klass seen before, nothing to do (regardless of unknown bit). + __ beq(CCR1, Lnext); +#ifdef ASSERT + { + Label ok; + __ clrrdi_(R0, tmp, exact_log2(-TypeEntries::type_mask)); + __ beq(CCR0, ok); // First time here. + + __ stop("unexpected profiling mismatch", 0x7865); + __ bind(ok); + } +#endif + // First time here. Set profile type. + __ orr(R0, klass, tmp); // Combine klass and null_seen bit (only used if (tmp & type_mask)==0). + } else { + assert(ciTypeEntries::valid_ciklass(current_klass) != NULL && + ciTypeEntries::valid_ciklass(current_klass) != exact_klass, "inconsistent"); + + // Already unknown. Nothing to do anymore. + __ andi_(R0, tmp, TypeEntries::type_unknown); + __ bne(CCR0, Lnext); + + // Different than before. Cannot keep accurate profile. + __ ori(R0, tmp, TypeEntries::type_unknown); + } + } + + __ bind(Ldo_update); + __ std(R0, index_or_disp(mdo_addr), mdo_addr->base()->as_pointer_register()); + + __ bind(Lnext); + if (klass_reg_used) { __ load_const_optimized(R29_TOC, MacroAssembler::global_toc(), R0); } // reinit + } + __ bind(Ldone); +} + + +void LIR_Assembler::emit_updatecrc32(LIR_OpUpdateCRC32* op) { + assert(op->crc()->is_single_cpu(), "crc must be register"); + assert(op->val()->is_single_cpu(), "byte value must be register"); + assert(op->result_opr()->is_single_cpu(), "result must be register"); + Register crc = op->crc()->as_register(); + Register val = op->val()->as_register(); + Register res = op->result_opr()->as_register(); + + assert_different_registers(val, crc, res); + + __ load_const_optimized(res, StubRoutines::crc_table_addr(), R0); + __ nand(crc, crc, crc); // ~crc + __ update_byte_crc32(crc, val, res); + __ nand(res, crc, crc); // ~crc +} + +#undef __ diff --git a/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.hpp new file mode 100644 index 00000000000..03d1faedbf9 --- /dev/null +++ b/hotspot/src/cpu/ppc/vm/c1_LIRAssembler_ppc.hpp @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef CPU_PPC_VM_C1_LIRASSEMBLER_PPC_HPP +#define CPU_PPC_VM_C1_LIRASSEMBLER_PPC_HPP + + private: + + ////////////////////////////////////////////////////////////////////////////// + // PPC64 load/store emission + // + // The PPC ld/st instructions cannot accomodate displacements > 16 bits long. + // The following "pseudo" instructions (load/store) make it easier to + // use the indexed addressing mode by allowing 32 bit displacements: + // + + void explicit_null_check(Register addr, CodeEmitInfo* info); + + int store(LIR_Opr from_reg, Register base, int offset, BasicType type, bool wide, bool unaligned); + int store(LIR_Opr from_reg, Register base, Register disp, BasicType type, bool wide); + + int load(Register base, int offset, LIR_Opr to_reg, BasicType type, bool wide, bool unaligned); + int load(Register base, Register disp, LIR_Opr to_reg, BasicType type, bool wide); + + int shift_amount(BasicType t); + + // Record the type of the receiver in ReceiverTypeData. + void type_profile_helper(Register mdo, int mdo_offset_bias, + ciMethodData *md, ciProfileData *data, + Register recv, Register tmp1, Label* update_done); + // Setup pointers to MDO, MDO slot, also compute offset bias to access the slot. + void setup_md_access(ciMethod* method, int bci, + ciMethodData*& md, ciProfileData*& data, int& mdo_offset_bias); + public: + static const ConditionRegister BOOL_RESULT; + + // Emit trampoline stub for call. Call bailout() if failed. Return true on success. + bool emit_trampoline_stub_for_call(address target, Register Rtoc = noreg); + +enum { + max_static_call_stub_size = 4 * BytesPerInstWord + MacroAssembler::b64_patchable_size, + call_stub_size = max_static_call_stub_size + MacroAssembler::trampoline_stub_size, // or smaller + exception_handler_size = MacroAssembler::b64_patchable_size, // or smaller + deopt_handler_size = MacroAssembler::bl64_patchable_size +}; + +#endif // CPU_PPC_VM_C1_LIRASSEMBLER_PPC_HPP diff --git a/hotspot/src/cpu/ppc/vm/c1_LIRGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_LIRGenerator_ppc.cpp new file mode 100644 index 00000000000..909d0136011 --- /dev/null +++ b/hotspot/src/cpu/ppc/vm/c1_LIRGenerator_ppc.cpp @@ -0,0 +1,1429 @@ +/* + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "c1/c1_Compilation.hpp" +#include "c1/c1_FrameMap.hpp" +#include "c1/c1_Instruction.hpp" +#include "c1/c1_LIRAssembler.hpp" +#include "c1/c1_LIRGenerator.hpp" +#include "c1/c1_Runtime1.hpp" +#include "c1/c1_ValueStack.hpp" +#include "ci/ciArray.hpp" +#include "ci/ciObjArrayKlass.hpp" +#include "ci/ciTypeArrayKlass.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/stubRoutines.hpp" +#include "vmreg_ppc.inline.hpp" + +#ifdef ASSERT +#define __ gen()->lir(__FILE__, __LINE__)-> +#else +#define __ gen()->lir()-> +#endif + +void LIRItem::load_byte_item() { + // Byte loads use same registers as other loads. + load_item(); +} + + +void LIRItem::load_nonconstant() { + LIR_Opr r = value()->operand(); + if (_gen->can_inline_as_constant(value())) { + if (!r->is_constant()) { + r = LIR_OprFact::value_type(value()->type()); + } + _result = r; + } else { + load_item(); + } +} + + +inline void load_int_as_long(LIR_List *ll, LIRItem &li, LIR_Opr dst) { + LIR_Opr r = li.value()->operand(); + if (r->is_register()) { + LIR_Opr dst_l = FrameMap::as_long_opr(dst->as_register()); + ll->convert(Bytecodes::_i2l, li.result(), dst_l); // Convert. + } else { + // Constants or memory get loaded with sign extend on this platform. + ll->move(li.result(), dst); + } +} + + +//-------------------------------------------------------------- +// LIRGenerator +//-------------------------------------------------------------- + +LIR_Opr LIRGenerator::exceptionOopOpr() { return FrameMap::R3_oop_opr; } +LIR_Opr LIRGenerator::exceptionPcOpr() { return FrameMap::R4_opr; } +LIR_Opr LIRGenerator::syncLockOpr() { return FrameMap::R5_opr; } // Need temp effect for MonitorEnterStub. +LIR_Opr LIRGenerator::syncTempOpr() { return FrameMap::R4_oop_opr; } // Need temp effect for MonitorEnterStub. +LIR_Opr LIRGenerator::getThreadTemp() { return LIR_OprFact::illegalOpr; } // not needed + +LIR_Opr LIRGenerator::result_register_for(ValueType* type, bool callee) { + LIR_Opr opr; + switch (type->tag()) { + case intTag: opr = FrameMap::R3_opr; break; + case objectTag: opr = FrameMap::R3_oop_opr; break; + case longTag: opr = FrameMap::R3_long_opr; break; + case floatTag: opr = FrameMap::F1_opr; break; + case doubleTag: opr = FrameMap::F1_double_opr; break; + + case addressTag: + default: ShouldNotReachHere(); return LIR_OprFact::illegalOpr; + } + + assert(opr->type_field() == as_OprType(as_BasicType(type)), "type mismatch"); + return opr; +} + +LIR_Opr LIRGenerator::rlock_callee_saved(BasicType type) { + ShouldNotReachHere(); + return LIR_OprFact::illegalOpr; +} + + +LIR_Opr LIRGenerator::rlock_byte(BasicType type) { + return new_register(T_INT); +} + + +//--------- loading items into registers -------------------------------- + +// PPC cannot inline all constants. +bool LIRGenerator::can_store_as_constant(Value v, BasicType type) const { + if (v->type()->as_IntConstant() != NULL) { + return Assembler::is_simm16(v->type()->as_IntConstant()->value()); + } else if (v->type()->as_LongConstant() != NULL) { + return Assembler::is_simm16(v->type()->as_LongConstant()->value()); + } else if (v->type()->as_ObjectConstant() != NULL) { + return v->type()->as_ObjectConstant()->value()->is_null_object(); + } else { + return false; + } +} + + +// Only simm16 constants can be inlined. +bool LIRGenerator::can_inline_as_constant(Value i) const { + return can_store_as_constant(i, as_BasicType(i->type())); +} + + +bool LIRGenerator::can_inline_as_constant(LIR_Const* c) const { + if (c->type() == T_INT) { + return Assembler::is_simm16(c->as_jint()); + } + if (c->type() == T_LONG) { + return Assembler::is_simm16(c->as_jlong()); + } + if (c->type() == T_OBJECT) { + return c->as_jobject() == NULL; + } + return false; +} + + +LIR_Opr LIRGenerator::safepoint_poll_register() { + return new_register(T_INT); +} + + +LIR_Address* LIRGenerator::generate_address(LIR_Opr base, LIR_Opr index, + int shift, int disp, BasicType type) { + assert(base->is_register(), "must be"); + + // Accumulate fixed displacements. + if (index->is_constant()) { + disp += index->as_constant_ptr()->as_jint() << shift; + index = LIR_OprFact::illegalOpr; + } + + if (index->is_register()) { + // Apply the shift and accumulate the displacement. + if (shift > 0) { + LIR_Opr tmp = new_pointer_register(); + __ shift_left(index, shift, tmp); + index = tmp; + } + if (disp != 0) { + LIR_Opr tmp = new_pointer_register(); + if (Assembler::is_simm16(disp)) { + __ add(index, LIR_OprFact::intptrConst(disp), tmp); + index = tmp; + } else { + __ move(LIR_OprFact::intptrConst(disp), tmp); + __ add(tmp, index, tmp); + index = tmp; + } + disp = 0; + } + } else if (!Assembler::is_simm16(disp)) { + // Index is illegal so replace it with the displacement loaded into a register. + index = new_pointer_register(); + __ move(LIR_OprFact::intptrConst(disp), index); + disp = 0; + } + + // At this point we either have base + index or base + displacement. + if (disp == 0) { + return new LIR_Address(base, index, type); + } else { + assert(Assembler::is_simm16(disp), "must be"); + return new LIR_Address(base, disp, type); + } +} + + +LIR_Address* LIRGenerator::emit_array_address(LIR_Opr array_opr, LIR_Opr index_opr, + BasicType type, bool needs_card_mark) { + int elem_size = type2aelembytes(type); + int shift = exact_log2(elem_size); + + LIR_Opr base_opr; + int offset = arrayOopDesc::base_offset_in_bytes(type); + + if (index_opr->is_constant()) { + int i = index_opr->as_constant_ptr()->as_jint(); + int array_offset = i * elem_size; + if (Assembler::is_simm16(array_offset + offset)) { + base_opr = array_opr; + offset = array_offset + offset; + } else { + base_opr = new_pointer_register(); + if (Assembler::is_simm16(array_offset)) { + __ add(array_opr, LIR_OprFact::intptrConst(array_offset), base_opr); + } else { + __ move(LIR_OprFact::intptrConst(array_offset), base_opr); + __ add(base_opr, array_opr, base_opr); + } + } + } else { +#ifdef _LP64 + if (index_opr->type() == T_INT) { + LIR_Opr tmp = new_register(T_LONG); + __ convert(Bytecodes::_i2l, index_opr, tmp); + index_opr = tmp; + } +#endif + + base_opr = new_pointer_register(); + assert (index_opr->is_register(), "Must be register"); + if (shift > 0) { + __ shift_left(index_opr, shift, base_opr); + __ add(base_opr, array_opr, base_opr); + } else { + __ add(index_opr, array_opr, base_opr); + } + } + if (needs_card_mark) { + LIR_Opr ptr = new_pointer_register(); + __ add(base_opr, LIR_OprFact::intptrConst(offset), ptr); + return new LIR_Address(ptr, type); + } else { + return new LIR_Address(base_opr, offset, type); + } +} + + +LIR_Opr LIRGenerator::load_immediate(int x, BasicType type) { + LIR_Opr r = NULL; + if (type == T_LONG) { + r = LIR_OprFact::longConst(x); + } else if (type == T_INT) { + r = LIR_OprFact::intConst(x); + } else { + ShouldNotReachHere(); + } + if (!Assembler::is_simm16(x)) { + LIR_Opr tmp = new_register(type); + __ move(r, tmp); + return tmp; + } + return r; +} + + +void LIRGenerator::increment_counter(address counter, BasicType type, int step) { + LIR_Opr pointer = new_pointer_register(); + __ move(LIR_OprFact::intptrConst(counter), pointer); + LIR_Address* addr = new LIR_Address(pointer, type); + increment_counter(addr, step); +} + + +void LIRGenerator::increment_counter(LIR_Address* addr, int step) { + LIR_Opr temp = new_register(addr->type()); + __ move(addr, temp); + __ add(temp, load_immediate(step, addr->type()), temp); + __ move(temp, addr); +} + + +void LIRGenerator::cmp_mem_int(LIR_Condition condition, LIR_Opr base, int disp, int c, CodeEmitInfo* info) { + LIR_Opr tmp = FrameMap::R0_opr; + __ load(new LIR_Address(base, disp, T_INT), tmp, info); + __ cmp(condition, tmp, c); +} + + +void LIRGenerator::cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Opr base, + int disp, BasicType type, CodeEmitInfo* info) { + LIR_Opr tmp = FrameMap::R0_opr; + __ load(new LIR_Address(base, disp, type), tmp, info); + __ cmp(condition, reg, tmp); +} + + +void LIRGenerator::cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Opr base, + LIR_Opr disp, BasicType type, CodeEmitInfo* info) { + LIR_Opr tmp = FrameMap::R0_opr; + __ load(new LIR_Address(base, disp, type), tmp, info); + __ cmp(condition, reg, tmp); +} + + +bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, int c, LIR_Opr result, LIR_Opr tmp) { + assert(left != result, "should be different registers"); + if (is_power_of_2(c + 1)) { + __ shift_left(left, log2_intptr(c + 1), result); + __ sub(result, left, result); + return true; + } else if (is_power_of_2(c - 1)) { + __ shift_left(left, log2_intptr(c - 1), result); + __ add(result, left, result); + return true; + } + return false; +} + + +void LIRGenerator::store_stack_parameter(LIR_Opr item, ByteSize offset_from_sp) { + BasicType t = item->type(); + LIR_Opr sp_opr = FrameMap::SP_opr; + if ((t == T_LONG || t == T_DOUBLE) && + ((in_bytes(offset_from_sp) - STACK_BIAS) % 8 != 0)) { + __ unaligned_move(item, new LIR_Address(sp_opr, in_bytes(offset_from_sp), t)); + } else { + __ move(item, new LIR_Address(sp_opr, in_bytes(offset_from_sp), t)); + } +} + + +//---------------------------------------------------------------------- +// visitor functions +//---------------------------------------------------------------------- + +void LIRGenerator::do_StoreIndexed(StoreIndexed* x) { + assert(x->is_pinned(),""); + bool needs_range_check = x->compute_needs_range_check(); + bool use_length = x->length() != NULL; + bool obj_store = x->elt_type() == T_ARRAY || x->elt_type() == T_OBJECT; + bool needs_store_check = obj_store && (x->value()->as_Constant() == NULL || + !get_jobject_constant(x->value())->is_null_object() || + x->should_profile()); + + LIRItem array(x->array(), this); + LIRItem index(x->index(), this); + LIRItem value(x->value(), this); + LIRItem length(this); + + array.load_item(); + index.load_nonconstant(); + + if (use_length && needs_range_check) { + length.set_instruction(x->length()); + length.load_item(); + } + if (needs_store_check) { + value.load_item(); + } else { + value.load_for_store(x->elt_type()); + } + + set_no_result(x); + + // The CodeEmitInfo must be duplicated for each different + // LIR-instruction because spilling can occur anywhere between two + // instructions and so the debug information must be different. + CodeEmitInfo* range_check_info = state_for(x); + CodeEmitInfo* null_check_info = NULL; + if (x->needs_null_check()) { + null_check_info = new CodeEmitInfo(range_check_info); + } + + // Emit array address setup early so it schedules better. + LIR_Address* array_addr = emit_array_address(array.result(), index.result(), x->elt_type(), obj_store); + + if (GenerateRangeChecks && needs_range_check) { + if (use_length) { + __ cmp(lir_cond_belowEqual, length.result(), index.result()); + __ branch(lir_cond_belowEqual, T_INT, new RangeCheckStub(range_check_info, index.result())); + } else { + array_range_check(array.result(), index.result(), null_check_info, range_check_info); + // Range_check also does the null check. + null_check_info = NULL; + } + } + + if (GenerateArrayStoreCheck && needs_store_check) { + // Following registers are used by slow_subtype_check: + LIR_Opr tmp1 = FrameMap::R4_opr; // super_klass + LIR_Opr tmp2 = FrameMap::R5_opr; // sub_klass + LIR_Opr tmp3 = FrameMap::R6_opr; // temp + + CodeEmitInfo* store_check_info = new CodeEmitInfo(range_check_info); + __ store_check(value.result(), array.result(), tmp1, tmp2, tmp3, + store_check_info, x->profiled_method(), x->profiled_bci()); + } + + if (obj_store) { + // Needs GC write barriers. + pre_barrier(LIR_OprFact::address(array_addr), LIR_OprFact::illegalOpr /* pre_val */, + true /* do_load */, false /* patch */, NULL); + } + __ move(value.result(), array_addr, null_check_info); + if (obj_store) { + // Precise card mark. + post_barrier(LIR_OprFact::address(array_addr), value.result()); + } +} + + +void LIRGenerator::do_MonitorEnter(MonitorEnter* x) { + assert(x->is_pinned(),""); + LIRItem obj(x->obj(), this); + obj.load_item(); + + set_no_result(x); + + // We use R4+R5 in order to get a temp effect. These regs are used in slow path (MonitorEnterStub). + LIR_Opr lock = FrameMap::R5_opr; + LIR_Opr scratch = FrameMap::R4_opr; + LIR_Opr hdr = FrameMap::R6_opr; + + CodeEmitInfo* info_for_exception = NULL; + if (x->needs_null_check()) { + info_for_exception = state_for(x); + } + + // This CodeEmitInfo must not have the xhandlers because here the + // object is already locked (xhandlers expects object to be unlocked). + CodeEmitInfo* info = state_for(x, x->state(), true); + monitor_enter(obj.result(), lock, hdr, scratch, x->monitor_no(), info_for_exception, info); +} + + +void LIRGenerator::do_MonitorExit(MonitorExit* x) { + assert(x->is_pinned(),""); + LIRItem obj(x->obj(), this); + obj.dont_load_item(); + + set_no_result(x); + LIR_Opr lock = FrameMap::R5_opr; + LIR_Opr hdr = FrameMap::R4_opr; // Used for slow path (MonitorExitStub). + LIR_Opr obj_temp = FrameMap::R6_opr; + monitor_exit(obj_temp, lock, hdr, LIR_OprFact::illegalOpr, x->monitor_no()); +} + + +// _ineg, _lneg, _fneg, _dneg +void LIRGenerator::do_NegateOp(NegateOp* x) { + LIRItem value(x->x(), this); + value.load_item(); + LIR_Opr reg = rlock_result(x); + __ negate(value.result(), reg); +} + + +// for _fadd, _fmul, _fsub, _fdiv, _frem +// _dadd, _dmul, _dsub, _ddiv, _drem +void LIRGenerator::do_ArithmeticOp_FPU(ArithmeticOp* x) { + switch (x->op()) { + case Bytecodes::_fadd: + case Bytecodes::_fmul: + case Bytecodes::_fsub: + case Bytecodes::_fdiv: + case Bytecodes::_dadd: + case Bytecodes::_dmul: + case Bytecodes::_dsub: + case Bytecodes::_ddiv: { + LIRItem left(x->x(), this); + LIRItem right(x->y(), this); + left.load_item(); + right.load_item(); + rlock_result(x); + arithmetic_op_fpu(x->op(), x->operand(), left.result(), right.result(), x->is_strictfp()); + } + break; + + case Bytecodes::_frem: + case Bytecodes::_drem: { + address entry = NULL; + switch (x->op()) { + case Bytecodes::_frem: + entry = CAST_FROM_FN_PTR(address, SharedRuntime::frem); + break; + case Bytecodes::_drem: + entry = CAST_FROM_FN_PTR(address, SharedRuntime::drem); + break; + default: + ShouldNotReachHere(); + } + LIR_Opr result = call_runtime(x->x(), x->y(), entry, x->type(), NULL); + set_result(x, result); + } + break; + + default: ShouldNotReachHere(); + } +} + + +// for _ladd, _lmul, _lsub, _ldiv, _lrem +void LIRGenerator::do_ArithmeticOp_Long(ArithmeticOp* x) { + bool is_div_rem = x->op() == Bytecodes::_ldiv || x->op() == Bytecodes::_lrem; + + LIRItem right(x->y(), this); + // Missing test if instr is commutative and if we should swap. + if (right.value()->type()->as_LongConstant() && + (x->op() == Bytecodes::_lsub && right.value()->type()->as_LongConstant()->value() == ((-1)<<15)) ) { + // Sub is implemented by addi and can't support min_simm16 as constant.. + right.load_item(); + } else { + right.load_nonconstant(); + } + assert(right.is_constant() || right.is_register(), "wrong state of right"); + + if (is_div_rem) { + LIR_Opr divisor = right.result(); + if (divisor->is_register()) { + CodeEmitInfo* null_check_info = state_for(x); + __ cmp(lir_cond_equal, divisor, LIR_OprFact::longConst(0)); + __ branch(lir_cond_equal, T_LONG, new DivByZeroStub(null_check_info)); + } else { + jlong const_divisor = divisor->as_constant_ptr()->as_jlong(); + if (const_divisor == 0) { + CodeEmitInfo* null_check_info = state_for(x); + __ jump(new DivByZeroStub(null_check_info)); + rlock_result(x); + __ move(LIR_OprFact::longConst(0), x->operand()); // dummy + return; + } + if (x->op() == Bytecodes::_lrem && !is_power_of_2(const_divisor) && const_divisor != -1) { + // Remainder computation would need additional tmp != R0. + right.load_item(); + } + } + } + + LIRItem left(x->x(), this); + left.load_item(); + rlock_result(x); + if (is_div_rem) { + CodeEmitInfo* info = NULL; // Null check already done above. + LIR_Opr tmp = FrameMap::R0_opr; + if (x->op() == Bytecodes::_lrem) { + __ irem(left.result(), right.result(), x->operand(), tmp, info); + } else if (x->op() == Bytecodes::_ldiv) { + __ idiv(left.result(), right.result(), x->operand(), tmp, info); + } + } else { + arithmetic_op_long(x->op(), x->operand(), left.result(), right.result(), NULL); + } +} + + +// for: _iadd, _imul, _isub, _idiv, _irem +void LIRGenerator::do_ArithmeticOp_Int(ArithmeticOp* x) { + bool is_div_rem = x->op() == Bytecodes::_idiv || x->op() == Bytecodes::_irem; + + LIRItem right(x->y(), this); + // Missing test if instr is commutative and if we should swap. + if (right.value()->type()->as_IntConstant() && + (x->op() == Bytecodes::_isub && right.value()->type()->as_IntConstant()->value() == ((-1)<<15)) ) { + // Sub is implemented by addi and can't support min_simm16 as constant. + right.load_item(); + } else { + right.load_nonconstant(); + } + assert(right.is_constant() || right.is_register(), "wrong state of right"); + + if (is_div_rem) { + LIR_Opr divisor = right.result(); + if (divisor->is_register()) { + CodeEmitInfo* null_check_info = state_for(x); + __ cmp(lir_cond_equal, divisor, LIR_OprFact::intConst(0)); + __ branch(lir_cond_equal, T_INT, new DivByZeroStub(null_check_info)); + } else { + jint const_divisor = divisor->as_constant_ptr()->as_jint(); + if (const_divisor == 0) { + CodeEmitInfo* null_check_info = state_for(x); + __ jump(new DivByZeroStub(null_check_info)); + rlock_result(x); + __ move(LIR_OprFact::intConst(0), x->operand()); // dummy + return; + } + if (x->op() == Bytecodes::_irem && !is_power_of_2(const_divisor) && const_divisor != -1) { + // Remainder computation would need additional tmp != R0. + right.load_item(); + } + } + } + + LIRItem left(x->x(), this); + left.load_item(); + rlock_result(x); + if (is_div_rem) { + CodeEmitInfo* info = NULL; // Null check already done above. + LIR_Opr tmp = FrameMap::R0_opr; + if (x->op() == Bytecodes::_irem) { + __ irem(left.result(), right.result(), x->operand(), tmp, info); + } else if (x->op() == Bytecodes::_idiv) { + __ idiv(left.result(), right.result(), x->operand(), tmp, info); + } + } else { + arithmetic_op_int(x->op(), x->operand(), left.result(), right.result(), FrameMap::R0_opr); + } +} + + +void LIRGenerator::do_ArithmeticOp(ArithmeticOp* x) { + ValueTag tag = x->type()->tag(); + assert(x->x()->type()->tag() == tag && x->y()->type()->tag() == tag, "wrong parameters"); + switch (tag) { + case floatTag: + case doubleTag: do_ArithmeticOp_FPU(x); return; + case longTag: do_ArithmeticOp_Long(x); return; + case intTag: do_ArithmeticOp_Int(x); return; + } + ShouldNotReachHere(); +} + + +// _ishl, _lshl, _ishr, _lshr, _iushr, _lushr +void LIRGenerator::do_ShiftOp(ShiftOp* x) { + LIRItem value(x->x(), this); + LIRItem count(x->y(), this); + value.load_item(); + LIR_Opr reg = rlock_result(x); + LIR_Opr mcount; + if (count.result()->is_register()) { + mcount = FrameMap::R0_opr; + } else { + mcount = LIR_OprFact::illegalOpr; + } + shift_op(x->op(), reg, value.result(), count.result(), mcount); +} + + +inline bool can_handle_logic_op_as_uimm(ValueType *type, Bytecodes::Code bc) { + jlong int_or_long_const; + if (type->as_IntConstant()) { + int_or_long_const = type->as_IntConstant()->value(); + } else if (type->as_LongConstant()) { + int_or_long_const = type->as_LongConstant()->value(); + } else if (type->as_ObjectConstant()) { + return type->as_ObjectConstant()->value()->is_null_object(); + } else { + return false; + } + + if (Assembler::is_uimm(int_or_long_const, 16)) return true; + if ((int_or_long_const & 0xFFFF) == 0 && + Assembler::is_uimm((jlong)((julong)int_or_long_const >> 16), 16)) return true; + + // see Assembler::andi + if (bc == Bytecodes::_iand && + (is_power_of_2_long(int_or_long_const+1) || + is_power_of_2_long(int_or_long_const) || + is_power_of_2_long(-int_or_long_const))) return true; + if (bc == Bytecodes::_land && + (is_power_of_2_long(int_or_long_const+1) || + (Assembler::is_uimm(int_or_long_const, 32) && is_power_of_2_long(int_or_long_const)) || + (int_or_long_const != min_jlong && is_power_of_2_long(-int_or_long_const)))) return true; + + // special case: xor -1 + if ((bc == Bytecodes::_ixor || bc == Bytecodes::_lxor) && + int_or_long_const == -1) return true; + return false; +} + + +// _iand, _land, _ior, _lor, _ixor, _lxor +void LIRGenerator::do_LogicOp(LogicOp* x) { + LIRItem left(x->x(), this); + LIRItem right(x->y(), this); + + left.load_item(); + + Value rval = right.value(); + LIR_Opr r = rval->operand(); + ValueType *type = rval->type(); + // Logic instructions use unsigned immediate values. + if (can_handle_logic_op_as_uimm(type, x->op())) { + if (!r->is_constant()) { + r = LIR_OprFact::value_type(type); + rval->set_operand(r); + } + right.set_result(r); + } else { + right.load_item(); + } + + LIR_Opr reg = rlock_result(x); + + logic_op(x->op(), reg, left.result(), right.result()); +} + + +// _lcmp, _fcmpl, _fcmpg, _dcmpl, _dcmpg +void LIRGenerator::do_CompareOp(CompareOp* x) { + LIRItem left(x->x(), this); + LIRItem right(x->y(), this); + left.load_item(); + right.load_item(); + LIR_Opr reg = rlock_result(x); + if (x->x()->type()->is_float_kind()) { + Bytecodes::Code code = x->op(); + __ fcmp2int(left.result(), right.result(), reg, (code == Bytecodes::_fcmpl || code == Bytecodes::_dcmpl)); + } else if (x->x()->type()->tag() == longTag) { + __ lcmp2int(left.result(), right.result(), reg); + } else { + Unimplemented(); + } +} + + +void LIRGenerator::do_CompareAndSwap(Intrinsic* x, ValueType* type) { + assert(x->number_of_arguments() == 4, "wrong type"); + LIRItem obj (x->argument_at(0), this); // object + LIRItem offset(x->argument_at(1), this); // offset of field + LIRItem cmp (x->argument_at(2), this); // Value to compare with field. + LIRItem val (x->argument_at(3), this); // Replace field with val if matches cmp. + + LIR_Opr t1 = LIR_OprFact::illegalOpr; + LIR_Opr t2 = LIR_OprFact::illegalOpr; + LIR_Opr addr = new_pointer_register(); + + // Get address of field. + obj.load_item(); + offset.load_item(); + cmp.load_item(); + val.load_item(); + + __ add(obj.result(), offset.result(), addr); + + // Volatile load may be followed by Unsafe CAS. + if (support_IRIW_for_not_multiple_copy_atomic_cpu) { + __ membar(); // To be safe. Unsafe semantics are unclear. + } else { + __ membar_release(); + } + + if (type == objectType) { // Write-barrier needed for Object fields. + // Only cmp value can get overwritten, no do_load required. + pre_barrier(LIR_OprFact::illegalOpr /* addr */, cmp.result() /* pre_val */, + false /* do_load */, false /* patch */, NULL); + } + + if (type == objectType) { + if (UseCompressedOops) { + t1 = new_register(T_OBJECT); + t2 = new_register(T_OBJECT); + } + __ cas_obj(addr, cmp.result(), val.result(), t1, t2); + } else if (type == intType) { + __ cas_int(addr, cmp.result(), val.result(), t1, t2); + } else if (type == longType) { + __ cas_long(addr, cmp.result(), val.result(), t1, t2); + } else { + ShouldNotReachHere(); + } + // Benerate conditional move of boolean result. + LIR_Opr result = rlock_result(x); + __ cmove(lir_cond_equal, LIR_OprFact::intConst(1), LIR_OprFact::intConst(0), + result, as_BasicType(type)); + if (type == objectType) { // Write-barrier needed for Object fields. + // Precise card mark since could either be object or array. + post_barrier(addr, val.result()); + } +} + + +void LIRGenerator::do_MathIntrinsic(Intrinsic* x) { + switch (x->id()) { + case vmIntrinsics::_dabs: { + assert(x->number_of_arguments() == 1, "wrong type"); + LIRItem value(x->argument_at(0), this); + value.load_item(); + LIR_Opr dst = rlock_result(x); + __ abs(value.result(), dst, LIR_OprFact::illegalOpr); + break; + } + case vmIntrinsics::_dsqrt: { + if (VM_Version::has_fsqrt()) { + assert(x->number_of_arguments() == 1, "wrong type"); + LIRItem value(x->argument_at(0), this); + value.load_item(); + LIR_Opr dst = rlock_result(x); + __ sqrt(value.result(), dst, LIR_OprFact::illegalOpr); + break; + } // else fallthru + } + case vmIntrinsics::_dlog10: // fall through + case vmIntrinsics::_dlog: // fall through + case vmIntrinsics::_dsin: // fall through + case vmIntrinsics::_dtan: // fall through + case vmIntrinsics::_dcos: // fall through + case vmIntrinsics::_dexp: { + assert(x->number_of_arguments() == 1, "wrong type"); + + address runtime_entry = NULL; + switch (x->id()) { + case vmIntrinsics::_dsqrt: + runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dsqrt); + break; + case vmIntrinsics::_dsin: + runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dsin); + break; + case vmIntrinsics::_dcos: + runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dcos); + break; + case vmIntrinsics::_dtan: + runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dtan); + break; + case vmIntrinsics::_dlog: + runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dlog); + break; + case vmIntrinsics::_dlog10: + runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dlog10); + break; + case vmIntrinsics::_dexp: + runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dexp); + break; + default: + ShouldNotReachHere(); + } + + LIR_Opr result = call_runtime(x->argument_at(0), runtime_entry, x->type(), NULL); + set_result(x, result); + break; + } + case vmIntrinsics::_dpow: { + assert(x->number_of_arguments() == 2, "wrong type"); + address runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dpow); + LIR_Opr result = call_runtime(x->argument_at(0), x->argument_at(1), runtime_entry, x->type(), NULL); + set_result(x, result); + break; + } + } +} + + +void LIRGenerator::do_ArrayCopy(Intrinsic* x) { + assert(x->number_of_arguments() == 5, "wrong type"); + + // Make all state_for calls early since they can emit code. + CodeEmitInfo* info = state_for(x, x->state()); + + LIRItem src (x->argument_at(0), this); + LIRItem src_pos (x->argument_at(1), this); + LIRItem dst (x->argument_at(2), this); + LIRItem dst_pos (x->argument_at(3), this); + LIRItem length (x->argument_at(4), this); + + // Load all values in callee_save_registers (C calling convention), + // as this makes the parameter passing to the fast case simpler. + src.load_item_force (FrameMap::R14_oop_opr); + src_pos.load_item_force (FrameMap::R15_opr); + dst.load_item_force (FrameMap::R17_oop_opr); + dst_pos.load_item_force (FrameMap::R18_opr); + length.load_item_force (FrameMap::R19_opr); + LIR_Opr tmp = FrameMap::R20_opr; + + int flags; + ciArrayKlass* expected_type; + arraycopy_helper(x, &flags, &expected_type); + + __ arraycopy(src.result(), src_pos.result(), dst.result(), dst_pos.result(), + length.result(), tmp, + expected_type, flags, info); + set_no_result(x); +} + + +// _i2l, _i2f, _i2d, _l2i, _l2f, _l2d, _f2i, _f2l, _f2d, _d2i, _d2l, _d2f +// _i2b, _i2c, _i2s +void LIRGenerator::do_Convert(Convert* x) { + switch (x->op()) { + + // int -> float: force spill + case Bytecodes::_l2f: { + if (!VM_Version::has_fcfids()) { // fcfids is >= Power7 only + // fcfid+frsp needs fixup code to avoid rounding incompatibility. + address entry = CAST_FROM_FN_PTR(address, SharedRuntime::l2f); + LIR_Opr result = call_runtime(x->value(), entry, x->type(), NULL); + set_result(x, result); + break; + } // else fallthru + } + case Bytecodes::_l2d: { + LIRItem value(x->value(), this); + LIR_Opr reg = rlock_result(x); + value.load_item(); + LIR_Opr tmp = force_to_spill(value.result(), T_DOUBLE); + __ convert(x->op(), tmp, reg); + break; + } + case Bytecodes::_i2f: + case Bytecodes::_i2d: { + LIRItem value(x->value(), this); + LIR_Opr reg = rlock_result(x); + value.load_item(); + // Convert i2l first. + LIR_Opr tmp1 = new_register(T_LONG); + __ convert(Bytecodes::_i2l, value.result(), tmp1); + LIR_Opr tmp2 = force_to_spill(tmp1, T_DOUBLE); + __ convert(x->op(), tmp2, reg); + break; + } + + // float -> int: result will be stored + case Bytecodes::_f2l: + case Bytecodes::_d2l: { + LIRItem value(x->value(), this); + LIR_Opr reg = rlock_result(x); + value.set_destroys_register(); // USE_KILL + value.load_item(); + set_vreg_flag(reg, must_start_in_memory); + __ convert(x->op(), value.result(), reg); + break; + } + case Bytecodes::_f2i: + case Bytecodes::_d2i: { + LIRItem value(x->value(), this); + LIR_Opr reg = rlock_result(x); + value.set_destroys_register(); // USE_KILL + value.load_item(); + // Convert l2i afterwards. + LIR_Opr tmp1 = new_register(T_LONG); + set_vreg_flag(tmp1, must_start_in_memory); + __ convert(x->op(), value.result(), tmp1); + __ convert(Bytecodes::_l2i, tmp1, reg); + break; + } + + // Within same category: just register conversions. + case Bytecodes::_i2b: + case Bytecodes::_i2c: + case Bytecodes::_i2s: + case Bytecodes::_i2l: + case Bytecodes::_l2i: + case Bytecodes::_f2d: + case Bytecodes::_d2f: { + LIRItem value(x->value(), this); + LIR_Opr reg = rlock_result(x); + value.load_item(); + __ convert(x->op(), value.result(), reg); + break; + } + + default: ShouldNotReachHere(); + } +} + + +void LIRGenerator::do_NewInstance(NewInstance* x) { + // This instruction can be deoptimized in the slow path. + const LIR_Opr reg = result_register_for(x->type()); +#ifndef PRODUCT + if (PrintNotLoaded && !x->klass()->is_loaded()) { + tty->print_cr(" ###class not loaded at new bci %d", x->printable_bci()); + } +#endif + CodeEmitInfo* info = state_for(x, x->state()); + LIR_Opr klass_reg = FrameMap::R4_metadata_opr; // Used by slow path (NewInstanceStub). + LIR_Opr tmp1 = FrameMap::R5_oop_opr; + LIR_Opr tmp2 = FrameMap::R6_oop_opr; + LIR_Opr tmp3 = FrameMap::R7_oop_opr; + LIR_Opr tmp4 = FrameMap::R8_oop_opr; + new_instance(reg, x->klass(), x->is_unresolved(), tmp1, tmp2, tmp3, tmp4, klass_reg, info); + + // Must prevent reordering of stores for object initialization + // with stores that publish the new object. + __ membar_storestore(); + LIR_Opr result = rlock_result(x); + __ move(reg, result); +} + + +void LIRGenerator::do_NewTypeArray(NewTypeArray* x) { + // Evaluate state_for early since it may emit code. + CodeEmitInfo* info = state_for(x, x->state()); + + LIRItem length(x->length(), this); + length.load_item(); + + LIR_Opr reg = result_register_for(x->type()); + LIR_Opr klass_reg = FrameMap::R4_metadata_opr; // Used by slow path (NewTypeArrayStub). + // We use R5 in order to get a temp effect. This reg is used in slow path (NewTypeArrayStub). + LIR_Opr tmp1 = FrameMap::R5_oop_opr; + LIR_Opr tmp2 = FrameMap::R6_oop_opr; + LIR_Opr tmp3 = FrameMap::R7_oop_opr; + LIR_Opr tmp4 = FrameMap::R8_oop_opr; + LIR_Opr len = length.result(); + BasicType elem_type = x->elt_type(); + + __ metadata2reg(ciTypeArrayKlass::make(elem_type)->constant_encoding(), klass_reg); + + CodeStub* slow_path = new NewTypeArrayStub(klass_reg, len, reg, info); + __ allocate_array(reg, len, tmp1, tmp2, tmp3, tmp4, elem_type, klass_reg, slow_path); + + // Must prevent reordering of stores for object initialization + // with stores that publish the new object. + __ membar_storestore(); + LIR_Opr result = rlock_result(x); + __ move(reg, result); +} + + +void LIRGenerator::do_NewObjectArray(NewObjectArray* x) { + // Evaluate state_for early since it may emit code. + CodeEmitInfo* info = state_for(x, x->state()); + // In case of patching (i.e., object class is not yet loaded), + // we need to reexecute the instruction and therefore provide + // the state before the parameters have been consumed. + CodeEmitInfo* patching_info = NULL; + if (!x->klass()->is_loaded() || PatchALot) { + patching_info = state_for(x, x->state_before()); + } + + LIRItem length(x->length(), this); + length.load_item(); + + const LIR_Opr reg = result_register_for(x->type()); + LIR_Opr klass_reg = FrameMap::R4_metadata_opr; // Used by slow path (NewObjectArrayStub). + // We use R5 in order to get a temp effect. This reg is used in slow path (NewObjectArrayStub). + LIR_Opr tmp1 = FrameMap::R5_oop_opr; + LIR_Opr tmp2 = FrameMap::R6_oop_opr; + LIR_Opr tmp3 = FrameMap::R7_oop_opr; + LIR_Opr tmp4 = FrameMap::R8_oop_opr; + LIR_Opr len = length.result(); + + CodeStub* slow_path = new NewObjectArrayStub(klass_reg, len, reg, info); + ciMetadata* obj = ciObjArrayKlass::make(x->klass()); + if (obj == ciEnv::unloaded_ciobjarrayklass()) { + BAILOUT("encountered unloaded_ciobjarrayklass due to out of memory error"); + } + klass2reg_with_patching(klass_reg, obj, patching_info); + __ allocate_array(reg, len, tmp1, tmp2, tmp3, tmp4, T_OBJECT, klass_reg, slow_path); + + // Must prevent reordering of stores for object initialization + // with stores that publish the new object. + __ membar_storestore(); + LIR_Opr result = rlock_result(x); + __ move(reg, result); +} + + +void LIRGenerator::do_NewMultiArray(NewMultiArray* x) { + Values* dims = x->dims(); + int i = dims->length(); + LIRItemList* items = new LIRItemList(dims->length(), NULL); + while (i-- > 0) { + LIRItem* size = new LIRItem(dims->at(i), this); + items->at_put(i, size); + } + + // Evaluate state_for early since it may emit code. + CodeEmitInfo* patching_info = NULL; + if (!x->klass()->is_loaded() || PatchALot) { + patching_info = state_for(x, x->state_before()); + + // Cannot re-use same xhandlers for multiple CodeEmitInfos, so + // clone all handlers (NOTE: Usually this is handled transparently + // by the CodeEmitInfo cloning logic in CodeStub constructors but + // is done explicitly here because a stub isn't being used). + x->set_exception_handlers(new XHandlers(x->exception_handlers())); + } + CodeEmitInfo* info = state_for(x, x->state()); + + i = dims->length(); + while (i-- > 0) { + LIRItem* size = items->at(i); + size->load_nonconstant(); + // FrameMap::_reserved_argument_area_size includes the dimensions + // varargs, because it's initialized to hir()->max_stack() when the + // FrameMap is created. + store_stack_parameter(size->result(), in_ByteSize(i*sizeof(jint) + FrameMap::first_available_sp_in_frame)); + } + + const LIR_Opr klass_reg = FrameMap::R4_metadata_opr; // Used by slow path. + klass2reg_with_patching(klass_reg, x->klass(), patching_info); + + LIR_Opr rank = FrameMap::R5_opr; // Used by slow path. + __ move(LIR_OprFact::intConst(x->rank()), rank); + + LIR_Opr varargs = FrameMap::as_pointer_opr(R6); // Used by slow path. + __ leal(LIR_OprFact::address(new LIR_Address(FrameMap::SP_opr, FrameMap::first_available_sp_in_frame, T_INT)), + varargs); + + // Note: This instruction can be deoptimized in the slow path. + LIR_OprList* args = new LIR_OprList(3); + args->append(klass_reg); + args->append(rank); + args->append(varargs); + const LIR_Opr reg = result_register_for(x->type()); + __ call_runtime(Runtime1::entry_for(Runtime1::new_multi_array_id), + LIR_OprFact::illegalOpr, + reg, args, info); + + // Must prevent reordering of stores for object initialization + // with stores that publish the new object. + __ membar_storestore(); + LIR_Opr result = rlock_result(x); + __ move(reg, result); +} + + +void LIRGenerator::do_BlockBegin(BlockBegin* x) { + // nothing to do for now +} + + +void LIRGenerator::do_CheckCast(CheckCast* x) { + LIRItem obj(x->obj(), this); + CodeEmitInfo* patching_info = NULL; + if (!x->klass()->is_loaded() || (PatchALot && !x->is_incompatible_class_change_check())) { + // Must do this before locking the destination register as + // an oop register, and before the obj is loaded (so x->obj()->item() + // is valid for creating a debug info location). + patching_info = state_for(x, x->state_before()); + } + obj.load_item(); + LIR_Opr out_reg = rlock_result(x); + CodeStub* stub; + CodeEmitInfo* info_for_exception = state_for(x); + + if (x->is_incompatible_class_change_check()) { + assert(patching_info == NULL, "can't patch this"); + stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id, + LIR_OprFact::illegalOpr, info_for_exception); + } else { + stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, obj.result(), info_for_exception); + } + // Following registers are used by slow_subtype_check: + LIR_Opr tmp1 = FrameMap::R4_oop_opr; // super_klass + LIR_Opr tmp2 = FrameMap::R5_oop_opr; // sub_klass + LIR_Opr tmp3 = FrameMap::R6_oop_opr; // temp + __ checkcast(out_reg, obj.result(), x->klass(), tmp1, tmp2, tmp3, + x->direct_compare(), info_for_exception, patching_info, stub, + x->profiled_method(), x->profiled_bci()); +} + + +void LIRGenerator::do_InstanceOf(InstanceOf* x) { + LIRItem obj(x->obj(), this); + CodeEmitInfo* patching_info = NULL; + if (!x->klass()->is_loaded() || PatchALot) { + patching_info = state_for(x, x->state_before()); + } + // Ensure the result register is not the input register because the + // result is initialized before the patching safepoint. + obj.load_item(); + LIR_Opr out_reg = rlock_result(x); + // Following registers are used by slow_subtype_check: + LIR_Opr tmp1 = FrameMap::R4_oop_opr; // super_klass + LIR_Opr tmp2 = FrameMap::R5_oop_opr; // sub_klass + LIR_Opr tmp3 = FrameMap::R6_oop_opr; // temp + __ instanceof(out_reg, obj.result(), x->klass(), tmp1, tmp2, tmp3, + x->direct_compare(), patching_info, + x->profiled_method(), x->profiled_bci()); +} + + +void LIRGenerator::do_If(If* x) { + assert(x->number_of_sux() == 2, "inconsistency"); + ValueTag tag = x->x()->type()->tag(); + LIRItem xitem(x->x(), this); + LIRItem yitem(x->y(), this); + LIRItem* xin = &xitem; + LIRItem* yin = &yitem; + If::Condition cond = x->cond(); + + LIR_Opr left = LIR_OprFact::illegalOpr; + LIR_Opr right = LIR_OprFact::illegalOpr; + + xin->load_item(); + left = xin->result(); + + if (yin->result()->is_constant() && yin->result()->type() == T_INT && + Assembler::is_simm16(yin->result()->as_constant_ptr()->as_jint())) { + // Inline int constants which are small enough to be immediate operands. + right = LIR_OprFact::value_type(yin->value()->type()); + } else if (tag == longTag && yin->is_constant() && yin->get_jlong_constant() == 0 && + (cond == If::eql || cond == If::neq)) { + // Inline long zero. + right = LIR_OprFact::value_type(yin->value()->type()); + } else if (tag == objectTag && yin->is_constant() && (yin->get_jobject_constant()->is_null_object())) { + right = LIR_OprFact::value_type(yin->value()->type()); + } else { + yin->load_item(); + right = yin->result(); + } + set_no_result(x); + + // Add safepoint before generating condition code so it can be recomputed. + if (x->is_safepoint()) { + // Increment backedge counter if needed. + increment_backedge_counter(state_for(x, x->state_before()), x->profiled_bci()); + __ safepoint(safepoint_poll_register(), state_for(x, x->state_before())); + } + + __ cmp(lir_cond(cond), left, right); + // Generate branch profiling. Profiling code doesn't kill flags. + profile_branch(x, cond); + move_to_phi(x->state()); + if (x->x()->type()->is_float_kind()) { + __ branch(lir_cond(cond), right->type(), x->tsux(), x->usux()); + } else { + __ branch(lir_cond(cond), right->type(), x->tsux()); + } + assert(x->default_sux() == x->fsux(), "wrong destination above"); + __ jump(x->default_sux()); +} + + +LIR_Opr LIRGenerator::getThreadPointer() { + return FrameMap::as_pointer_opr(R16_thread); +} + + +void LIRGenerator::trace_block_entry(BlockBegin* block) { + LIR_Opr arg1 = FrameMap::R3_opr; // ARG1 + __ move(LIR_OprFact::intConst(block->block_id()), arg1); + LIR_OprList* args = new LIR_OprList(1); + args->append(arg1); + address func = CAST_FROM_FN_PTR(address, Runtime1::trace_block_entry); + __ call_runtime_leaf(func, LIR_OprFact::illegalOpr, LIR_OprFact::illegalOpr, args); +} + + +void LIRGenerator::volatile_field_store(LIR_Opr value, LIR_Address* address, + CodeEmitInfo* info) { +#ifdef _LP64 + __ store(value, address, info); +#else + Unimplemented(); +// __ volatile_store_mem_reg(value, address, info); +#endif +} + +void LIRGenerator::volatile_field_load(LIR_Address* address, LIR_Opr result, + CodeEmitInfo* info) { +#ifdef _LP64 + __ load(address, result, info); +#else + Unimplemented(); +// __ volatile_load_mem_reg(address, result, info); +#endif +} + + +void LIRGenerator::put_Object_unsafe(LIR_Opr src, LIR_Opr offset, LIR_Opr data, + BasicType type, bool is_volatile) { + LIR_Opr base_op = src; + LIR_Opr index_op = offset; + + bool is_obj = (type == T_ARRAY || type == T_OBJECT); +#ifndef _LP64 + if (is_volatile && type == T_LONG) { + __ volatile_store_unsafe_reg(data, src, offset, type, NULL, lir_patch_none); + } else +#endif + { + if (type == T_BOOLEAN) { + type = T_BYTE; + } + LIR_Address* addr; + if (type == T_ARRAY || type == T_OBJECT) { + LIR_Opr tmp = new_pointer_register(); + __ add(base_op, index_op, tmp); + addr = new LIR_Address(tmp, type); + } else { + addr = new LIR_Address(base_op, index_op, type); + } + + if (is_obj) { + pre_barrier(LIR_OprFact::address(addr), LIR_OprFact::illegalOpr /* pre_val */, + true /* do_load */, false /* patch */, NULL); + // _bs->c1_write_barrier_pre(this, LIR_OprFact::address(addr)); + } + __ move(data, addr); + if (is_obj) { + // This address is precise. + post_barrier(LIR_OprFact::address(addr), data); + } + } +} + + +void LIRGenerator::get_Object_unsafe(LIR_Opr dst, LIR_Opr src, LIR_Opr offset, + BasicType type, bool is_volatile) { +#ifndef _LP64 + if (is_volatile && type == T_LONG) { + __ volatile_load_unsafe_reg(src, offset, dst, type, NULL, lir_patch_none); + } else +#endif + { + LIR_Address* addr = new LIR_Address(src, offset, type); + __ load(addr, dst); + } +} + + +void LIRGenerator::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) { + BasicType type = x->basic_type(); + LIRItem src(x->object(), this); + LIRItem off(x->offset(), this); + LIRItem value(x->value(), this); + + src.load_item(); + value.load_item(); + off.load_nonconstant(); + + LIR_Opr dst = rlock_result(x, type); + LIR_Opr data = value.result(); + bool is_obj = (type == T_ARRAY || type == T_OBJECT); + + LIR_Opr tmp = FrameMap::R0_opr; + LIR_Opr ptr = new_pointer_register(); + __ add(src.result(), off.result(), ptr); + + if (support_IRIW_for_not_multiple_copy_atomic_cpu) { + __ membar(); + } else { + __ membar_release(); + } + + if (x->is_add()) { + __ xadd(ptr, data, dst, tmp); + } else { + const bool can_move_barrier = true; // TODO: port GraphKit::can_move_pre_barrier() from C2 + if (!can_move_barrier && is_obj) { + // Do the pre-write barrier, if any. + pre_barrier(ptr, LIR_OprFact::illegalOpr /* pre_val */, + true /* do_load */, false /* patch */, NULL); + } + __ xchg(ptr, data, dst, tmp); + if (is_obj) { + // Seems to be a precise address. + post_barrier(ptr, data); + if (can_move_barrier) { + pre_barrier(LIR_OprFact::illegalOpr, dst /* pre_val */, + false /* do_load */, false /* patch */, NULL); + } + } + } + + __ membar(); +} + + +void LIRGenerator::do_update_CRC32(Intrinsic* x) { + assert(UseCRC32Intrinsics, "or should not be here"); + LIR_Opr result = rlock_result(x); + + switch (x->id()) { + case vmIntrinsics::_updateCRC32: { + LIRItem crc(x->argument_at(0), this); + LIRItem val(x->argument_at(1), this); + // Registers destroyed by update_crc32. + crc.set_destroys_register(); + val.set_destroys_register(); + crc.load_item(); + val.load_item(); + __ update_crc32(crc.result(), val.result(), result); + break; + } + case vmIntrinsics::_updateBytesCRC32: + case vmIntrinsics::_updateByteBufferCRC32: { + bool is_updateBytes = (x->id() == vmIntrinsics::_updateBytesCRC32); + + LIRItem crc(x->argument_at(0), this); + LIRItem buf(x->argument_at(1), this); + LIRItem off(x->argument_at(2), this); + LIRItem len(x->argument_at(3), this); + buf.load_item(); + off.load_nonconstant(); + + LIR_Opr index = off.result(); + int offset = is_updateBytes ? arrayOopDesc::base_offset_in_bytes(T_BYTE) : 0; + if (off.result()->is_constant()) { + index = LIR_OprFact::illegalOpr; + offset += off.result()->as_jint(); + } + LIR_Opr base_op = buf.result(); + LIR_Address* a = NULL; + + if (index->is_valid()) { + LIR_Opr tmp = new_register(T_LONG); + __ convert(Bytecodes::_i2l, index, tmp); + index = tmp; + __ add(index, LIR_OprFact::intptrConst(offset), index); + a = new LIR_Address(base_op, index, T_BYTE); + } else { + a = new LIR_Address(base_op, offset, T_BYTE); + } + + BasicTypeList signature(3); + signature.append(T_INT); + signature.append(T_ADDRESS); + signature.append(T_INT); + CallingConvention* cc = frame_map()->c_calling_convention(&signature); + const LIR_Opr result_reg = result_register_for(x->type()); + + LIR_Opr arg1 = cc->at(0), + arg2 = cc->at(1), + arg3 = cc->at(2); + + // CCallingConventionRequiresIntsAsLongs + crc.load_item_force(arg1); // We skip int->long conversion here, because CRC32 stub doesn't care about high bits. + __ leal(LIR_OprFact::address(a), arg2); + load_int_as_long(gen()->lir(), len, arg3); + + __ call_runtime_leaf(StubRoutines::updateBytesCRC32(), LIR_OprFact::illegalOpr, result_reg, cc->args()); + __ move(result_reg, result); + break; + } + default: { + ShouldNotReachHere(); + } + } +} diff --git a/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.cpp new file mode 100644 index 00000000000..7c73b1c70a8 --- /dev/null +++ b/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.cpp @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "c1/c1_Instruction.hpp" +#include "c1/c1_LinearScan.hpp" +#include "utilities/bitMap.inline.hpp" + +void LinearScan::allocate_fpu_stack() { + Unimplemented(); + // No FPU stack on PPC +} diff --git a/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.hpp new file mode 100644 index 00000000000..d0f6002929e --- /dev/null +++ b/hotspot/src/cpu/ppc/vm/c1_LinearScan_ppc.hpp @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef CPU_PPC_VM_C1_LINEARSCAN_PPC_HPP +#define CPU_PPC_VM_C1_LINEARSCAN_PPC_HPP + +inline bool LinearScan::is_processed_reg_num(int reg_num) { + assert(FrameMap::R0_opr->cpu_regnr() == FrameMap::last_cpu_reg() + 1, "wrong assumption below"); + assert(FrameMap::R1_opr->cpu_regnr() == FrameMap::last_cpu_reg() + 2, "wrong assumption below"); + assert(FrameMap::R13_opr->cpu_regnr() == FrameMap::last_cpu_reg() + 3, "wrong assumption below"); + assert(FrameMap::R16_opr->cpu_regnr() == FrameMap::last_cpu_reg() + 4, "wrong assumption below"); + assert(FrameMap::R29_opr->cpu_regnr() == FrameMap::last_cpu_reg() + 5, "wrong assumption below"); + return reg_num <= FrameMap::last_cpu_reg() || reg_num >= pd_nof_cpu_regs_frame_map; +} + +inline int LinearScan::num_physical_regs(BasicType type) { + return 1; +} + + +inline bool LinearScan::requires_adjacent_regs(BasicType type) { + return false; +} + +inline bool LinearScan::is_caller_save(int assigned_reg) { + return true; // assigned_reg < pd_first_callee_saved_reg; +} + + +inline void LinearScan::pd_add_temps(LIR_Op* op) { + // No special case behaviours yet +} + + +inline bool LinearScanWalker::pd_init_regs_for_alloc(Interval* cur) { + if (allocator()->gen()->is_vreg_flag_set(cur->reg_num(), LIRGenerator::callee_saved)) { + assert(cur->type() != T_FLOAT && cur->type() != T_DOUBLE, "cpu regs only"); + _first_reg = pd_first_callee_saved_reg; + _last_reg = pd_last_callee_saved_reg; + ShouldNotReachHere(); // Currently no callee saved regs. + return true; + } else if (cur->type() == T_INT || cur->type() == T_LONG || cur->type() == T_OBJECT || + cur->type() == T_ADDRESS || cur->type() == T_METADATA) { + _first_reg = pd_first_cpu_reg; + _last_reg = pd_last_cpu_reg; + return true; + } + return false; +} + +#endif // CPU_PPC_VM_C1_LINEARSCAN_PPC_HPP diff --git a/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.cpp new file mode 100644 index 00000000000..f41a83b1c71 --- /dev/null +++ b/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.cpp @@ -0,0 +1,486 @@ +/* + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "c1/c1_MacroAssembler.hpp" +#include "c1/c1_Runtime1.hpp" +#include "classfile/systemDictionary.hpp" +#include "gc/shared/collectedHeap.hpp" +#include "interpreter/interpreter.hpp" +#include "oops/arrayOop.hpp" +#include "oops/markOop.hpp" +#include "runtime/basicLock.hpp" +#include "runtime/biasedLocking.hpp" +#include "runtime/os.hpp" +#include "runtime/stubRoutines.hpp" +#include "runtime/sharedRuntime.hpp" + + +void C1_MacroAssembler::inline_cache_check(Register receiver, Register iCache) { + const Register temp_reg = R12_scratch2; + verify_oop(receiver); + load_klass(temp_reg, receiver); + if (TrapBasedICMissChecks) { + trap_ic_miss_check(temp_reg, iCache); + } else { + Label L; + cmpd(CCR0, temp_reg, iCache); + beq(CCR0, L); + //load_const_optimized(temp_reg, SharedRuntime::get_ic_miss_stub(), R0); + calculate_address_from_global_toc(temp_reg, SharedRuntime::get_ic_miss_stub(), true, true, false); + mtctr(temp_reg); + bctr(); + align(32, 12); + bind(L); + } +} + + +void C1_MacroAssembler::explicit_null_check(Register base) { + Unimplemented(); +} + + +void C1_MacroAssembler::build_frame(int frame_size_in_bytes, int bang_size_in_bytes) { + assert(bang_size_in_bytes >= frame_size_in_bytes, "stack bang size incorrect"); + // Make sure there is enough stack space for this method's activation. + generate_stack_overflow_check(bang_size_in_bytes); + + // Create the frame. + const Register return_pc = R0; + + mflr(return_pc); + // Get callers sp. + std(return_pc, _abi(lr), R1_SP); // SP->lr = return_pc + push_frame(frame_size_in_bytes, R0); // SP -= frame_size_in_bytes +} + + +void C1_MacroAssembler::unverified_entry(Register receiver, Register ic_klass) { + Unimplemented(); // Currently unused. + //if (C1Breakpoint) illtrap(); + //inline_cache_check(receiver, ic_klass); +} + + +void C1_MacroAssembler::verified_entry() { + if (C1Breakpoint) illtrap(); + // build frame +} + + +void C1_MacroAssembler::lock_object(Register Rmark, Register Roop, Register Rbox, Register Rscratch, Label& slow_case) { + assert_different_registers(Rmark, Roop, Rbox, Rscratch); + + Label done, cas_failed, slow_int; + + // The following move must be the first instruction of emitted since debug + // information may be generated for it. + // Load object header. + ld(Rmark, oopDesc::mark_offset_in_bytes(), Roop); + + verify_oop(Roop); + + // Save object being locked into the BasicObjectLock... + std(Roop, BasicObjectLock::obj_offset_in_bytes(), Rbox); + + if (UseBiasedLocking) { + biased_locking_enter(CCR0, Roop, Rmark, Rscratch, R0, done, &slow_int); + } + + // ... and mark it unlocked. + ori(Rmark, Rmark, markOopDesc::unlocked_value); + + // Save unlocked object header into the displaced header location on the stack. + std(Rmark, BasicLock::displaced_header_offset_in_bytes(), Rbox); + + // Compare object markOop with Rmark and if equal exchange Rscratch with object markOop. + assert(oopDesc::mark_offset_in_bytes() == 0, "cas must take a zero displacement"); + cmpxchgd(/*flag=*/CCR0, + /*current_value=*/Rscratch, + /*compare_value=*/Rmark, + /*exchange_value=*/Rbox, + /*where=*/Roop/*+0==mark_offset_in_bytes*/, + MacroAssembler::MemBarRel | MacroAssembler::MemBarAcq, + MacroAssembler::cmpxchgx_hint_acquire_lock(), + noreg, + &cas_failed, + /*check without membar and ldarx first*/true); + // If compare/exchange succeeded we found an unlocked object and we now have locked it + // hence we are done. + b(done); + + bind(slow_int); + b(slow_case); // far + + bind(cas_failed); + // We did not find an unlocked object so see if this is a recursive case. + sub(Rscratch, Rscratch, R1_SP); + load_const_optimized(R0, (~(os::vm_page_size()-1) | markOopDesc::lock_mask_in_place)); + and_(R0/*==0?*/, Rscratch, R0); + std(R0/*==0, perhaps*/, BasicLock::displaced_header_offset_in_bytes(), Rbox); + bne(CCR0, slow_int); + + bind(done); +} + + +void C1_MacroAssembler::unlock_object(Register Rmark, Register Roop, Register Rbox, Label& slow_case) { + assert_different_registers(Rmark, Roop, Rbox); + + Label slow_int, done; + + Address mark_addr(Roop, oopDesc::mark_offset_in_bytes()); + assert(mark_addr.disp() == 0, "cas must take a zero displacement"); + + if (UseBiasedLocking) { + // Load the object out of the BasicObjectLock. + ld(Roop, BasicObjectLock::obj_offset_in_bytes(), Rbox); + verify_oop(Roop); + biased_locking_exit(CCR0, Roop, R0, done); + } + // Test first it it is a fast recursive unlock. + ld(Rmark, BasicLock::displaced_header_offset_in_bytes(), Rbox); + cmpdi(CCR0, Rmark, 0); + beq(CCR0, done); + if (!UseBiasedLocking) { + // Load object. + ld(Roop, BasicObjectLock::obj_offset_in_bytes(), Rbox); + verify_oop(Roop); + } + + // Check if it is still a light weight lock, this is is true if we see + // the stack address of the basicLock in the markOop of the object. + cmpxchgd(/*flag=*/CCR0, + /*current_value=*/R0, + /*compare_value=*/Rbox, + /*exchange_value=*/Rmark, + /*where=*/Roop, + MacroAssembler::MemBarRel, + MacroAssembler::cmpxchgx_hint_release_lock(), + noreg, + &slow_int); + b(done); + bind(slow_int); + b(slow_case); // far + + // Done + bind(done); +} + + +void C1_MacroAssembler::try_allocate( + Register obj, // result: pointer to object after successful allocation + Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise + int con_size_in_bytes, // object size in bytes if known at compile time + Register t1, // temp register, must be global register for incr_allocated_bytes + Register t2, // temp register + Label& slow_case // continuation point if fast allocation fails +) { + if (UseTLAB) { + tlab_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, slow_case); + } else { + eden_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, t2, slow_case); + RegisterOrConstant size_in_bytes = var_size_in_bytes->is_valid() + ? RegisterOrConstant(var_size_in_bytes) + : RegisterOrConstant(con_size_in_bytes); + incr_allocated_bytes(size_in_bytes, t1, t2); + } +} + + +void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register len, Register t1, Register t2) { + assert_different_registers(obj, klass, len, t1, t2); + if (UseBiasedLocking && !len->is_valid()) { + ld(t1, in_bytes(Klass::prototype_header_offset()), klass); + } else { + load_const_optimized(t1, (intx)markOopDesc::prototype()); + } + std(t1, oopDesc::mark_offset_in_bytes(), obj); + store_klass(obj, klass); + if (len->is_valid()) { + stw(len, arrayOopDesc::length_offset_in_bytes(), obj); + } else if (UseCompressedClassPointers) { + // Otherwise length is in the class gap. + store_klass_gap(obj); + } +} + + +void C1_MacroAssembler::initialize_body(Register base, Register index) { + assert_different_registers(base, index); + srdi(index, index, LogBytesPerWord); + clear_memory_doubleword(base, index); +} + +void C1_MacroAssembler::initialize_body(Register obj, Register tmp1, Register tmp2, + int obj_size_in_bytes, int hdr_size_in_bytes) { + const int index = (obj_size_in_bytes - hdr_size_in_bytes) / HeapWordSize; + + const int cl_size = VM_Version::L1_data_cache_line_size(), + cl_dwords = cl_size>>3, + cl_dw_addr_bits = exact_log2(cl_dwords); + + const Register tmp = R0, + base_ptr = tmp1, + cnt_dwords = tmp2; + + if (index <= 6) { + // Use explicit NULL stores. + if (index > 0) { li(tmp, 0); } + for (int i = 0; i < index; ++i) { std(tmp, hdr_size_in_bytes + i * HeapWordSize, obj); } + + } else if (index < (2<0). + andi(cnt_dwords, cnt_dwords, cl_dwords-1); // Rest in dwords. + mtctr(tmp); // Load counter. + + bind(fastloop); + dcbz(base_ptr); // Clear 128byte aligned block. + addi(base_ptr, base_ptr, cl_size); + bdnz(fastloop); + + cmpdi(CCR0, cnt_dwords, 0); // size 0? + beq(CCR0, done); // rest == 0 + li(tmp, 0); + mtctr(cnt_dwords); // Load counter. + + bind(restloop); // Clear rest. + std(tmp, 0, base_ptr); // Clear 8byte aligned block. + addi(base_ptr, base_ptr, 8); + bdnz(restloop); + + bind(done); + } +} + +void C1_MacroAssembler::allocate_object( + Register obj, // result: pointer to object after successful allocation + Register t1, // temp register + Register t2, // temp register + Register t3, // temp register + int hdr_size, // object header size in words + int obj_size, // object size in words + Register klass, // object klass + Label& slow_case // continuation point if fast allocation fails +) { + assert_different_registers(obj, t1, t2, t3, klass); + + // allocate space & initialize header + if (!is_simm16(obj_size * wordSize)) { + // Would need to use extra register to load + // object size => go the slow case for now. + b(slow_case); + return; + } + try_allocate(obj, noreg, obj_size * wordSize, t2, t3, slow_case); + + initialize_object(obj, klass, noreg, obj_size * HeapWordSize, t1, t2); +} + +void C1_MacroAssembler::initialize_object( + Register obj, // result: pointer to object after successful allocation + Register klass, // object klass + Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise + int con_size_in_bytes, // object size in bytes if known at compile time + Register t1, // temp register + Register t2 // temp register + ) { + const int hdr_size_in_bytes = instanceOopDesc::header_size() * HeapWordSize; + + initialize_header(obj, klass, noreg, t1, t2); + +#ifdef ASSERT + { + lwz(t1, in_bytes(Klass::layout_helper_offset()), klass); + if (var_size_in_bytes != noreg) { + cmpw(CCR0, t1, var_size_in_bytes); + } else { + cmpwi(CCR0, t1, con_size_in_bytes); + } + asm_assert_eq("bad size in initialize_object", 0x753); + } +#endif + + // Initialize body. + if (var_size_in_bytes != noreg) { + // Use a loop. + addi(t1, obj, hdr_size_in_bytes); // Compute address of first element. + addi(t2, var_size_in_bytes, -hdr_size_in_bytes); // Compute size of body. + initialize_body(t1, t2); + } else if (con_size_in_bytes > hdr_size_in_bytes) { + // Use a loop. + initialize_body(obj, t1, t2, con_size_in_bytes, hdr_size_in_bytes); + } + + if (CURRENT_ENV->dtrace_alloc_probes()) { + Unimplemented(); +// assert(obj == O0, "must be"); +// call(CAST_FROM_FN_PTR(address, Runtime1::entry_for(Runtime1::dtrace_object_alloc_id)), +// relocInfo::runtime_call_type); + } + + verify_oop(obj); +} + + +void C1_MacroAssembler::allocate_array( + Register obj, // result: pointer to array after successful allocation + Register len, // array length + Register t1, // temp register + Register t2, // temp register + Register t3, // temp register + int hdr_size, // object header size in words + int elt_size, // element size in bytes + Register klass, // object klass + Label& slow_case // continuation point if fast allocation fails +) { + assert_different_registers(obj, len, t1, t2, t3, klass); + + // Determine alignment mask. + assert(!(BytesPerWord & 1), "must be a multiple of 2 for masking code to work"); + int log2_elt_size = exact_log2(elt_size); + + // Check for negative or excessive length. + size_t max_length = max_array_allocation_length >> log2_elt_size; + if (UseTLAB) { + size_t max_tlab = align_size_up(ThreadLocalAllocBuffer::max_size() >> log2_elt_size, 64*K); + if (max_tlab < max_length) { max_length = max_tlab; } + } + load_const_optimized(t1, max_length); + cmpld(CCR0, len, t1); + bc_far_optimized(Assembler::bcondCRbiIs1, bi0(CCR0, Assembler::greater), slow_case); + + // compute array size + // note: If 0 <= len <= max_length, len*elt_size + header + alignment is + // smaller or equal to the largest integer; also, since top is always + // aligned, we can do the alignment here instead of at the end address + // computation. + const Register arr_size = t1; + Register arr_len_in_bytes = len; + if (elt_size != 1) { + sldi(t1, len, log2_elt_size); + arr_len_in_bytes = t1; + } + addi(arr_size, arr_len_in_bytes, hdr_size * wordSize + MinObjAlignmentInBytesMask); // Add space for header & alignment. + clrrdi(arr_size, arr_size, LogMinObjAlignmentInBytes); // Align array size. + + // Allocate space & initialize header. + if (UseTLAB) { + tlab_allocate(obj, arr_size, 0, t2, slow_case); + } else { + eden_allocate(obj, arr_size, 0, t2, t3, slow_case); + } + initialize_header(obj, klass, len, t2, t3); + + // Initialize body. + const Register base = t2; + const Register index = t3; + addi(base, obj, hdr_size * wordSize); // compute address of first element + addi(index, arr_size, -(hdr_size * wordSize)); // compute index = number of bytes to clear + initialize_body(base, index); + + if (CURRENT_ENV->dtrace_alloc_probes()) { + Unimplemented(); + //assert(obj == O0, "must be"); + //call(CAST_FROM_FN_PTR(address, Runtime1::entry_for(Runtime1::dtrace_object_alloc_id)), + // relocInfo::runtime_call_type); + } + + verify_oop(obj); +} + + +#ifndef PRODUCT + +void C1_MacroAssembler::verify_stack_oop(int stack_offset) { + verify_oop_addr((RegisterOrConstant)(stack_offset + STACK_BIAS), R1_SP, "broken oop in stack slot"); +} + +void C1_MacroAssembler::verify_not_null_oop(Register r) { + Label not_null; + cmpdi(CCR0, r, 0); + bne(CCR0, not_null); + stop("non-null oop required"); + bind(not_null); + if (!VerifyOops) return; + verify_oop(r); +} + +#endif // PRODUCT + +void C1_MacroAssembler::null_check(Register r, Label* Lnull) { + if (TrapBasedNullChecks) { // SIGTRAP based + trap_null_check(r); + } else { // explicit + //const address exception_entry = Runtime1::entry_for(Runtime1::throw_null_pointer_exception_id); + assert(Lnull != NULL, "must have Label for explicit check"); + cmpdi(CCR0, r, 0); + bc_far_optimized(Assembler::bcondCRbiIs1, bi0(CCR0, Assembler::equal), *Lnull); + } +} + +address C1_MacroAssembler::call_c_with_frame_resize(address dest, int frame_resize) { + if (frame_resize) { resize_frame(-frame_resize, R0); } +#if defined(ABI_ELFv2) + address return_pc = call_c(dest, relocInfo::runtime_call_type); +#else + address return_pc = call_c(CAST_FROM_FN_PTR(FunctionDescriptor*, dest), relocInfo::runtime_call_type); +#endif + if (frame_resize) { resize_frame(frame_resize, R0); } + return return_pc; +} diff --git a/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.hpp new file mode 100644 index 00000000000..9989baa8700 --- /dev/null +++ b/hotspot/src/cpu/ppc/vm/c1_MacroAssembler_ppc.hpp @@ -0,0 +1,93 @@ +/* + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef CPU_PPC_VM_C1_MACROASSEMBLER_PPC_HPP +#define CPU_PPC_VM_C1_MACROASSEMBLER_PPC_HPP + + void pd_init() { /* nothing to do */ } + + public: + void try_allocate( + Register obj, // result: pointer to object after successful allocation + Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise + int con_size_in_bytes, // object size in bytes if known at compile time + Register t1, // temp register + Register t2, // temp register + Label& slow_case // continuation point if fast allocation fails + ); + + void initialize_header(Register obj, Register klass, Register len, Register t1, Register t2); + void initialize_body(Register base, Register index); + void initialize_body(Register obj, Register tmp1, Register tmp2, int obj_size_in_bytes, int hdr_size_in_bytes); + + // locking/unlocking + void lock_object (Register Rmark, Register Roop, Register Rbox, Register Rscratch, Label& slow_case); + void unlock_object(Register Rmark, Register Roop, Register Rbox, Label& slow_case); + + void initialize_object( + Register obj, // result: pointer to object after successful allocation + Register klass, // object klass + Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise + int con_size_in_bytes, // object size in bytes if known at compile time + Register t1, // temp register + Register t2 // temp register + ); + + // Allocation of fixed-size objects + // (Can also be used to allocate fixed-size arrays, by setting + // hdr_size correctly and storing the array length afterwards.) + void allocate_object( + Register obj, // result: pointer to object after successful allocation + Register t1, // temp register + Register t2, // temp register + Register t3, // temp register + int hdr_size, // object header size in words + int obj_size, // object size in words + Register klass, // object klass + Label& slow_case // continuation point if fast allocation fails + ); + + enum { + max_array_allocation_length = 0x40000000 // ppc friendly value, requires lis only + }; + + // Allocation of arrays + void allocate_array( + Register obj, // result: pointer to array after successful allocation + Register len, // array length + Register t1, // temp register + Register t2, // temp register + Register t3, // temp register + int hdr_size, // object header size in words + int elt_size, // element size in bytes + Register klass, // object klass + Label& slow_case // continuation point if fast allocation fails + ); + + void null_check(Register r, Label *Lnull = NULL); + + address call_c_with_frame_resize(address dest, int frame_resize); + +#endif // CPU_PPC_VM_C1_MACROASSEMBLER_PPC_HPP diff --git a/hotspot/src/cpu/ppc/vm/c1_Runtime1_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_Runtime1_ppc.cpp new file mode 100644 index 00000000000..5fbaa4beb4e --- /dev/null +++ b/hotspot/src/cpu/ppc/vm/c1_Runtime1_ppc.cpp @@ -0,0 +1,1020 @@ +/* + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "c1/c1_Defs.hpp" +#include "c1/c1_MacroAssembler.hpp" +#include "c1/c1_Runtime1.hpp" +#include "interpreter/interpreter.hpp" +#include "nativeInst_ppc.hpp" +#include "oops/compiledICHolder.hpp" +#include "oops/oop.inline.hpp" +#include "prims/jvmtiExport.hpp" +#include "register_ppc.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/signature.hpp" +#include "runtime/vframeArray.hpp" +#include "utilities/macros.hpp" +#include "vmreg_ppc.inline.hpp" +#if INCLUDE_ALL_GCS +#include "gc/g1/g1SATBCardTableModRefBS.hpp" +#endif + +// Implementation of StubAssembler + +int StubAssembler::call_RT(Register oop_result1, Register metadata_result, + address entry_point, int number_of_arguments) { + set_num_rt_args(0); // Nothing on stack + assert(!(oop_result1->is_valid() || metadata_result->is_valid()) || + oop_result1 != metadata_result, "registers must be different"); + + // Currently no stack banging. We assume that there are enough + // StackShadowPages (which have been banged in generate_stack_overflow_check) + // for the stub frame and the runtime frames. + + set_last_Java_frame(R1_SP, noreg); + + // ARG1 must hold thread address. + mr(R3_ARG1, R16_thread); + + address return_pc = call_c_with_frame_resize(entry_point, /*No resize, we have a C compatible frame.*/0); + + reset_last_Java_frame(); + + // Check for pending exceptions. + { + ld(R0, in_bytes(Thread::pending_exception_offset()), R16_thread); + cmpdi(CCR0, R0, 0); + + // This used to conditionally jump to forward_exception however it is + // possible if we relocate that the branch will not reach. So we must jump + // around so we can always reach. + + Label ok; + beq(CCR0, ok); + + // Make sure that the vm_results are cleared. + if (oop_result1->is_valid() || metadata_result->is_valid()) { + li(R0, 0); + if (oop_result1->is_valid()) { + std(R0, in_bytes(JavaThread::vm_result_offset()), R16_thread); + } + if (metadata_result->is_valid()) { + std(R0, in_bytes(JavaThread::vm_result_2_offset()), R16_thread); + } + } + + if (frame_size() == no_frame_size) { + ShouldNotReachHere(); // We always have a frame size. + //pop_frame(); // pop the stub frame + //ld(R0, _abi(lr), R1_SP); + //mtlr(R0); + //load_const_optimized(R0, StubRoutines::forward_exception_entry()); + //mtctr(R0); + //bctr(); + } else if (_stub_id == Runtime1::forward_exception_id) { + should_not_reach_here(); + } else { + // keep stub frame for next call_RT + //load_const_optimized(R0, Runtime1::entry_for(Runtime1::forward_exception_id)); + add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(Runtime1::entry_for(Runtime1::forward_exception_id))); + mtctr(R0); + bctr(); + } + + bind(ok); + } + + // Get oop results if there are any and reset the values in the thread. + if (oop_result1->is_valid()) { + get_vm_result(oop_result1); + } + if (metadata_result->is_valid()) { + get_vm_result_2(metadata_result); + } + + return (int)(return_pc - code_section()->start()); +} + + +int StubAssembler::call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1) { + mr_if_needed(R4_ARG2, arg1); + return call_RT(oop_result1, metadata_result, entry, 1); +} + + +int StubAssembler::call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1, Register arg2) { + mr_if_needed(R4_ARG2, arg1); + mr_if_needed(R5_ARG3, arg2); assert(arg2 != R4_ARG2, "smashed argument"); + return call_RT(oop_result1, metadata_result, entry, 2); +} + + +int StubAssembler::call_RT(Register oop_result1, Register metadata_result, address entry, Register arg1, Register arg2, Register arg3) { + mr_if_needed(R4_ARG2, arg1); + mr_if_needed(R5_ARG3, arg2); assert(arg2 != R4_ARG2, "smashed argument"); + mr_if_needed(R6_ARG4, arg3); assert(arg3 != R4_ARG2 && arg3 != R5_ARG3, "smashed argument"); + return call_RT(oop_result1, metadata_result, entry, 3); +} + + +// Implementation of Runtime1 + +#define __ sasm-> + +static int cpu_reg_save_offsets[FrameMap::nof_cpu_regs]; +static int fpu_reg_save_offsets[FrameMap::nof_fpu_regs]; +static int frame_size_in_bytes = -1; + +static OopMap* generate_oop_map(StubAssembler* sasm, bool save_fpu_registers) { + assert(frame_size_in_bytes > frame::abi_reg_args_size, "init"); + sasm->set_frame_size(frame_size_in_bytes / BytesPerWord); + int frame_size_in_slots = frame_size_in_bytes / sizeof(jint); + OopMap* oop_map = new OopMap(frame_size_in_slots, 0); + + int i; + for (i = 0; i < FrameMap::nof_cpu_regs; i++) { + Register r = as_Register(i); + if (FrameMap::reg_needs_save(r)) { + int sp_offset = cpu_reg_save_offsets[i]; + oop_map->set_callee_saved(VMRegImpl::stack2reg(sp_offset>>2), r->as_VMReg()); + oop_map->set_callee_saved(VMRegImpl::stack2reg((sp_offset>>2) + 1), r->as_VMReg()->next()); + } + } + + if (save_fpu_registers) { + for (i = 0; i < FrameMap::nof_fpu_regs; i++) { + FloatRegister r = as_FloatRegister(i); + int sp_offset = fpu_reg_save_offsets[i]; + oop_map->set_callee_saved(VMRegImpl::stack2reg(sp_offset>>2), r->as_VMReg()); + oop_map->set_callee_saved(VMRegImpl::stack2reg((sp_offset>>2) + 1), r->as_VMReg()->next()); + } + } + + return oop_map; +} + +static OopMap* save_live_registers(StubAssembler* sasm, bool save_fpu_registers = true, + Register ret_pc = noreg, int stack_preserve = 0) { + if (ret_pc == noreg) { + ret_pc = R0; + __ mflr(ret_pc); + } + __ std(ret_pc, _abi(lr), R1_SP); // C code needs pc in C1 method. + __ push_frame(frame_size_in_bytes + stack_preserve, R0); + + // Record volatile registers as callee-save values in an OopMap so + // their save locations will be propagated to the caller frame's + // RegisterMap during StackFrameStream construction (needed for + // deoptimization; see compiledVFrame::create_stack_value). + // OopMap frame sizes are in c2 stack slot sizes (sizeof(jint)). + + int i; + for (i = 0; i < FrameMap::nof_cpu_regs; i++) { + Register r = as_Register(i); + if (FrameMap::reg_needs_save(r)) { + int sp_offset = cpu_reg_save_offsets[i]; + __ std(r, sp_offset + STACK_BIAS, R1_SP); + } + } + + if (save_fpu_registers) { + for (i = 0; i < FrameMap::nof_fpu_regs; i++) { + FloatRegister r = as_FloatRegister(i); + int sp_offset = fpu_reg_save_offsets[i]; + __ stfd(r, sp_offset + STACK_BIAS, R1_SP); + } + } + + return generate_oop_map(sasm, save_fpu_registers); +} + +static void restore_live_registers(StubAssembler* sasm, Register result1, Register result2, + bool restore_fpu_registers = true) { + for (int i = 0; i < FrameMap::nof_cpu_regs; i++) { + Register r = as_Register(i); + if (FrameMap::reg_needs_save(r) && r != result1 && r != result2) { + int sp_offset = cpu_reg_save_offsets[i]; + __ ld(r, sp_offset + STACK_BIAS, R1_SP); + } + } + + if (restore_fpu_registers) { + for (int i = 0; i < FrameMap::nof_fpu_regs; i++) { + FloatRegister r = as_FloatRegister(i); + int sp_offset = fpu_reg_save_offsets[i]; + __ lfd(r, sp_offset + STACK_BIAS, R1_SP); + } + } + + __ pop_frame(); + __ ld(R0, _abi(lr), R1_SP); + __ mtlr(R0); +} + + +void Runtime1::initialize_pd() { + int i; + int sp_offset = frame::abi_reg_args_size; + + for (i = 0; i < FrameMap::nof_cpu_regs; i++) { + Register r = as_Register(i); + if (FrameMap::reg_needs_save(r)) { + cpu_reg_save_offsets[i] = sp_offset; + sp_offset += BytesPerWord; + } + } + + for (i = 0; i < FrameMap::nof_fpu_regs; i++) { + fpu_reg_save_offsets[i] = sp_offset; + sp_offset += BytesPerWord; + } + frame_size_in_bytes = align_size_up(sp_offset, frame::alignment_in_bytes); +} + + +OopMapSet* Runtime1::generate_exception_throw(StubAssembler* sasm, address target, bool has_argument) { + // Make a frame and preserve the caller's caller-save registers. + OopMap* oop_map = save_live_registers(sasm); + + int call_offset; + if (!has_argument) { + call_offset = __ call_RT(noreg, noreg, target); + } else { + call_offset = __ call_RT(noreg, noreg, target, R4_ARG2); + } + OopMapSet* oop_maps = new OopMapSet(); + oop_maps->add_gc_map(call_offset, oop_map); + + __ should_not_reach_here(); + return oop_maps; +} + +static OopMapSet* generate_exception_throw_with_stack_parms(StubAssembler* sasm, address target, + int stack_parms) { + // Make a frame and preserve the caller's caller-save registers. + const int parm_size_in_bytes = align_size_up(stack_parms << LogBytesPerWord, frame::alignment_in_bytes); + const int padding = parm_size_in_bytes - (stack_parms << LogBytesPerWord); + OopMap* oop_map = save_live_registers(sasm, true, noreg, parm_size_in_bytes); + + int call_offset = 0; + switch (stack_parms) { + case 3: + __ ld(R6_ARG4, frame_size_in_bytes + padding + 16, R1_SP); + case 2: + __ ld(R5_ARG3, frame_size_in_bytes + padding + 8, R1_SP); + case 1: + __ ld(R4_ARG2, frame_size_in_bytes + padding + 0, R1_SP); + call_offset = __ call_RT(noreg, noreg, target); + break; + default: Unimplemented(); break; + } + OopMapSet* oop_maps = new OopMapSet(); + oop_maps->add_gc_map(call_offset, oop_map); + + __ should_not_reach_here(); + return oop_maps; +} + + +OopMapSet* Runtime1::generate_stub_call(StubAssembler* sasm, Register result, address target, + Register arg1, Register arg2, Register arg3) { + // Make a frame and preserve the caller's caller-save registers. + OopMap* oop_map = save_live_registers(sasm); + + int call_offset; + if (arg1 == noreg) { + call_offset = __ call_RT(result, noreg, target); + } else if (arg2 == noreg) { + call_offset = __ call_RT(result, noreg, target, arg1); + } else if (arg3 == noreg) { + call_offset = __ call_RT(result, noreg, target, arg1, arg2); + } else { + call_offset = __ call_RT(result, noreg, target, arg1, arg2, arg3); + } + OopMapSet* oop_maps = new OopMapSet(); + oop_maps->add_gc_map(call_offset, oop_map); + + restore_live_registers(sasm, result, noreg); + __ blr(); + return oop_maps; +} + +static OopMapSet* stub_call_with_stack_parms(StubAssembler* sasm, Register result, address target, + int stack_parms, bool do_return = true) { + // Make a frame and preserve the caller's caller-save registers. + const int parm_size_in_bytes = align_size_up(stack_parms << LogBytesPerWord, frame::alignment_in_bytes); + const int padding = parm_size_in_bytes - (stack_parms << LogBytesPerWord); + OopMap* oop_map = save_live_registers(sasm, true, noreg, parm_size_in_bytes); + + int call_offset = 0; + switch (stack_parms) { + case 3: + __ ld(R6_ARG4, frame_size_in_bytes + padding + 16, R1_SP); + case 2: + __ ld(R5_ARG3, frame_size_in_bytes + padding + 8, R1_SP); + case 1: + __ ld(R4_ARG2, frame_size_in_bytes + padding + 0, R1_SP); + call_offset = __ call_RT(result, noreg, target); + break; + default: Unimplemented(); break; + } + OopMapSet* oop_maps = new OopMapSet(); + oop_maps->add_gc_map(call_offset, oop_map); + + restore_live_registers(sasm, result, noreg); + if (do_return) __ blr(); + return oop_maps; +} + + +OopMapSet* Runtime1::generate_patching(StubAssembler* sasm, address target) { + // Make a frame and preserve the caller's caller-save registers. + OopMap* oop_map = save_live_registers(sasm); + + // Call the runtime patching routine, returns non-zero if nmethod got deopted. + int call_offset = __ call_RT(noreg, noreg, target); + OopMapSet* oop_maps = new OopMapSet(); + oop_maps->add_gc_map(call_offset, oop_map); + __ cmpdi(CCR0, R3_RET, 0); + + // Re-execute the patched instruction or, if the nmethod was deoptmized, + // return to the deoptimization handler entry that will cause re-execution + // of the current bytecode. + DeoptimizationBlob* deopt_blob = SharedRuntime::deopt_blob(); + assert(deopt_blob != NULL, "deoptimization blob must have been created"); + + // Return to the deoptimization handler entry for unpacking and rexecute. + // If we simply returned the we'd deopt as if any call we patched had just + // returned. + + restore_live_registers(sasm, noreg, noreg); + // Return if patching routine returned 0. + __ bclr(Assembler::bcondCRbiIs1, Assembler::bi0(CCR0, Assembler::equal), Assembler::bhintbhBCLRisReturn); + + address stub = deopt_blob->unpack_with_reexecution(); + //__ load_const_optimized(R0, stub); + __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub)); + __ mtctr(R0); + __ bctr(); + + return oop_maps; +} + +OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { + OopMapSet* oop_maps = NULL; + + // For better readability. + const bool must_gc_arguments = true; + const bool dont_gc_arguments = false; + + // Stub code & info for the different stubs. + switch (id) { + case forward_exception_id: + { + oop_maps = generate_handle_exception(id, sasm); + } + break; + + case new_instance_id: + case fast_new_instance_id: + case fast_new_instance_init_check_id: + { + if (id == new_instance_id) { + __ set_info("new_instance", dont_gc_arguments); + } else if (id == fast_new_instance_id) { + __ set_info("fast new_instance", dont_gc_arguments); + } else { + assert(id == fast_new_instance_init_check_id, "bad StubID"); + __ set_info("fast new_instance init check", dont_gc_arguments); + } + // We don't support eden allocation. +// if ((id == fast_new_instance_id || id == fast_new_instance_init_check_id) && +// UseTLAB && FastTLABRefill) { +// if (id == fast_new_instance_init_check_id) { +// // make sure the klass is initialized +// __ lbz(R0, in_bytes(InstanceKlass::init_state_offset()), R3_ARG1); +// __ cmpwi(CCR0, R0, InstanceKlass::fully_initialized); +// __ bne(CCR0, slow_path); +// } +//#ifdef ASSERT +// // assert object can be fast path allocated +// { +// Label ok, not_ok; +// __ lwz(R0, in_bytes(Klass::layout_helper_offset()), R3_ARG1); +// // make sure it's an instance (LH > 0) +// __ cmpwi(CCR0, R0, 0); +// __ ble(CCR0, not_ok); +// __ testbitdi(CCR0, R0, R0, Klass::_lh_instance_slow_path_bit); +// __ beq(CCR0, ok); +// +// __ bind(not_ok); +// __ stop("assert(can be fast path allocated)"); +// __ bind(ok); +// } +//#endif // ASSERT +// // We don't support eden allocation. +// __ bind(slow_path); +// } + oop_maps = generate_stub_call(sasm, R3_RET, CAST_FROM_FN_PTR(address, new_instance), R4_ARG2); + } + break; + + case counter_overflow_id: + // Bci and method are on stack. + oop_maps = stub_call_with_stack_parms(sasm, noreg, CAST_FROM_FN_PTR(address, counter_overflow), 2); + break; + + case new_type_array_id: + case new_object_array_id: + { + if (id == new_type_array_id) { + __ set_info("new_type_array", dont_gc_arguments); + } else { + __ set_info("new_object_array", dont_gc_arguments); + } + +#ifdef ASSERT + // Assert object type is really an array of the proper kind. + { + int tag = (id == new_type_array_id) ? Klass::_lh_array_tag_type_value : Klass::_lh_array_tag_obj_value; + Label ok; + __ lwz(R0, in_bytes(Klass::layout_helper_offset()), R4_ARG2); + __ srawi(R0, R0, Klass::_lh_array_tag_shift); + __ cmpwi(CCR0, R0, tag); + __ beq(CCR0, ok); + __ stop("assert(is an array klass)"); + __ should_not_reach_here(); + __ bind(ok); + } +#endif // ASSERT + + // We don't support eden allocation. + + if (id == new_type_array_id) { + oop_maps = generate_stub_call(sasm, R3_RET, CAST_FROM_FN_PTR(address, new_type_array), R4_ARG2, R5_ARG3); + } else { + oop_maps = generate_stub_call(sasm, R3_RET, CAST_FROM_FN_PTR(address, new_object_array), R4_ARG2, R5_ARG3); + } + } + break; + + case new_multi_array_id: + { + // R4: klass + // R5: rank + // R6: address of 1st dimension + __ set_info("new_multi_array", dont_gc_arguments); + oop_maps = generate_stub_call(sasm, R3_RET, CAST_FROM_FN_PTR(address, new_multi_array), R4_ARG2, R5_ARG3, R6_ARG4); + } + break; + + case register_finalizer_id: + { + __ set_info("register_finalizer", dont_gc_arguments); + // This code is called via rt_call. Hence, caller-save registers have been saved. + Register t = R11_scratch1; + + // Load the klass and check the has finalizer flag. + __ load_klass(t, R3_ARG1); + __ lwz(t, in_bytes(Klass::access_flags_offset()), t); + __ testbitdi(CCR0, R0, t, exact_log2(JVM_ACC_HAS_FINALIZER)); + // Return if has_finalizer bit == 0 (CR0.eq). + __ bclr(Assembler::bcondCRbiIs1, Assembler::bi0(CCR0, Assembler::equal), Assembler::bhintbhBCLRisReturn); + + __ mflr(R0); + __ std(R0, _abi(lr), R1_SP); + __ push_frame(frame::abi_reg_args_size, R0); // Empty dummy frame (no callee-save regs). + sasm->set_frame_size(frame::abi_reg_args_size / BytesPerWord); + OopMap* oop_map = new OopMap(frame::abi_reg_args_size / sizeof(jint), 0); + int call_offset = __ call_RT(noreg, noreg, + CAST_FROM_FN_PTR(address, SharedRuntime::register_finalizer), R3_ARG1); + oop_maps = new OopMapSet(); + oop_maps->add_gc_map(call_offset, oop_map); + + __ pop_frame(); + __ ld(R0, _abi(lr), R1_SP); + __ mtlr(R0); + __ blr(); + } + break; + + case throw_range_check_failed_id: + { + __ set_info("range_check_failed", dont_gc_arguments); // Arguments will be discarded. + __ std(R0, -8, R1_SP); // Pass index on stack. + oop_maps = generate_exception_throw_with_stack_parms(sasm, CAST_FROM_FN_PTR(address, throw_range_check_exception), 1); + } + break; + + case throw_index_exception_id: + { + __ set_info("index_range_check_failed", dont_gc_arguments); // Arguments will be discarded. + oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_index_exception), true); + } + break; + + case throw_div0_exception_id: + { + __ set_info("throw_div0_exception", dont_gc_arguments); + oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_div0_exception), false); + } + break; + + case throw_null_pointer_exception_id: + { + __ set_info("throw_null_pointer_exception", dont_gc_arguments); + oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_null_pointer_exception), false); + } + break; + + case handle_exception_nofpu_id: + case handle_exception_id: + { + __ set_info("handle_exception", dont_gc_arguments); + oop_maps = generate_handle_exception(id, sasm); + } + break; + + case handle_exception_from_callee_id: + { + __ set_info("handle_exception_from_callee", dont_gc_arguments); + oop_maps = generate_handle_exception(id, sasm); + } + break; + + case unwind_exception_id: + { + const Register Rexception = R3 /*LIRGenerator::exceptionOopOpr()*/, + Rexception_pc = R4 /*LIRGenerator::exceptionPcOpr()*/, + Rexception_save = R31, Rcaller_sp = R30; + __ set_info("unwind_exception", dont_gc_arguments); + + __ ld(Rcaller_sp, 0, R1_SP); + __ push_frame_reg_args(0, R0); // dummy frame for C call + __ mr(Rexception_save, Rexception); // save over C call + __ ld(Rexception_pc, _abi(lr), Rcaller_sp); // return pc + __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::exception_handler_for_return_address), R16_thread, Rexception_pc); + __ verify_not_null_oop(Rexception_save); + __ mtctr(R3_RET); + __ ld(Rexception_pc, _abi(lr), Rcaller_sp); // return pc + __ mr(R1_SP, Rcaller_sp); // Pop both frames at once. + __ mr(Rexception, Rexception_save); // restore + __ mtlr(Rexception_pc); + __ bctr(); + } + break; + + case throw_array_store_exception_id: + { + __ set_info("throw_array_store_exception", dont_gc_arguments); + oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_array_store_exception), true); + } + break; + + case throw_class_cast_exception_id: + { + __ set_info("throw_class_cast_exception", dont_gc_arguments); + oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_class_cast_exception), true); + } + break; + + case throw_incompatible_class_change_error_id: + { + __ set_info("throw_incompatible_class_cast_exception", dont_gc_arguments); + oop_maps = generate_exception_throw(sasm, CAST_FROM_FN_PTR(address, throw_incompatible_class_change_error), false); + } + break; + + case slow_subtype_check_id: + { // Support for uint StubRoutine::partial_subtype_check( Klass sub, Klass super ); + const Register sub_klass = R5, + super_klass = R4, + temp1_reg = R6, + temp2_reg = R0; + __ check_klass_subtype_slow_path(sub_klass, super_klass, temp1_reg, temp2_reg); // returns with CR0.eq if successful + __ crandc(CCR0, Assembler::equal, CCR0, Assembler::equal); // failed: CR0.ne + __ blr(); + } + break; + + case monitorenter_nofpu_id: + case monitorenter_id: + { + __ set_info("monitorenter", dont_gc_arguments); + + int save_fpu_registers = (id == monitorenter_id); + // Make a frame and preserve the caller's caller-save registers. + OopMap* oop_map = save_live_registers(sasm, save_fpu_registers); + + int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, monitorenter), R4_ARG2, R5_ARG3); + + oop_maps = new OopMapSet(); + oop_maps->add_gc_map(call_offset, oop_map); + + restore_live_registers(sasm, noreg, noreg, save_fpu_registers); + __ blr(); + } + break; + + case monitorexit_nofpu_id: + case monitorexit_id: + { + // note: Really a leaf routine but must setup last java sp + // => use call_RT for now (speed can be improved by + // doing last java sp setup manually). + __ set_info("monitorexit", dont_gc_arguments); + + int save_fpu_registers = (id == monitorexit_id); + // Make a frame and preserve the caller's caller-save registers. + OopMap* oop_map = save_live_registers(sasm, save_fpu_registers); + + int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, monitorexit), R4_ARG2); + + oop_maps = new OopMapSet(); + oop_maps->add_gc_map(call_offset, oop_map); + + restore_live_registers(sasm, noreg, noreg, save_fpu_registers); + __ blr(); + } + break; + + case deoptimize_id: + { + __ set_info("deoptimize", dont_gc_arguments); + __ std(R0, -8, R1_SP); // Pass trap_request on stack. + oop_maps = stub_call_with_stack_parms(sasm, noreg, CAST_FROM_FN_PTR(address, deoptimize), 1, /*do_return*/ false); + + DeoptimizationBlob* deopt_blob = SharedRuntime::deopt_blob(); + assert(deopt_blob != NULL, "deoptimization blob must have been created"); + address stub = deopt_blob->unpack_with_reexecution(); + //__ load_const_optimized(R0, stub); + __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub)); + __ mtctr(R0); + __ bctr(); + } + break; + + case access_field_patching_id: + { + __ set_info("access_field_patching", dont_gc_arguments); + oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, access_field_patching)); + } + break; + + case load_klass_patching_id: + { + __ set_info("load_klass_patching", dont_gc_arguments); + oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_klass_patching)); + } + break; + + case load_mirror_patching_id: + { + __ set_info("load_mirror_patching", dont_gc_arguments); + oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_mirror_patching)); + } + break; + + case load_appendix_patching_id: + { + __ set_info("load_appendix_patching", dont_gc_arguments); + oop_maps = generate_patching(sasm, CAST_FROM_FN_PTR(address, move_appendix_patching)); + } + break; + + case dtrace_object_alloc_id: + { // O0: object + __ unimplemented("stub dtrace_object_alloc_id"); + __ set_info("dtrace_object_alloc", dont_gc_arguments); +// // We can't gc here so skip the oopmap but make sure that all +// // the live registers get saved. +// save_live_registers(sasm); +// +// __ save_thread(L7_thread_cache); +// __ call(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_object_alloc), +// relocInfo::runtime_call_type); +// __ delayed()->mov(I0, O0); +// __ restore_thread(L7_thread_cache); +// +// restore_live_registers(sasm); +// __ ret(); +// __ delayed()->restore(); + } + break; + +#if INCLUDE_ALL_GCS + case g1_pre_barrier_slow_id: + { + BarrierSet* bs = Universe::heap()->barrier_set(); + if (bs->kind() != BarrierSet::G1SATBCTLogging) { + goto unimplemented_entry; + } + + __ set_info("g1_pre_barrier_slow_id", dont_gc_arguments); + + // Using stack slots: pre_val (pre-pushed), spill tmp, spill tmp2. + const int stack_slots = 3; + Register pre_val = R0; // previous value of memory + Register tmp = R14; + Register tmp2 = R15; + + Label refill, restart; + int satb_q_index_byte_offset = + in_bytes(JavaThread::satb_mark_queue_offset() + + SATBMarkQueue::byte_offset_of_index()); + int satb_q_buf_byte_offset = + in_bytes(JavaThread::satb_mark_queue_offset() + + SATBMarkQueue::byte_offset_of_buf()); + + // Spill + __ std(tmp, -16, R1_SP); + __ std(tmp2, -24, R1_SP); + + __ bind(restart); + // Load the index into the SATB buffer. SATBMarkQueue::_index is a + // size_t so ld_ptr is appropriate. + __ ld(tmp, satb_q_index_byte_offset, R16_thread); + + // index == 0? + __ cmpdi(CCR0, tmp, 0); + __ beq(CCR0, refill); + + __ ld(tmp2, satb_q_buf_byte_offset, R16_thread); + __ ld(pre_val, -8, R1_SP); // Load from stack. + __ addi(tmp, tmp, -oopSize); + + __ std(tmp, satb_q_index_byte_offset, R16_thread); + __ stdx(pre_val, tmp2, tmp); // [_buf + index] := + + // Restore temp registers and return-from-leaf. + __ ld(tmp2, -24, R1_SP); + __ ld(tmp, -16, R1_SP); + __ blr(); + + __ bind(refill); + const int nbytes_save = (MacroAssembler::num_volatile_regs + stack_slots) * BytesPerWord; + __ save_volatile_gprs(R1_SP, -nbytes_save); // except R0 + __ mflr(R0); + __ std(R0, _abi(lr), R1_SP); + __ push_frame_reg_args(nbytes_save, R0); // dummy frame for C call + __ call_VM_leaf(CAST_FROM_FN_PTR(address, SATBMarkQueueSet::handle_zero_index_for_thread), R16_thread); + __ pop_frame(); + __ ld(R0, _abi(lr), R1_SP); + __ mtlr(R0); + __ restore_volatile_gprs(R1_SP, -nbytes_save); // except R0 + __ b(restart); + } + break; + + case g1_post_barrier_slow_id: + { + BarrierSet* bs = Universe::heap()->barrier_set(); + if (bs->kind() != BarrierSet::G1SATBCTLogging) { + goto unimplemented_entry; + } + + __ set_info("g1_post_barrier_slow_id", dont_gc_arguments); + + // Using stack slots: spill addr, spill tmp2 + const int stack_slots = 2; + Register tmp = R0; + Register addr = R14; + Register tmp2 = R15; + jbyte* byte_map_base = ((CardTableModRefBS*)bs)->byte_map_base; + + Label restart, refill, ret; + + // Spill + __ std(addr, -8, R1_SP); + __ std(tmp2, -16, R1_SP); + + __ srdi(addr, R0, CardTableModRefBS::card_shift); // Addr is passed in R0. + __ load_const_optimized(/*cardtable*/ tmp2, byte_map_base, tmp); + __ add(addr, tmp2, addr); + __ lbz(tmp, 0, addr); // tmp := [addr + cardtable] + + // Return if young card. + __ cmpwi(CCR0, tmp, G1SATBCardTableModRefBS::g1_young_card_val()); + __ beq(CCR0, ret); + + // Return if sequential consistent value is already dirty. + __ membar(Assembler::StoreLoad); + __ lbz(tmp, 0, addr); // tmp := [addr + cardtable] + + __ cmpwi(CCR0, tmp, G1SATBCardTableModRefBS::dirty_card_val()); + __ beq(CCR0, ret); + + // Not dirty. + + // First, dirty it. + __ li(tmp, G1SATBCardTableModRefBS::dirty_card_val()); + __ stb(tmp, 0, addr); + + int dirty_card_q_index_byte_offset = + in_bytes(JavaThread::dirty_card_queue_offset() + + DirtyCardQueue::byte_offset_of_index()); + int dirty_card_q_buf_byte_offset = + in_bytes(JavaThread::dirty_card_queue_offset() + + DirtyCardQueue::byte_offset_of_buf()); + + __ bind(restart); + + // Get the index into the update buffer. DirtyCardQueue::_index is + // a size_t so ld_ptr is appropriate here. + __ ld(tmp2, dirty_card_q_index_byte_offset, R16_thread); + + // index == 0? + __ cmpdi(CCR0, tmp2, 0); + __ beq(CCR0, refill); + + __ ld(tmp, dirty_card_q_buf_byte_offset, R16_thread); + __ addi(tmp2, tmp2, -oopSize); + + __ std(tmp2, dirty_card_q_index_byte_offset, R16_thread); + __ add(tmp2, tmp, tmp2); + __ std(addr, 0, tmp2); // [_buf + index] := + + // Restore temp registers and return-from-leaf. + __ bind(ret); + __ ld(tmp2, -16, R1_SP); + __ ld(addr, -8, R1_SP); + __ blr(); + + __ bind(refill); + const int nbytes_save = (MacroAssembler::num_volatile_regs + stack_slots) * BytesPerWord; + __ save_volatile_gprs(R1_SP, -nbytes_save); // except R0 + __ mflr(R0); + __ std(R0, _abi(lr), R1_SP); + __ push_frame_reg_args(nbytes_save, R0); // dummy frame for C call + __ call_VM_leaf(CAST_FROM_FN_PTR(address, DirtyCardQueueSet::handle_zero_index_for_thread), R16_thread); + __ pop_frame(); + __ ld(R0, _abi(lr), R1_SP); + __ mtlr(R0); + __ restore_volatile_gprs(R1_SP, -nbytes_save); // except R0 + __ b(restart); + } + break; +#endif // INCLUDE_ALL_GCS + + case predicate_failed_trap_id: + { + __ set_info("predicate_failed_trap", dont_gc_arguments); + OopMap* oop_map = save_live_registers(sasm); + + int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, predicate_failed_trap)); + + oop_maps = new OopMapSet(); + oop_maps->add_gc_map(call_offset, oop_map); + + DeoptimizationBlob* deopt_blob = SharedRuntime::deopt_blob(); + assert(deopt_blob != NULL, "deoptimization blob must have been created"); + restore_live_registers(sasm, noreg, noreg); + + address stub = deopt_blob->unpack_with_reexecution(); + //__ load_const_optimized(R0, stub); + __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(stub)); + __ mtctr(R0); + __ bctr(); + } + break; + + default: + unimplemented_entry: + { + __ set_info("unimplemented entry", dont_gc_arguments); + __ mflr(R0); + __ std(R0, _abi(lr), R1_SP); + __ push_frame(frame::abi_reg_args_size, R0); // empty dummy frame + sasm->set_frame_size(frame::abi_reg_args_size / BytesPerWord); + OopMap* oop_map = new OopMap(frame::abi_reg_args_size / sizeof(jint), 0); + + __ load_const_optimized(R4_ARG2, (int)id); + int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, unimplemented_entry), R4_ARG2); + + oop_maps = new OopMapSet(); + oop_maps->add_gc_map(call_offset, oop_map); + __ should_not_reach_here(); + } + break; + } + return oop_maps; +} + + +OopMapSet* Runtime1::generate_handle_exception(StubID id, StubAssembler* sasm) { + __ block_comment("generate_handle_exception"); + + // Save registers, if required. + OopMapSet* oop_maps = new OopMapSet(); + OopMap* oop_map = NULL; + const Register Rexception = R3 /*LIRGenerator::exceptionOopOpr()*/, + Rexception_pc = R4 /*LIRGenerator::exceptionPcOpr()*/; + + switch (id) { + case forward_exception_id: + // We're handling an exception in the context of a compiled frame. + // The registers have been saved in the standard places. Perform + // an exception lookup in the caller and dispatch to the handler + // if found. Otherwise unwind and dispatch to the callers + // exception handler. + oop_map = generate_oop_map(sasm, true); + // Transfer the pending exception to the exception_oop. + // Also load the PC which is typically at SP + frame_size_in_bytes + _abi(lr), + // but we support additional slots in the frame for parameter passing. + __ ld(Rexception_pc, 0, R1_SP); + __ ld(Rexception, in_bytes(JavaThread::pending_exception_offset()), R16_thread); + __ li(R0, 0); + __ ld(Rexception_pc, _abi(lr), Rexception_pc); + __ std(R0, in_bytes(JavaThread::pending_exception_offset()), R16_thread); + break; + case handle_exception_nofpu_id: + case handle_exception_id: + // At this point all registers MAY be live. + oop_map = save_live_registers(sasm, id != handle_exception_nofpu_id, Rexception_pc); + break; + case handle_exception_from_callee_id: + // At this point all registers except exception oop and exception pc are dead. + oop_map = new OopMap(frame_size_in_bytes / sizeof(jint), 0); + sasm->set_frame_size(frame_size_in_bytes / BytesPerWord); + __ std(Rexception_pc, _abi(lr), R1_SP); + __ push_frame(frame_size_in_bytes, R0); + break; + default: ShouldNotReachHere(); + } + + __ verify_not_null_oop(Rexception); + +#ifdef ASSERT + // Check that fields in JavaThread for exception oop and issuing pc are + // empty before writing to them. + __ ld(R0, in_bytes(JavaThread::exception_oop_offset()), R16_thread); + __ cmpdi(CCR0, R0, 0); + __ asm_assert_eq("exception oop already set", 0x963); + __ ld(R0, in_bytes(JavaThread::exception_pc_offset() ), R16_thread); + __ cmpdi(CCR0, R0, 0); + __ asm_assert_eq("exception pc already set", 0x962); +#endif + + // Save the exception and issuing pc in the thread. + __ std(Rexception, in_bytes(JavaThread::exception_oop_offset()), R16_thread); + __ std(Rexception_pc, in_bytes(JavaThread::exception_pc_offset() ), R16_thread); + + int call_offset = __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, exception_handler_for_pc)); + oop_maps->add_gc_map(call_offset, oop_map); + + __ mtctr(R3_RET); + + // Note: if nmethod has been deoptimized then regardless of + // whether it had a handler or not we will deoptimize + // by entering the deopt blob with a pending exception. + + // Restore the registers that were saved at the beginning, remove + // the frame and jump to the exception handler. + switch (id) { + case forward_exception_id: + case handle_exception_nofpu_id: + case handle_exception_id: + restore_live_registers(sasm, noreg, noreg, id != handle_exception_nofpu_id); + __ bctr(); + break; + case handle_exception_from_callee_id: { + __ pop_frame(); + __ ld(Rexception_pc, _abi(lr), R1_SP); + __ mtlr(Rexception_pc); + __ bctr(); + break; + } + default: ShouldNotReachHere(); + } + + return oop_maps; +} + +const char *Runtime1::pd_name_for_address(address entry) { + return ""; +} + +#undef __ diff --git a/hotspot/src/cpu/ppc/vm/c1_globals_ppc.hpp b/hotspot/src/cpu/ppc/vm/c1_globals_ppc.hpp new file mode 100644 index 00000000000..234248e387e --- /dev/null +++ b/hotspot/src/cpu/ppc/vm/c1_globals_ppc.hpp @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef CPU_PPC_VM_C1_GLOBALS_PPC_HPP +#define CPU_PPC_VM_C1_GLOBALS_PPC_HPP + +#include "utilities/globalDefinitions.hpp" +#include "utilities/macros.hpp" + +// Sets the default values for platform dependent flags used by the client compiler. +// (see c1_globals.hpp) + +#ifndef TIERED +define_pd_global(bool, BackgroundCompilation, true ); +define_pd_global(bool, CICompileOSR, true ); +define_pd_global(bool, InlineIntrinsics, true ); +define_pd_global(bool, PreferInterpreterNativeStubs, false); +define_pd_global(bool, ProfileTraps, false); +define_pd_global(bool, UseOnStackReplacement, true ); +define_pd_global(bool, TieredCompilation, false); +define_pd_global(intx, CompileThreshold, 1000 ); + +define_pd_global(intx, OnStackReplacePercentage, 1400 ); +define_pd_global(bool, UseTLAB, true ); +define_pd_global(bool, ProfileInterpreter, false); +define_pd_global(intx, FreqInlineSize, 325 ); +define_pd_global(bool, ResizeTLAB, true ); +define_pd_global(intx, ReservedCodeCacheSize, 32*M ); +define_pd_global(intx, CodeCacheExpansionSize, 32*K ); +define_pd_global(uintx,CodeCacheMinBlockLength, 1); +define_pd_global(uintx,MetaspaceSize, 12*M ); +define_pd_global(bool, NeverActAsServerClassMachine, true ); +define_pd_global(intx, NewSizeThreadIncrease, 16*K ); +define_pd_global(uint64_t,MaxRAM, 1ULL*G); +define_pd_global(intx, InitialCodeCacheSize, 160*K); +#endif // !TIERED + +define_pd_global(bool, UseTypeProfile, false); +define_pd_global(bool, RoundFPResults, false); + +define_pd_global(bool, LIRFillDelaySlots, false); +define_pd_global(bool, OptimizeSinglePrecision, false); +define_pd_global(bool, CSEArrayLength, true ); +define_pd_global(bool, TwoOperandLIRForm, false); + +#endif // CPU_PPC_VM_C1_GLOBALS_PPC_HPP diff --git a/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp b/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp index 20174522381..9934d1f0143 100644 --- a/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/c2_globals_ppc.hpp @@ -39,7 +39,7 @@ define_pd_global(bool, PreferInterpreterNativeStubs, false); define_pd_global(bool, ProfileTraps, true); define_pd_global(bool, UseOnStackReplacement, true); define_pd_global(bool, ProfileInterpreter, true); -define_pd_global(bool, TieredCompilation, false); +define_pd_global(bool, TieredCompilation, true); define_pd_global(intx, CompileThreshold, 10000); define_pd_global(intx, OnStackReplacePercentage, 140); diff --git a/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp b/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp index 94b59db4d7e..9bfe48dd887 100644 --- a/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,4 +45,8 @@ void Compile::pd_compiler2_init() { FLAG_SET_ERGO(bool, InsertEndGroupPPC64, true); } } + + if (!VM_Version::has_isel() && FLAG_IS_DEFAULT(ConditionalMoveLimit)) { + FLAG_SET_ERGO(intx, ConditionalMoveLimit, 0); + } } diff --git a/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp b/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp index 41b5125f06e..197d3069817 100644 --- a/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/compiledIC_ppc.cpp @@ -1,5 +1,6 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -129,13 +130,20 @@ address CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf, address mark/* // - call __ calculate_address_from_global_toc(reg_scratch, __ method_toc()); AddressLiteral ic = __ allocate_metadata_address((Metadata *)NULL); - __ load_const_from_method_toc(as_Register(Matcher::inline_cache_reg_encode()), ic, reg_scratch); + bool success = __ load_const_from_method_toc(as_Register(Matcher::inline_cache_reg_encode()), + ic, reg_scratch, /*fixed_size*/ true); + if (!success) { + return NULL; // CodeCache is full + } if (ReoptimizeCallSequences) { __ b64_patchable((address)-1, relocInfo::none); } else { AddressLiteral a((address)-1); - __ load_const_from_method_toc(reg_scratch, a, reg_scratch); + success = __ load_const_from_method_toc(reg_scratch, a, reg_scratch, /*fixed_size*/ true); + if (!success) { + return NULL; // CodeCache is full + } __ mtctr(reg_scratch); __ bctr(); } @@ -153,6 +161,7 @@ address CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf, address mark/* return stub; #else ShouldNotReachHere(); + return NULL; #endif } #undef __ diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp index 2e051d99918..304cddca9e6 100644 --- a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -271,39 +271,6 @@ void frame::describe_pd(FrameValues& values, int frame_no) { } #endif -void frame::adjust_unextended_sp() { - // If we are returning to a compiled MethodHandle call site, the - // saved_fp will in fact be a saved value of the unextended SP. The - // simplest way to tell whether we are returning to such a call site - // is as follows: - - if (is_compiled_frame() && false /*is_at_mh_callsite()*/) { // TODO PPC port - // If the sender PC is a deoptimization point, get the original - // PC. For MethodHandle call site the unextended_sp is stored in - // saved_fp. - _unextended_sp = _fp - _cb->frame_size(); - -#ifdef ASSERT - nmethod *sender_nm = _cb->as_nmethod_or_null(); - assert(sender_nm && *_sp == *_unextended_sp, "backlink changed"); - - intptr_t* sp = _unextended_sp; // check if stack can be walked from here - for (int x = 0; x < 5; ++x) { // check up to a couple of backlinks - intptr_t* prev_sp = *(intptr_t**)sp; - if (prev_sp == 0) break; // end of stack - assert(prev_sp>sp, "broken stack"); - sp = prev_sp; - } - - if (sender_nm->is_deopt_mh_entry(_pc)) { // checks for deoptimization - address original_pc = sender_nm->get_original_pc(this); - assert(sender_nm->insts_contains(original_pc), "original PC must be in nmethod"); - assert(sender_nm->is_method_handle_return(original_pc), "must be"); - } -#endif - } -} - intptr_t *frame::initial_deoptimization_info() { // unused... but returns fp() to minimize changes introduced by 7087445 return fp(); diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.hpp b/hotspot/src/cpu/ppc/vm/frame_ppc.hpp index f327d2ce424..c645307a945 100644 --- a/hotspot/src/cpu/ppc/vm/frame_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -465,7 +465,6 @@ // The frame's stack pointer before it has been extended by a c2i adapter; // needed by deoptimization intptr_t* _unextended_sp; - void adjust_unextended_sp(); public: diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp index 4945d7f827b..fbd696cd47c 100644 --- a/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp @@ -39,9 +39,6 @@ inline void frame::find_codeblob_and_set_pc_and_deopt_state(address pc) { _pc = pc; // Must be set for get_deopt_original_pc() _fp = (intptr_t*)own_abi()->callers_sp; - // Use _fp - frame_size, needs to be done between _cb and _pc initialization - // and get_deopt_original_pc. - adjust_unextended_sp(); address original_pc = nmethod::get_deopt_original_pc(this); if (original_pc != NULL) { diff --git a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp index da5c8b008c5..542abd1bdb6 100644 --- a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp @@ -36,4 +36,7 @@ const int StackAlignmentInBytes = 16; // The PPC CPUs are NOT multiple-copy-atomic. #define CPU_NOT_MULTIPLE_COPY_ATOMIC +// The expected size in bytes of a cache line, used to pad data structures. +#define DEFAULT_CACHE_LINE_SIZE 128 + #endif // CPU_PPC_VM_GLOBALDEFINITIONS_PPC_HPP diff --git a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp index be9c8da7124..a839ba4cb49 100644 --- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp +++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp @@ -93,9 +93,9 @@ void InterpreterMacroAssembler::dispatch_prolog(TosState state, int bcp_incr) { // own dispatch. The dispatch address in R24_dispatch_addr is used for the // dispatch. void InterpreterMacroAssembler::dispatch_epilog(TosState state, int bcp_incr) { + if (bcp_incr) { addi(R14_bcp, R14_bcp, bcp_incr); } mtctr(R24_dispatch_addr); - addi(R14_bcp, R14_bcp, bcp_incr); - bctr(); + bcctr(bcondAlways, 0, bhintbhBCCTRisNotPredictable); } void InterpreterMacroAssembler::check_and_handle_popframe(Register scratch_reg) { @@ -212,9 +212,6 @@ void InterpreterMacroAssembler::dispatch_Lbyte_code(TosState state, Register byt unimplemented("dispatch_Lbyte_code: verify"); // See Sparc Implementation to implement this } -#ifdef FAST_DISPATCH - unimplemented("dispatch_Lbyte_code FAST_DISPATCH"); -#else assert_different_registers(bytecode, R11_scratch1); // Calc dispatch table address. @@ -225,8 +222,7 @@ void InterpreterMacroAssembler::dispatch_Lbyte_code(TosState state, Register byt // Jump off! mtctr(R11_scratch1); - bctr(); -#endif + bcctr(bcondAlways, 0, bhintbhBCCTRisNotPredictable); } void InterpreterMacroAssembler::load_receiver(Register Rparam_count, Register Rrecv_dst) { @@ -546,8 +542,8 @@ void InterpreterMacroAssembler::index_check_without_pop(Register Rarray, Registe sldi(RsxtIndex, RsxtIndex, index_shift); blt(CCR0, LnotOOR); // Index should be in R17_tos, array should be in R4_ARG2. - mr(R17_tos, Rindex); - mr(R4_ARG2, Rarray); + mr_if_needed(R17_tos, Rindex); + mr_if_needed(R4_ARG2, Rarray); load_dispatch_table(Rtmp, (address*)Interpreter::_throw_ArrayIndexOutOfBoundsException_entry); mtctr(Rtmp); bctr(); @@ -842,7 +838,6 @@ void InterpreterMacroAssembler::lock_object(Register monitor, Register object) { // Must fence, otherwise, preceding store(s) may float below cmpxchg. // CmpxchgX sets CCR0 to cmpX(current, displaced). - fence(); // TODO: replace by MacroAssembler::MemBarRel | MacroAssembler::MemBarAcq ? cmpxchgd(/*flag=*/CCR0, /*current_value=*/current_header, /*compare_value=*/displaced_header, /*exchange_value=*/monitor, @@ -850,7 +845,8 @@ void InterpreterMacroAssembler::lock_object(Register monitor, Register object) { MacroAssembler::MemBarRel | MacroAssembler::MemBarAcq, MacroAssembler::cmpxchgx_hint_acquire_lock(), noreg, - &cas_failed); + &cas_failed, + /*check without membar and ldarx first*/true); // If the compare-and-exchange succeeded, then we found an unlocked // object and we have now locked it. @@ -868,9 +864,7 @@ void InterpreterMacroAssembler::lock_object(Register monitor, Register object) { sub(current_header, current_header, R1_SP); assert(os::vm_page_size() > 0xfff, "page size too small - change the constant"); - load_const_optimized(tmp, - (address) (~(os::vm_page_size()-1) | - markOopDesc::lock_mask_in_place)); + load_const_optimized(tmp, ~(os::vm_page_size()-1) | markOopDesc::lock_mask_in_place); and_(R0/*==0?*/, current_header, tmp); // If condition is true we are done and hence we can store 0 in the displaced @@ -1107,6 +1101,7 @@ void InterpreterMacroAssembler::verify_method_data_pointer() { } void InterpreterMacroAssembler::test_invocation_counter_for_mdp(Register invocation_count, + Register method_counters, Register Rscratch, Label &profile_continue) { assert(ProfileInterpreter, "must be profiling interpreter"); @@ -1115,12 +1110,11 @@ void InterpreterMacroAssembler::test_invocation_counter_for_mdp(Register invocat Label done; // If no method data exists, and the counter is high enough, make one. - int ipl_offs = load_const_optimized(Rscratch, &InvocationCounter::InterpreterProfileLimit, R0, true); - lwz(Rscratch, ipl_offs, Rscratch); + lwz(Rscratch, in_bytes(MethodCounters::interpreter_profile_limit_offset()), method_counters); cmpdi(CCR0, R28_mdx, 0); // Test to see if we should create a method data oop. - cmpd(CCR1, Rscratch /* InterpreterProfileLimit */, invocation_count); + cmpd(CCR1, Rscratch, invocation_count); bne(CCR0, done); bge(CCR1, profile_continue); @@ -1133,15 +1127,15 @@ void InterpreterMacroAssembler::test_invocation_counter_for_mdp(Register invocat bind(done); } -void InterpreterMacroAssembler::test_backedge_count_for_osr(Register backedge_count, Register branch_bcp, Register Rtmp) { - assert_different_registers(backedge_count, Rtmp, branch_bcp); +void InterpreterMacroAssembler::test_backedge_count_for_osr(Register backedge_count, Register method_counters, + Register target_bcp, Register disp, Register Rtmp) { + assert_different_registers(backedge_count, target_bcp, disp, Rtmp, R4_ARG2); assert(UseOnStackReplacement,"Must UseOnStackReplacement to test_backedge_count_for_osr"); Label did_not_overflow; Label overflow_with_error; - int ibbl_offs = load_const_optimized(Rtmp, &InvocationCounter::InterpreterBackwardBranchLimit, R0, true); - lwz(Rtmp, ibbl_offs, Rtmp); + lwz(Rtmp, in_bytes(MethodCounters::interpreter_backward_branch_limit_offset()), method_counters); cmpw(CCR0, backedge_count, Rtmp); blt(CCR0, did_not_overflow); @@ -1153,17 +1147,15 @@ void InterpreterMacroAssembler::test_backedge_count_for_osr(Register backedge_co // the overflow function is called only once every overflow_frequency. if (ProfileInterpreter) { const int overflow_frequency = 1024; - li(Rtmp, overflow_frequency-1); - andr(Rtmp, Rtmp, backedge_count); - cmpwi(CCR0, Rtmp, 0); + andi_(Rtmp, backedge_count, overflow_frequency-1); bne(CCR0, did_not_overflow); } // Overflow in loop, pass branch bytecode. - call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::frequency_counter_overflow), branch_bcp, true); + subf(R4_ARG2, disp, target_bcp); // Compute branch bytecode (previous bcp). + call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::frequency_counter_overflow), R4_ARG2, true); // Was an OSR adapter generated? - // O0 = osr nmethod cmpdi(CCR0, R3_RET, 0); beq(CCR0, overflow_with_error); @@ -1324,7 +1316,7 @@ void InterpreterMacroAssembler::increment_backedge_counter(const Register Rcount assert_different_registers(Rdst, Rtmp1); const Register invocation_counter = Rtmp1; const Register counter = Rdst; - // TODO ppc port assert(4 == InvocationCounter::sz_counter(), "unexpected field size."); + // TODO: PPC port: assert(4 == InvocationCounter::sz_counter(), "unexpected field size."); // Load backedge counter. lwz(counter, in_bytes(MethodCounters::backedge_counter_offset()) + @@ -1337,8 +1329,7 @@ void InterpreterMacroAssembler::increment_backedge_counter(const Register Rcount addi(counter, counter, InvocationCounter::count_increment); // Mask the invocation counter. - li(Rscratch, InvocationCounter::count_mask_value); - andr(invocation_counter, invocation_counter, Rscratch); + andi(invocation_counter, invocation_counter, InvocationCounter::count_mask_value); // Store new counter value. stw(counter, in_bytes(MethodCounters::backedge_counter_offset()) + @@ -1817,15 +1808,13 @@ void InterpreterMacroAssembler::profile_return_type(Register ret, Register tmp1, test_method_data_pointer(profile_continue); if (MethodData::profile_return_jsr292_only()) { - assert(Method::intrinsic_id_size_in_bytes() == 2, "assuming Method::_intrinsic_id is u2"); - // If we don't profile all invoke bytecodes we must make sure // it's a bytecode we indeed profile. We can't go back to the // begining of the ProfileData we intend to update to check its // type because we're right after it and we don't known its // length. lbz(tmp1, 0, R14_bcp); - lhz(tmp2, Method::intrinsic_id_offset_in_bytes(), R19_method); + lbz(tmp2, Method::intrinsic_id_offset_in_bytes(), R19_method); cmpwi(CCR0, tmp1, Bytecodes::_invokedynamic); cmpwi(CCR1, tmp1, Bytecodes::_invokehandle); cror(CCR0, Assembler::equal, CCR1, Assembler::equal); @@ -2207,9 +2196,7 @@ void InterpreterMacroAssembler::increment_invocation_counter(Register Rcounters, // Load the backedge counter. lwz(backedge_count, be_counter_offset, Rcounters); // is unsigned int // Mask the backedge counter. - Register tmp = invocation_count; - li(tmp, InvocationCounter::count_mask_value); - andr(backedge_count, tmp, backedge_count); // Cannot use andi, need sign extension of count_mask_value. + andi(backedge_count, backedge_count, InvocationCounter::count_mask_value); // Load the invocation counter. lwz(invocation_count, inv_counter_offset, Rcounters); // is unsigned int @@ -2266,7 +2253,7 @@ void InterpreterMacroAssembler::verify_oop_or_return_address(Register reg, Regis bne(CCR0, test); address fd = CAST_FROM_FN_PTR(address, verify_return_address); - const int nbytes_save = 11*8; // volatile gprs except R0 + const int nbytes_save = MacroAssembler::num_volatile_regs * 8; save_volatile_gprs(R1_SP, -nbytes_save); // except R0 save_LR_CR(Rtmp); // Save in old frame. push_frame_reg_args(nbytes_save, Rtmp); diff --git a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp index 9692e65225c..5baf225c199 100644 --- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp +++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp @@ -203,7 +203,7 @@ class InterpreterMacroAssembler: public MacroAssembler { void restore_interpreter_state(Register scratch, bool bcp_and_mdx_only = false); void increment_backedge_counter(const Register Rcounters, Register Rtmp, Register Rtmp2, Register Rscratch); - void test_backedge_count_for_osr(Register backedge_count, Register branch_bcp, Register Rtmp); + void test_backedge_count_for_osr(Register backedge_count, Register method_counters, Register target_bcp, Register disp, Register Rtmp); void record_static_call_in_profile(Register Rentry, Register Rtmp); void record_receiver_call_in_profile(Register Rklass, Register Rentry, Register Rtmp); @@ -222,7 +222,7 @@ class InterpreterMacroAssembler: public MacroAssembler { void set_method_data_pointer_for_bcp(); void test_method_data_pointer(Label& zero_continue); void verify_method_data_pointer(); - void test_invocation_counter_for_mdp(Register invocation_count, Register Rscratch, Label &profile_continue); + void test_invocation_counter_for_mdp(Register invocation_count, Register method_counters, Register Rscratch, Label &profile_continue); void set_mdp_data_at(int constant, Register value); diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp index 38cf28d094a..1ba560b3160 100644 --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp @@ -30,6 +30,7 @@ #include "gc/shared/collectedHeap.inline.hpp" #include "interpreter/interpreter.hpp" #include "memory/resourceArea.hpp" +#include "nativeInst_ppc.hpp" #include "prims/methodHandles.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/icache.hpp" @@ -114,7 +115,7 @@ void MacroAssembler::calculate_address_from_global_toc(Register dst, address add } if (hi16) { - addis(dst, R29, MacroAssembler::largeoffset_si16_si16_hi(offset)); + addis(dst, R29_TOC, MacroAssembler::largeoffset_si16_si16_hi(offset)); } if (lo16) { if (add_relocation) { @@ -256,7 +257,9 @@ narrowOop MacroAssembler::get_narrow_oop(address a, address bound) { } #endif // _LP64 -void MacroAssembler::load_const_from_method_toc(Register dst, AddressLiteral& a, Register toc) { +// Returns true if successful. +bool MacroAssembler::load_const_from_method_toc(Register dst, AddressLiteral& a, + Register toc, bool fixed_size) { int toc_offset = 0; // Use RelocationHolder::none for the constant pool entry, otherwise // we will end up with a failing NativeCall::verify(x) where x is @@ -264,11 +267,13 @@ void MacroAssembler::load_const_from_method_toc(Register dst, AddressLiteral& a, // FIXME: We should insert relocation information for oops at the constant // pool entries instead of inserting it at the loads; patching of a constant // pool entry should be less expensive. - address oop_address = address_constant((address)a.value(), RelocationHolder::none); + address const_address = address_constant((address)a.value(), RelocationHolder::none); + if (const_address == NULL) { return false; } // allocation failure // Relocate at the pc of the load. relocate(a.rspec()); - toc_offset = (int)(oop_address - code()->consts()->start()); - ld_largeoffset_unchecked(dst, toc_offset, toc, true); + toc_offset = (int)(const_address - code()->consts()->start()); + ld_largeoffset_unchecked(dst, toc_offset, toc, fixed_size); + return true; } bool MacroAssembler::is_load_const_from_method_toc_at(address a) { @@ -446,6 +451,15 @@ void MacroAssembler::bc_far(int boint, int biint, Label& dest, int optimize) { assert(dest.is_bound() || target_pc == b_pc, "postcondition"); } +// 1 or 2 instructions +void MacroAssembler::bc_far_optimized(int boint, int biint, Label& dest) { + if (dest.is_bound() && is_within_range_of_bcxx(target(dest), pc())) { + bc(boint, biint, dest); + } else { + bc_far(boint, biint, dest, MacroAssembler::bc_far_optimize_on_relocate); + } +} + bool MacroAssembler::is_bc_far_at(address instruction_addr) { return is_bc_far_variant1_at(instruction_addr) || is_bc_far_variant2_at(instruction_addr) || @@ -496,7 +510,7 @@ void MacroAssembler::set_dest_of_bc_far_at(address instruction_addr, address des // variant 1, the 1st instruction contains the destination address: // // bcxx DEST - // endgroup + // nop // const int instruction_1 = *(int*)(instruction_addr); boint = inv_bo_field(instruction_1); @@ -523,10 +537,10 @@ void MacroAssembler::set_dest_of_bc_far_at(address instruction_addr, address des // variant 1: // // bcxx DEST - // endgroup + // nop // masm.bc(boint, biint, dest); - masm.endgroup(); + masm.nop(); } else { // variant 2: // @@ -810,7 +824,22 @@ void MacroAssembler::save_volatile_gprs(Register dst, int offset) { std(R9, offset, dst); offset += 8; std(R10, offset, dst); offset += 8; std(R11, offset, dst); offset += 8; - std(R12, offset, dst); + std(R12, offset, dst); offset += 8; + + stfd(F0, offset, dst); offset += 8; + stfd(F1, offset, dst); offset += 8; + stfd(F2, offset, dst); offset += 8; + stfd(F3, offset, dst); offset += 8; + stfd(F4, offset, dst); offset += 8; + stfd(F5, offset, dst); offset += 8; + stfd(F6, offset, dst); offset += 8; + stfd(F7, offset, dst); offset += 8; + stfd(F8, offset, dst); offset += 8; + stfd(F9, offset, dst); offset += 8; + stfd(F10, offset, dst); offset += 8; + stfd(F11, offset, dst); offset += 8; + stfd(F12, offset, dst); offset += 8; + stfd(F13, offset, dst); } // For verify_oops. @@ -825,7 +854,22 @@ void MacroAssembler::restore_volatile_gprs(Register src, int offset) { ld(R9, offset, src); offset += 8; ld(R10, offset, src); offset += 8; ld(R11, offset, src); offset += 8; - ld(R12, offset, src); + ld(R12, offset, src); offset += 8; + + lfd(F0, offset, src); offset += 8; + lfd(F1, offset, src); offset += 8; + lfd(F2, offset, src); offset += 8; + lfd(F3, offset, src); offset += 8; + lfd(F4, offset, src); offset += 8; + lfd(F5, offset, src); offset += 8; + lfd(F6, offset, src); offset += 8; + lfd(F7, offset, src); offset += 8; + lfd(F8, offset, src); offset += 8; + lfd(F9, offset, src); offset += 8; + lfd(F10, offset, src); offset += 8; + lfd(F11, offset, src); offset += 8; + lfd(F12, offset, src); offset += 8; + lfd(F13, offset, src); } void MacroAssembler::save_LR_CR(Register tmp) { @@ -908,7 +952,7 @@ void MacroAssembler::push_frame(unsigned int bytes, Register tmp) { if (is_simm(-offset, 16)) { stdu(R1_SP, -offset, R1_SP); } else { - load_const(tmp, -offset); + load_const_optimized(tmp, -offset); stdux(R1_SP, R1_SP, tmp); } } @@ -1090,20 +1134,21 @@ address MacroAssembler::call_c_using_toc(const FunctionDescriptor* fd, assert(fd->entry() != NULL, "function must be linked"); AddressLiteral fd_entry(fd->entry()); - load_const_from_method_toc(R11, fd_entry, toc); + bool success = load_const_from_method_toc(R11, fd_entry, toc, /*fixed_size*/ true); mtctr(R11); if (fd->env() == NULL) { li(R11, 0); nop(); } else { AddressLiteral fd_env(fd->env()); - load_const_from_method_toc(R11, fd_env, toc); + success = success && load_const_from_method_toc(R11, fd_env, toc, /*fixed_size*/ true); } AddressLiteral fd_toc(fd->toc()); - load_toc_from_toc(R2_TOC, fd_toc, toc); - // R2_TOC is killed. + // Set R2_TOC (load from toc) + success = success && load_const_from_method_toc(R2_TOC, fd_toc, toc, /*fixed_size*/ true); bctrl(); _last_calls_return_pc = pc(); + if (!success) { return NULL; } } else { // It's a friend function, load the entry point and don't care about // toc and env. Use an optimizable call instruction, but ensure the @@ -1367,11 +1412,6 @@ void MacroAssembler::cmpxchgw(ConditionRegister flag, Register dest_current_valu bool preset_result_reg = (int_flag_success != dest_current_value && int_flag_success != compare_value && int_flag_success != exchange_value && int_flag_success != addr_base); - // release/fence semantics - if (semantics & MemBarRel) { - release(); - } - if (use_result_reg && preset_result_reg) { li(int_flag_success, 0); // preset (assume cas failed) } @@ -1383,6 +1423,11 @@ void MacroAssembler::cmpxchgw(ConditionRegister flag, Register dest_current_valu bne(flag, failed); } + // release/fence semantics + if (semantics & MemBarRel) { + release(); + } + // atomic emulation loop bind(retry); @@ -1462,11 +1507,6 @@ void MacroAssembler::cmpxchgd(ConditionRegister flag, int_flag_success!=exchange_value && int_flag_success!=addr_base); assert(int_flag_success == noreg || failed_ext == NULL, "cannot have both"); - // release/fence semantics - if (semantics & MemBarRel) { - release(); - } - if (use_result_reg && preset_result_reg) { li(int_flag_success, 0); // preset (assume cas failed) } @@ -1478,6 +1518,11 @@ void MacroAssembler::cmpxchgd(ConditionRegister flag, bne(flag, failed); } + // release/fence semantics + if (semantics & MemBarRel) { + release(); + } + // atomic emulation loop bind(retry); @@ -1501,8 +1546,6 @@ void MacroAssembler::cmpxchgd(ConditionRegister flag, li(int_flag_success, 1); } - // POWER6 doesn't need isync in CAS. - // Always emit isync to be on the safe side. if (semantics & MemBarFenceAfter) { fence(); } else if (semantics & MemBarAcq) { @@ -1627,13 +1670,14 @@ void MacroAssembler::lookup_virtual_method(Register recv_klass, } /////////////////////////////////////////// subtype checking //////////////////////////////////////////// - void MacroAssembler::check_klass_subtype_fast_path(Register sub_klass, Register super_klass, Register temp1_reg, Register temp2_reg, - Label& L_success, - Label& L_failure) { + Label* L_success, + Label* L_failure, + Label* L_slow_path, + RegisterOrConstant super_check_offset) { const Register check_cache_offset = temp1_reg; const Register cached_super = temp2_reg; @@ -1643,6 +1687,18 @@ void MacroAssembler::check_klass_subtype_fast_path(Register sub_klass, int sco_offset = in_bytes(Klass::super_check_offset_offset()); int sc_offset = in_bytes(Klass::secondary_super_cache_offset()); + bool must_load_sco = (super_check_offset.constant_or_zero() == -1); + bool need_slow_path = (must_load_sco || super_check_offset.constant_or_zero() == sco_offset); + + Label L_fallthrough; + int label_nulls = 0; + if (L_success == NULL) { L_success = &L_fallthrough; label_nulls++; } + if (L_failure == NULL) { L_failure = &L_fallthrough; label_nulls++; } + if (L_slow_path == NULL) { L_slow_path = &L_fallthrough; label_nulls++; } + assert(label_nulls <= 1 || + (L_slow_path == &L_fallthrough && label_nulls <= 2 && !need_slow_path), + "at most one NULL in the batch, usually"); + // If the pointers are equal, we are done (e.g., String[] elements). // This self-check enables sharing of secondary supertype arrays among // non-primary types such as array-of-interface. Otherwise, each such @@ -1651,15 +1707,20 @@ void MacroAssembler::check_klass_subtype_fast_path(Register sub_klass, // type checks are in fact trivially successful in this manner, // so we get a nicely predicted branch right at the start of the check. cmpd(CCR0, sub_klass, super_klass); - beq(CCR0, L_success); + beq(CCR0, *L_success); // Check the supertype display: + if (must_load_sco) { + // The super check offset is always positive... lwz(check_cache_offset, sco_offset, super_klass); + super_check_offset = RegisterOrConstant(check_cache_offset); + // super_check_offset is register. + assert_different_registers(sub_klass, super_klass, cached_super, super_check_offset.as_register()); + } // The loaded value is the offset from KlassOopDesc. - ldx(cached_super, check_cache_offset, sub_klass); + ld(cached_super, super_check_offset, sub_klass); cmpd(CCR0, cached_super, super_klass); - beq(CCR0, L_success); // This check has worked decisively for primary supers. // Secondary supers are sought in the super_cache ('super_cache_addr'). @@ -1672,9 +1733,39 @@ void MacroAssembler::check_klass_subtype_fast_path(Register sub_klass, // So if it was a primary super, we can just fail immediately. // Otherwise, it's the slow path for us (no success at this point). - cmpwi(CCR0, check_cache_offset, sc_offset); - bne(CCR0, L_failure); - // bind(slow_path); // fallthru +#define FINAL_JUMP(label) if (&(label) != &L_fallthrough) { b(label); } + + if (super_check_offset.is_register()) { + beq(CCR0, *L_success); + cmpwi(CCR0, super_check_offset.as_register(), sc_offset); + if (L_failure == &L_fallthrough) { + beq(CCR0, *L_slow_path); + } else { + bne(CCR0, *L_failure); + FINAL_JUMP(*L_slow_path); + } + } else { + if (super_check_offset.as_constant() == sc_offset) { + // Need a slow path; fast failure is impossible. + if (L_slow_path == &L_fallthrough) { + beq(CCR0, *L_success); + } else { + bne(CCR0, *L_slow_path); + FINAL_JUMP(*L_success); + } + } else { + // No slow path; it's a fast decision. + if (L_failure == &L_fallthrough) { + beq(CCR0, *L_success); + } else { + bne(CCR0, *L_failure); + FINAL_JUMP(*L_success); + } + } + } + + bind(L_fallthrough); +#undef FINAL_JUMP } void MacroAssembler::check_klass_subtype_slow_path(Register sub_klass, @@ -1698,7 +1789,7 @@ void MacroAssembler::check_klass_subtype_slow_path(Register sub_klass, ld(array_ptr, source_offset, sub_klass); - //assert(4 == arrayOopDesc::length_length_in_bytes(), "precondition violated."); + // TODO: PPC port: assert(4 == arrayOopDesc::length_length_in_bytes(), "precondition violated."); lwz(temp, length_offset, array_ptr); cmpwi(CCR0, temp, 0); beq(CCR0, result_reg!=noreg ? failure : fallthru); // length 0 @@ -1719,8 +1810,9 @@ void MacroAssembler::check_klass_subtype_slow_path(Register sub_klass, bind(hit); std(super_klass, target_offset, sub_klass); // save result to cache - if (result_reg != noreg) li(result_reg, 0); // load zero result (indicates a hit) - if (L_success != NULL) b(*L_success); + if (result_reg != noreg) { li(result_reg, 0); } // load zero result (indicates a hit) + if (L_success != NULL) { b(*L_success); } + else if (result_reg == noreg) { blr(); } // return with CR0.eq if neither label nor result reg provided bind(fallthru); } @@ -1732,7 +1824,7 @@ void MacroAssembler::check_klass_subtype(Register sub_klass, Register temp2_reg, Label& L_success) { Label L_failure; - check_klass_subtype_fast_path(sub_klass, super_klass, temp1_reg, temp2_reg, L_success, L_failure); + check_klass_subtype_fast_path(sub_klass, super_klass, temp1_reg, temp2_reg, &L_success, &L_failure); check_klass_subtype_slow_path(sub_klass, super_klass, temp1_reg, temp2_reg, &L_success); bind(L_failure); // Fallthru if not successful. } @@ -1765,6 +1857,7 @@ RegisterOrConstant MacroAssembler::argument_offset(RegisterOrConstant arg_slot, } } +// Supports temp2_reg = R0. void MacroAssembler::biased_locking_enter(ConditionRegister cr_reg, Register obj_reg, Register mark_reg, Register temp_reg, Register temp2_reg, Label& done, Label* slow_case) { @@ -1788,10 +1881,10 @@ void MacroAssembler::biased_locking_enter(ConditionRegister cr_reg, Register obj "biased locking makes assumptions about bit layout"); if (PrintBiasedLockingStatistics) { - load_const(temp_reg, (address) BiasedLocking::total_entry_count_addr(), temp2_reg); - lwz(temp2_reg, 0, temp_reg); - addi(temp2_reg, temp2_reg, 1); - stw(temp2_reg, 0, temp_reg); + load_const(temp2_reg, (address) BiasedLocking::total_entry_count_addr(), temp_reg); + lwzx(temp_reg, temp2_reg); + addi(temp_reg, temp_reg, 1); + stwx(temp_reg, temp2_reg); } andi(temp_reg, mark_reg, markOopDesc::biased_lock_mask_in_place); @@ -1809,10 +1902,10 @@ void MacroAssembler::biased_locking_enter(ConditionRegister cr_reg, Register obj if (PrintBiasedLockingStatistics) { Label l; bne(cr_reg, l); - load_const(mark_reg, (address) BiasedLocking::biased_lock_entry_count_addr()); - lwz(temp2_reg, 0, mark_reg); - addi(temp2_reg, temp2_reg, 1); - stw(temp2_reg, 0, mark_reg); + load_const(temp2_reg, (address) BiasedLocking::biased_lock_entry_count_addr()); + lwzx(mark_reg, temp2_reg); + addi(mark_reg, mark_reg, 1); + stwx(mark_reg, temp2_reg); // restore mark_reg ld(mark_reg, oopDesc::mark_offset_in_bytes(), obj_reg); bind(l); @@ -1878,10 +1971,10 @@ void MacroAssembler::biased_locking_enter(ConditionRegister cr_reg, Register obj // need to revoke that bias. The revocation will occur in the // interpreter runtime in the slow case. if (PrintBiasedLockingStatistics) { - load_const(temp_reg, (address) BiasedLocking::anonymously_biased_lock_entry_count_addr(), temp2_reg); - lwz(temp2_reg, 0, temp_reg); - addi(temp2_reg, temp2_reg, 1); - stw(temp2_reg, 0, temp_reg); + load_const(temp2_reg, (address) BiasedLocking::anonymously_biased_lock_entry_count_addr(), temp_reg); + lwzx(temp_reg, temp2_reg); + addi(temp_reg, temp_reg, 1); + stwx(temp_reg, temp2_reg); } b(done); @@ -1892,15 +1985,14 @@ void MacroAssembler::biased_locking_enter(ConditionRegister cr_reg, Register obj // value as the comparison value when doing the cas to acquire the // bias in the current epoch. In other words, we allow transfer of // the bias from one thread to another directly in this situation. - andi(temp_reg, mark_reg, markOopDesc::age_mask_in_place); - orr(temp_reg, R16_thread, temp_reg); - load_klass(temp2_reg, obj_reg); - ld(temp2_reg, in_bytes(Klass::prototype_header_offset()), temp2_reg); - orr(temp_reg, temp_reg, temp2_reg); + load_klass(temp_reg, obj_reg); + andi(temp2_reg, mark_reg, markOopDesc::age_mask_in_place); + orr(temp2_reg, R16_thread, temp2_reg); + ld(temp_reg, in_bytes(Klass::prototype_header_offset()), temp_reg); + orr(temp_reg, temp2_reg, temp_reg); assert(oopDesc::mark_offset_in_bytes() == 0, "offset of _mark is not 0"); - // CmpxchgX sets cr_reg to cmpX(temp2_reg, mark_reg). cmpxchgd(/*flag=*/cr_reg, /*current_value=*/temp2_reg, /*compare_value=*/mark_reg, /*exchange_value=*/temp_reg, /*where=*/obj_reg, @@ -1913,10 +2005,10 @@ void MacroAssembler::biased_locking_enter(ConditionRegister cr_reg, Register obj // need to revoke that bias. The revocation will occur in the // interpreter runtime in the slow case. if (PrintBiasedLockingStatistics) { - load_const(temp_reg, (address) BiasedLocking::rebiased_lock_entry_count_addr(), temp2_reg); - lwz(temp2_reg, 0, temp_reg); - addi(temp2_reg, temp2_reg, 1); - stw(temp2_reg, 0, temp_reg); + load_const(temp2_reg, (address) BiasedLocking::rebiased_lock_entry_count_addr(), temp_reg); + lwzx(temp_reg, temp2_reg); + addi(temp_reg, temp_reg, 1); + stwx(temp_reg, temp2_reg); } b(done); @@ -1952,10 +2044,10 @@ void MacroAssembler::biased_locking_enter(ConditionRegister cr_reg, Register obj if (PrintBiasedLockingStatistics) { Label l; bne(cr_reg, l); - load_const(temp_reg, (address) BiasedLocking::revoked_lock_entry_count_addr(), temp2_reg); - lwz(temp2_reg, 0, temp_reg); - addi(temp2_reg, temp2_reg, 1); - stw(temp2_reg, 0, temp_reg); + load_const(temp2_reg, (address) BiasedLocking::revoked_lock_entry_count_addr(), temp_reg); + lwzx(temp_reg, temp2_reg); + addi(temp_reg, temp_reg, 1); + stwx(temp_reg, temp2_reg); bind(l); } @@ -1977,6 +2069,109 @@ void MacroAssembler::biased_locking_exit (ConditionRegister cr_reg, Register mar beq(cr_reg, done); } +// allocation (for C1) +void MacroAssembler::eden_allocate( + Register obj, // result: pointer to object after successful allocation + Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise + int con_size_in_bytes, // object size in bytes if known at compile time + Register t1, // temp register + Register t2, // temp register + Label& slow_case // continuation point if fast allocation fails +) { + b(slow_case); +} + +void MacroAssembler::tlab_allocate( + Register obj, // result: pointer to object after successful allocation + Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise + int con_size_in_bytes, // object size in bytes if known at compile time + Register t1, // temp register + Label& slow_case // continuation point if fast allocation fails +) { + // make sure arguments make sense + assert_different_registers(obj, var_size_in_bytes, t1); + assert(0 <= con_size_in_bytes && is_simm13(con_size_in_bytes), "illegal object size"); + assert((con_size_in_bytes & MinObjAlignmentInBytesMask) == 0, "object size is not multiple of alignment"); + + const Register new_top = t1; + //verify_tlab(); not implemented + + ld(obj, in_bytes(JavaThread::tlab_top_offset()), R16_thread); + ld(R0, in_bytes(JavaThread::tlab_end_offset()), R16_thread); + if (var_size_in_bytes == noreg) { + addi(new_top, obj, con_size_in_bytes); + } else { + add(new_top, obj, var_size_in_bytes); + } + cmpld(CCR0, new_top, R0); + bc_far_optimized(Assembler::bcondCRbiIs1, bi0(CCR0, Assembler::greater), slow_case); + +#ifdef ASSERT + // make sure new free pointer is properly aligned + { + Label L; + andi_(R0, new_top, MinObjAlignmentInBytesMask); + beq(CCR0, L); + stop("updated TLAB free is not properly aligned", 0x934); + bind(L); + } +#endif // ASSERT + + // update the tlab top pointer + std(new_top, in_bytes(JavaThread::tlab_top_offset()), R16_thread); + //verify_tlab(); not implemented +} +void MacroAssembler::tlab_refill(Label& retry_tlab, Label& try_eden, Label& slow_case) { + unimplemented("tlab_refill"); +} +void MacroAssembler::incr_allocated_bytes(RegisterOrConstant size_in_bytes, Register t1, Register t2) { + unimplemented("incr_allocated_bytes"); +} + +address MacroAssembler::emit_trampoline_stub(int destination_toc_offset, + int insts_call_instruction_offset, Register Rtoc) { + // Start the stub. + address stub = start_a_stub(64); + if (stub == NULL) { return NULL; } // CodeCache full: bail out + + // Create a trampoline stub relocation which relates this trampoline stub + // with the call instruction at insts_call_instruction_offset in the + // instructions code-section. + relocate(trampoline_stub_Relocation::spec(code()->insts()->start() + insts_call_instruction_offset)); + const int stub_start_offset = offset(); + + // For java_to_interp stubs we use R11_scratch1 as scratch register + // and in call trampoline stubs we use R12_scratch2. This way we + // can distinguish them (see is_NativeCallTrampolineStub_at()). + Register reg_scratch = R12_scratch2; + + // Now, create the trampoline stub's code: + // - load the TOC + // - load the call target from the constant pool + // - call + if (Rtoc == noreg) { + calculate_address_from_global_toc(reg_scratch, method_toc()); + Rtoc = reg_scratch; + } + + ld_largeoffset_unchecked(reg_scratch, destination_toc_offset, Rtoc, false); + mtctr(reg_scratch); + bctr(); + + const address stub_start_addr = addr_at(stub_start_offset); + + // Assert that the encoded destination_toc_offset can be identified and that it is correct. + assert(destination_toc_offset == NativeCallTrampolineStub_at(stub_start_addr)->destination_toc_offset(), + "encoded offset into the constant pool must match"); + // Trampoline_stub_size should be good. + assert((uint)(offset() - stub_start_offset) <= trampoline_stub_size, "should be good size"); + assert(is_NativeCallTrampolineStub_at(stub_start_addr), "doesn't look like a trampoline"); + + // End the stub. + end_a_stub(); + return stub; +} + // TM on PPC64. void MacroAssembler::atomic_inc_ptr(Register addr, Register result, int simm16) { Label retry; @@ -2387,17 +2582,16 @@ void MacroAssembler::compiler_fast_lock_object(ConditionRegister flag, Register // Must fence, otherwise, preceding store(s) may float below cmpxchg. // Compare object markOop with mark and if equal exchange scratch1 with object markOop. - // CmpxchgX sets cr_reg to cmpX(current, displaced). - membar(Assembler::StoreStore); cmpxchgd(/*flag=*/flag, /*current_value=*/current_header, /*compare_value=*/displaced_header, /*exchange_value=*/box, /*where=*/oop, - MacroAssembler::MemBarAcq, + MacroAssembler::MemBarRel | MacroAssembler::MemBarAcq, MacroAssembler::cmpxchgx_hint_acquire_lock(), noreg, - &cas_failed); + &cas_failed, + /*check without membar and ldarx first*/true); assert(oopDesc::mark_offset_in_bytes() == 0, "offset of _mark is not 0"); // If the compare-and-exchange succeeded, then we found an unlocked @@ -2410,8 +2604,7 @@ void MacroAssembler::compiler_fast_lock_object(ConditionRegister flag, Register // Check if the owner is self by comparing the value in the markOop of object // (current_header) with the stack pointer. sub(current_header, current_header, R1_SP); - load_const_optimized(temp, (address) (~(os::vm_page_size()-1) | - markOopDesc::lock_mask_in_place)); + load_const_optimized(temp, ~(os::vm_page_size()-1) | markOopDesc::lock_mask_in_place); and_(R0/*==0?*/, current_header, temp); // If condition is true we are cont and hence we can store 0 as the @@ -2437,8 +2630,6 @@ void MacroAssembler::compiler_fast_lock_object(ConditionRegister flag, Register // Try to CAS m->owner from NULL to current thread. addi(temp, displaced_header, ObjectMonitor::owner_offset_in_bytes()-markOopDesc::monitor_value); - li(displaced_header, 0); - // CmpxchgX sets flag to cmpX(current, displaced). cmpxchgd(/*flag=*/flag, /*current_value=*/current_header, /*compare_value=*/(intptr_t)0, @@ -2928,31 +3119,12 @@ void MacroAssembler::load_klass(Register dst, Register src) { } } -void MacroAssembler::load_klass_with_trap_null_check(Register dst, Register src) { - if (!os::zero_page_read_protected()) { - if (TrapBasedNullChecks) { - trap_null_check(src); - } - } - load_klass(dst, src); -} - -void MacroAssembler::reinit_heapbase(Register d, Register tmp) { - if (Universe::heap() != NULL) { - load_const_optimized(R30, Universe::narrow_ptrs_base(), tmp); - } else { - // Heap not yet allocated. Load indirectly. - int simm16_offset = load_const_optimized(R30, Universe::narrow_ptrs_base_addr(), tmp, true); - ld(R30, simm16_offset, R30); - } -} - // Clear Array // Kills both input registers. tmp == R0 is allowed. void MacroAssembler::clear_memory_doubleword(Register base_ptr, Register cnt_dwords, Register tmp) { // Procedure for large arrays (uses data cache block zero instruction). Label startloop, fast, fastloop, small_rest, restloop, done; - const int cl_size = VM_Version::get_cache_line_size(), + const int cl_size = VM_Version::L1_data_cache_line_size(), cl_dwords = cl_size>>3, cl_dw_addr_bits = exact_log2(cl_dwords), dcbz_min = 1; // Min count of dcbz executions, needs to be >0. @@ -4025,7 +4197,7 @@ void MacroAssembler::multiply_128_x_128_loop(Register x_xstart, bind(L_check_1); addi(idx, idx, 0x2); - andi_(idx, idx, 0x1) ; + andi_(idx, idx, 0x1); addic_(idx, idx, -1); blt(CCR0, L_post_third_loop_done); @@ -4255,17 +4427,42 @@ void MacroAssembler::verify_oop(Register oop, const char* msg) { address/* FunctionDescriptor** */fd = StubRoutines::verify_oop_subroutine_entry_address(); const Register tmp = R11; // Will be preserved. - const int nbytes_save = 11*8; // Volatile gprs except R0. + const int nbytes_save = MacroAssembler::num_volatile_regs * 8; save_volatile_gprs(R1_SP, -nbytes_save); // except R0 - if (oop == tmp) mr(R4_ARG2, oop); + mr_if_needed(R4_ARG2, oop); + save_LR_CR(tmp); // save in old frame + push_frame_reg_args(nbytes_save, tmp); + // load FunctionDescriptor** / entry_address * + load_const_optimized(tmp, fd, R0); + // load FunctionDescriptor* / entry_address + ld(tmp, 0, tmp); + load_const_optimized(R3_ARG1, (address)msg, R0); + // Call destination for its side effect. + call_c(tmp); + + pop_frame(); + restore_LR_CR(tmp); + restore_volatile_gprs(R1_SP, -nbytes_save); // except R0 +} + +void MacroAssembler::verify_oop_addr(RegisterOrConstant offs, Register base, const char* msg) { + if (!VerifyOops) { + return; + } + + address/* FunctionDescriptor** */fd = StubRoutines::verify_oop_subroutine_entry_address(); + const Register tmp = R11; // Will be preserved. + const int nbytes_save = MacroAssembler::num_volatile_regs * 8; + save_volatile_gprs(R1_SP, -nbytes_save); // except R0 + + ld(R4_ARG2, offs, base); save_LR_CR(tmp); // save in old frame push_frame_reg_args(nbytes_save, tmp); // load FunctionDescriptor** / entry_address * load_const_optimized(tmp, fd, R0); // load FunctionDescriptor* / entry_address ld(tmp, 0, tmp); - if (oop != tmp) mr_if_needed(R4_ARG2, oop); load_const_optimized(R3_ARG1, (address)msg, R0); // Call destination for its side effect. call_c(tmp); diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp index 37930a4bfc2..df58832b160 100644 --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp @@ -119,11 +119,8 @@ class MacroAssembler: public Assembler { // Emits an oop const to the constant pool, loads the constant, and // sets a relocation info with address current_pc. - void load_const_from_method_toc(Register dst, AddressLiteral& a, Register toc); - void load_toc_from_toc(Register dst, AddressLiteral& a, Register toc) { - assert(dst == R2_TOC, "base register must be TOC"); - load_const_from_method_toc(dst, a, toc); - } + // Returns true if successful. + bool load_const_from_method_toc(Register dst, AddressLiteral& a, Register toc, bool fixed_size = false); static bool is_load_const_from_method_toc_at(address a); static int get_offset_of_load_const_from_method_toc_at(address a); @@ -174,6 +171,7 @@ class MacroAssembler: public Assembler { // optimize: flag for telling the conditional far branch to optimize // itself when relocated. void bc_far(int boint, int biint, Label& dest, int optimize); + void bc_far_optimized(int boint, int biint, Label& dest); // 1 or 2 instructions // Relocation of conditional far branches. static bool is_bc_far_at(address instruction_addr); static address get_dest_of_bc_far_at(address instruction_addr); @@ -262,6 +260,7 @@ class MacroAssembler: public Assembler { // some ABI-related functions void save_nonvolatile_gprs( Register dst_base, int offset); void restore_nonvolatile_gprs(Register src_base, int offset); + enum { num_volatile_regs = 11 + 14 }; // GPR + FPR void save_volatile_gprs( Register dst_base, int offset); void restore_volatile_gprs(Register src_base, int offset); void save_LR_CR( Register tmp); // tmp contains LR on return. @@ -461,8 +460,10 @@ class MacroAssembler: public Assembler { Register super_klass, Register temp1_reg, Register temp2_reg, - Label& L_success, - Label& L_failure); + Label* L_success, + Label* L_failure, + Label* L_slow_path = NULL, // default fall through + RegisterOrConstant super_check_offset = RegisterOrConstant(-1)); // The rest of the type check; must be wired to a corresponding fast path. // It does not repeat the fast path logic, so don't use it standalone. @@ -507,6 +508,28 @@ class MacroAssembler: public Assembler { // biased locking exit case failed. void biased_locking_exit(ConditionRegister cr_reg, Register mark_addr, Register temp_reg, Label& done); + // allocation (for C1) + void eden_allocate( + Register obj, // result: pointer to object after successful allocation + Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise + int con_size_in_bytes, // object size in bytes if known at compile time + Register t1, // temp register + Register t2, // temp register + Label& slow_case // continuation point if fast allocation fails + ); + void tlab_allocate( + Register obj, // result: pointer to object after successful allocation + Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise + int con_size_in_bytes, // object size in bytes if known at compile time + Register t1, // temp register + Label& slow_case // continuation point if fast allocation fails + ); + void tlab_refill(Label& retry_tlab, Label& try_eden, Label& slow_case); + void incr_allocated_bytes(RegisterOrConstant size_in_bytes, Register t1, Register t2); + + enum { trampoline_stub_size = 6 * 4 }; + address emit_trampoline_stub(int destination_toc_offset, int insts_call_instruction_offset, Register Rtoc = noreg); + void atomic_inc_ptr(Register addr, Register result, int simm16 = 1); void atomic_ori_int(Register addr, Register result, int uimm16); @@ -597,9 +620,7 @@ class MacroAssembler: public Assembler { // Implicit or explicit null check, jumps to static address exception_entry. inline void null_check_throw(Register a, int offset, Register temp_reg, address exception_entry); - - // Check accessed object for null. Use SIGTRAP-based null checks on AIX. - inline void load_with_trap_null_check(Register d, int si16, Register s1); + inline void null_check(Register a, int offset, Label *Lis_null); // implicit only if Lis_null not provided // Load heap oop and decompress. Loaded oop may not be null. // Specify tmp to save one cycle. @@ -619,20 +640,17 @@ class MacroAssembler: public Assembler { inline Register decode_heap_oop_not_null(Register d, Register src = noreg); // Null allowed. + inline Register encode_heap_oop(Register d, Register src); // Prefer null check in GC barrier! inline void decode_heap_oop(Register d); // Load/Store klass oop from klass field. Compress. void load_klass(Register dst, Register src); - void load_klass_with_trap_null_check(Register dst, Register src); void store_klass(Register dst_oop, Register klass, Register tmp = R0); void store_klass_gap(Register dst_oop, Register val = noreg); // Will store 0 if val not specified. static int instr_size_for_decode_klass_not_null(); void decode_klass_not_null(Register dst, Register src = noreg); Register encode_klass_not_null(Register dst, Register src = noreg); - // Load common heap base into register. - void reinit_heapbase(Register d, Register tmp = noreg); - // SIGTRAP-based range checks for arrays. inline void trap_range_check_l(Register a, Register b); inline void trap_range_check_l(Register a, int si16); @@ -750,6 +768,7 @@ class MacroAssembler: public Assembler { // Emit code to verify that reg contains a valid oop if +VerifyOops is set. void verify_oop(Register reg, const char* s = "broken oop"); + void verify_oop_addr(RegisterOrConstant offs, Register base, const char* s = "contains broken oop"); // TODO: verify method and klass metadata (compare against vptr?) void _verify_method_ptr(Register reg, const char * msg, const char * file, int line) {} diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp index 9d062d799c7..62843482074 100644 --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.inline.hpp @@ -70,9 +70,11 @@ inline void MacroAssembler::endgroup_if_needed(bool needed) { } inline void MacroAssembler::membar(int bits) { - // TODO: use elemental_membar(bits) for Power 8 and disable optimization of acquire-release - // (Matcher::post_membar_release where we use PPC64_ONLY(xop == Op_MemBarRelease ||)) - if (bits & StoreLoad) sync(); else lwsync(); + // Comment: Usage of elemental_membar(bits) is not recommended for Power 8. + // If elemental_membar(bits) is used, disable optimization of acquire-release + // (Matcher::post_membar_release where we use PPC64_ONLY(xop == Op_MemBarRelease ||))! + if (bits & StoreLoad) { sync(); } + else if (bits) { lwsync(); } } inline void MacroAssembler::release() { membar(LoadStore | StoreStore); } inline void MacroAssembler::acquire() { membar(LoadLoad | LoadStore); } @@ -86,7 +88,7 @@ inline address MacroAssembler::global_toc() { // Offset of given address to the global TOC. inline int MacroAssembler::offset_to_global_toc(const address addr) { intptr_t offset = (intptr_t)addr - (intptr_t)MacroAssembler::global_toc(); - assert(Assembler::is_simm((long)offset, 31) && offset >= 0, "must be in range"); + assert(Assembler::is_uimm((long)offset, 31), "must be in range"); return (int)offset; } @@ -98,7 +100,7 @@ inline address MacroAssembler::method_toc() { // Offset of given address to current method's TOC. inline int MacroAssembler::offset_to_method_toc(address addr) { intptr_t offset = (intptr_t)addr - (intptr_t)method_toc(); - assert(is_simm((long)offset, 31) && offset >= 0, "must be in range"); + assert(Assembler::is_uimm((long)offset, 31), "must be in range"); return (int)offset; } @@ -190,13 +192,13 @@ inline bool MacroAssembler::is_bc_far_variant1_at(address instruction_addr) { // Variant 1, the 1st instruction contains the destination address: // // bcxx DEST - // endgroup + // nop // const int instruction_1 = *(int*)(instruction_addr); const int instruction_2 = *(int*)(instruction_addr + 4); return is_bcxx(instruction_1) && (inv_bd_field(instruction_1, (intptr_t)instruction_addr) != (intptr_t)(instruction_addr + 2*4)) && - is_endgroup(instruction_2); + is_nop(instruction_2); } // Relocation of conditional far branches. @@ -302,13 +304,17 @@ inline void MacroAssembler::null_check_throw(Register a, int offset, Register te } } -inline void MacroAssembler::load_with_trap_null_check(Register d, int si16, Register s1) { - if (!os::zero_page_read_protected()) { +inline void MacroAssembler::null_check(Register a, int offset, Label *Lis_null) { + if (!ImplicitNullChecks || needs_explicit_null_check(offset) || !os::zero_page_read_protected()) { if (TrapBasedNullChecks) { - trap_null_check(s1); + assert(UseSIGTRAP, "sanity"); + trap_null_check(a); + } else if (Lis_null){ + Label ok; + cmpdi(CCR0, a, 0); + beq(CCR0, *Lis_null); } } - ld(d, si16, s1); } inline void MacroAssembler::load_heap_oop_not_null(Register d, RegisterOrConstant offs, Register s1, Register tmp) { @@ -365,6 +371,26 @@ inline Register MacroAssembler::encode_heap_oop_not_null(Register d, Register sr return current; // Encoded oop is in this register. } +inline Register MacroAssembler::encode_heap_oop(Register d, Register src) { + if (Universe::narrow_oop_base() != NULL) { + if (VM_Version::has_isel()) { + cmpdi(CCR0, src, 0); + Register co = encode_heap_oop_not_null(d, src); + assert(co == d, "sanity"); + isel_0(d, CCR0, Assembler::equal); + } else { + Label isNull; + or_(d, src, src); // move and compare 0 + beq(CCR0, isNull); + encode_heap_oop_not_null(d, src); + bind(isNull); + } + return d; + } else { + return encode_heap_oop_not_null(d, src); + } +} + inline Register MacroAssembler::decode_heap_oop_not_null(Register d, Register src) { if (Universe::narrow_oop_base_disjoint() && src != noreg && src != d && Universe::narrow_oop_shift() != 0) { diff --git a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp index fed5e53c206..4a743eed8be 100644 --- a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -504,8 +504,7 @@ void trace_method_handle_stub(const char* adaptername, frame cur_frame = os::current_frame(); // Robust search of trace_calling_frame (independant of inlining). - // Assumes saved_regs comes from a pusha in the trace_calling_frame. - assert(cur_frame.sp() < saved_regs, "registers not saved on stack ?"); + assert(cur_frame.sp() <= saved_regs, "registers not saved on stack ?"); frame trace_calling_frame = os::get_sender_for_C_frame(&cur_frame); while (trace_calling_frame.fp() < saved_regs) { trace_calling_frame = os::get_sender_for_C_frame(&trace_calling_frame); @@ -539,7 +538,7 @@ void MethodHandles::trace_method_handle(MacroAssembler* _masm, const char* adapt BLOCK_COMMENT("trace_method_handle {"); const Register tmp = R11; // Will be preserved. - const int nbytes_save = 11*8; // volatile gprs except R0 + const int nbytes_save = MacroAssembler::num_volatile_regs * 8; __ save_volatile_gprs(R1_SP, -nbytes_save); // except R0 __ save_LR_CR(tmp); // save in old frame diff --git a/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp b/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp index ecca49af2ef..37956925d0d 100644 --- a/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -65,13 +65,17 @@ address NativeCall::destination() const { address destination = Assembler::bxx_destination(addr); // Do we use a trampoline stub for this call? - CodeBlob* cb = CodeCache::find_blob_unsafe(addr); // Else we get assertion if nmethod is zombie. - assert(cb && cb->is_nmethod(), "sanity"); - nmethod *nm = (nmethod *)cb; - if (nm->stub_contains(destination) && is_NativeCallTrampolineStub_at(destination)) { - // Yes we do, so get the destination from the trampoline stub. - const address trampoline_stub_addr = destination; - destination = NativeCallTrampolineStub_at(trampoline_stub_addr)->destination(nm); + // Trampoline stubs are located behind the main code. + if (destination > addr) { + // Filter out recursive method invocation (call to verified/unverified entry point). + CodeBlob* cb = CodeCache::find_blob_unsafe(addr); // Else we get assertion if nmethod is zombie. + assert(cb && cb->is_nmethod(), "sanity"); + nmethod *nm = (nmethod *)cb; + if (nm->stub_contains(destination) && is_NativeCallTrampolineStub_at(destination)) { + // Yes we do, so get the destination from the trampoline stub. + const address trampoline_stub_addr = destination; + destination = NativeCallTrampolineStub_at(trampoline_stub_addr)->destination(nm); + } } return destination; @@ -267,7 +271,7 @@ void NativeMovConstReg::set_data(intptr_t data) { oop_addr = r->oop_addr(); *oop_addr = cast_to_oop(data); } else { - assert(oop_addr == r->oop_addr(), "must be only one set-oop here") ; + assert(oop_addr == r->oop_addr(), "must be only one set-oop here"); } } if (iter.type() == relocInfo::metadata_type) { @@ -351,6 +355,27 @@ void NativeJump::verify() { } #endif // ASSERT + +void NativeGeneralJump::insert_unconditional(address code_pos, address entry) { + CodeBuffer cb(code_pos, BytesPerInstWord + 1); + MacroAssembler* a = new MacroAssembler(&cb); + a->b(entry); + ICache::ppc64_flush_icache_bytes(code_pos, NativeGeneralJump::instruction_size); +} + +// MT-safe patching of a jmp instruction. +void NativeGeneralJump::replace_mt_safe(address instr_addr, address code_buffer) { + // Bytes beyond offset NativeGeneralJump::instruction_size are copied by caller. + + // Finally patch out the jump. + volatile juint *jump_addr = (volatile juint*)instr_addr; + // Release not needed because caller uses invalidate_range after copying the remaining bytes. + //OrderAccess::release_store(jump_addr, *((juint*)code_buffer)); + *jump_addr = *((juint*)code_buffer); // atomically store code over branch instruction + ICache::ppc64_flush_icache_bytes(instr_addr, NativeGeneralJump::instruction_size); +} + + //------------------------------------------------------------------- // Call trampoline stubs. @@ -364,10 +389,12 @@ void NativeJump::verify() { // address NativeCallTrampolineStub::encoded_destination_addr() const { - address instruction_addr = addr_at(2 * BytesPerInstWord); - assert(MacroAssembler::is_ld_largeoffset(instruction_addr), - "must be a ld with large offset (from the constant pool)"); - + address instruction_addr = addr_at(0 * BytesPerInstWord); + if (!MacroAssembler::is_ld_largeoffset(instruction_addr)) { + instruction_addr = addr_at(2 * BytesPerInstWord); + assert(MacroAssembler::is_ld_largeoffset(instruction_addr), + "must be a ld with large offset (from the constant pool)"); + } return instruction_addr; } diff --git a/hotspot/src/cpu/ppc/vm/nativeInst_ppc.hpp b/hotspot/src/cpu/ppc/vm/nativeInst_ppc.hpp index 0ef57be0556..f0f6b6a87d9 100644 --- a/hotspot/src/cpu/ppc/vm/nativeInst_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/nativeInst_ppc.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2013 SAP AG. All rights reserved. + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,6 +50,8 @@ class NativeInstruction VALUE_OBJ_CLASS_SPEC { friend class Relocation; public: + bool is_jump() { return Assembler::is_b(long_at(0)); } // See NativeGeneralJump. + bool is_sigtrap_ic_miss_check() { assert(UseSIGTRAP, "precondition"); return MacroAssembler::is_trap_ic_miss_check(long_at(0)); @@ -235,8 +237,8 @@ inline NativeFarCall* nativeFarCall_at(address instr) { return call; } -// An interface for accessing/manipulating native set_oop imm, reg instructions. -// (used to manipulate inlined data references, etc.) +// An interface for accessing/manipulating native set_oop imm, reg instructions +// (used to manipulate inlined data references, etc.). class NativeMovConstReg: public NativeInstruction { public: @@ -384,10 +386,21 @@ class NativeCallTrampolineStub : public NativeInstruction { void set_destination(address new_destination); }; +// Note: Other stubs must not begin with this pattern. inline bool is_NativeCallTrampolineStub_at(address address) { int first_instr = *(int*)address; - return Assembler::is_addis(first_instr) && - (Register)(intptr_t)Assembler::inv_rt_field(first_instr) == R12_scratch2; + // calculate_address_from_global_toc and long form of ld_largeoffset_unchecked begin with addis with target R12 + if (Assembler::is_addis(first_instr) && + (Register)(intptr_t)Assembler::inv_rt_field(first_instr) == R12_scratch2) return true; + + // short form of ld_largeoffset_unchecked is ld which is followed by mtctr + int second_instr = *((int*)address + 1); + if (Assembler::is_ld(first_instr) && + (Register)(intptr_t)Assembler::inv_rt_field(first_instr) == R12_scratch2 && + Assembler::is_mtctr(second_instr) && + (Register)(intptr_t)Assembler::inv_rs_field(second_instr) == R12_scratch2) return true; + + return false; } inline NativeCallTrampolineStub* NativeCallTrampolineStub_at(address address) { @@ -395,4 +408,102 @@ inline NativeCallTrampolineStub* NativeCallTrampolineStub_at(address address) { return (NativeCallTrampolineStub*)address; } +/////////////////////////////////////////////////////////////////////////////////////////////////// + +//------------------------------------- +// N a t i v e G e n e r a l J u m p +//------------------------------------- + +// Despite the name, handles only simple branches. +class NativeGeneralJump; +inline NativeGeneralJump* nativeGeneralJump_at(address address); + +// Currently only implemented as single unconditional branch. +class NativeGeneralJump: public NativeInstruction { + public: + + enum PPC64_specific_constants { + instruction_size = 4 + }; + + address instruction_address() const { return addr_at(0); } + + // Creation. + friend inline NativeGeneralJump* nativeGeneralJump_at(address addr) { + NativeGeneralJump* jump = (NativeGeneralJump*)(addr); + DEBUG_ONLY( jump->verify(); ) + return jump; + } + + // Insertion of native general jump instruction. + static void insert_unconditional(address code_pos, address entry); + + address jump_destination() const { + DEBUG_ONLY( verify(); ) + return addr_at(0) + Assembler::inv_li_field(long_at(0)); + } + + void set_jump_destination(address dest) { + DEBUG_ONLY( verify(); ) + insert_unconditional(addr_at(0), dest); + } + + static void replace_mt_safe(address instr_addr, address code_buffer); + + void verify() const { guarantee(Assembler::is_b(long_at(0)), "invalid NativeGeneralJump"); } +}; + +// An interface for accessing/manipulating native load int (load_const32). +class NativeMovRegMem; +inline NativeMovRegMem* nativeMovRegMem_at(address address); +class NativeMovRegMem: public NativeInstruction { + public: + + enum PPC64_specific_constants { + instruction_size = 8 + }; + + address instruction_address() const { return addr_at(0); } + + intptr_t offset() const { +#ifdef VM_LITTLE_ENDIAN + short *hi_ptr = (short*)(addr_at(0)); + short *lo_ptr = (short*)(addr_at(4)); +#else + short *hi_ptr = (short*)(addr_at(0) + 2); + short *lo_ptr = (short*)(addr_at(4) + 2); +#endif + return ((*hi_ptr) << 16) | ((*lo_ptr) & 0xFFFF); + } + + void set_offset(intptr_t x) { +#ifdef VM_LITTLE_ENDIAN + short *hi_ptr = (short*)(addr_at(0)); + short *lo_ptr = (short*)(addr_at(4)); +#else + short *hi_ptr = (short*)(addr_at(0) + 2); + short *lo_ptr = (short*)(addr_at(4) + 2); +#endif + *hi_ptr = x >> 16; + *lo_ptr = x & 0xFFFF; + ICache::ppc64_flush_icache_bytes(addr_at(0), NativeMovRegMem::instruction_size); + } + + void add_offset_in_bytes(intptr_t radd_offset) { + set_offset(offset() + radd_offset); + } + + void verify() const { + guarantee(Assembler::is_lis(long_at(0)), "load_const32 1st instr"); + guarantee(Assembler::is_ori(long_at(4)), "load_const32 2nd instr"); + } + + private: + friend inline NativeMovRegMem* nativeMovRegMem_at(address address) { + NativeMovRegMem* test = (NativeMovRegMem*)address; + DEBUG_ONLY( test->verify(); ) + return test; + } +}; + #endif // CPU_PPC_VM_NATIVEINST_PPC_HPP diff --git a/hotspot/src/cpu/ppc/vm/ppc.ad b/hotspot/src/cpu/ppc/vm/ppc.ad index daa35899360..aefdf28133f 100644 --- a/hotspot/src/cpu/ppc/vm/ppc.ad +++ b/hotspot/src/cpu/ppc/vm/ppc.ad @@ -698,7 +698,7 @@ reg_class ctr_reg(SR_CTR); // ---------------------------- reg_class flt_reg( -/*F0*/ // scratch + F0, F1, F2, F3, @@ -735,7 +735,7 @@ reg_class flt_reg( // Double precision float registers have virtual `high halves' that // are needed by the allocator. reg_class dbl_reg( -/*F0, F0_H*/ // scratch + F0, F0_H, F1, F1_H, F2, F2_H, F3, F3_H, @@ -1040,8 +1040,6 @@ source_hpp %{ // Header information of the source block. //---< Used for optimization in Compile::Shorten_branches >--- //-------------------------------------------------------------- -const uint trampoline_stub_size = 6 * BytesPerInstWord; - class CallStubImpl { public: @@ -1053,7 +1051,7 @@ class CallStubImpl { // This doesn't need to be accurate to the byte, but it // must be larger than or equal to the real size of the stub. static uint size_call_trampoline() { - return trampoline_stub_size; + return MacroAssembler::trampoline_stub_size; } // number of relocations needed by a call trampoline stub @@ -1079,46 +1077,10 @@ source %{ // branch via CTR (LR/link still points to the call-site above) void CallStubImpl::emit_trampoline_stub(MacroAssembler &_masm, int destination_toc_offset, int insts_call_instruction_offset) { - // Start the stub. - address stub = __ start_a_stub(Compile::MAX_stubs_size/2); + address stub = __ emit_trampoline_stub(destination_toc_offset, insts_call_instruction_offset); if (stub == NULL) { - ciEnv::current()->record_failure("CodeCache is full"); - return; + ciEnv::current()->record_out_of_memory_failure(); } - - // For java_to_interp stubs we use R11_scratch1 as scratch register - // and in call trampoline stubs we use R12_scratch2. This way we - // can distinguish them (see is_NativeCallTrampolineStub_at()). - Register reg_scratch = R12_scratch2; - - // Create a trampoline stub relocation which relates this trampoline stub - // with the call instruction at insts_call_instruction_offset in the - // instructions code-section. - __ relocate(trampoline_stub_Relocation::spec(__ code()->insts()->start() + insts_call_instruction_offset)); - const int stub_start_offset = __ offset(); - - // Now, create the trampoline stub's code: - // - load the TOC - // - load the call target from the constant pool - // - call - __ calculate_address_from_global_toc(reg_scratch, __ method_toc()); - __ ld_largeoffset_unchecked(reg_scratch, destination_toc_offset, reg_scratch, false); - __ mtctr(reg_scratch); - __ bctr(); - - const address stub_start_addr = __ addr_at(stub_start_offset); - - // FIXME: Assert that the trampoline stub can be identified and patched. - - // Assert that the encoded destination_toc_offset can be identified and that it is correct. - assert(destination_toc_offset == NativeCallTrampolineStub_at(stub_start_addr)->destination_toc_offset(), - "encoded offset into the constant pool must match"); - // Trampoline_stub_size should be good. - assert((uint)(__ offset() - stub_start_offset) <= trampoline_stub_size, "should be good size"); - assert(is_NativeCallTrampolineStub_at(stub_start_addr), "doesn't look like a trampoline"); - - // End the stub. - __ end_a_stub(); } //============================================================================= @@ -1156,6 +1118,10 @@ EmitCallOffsets emit_call_with_trampoline_stub(MacroAssembler &_masm, address en if (!Compile::current()->in_scratch_emit_size()) { // Put the entry point as a constant into the constant pool. const address entry_point_toc_addr = __ address_constant(entry_point, RelocationHolder::none); + if (entry_point_toc_addr == NULL) { + ciEnv::current()->record_out_of_memory_failure(); + return offsets; + } const int entry_point_toc_offset = __ offset_to_method_toc(entry_point_toc_addr); // Emit the trampoline stub which will be related to the branch-and-link below. @@ -2474,6 +2440,10 @@ encode %{ // Create a non-oop constant, no relocation needed. // If it is an IC, it has a virtual_call_Relocation. const_toc_addr = __ long_constant((jlong)$src$$constant); + if (const_toc_addr == NULL) { + ciEnv::current()->record_out_of_memory_failure(); + return; + } // Get the constant's TOC offset. toc_offset = __ offset_to_method_toc(const_toc_addr); @@ -2495,6 +2465,10 @@ encode %{ // Create a non-oop constant, no relocation needed. // If it is an IC, it has a virtual_call_Relocation. const_toc_addr = __ long_constant((jlong)$src$$constant); + if (const_toc_addr == NULL) { + ciEnv::current()->record_out_of_memory_failure(); + return; + } // Get the constant's TOC offset. const int toc_offset = __ offset_to_method_toc(const_toc_addr); @@ -2631,6 +2605,10 @@ encode %{ const_toc_addr = __ long_constant((jlong)$src$$constant); } + if (const_toc_addr == NULL) { + ciEnv::current()->record_out_of_memory_failure(); + return; + } // Get the constant's TOC offset. toc_offset = __ offset_to_method_toc(const_toc_addr); } @@ -2660,6 +2638,10 @@ encode %{ const_toc_addr = __ long_constant((jlong)$src$$constant); } + if (const_toc_addr == NULL) { + ciEnv::current()->record_out_of_memory_failure(); + return; + } // Get the constant's TOC offset. const int toc_offset = __ offset_to_method_toc(const_toc_addr); // Store the toc offset of the constant. @@ -3408,6 +3390,10 @@ encode %{ // Put the entry point as a constant into the constant pool. const address entry_point_toc_addr = __ address_constant(entry_point, RelocationHolder::none); + if (entry_point_toc_addr == NULL) { + ciEnv::current()->record_out_of_memory_failure(); + return; + } const int entry_point_toc_offset = __ offset_to_method_toc(entry_point_toc_addr); // Emit the trampoline stub which will be related to the branch-and-link below. @@ -3433,76 +3419,6 @@ encode %{ } %} - // Emit a method handle call. - // - // Method handle calls from compiled to compiled are going thru a - // c2i -> i2c adapter, extending the frame for their arguments. The - // caller however, returns directly to the compiled callee, that has - // to cope with the extended frame. We restore the original frame by - // loading the callers sp and adding the calculated framesize. - enc_class enc_java_handle_call(method meth) %{ - // TODO: PPC port $archOpcode(ppc64Opcode_compound); - - MacroAssembler _masm(&cbuf); - address entry_point = (address)$meth$$method; - - // Remember the offset not the address. - const int start_offset = __ offset(); - // The trampoline stub. - if (!ra_->C->in_scratch_emit_size()) { - // No entry point given, use the current pc. - // Make sure branch fits into - if (entry_point == 0) entry_point = __ pc(); - - // Put the entry point as a constant into the constant pool. - const address entry_point_toc_addr = __ address_constant(entry_point, RelocationHolder::none); - const int entry_point_toc_offset = __ offset_to_method_toc(entry_point_toc_addr); - - // Emit the trampoline stub which will be related to the branch-and-link below. - CallStubImpl::emit_trampoline_stub(_masm, entry_point_toc_offset, start_offset); - if (ra_->C->env()->failing()) { return; } // Code cache may be full. - assert(_optimized_virtual, "methodHandle call should be a virtual call"); - __ relocate(relocInfo::opt_virtual_call_type); - } - - // The real call. - // Note: At this point we do not have the address of the trampoline - // stub, and the entry point might be too far away for bl, so __ pc() - // serves as dummy and the bl will be patched later. - cbuf.set_insts_mark(); - __ bl(__ pc()); // Emits a relocation. - - assert(_method, "execute next statement conditionally"); - // The stub for call to interpreter. - address stub = CompiledStaticCall::emit_to_interp_stub(cbuf); - if (stub == NULL) { - ciEnv::current()->record_failure("CodeCache is full"); - return; - } - - // Restore original sp. - __ ld(R11_scratch1, 0, R1_SP); // Load caller sp. - const long framesize = ra_->C->frame_slots() << LogBytesPerInt; - unsigned int bytes = (unsigned int)framesize; - long offset = Assembler::align_addr(bytes, frame::alignment_in_bytes); - if (Assembler::is_simm(-offset, 16)) { - __ addi(R1_SP, R11_scratch1, -offset); - } else { - __ load_const_optimized(R12_scratch2, -offset); - __ add(R1_SP, R11_scratch1, R12_scratch2); - } -#ifdef ASSERT - __ ld(R12_scratch2, 0, R1_SP); // Load from unextended_sp. - __ cmpd(CCR0, R11_scratch1, R12_scratch2); - __ asm_assert_eq("backlink changed", 0x8000); -#endif - // If fails should store backlink before unextending. - - if (ra_->C->env()->failing()) { - return; - } - %} - // Second node of expanded dynamic call - the call. enc_class enc_java_dynamic_call_sched(method meth) %{ // TODO: PPC port $archOpcode(ppc64Opcode_bl); @@ -3513,6 +3429,10 @@ encode %{ // Create a call trampoline stub for the given method. const address entry_point = !($meth$$method) ? 0 : (address)$meth$$method; const address entry_point_const = __ address_constant(entry_point, RelocationHolder::none); + if (entry_point_const == NULL) { + ciEnv::current()->record_out_of_memory_failure(); + return; + } const int entry_point_const_toc_offset = __ offset_to_method_toc(entry_point_const); CallStubImpl::emit_trampoline_stub(_masm, entry_point_const_toc_offset, __ offset()); if (ra_->C->env()->failing()) { return; } // Code cache may be full. @@ -3620,7 +3540,11 @@ encode %{ address virtual_call_meta_addr = __ pc(); // Load a clear inline cache. AddressLiteral empty_ic((address) Universe::non_oop_word()); - __ load_const_from_method_toc(ic_reg, empty_ic, Rtoc); + bool success = __ load_const_from_method_toc(ic_reg, empty_ic, Rtoc, /*fixed_size*/ true); + if (!success) { + ciEnv::current()->record_out_of_memory_failure(); + return; + } // CALL to fixup routine. Fixup routine uses ScopeDesc info // to determine who we intended to call. __ relocate(virtual_call_Relocation::spec(virtual_call_meta_addr)); @@ -3676,7 +3600,11 @@ encode %{ __ calculate_address_from_global_toc(Rtoc, __ method_toc()); // Put entry, env, toc into the constant pool, this needs up to 3 constant // pool entries; call_c_using_toc will optimize the call. - __ call_c_using_toc(fd, relocInfo::runtime_call_type, Rtoc); + bool success = __ call_c_using_toc(fd, relocInfo::runtime_call_type, Rtoc); + if (!success) { + ciEnv::current()->record_out_of_memory_failure(); + return; + } #endif // Check the ret_addr_offset. @@ -6263,6 +6191,10 @@ instruct loadConF(regF dst, immF src, iRegLdst toc) %{ ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_lfs); address float_address = __ float_constant($src$$constant); + if (float_address == NULL) { + ciEnv::current()->record_out_of_memory_failure(); + return; + } __ lfs($dst$$FloatRegister, __ offset_to_method_toc(float_address), $toc$$Register); %} ins_pipe(pipe_class_memory); @@ -6284,6 +6216,10 @@ instruct loadConFComp(regF dst, immF src, iRegLdst toc) %{ FloatRegister Rdst = $dst$$FloatRegister; Register Rtoc = $toc$$Register; address float_address = __ float_constant($src$$constant); + if (float_address == NULL) { + ciEnv::current()->record_out_of_memory_failure(); + return; + } int offset = __ offset_to_method_toc(float_address); int hi = (offset + (1<<15))>>16; int lo = offset - hi * (1<<16); @@ -6318,7 +6254,12 @@ instruct loadConD(regD dst, immD src, iRegLdst toc) %{ size(4); ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_lfd); - int offset = __ offset_to_method_toc(__ double_constant($src$$constant)); + address float_address = __ double_constant($src$$constant); + if (float_address == NULL) { + ciEnv::current()->record_out_of_memory_failure(); + return; + } + int offset = __ offset_to_method_toc(float_address); __ lfd($dst$$FloatRegister, offset, $toc$$Register); %} ins_pipe(pipe_class_memory); @@ -6340,7 +6281,11 @@ instruct loadConDComp(regD dst, immD src, iRegLdst toc) %{ FloatRegister Rdst = $dst$$FloatRegister; Register Rtoc = $toc$$Register; address float_address = __ double_constant($src$$constant); - int offset = __ offset_to_method_toc(float_address); + if (float_address == NULL) { + ciEnv::current()->record_out_of_memory_failure(); + return; + } + int offset = __ offset_to_method_toc(float_address); int hi = (offset + (1<<15))>>16; int lo = offset - hi * (1<<16); @@ -11790,7 +11735,6 @@ instruct safePoint_poll_conPollAddr(rscratch2RegP poll) %{ instruct CallStaticJavaDirect(method meth) %{ match(CallStaticJava); effect(USE meth); - predicate(!((CallStaticJavaNode*)n)->is_method_handle_invoke()); ins_cost(CALL_COST); ins_num_consts(3 /* up to 3 patchable constants: inline cache, 2 call targets. */); @@ -11801,20 +11745,6 @@ instruct CallStaticJavaDirect(method meth) %{ ins_pipe(pipe_class_call); %} -// Schedulable version of call static node. -instruct CallStaticJavaDirectHandle(method meth) %{ - match(CallStaticJava); - effect(USE meth); - predicate(((CallStaticJavaNode*)n)->is_method_handle_invoke()); - ins_cost(CALL_COST); - - ins_num_consts(3 /* up to 3 patchable constants: inline cache, 2 call targets. */); - - format %{ "CALL,static $meth \t// ==> " %} - ins_encode( enc_java_handle_call(meth) ); - ins_pipe(pipe_class_call); -%} - // Call Java Dynamic Instruction // Used by postalloc expand of CallDynamicJavaDirectSchedEx (actual call). diff --git a/hotspot/src/cpu/ppc/vm/register_ppc.hpp b/hotspot/src/cpu/ppc/vm/register_ppc.hpp index 9dc765ab4a2..1d0eeac61a2 100644 --- a/hotspot/src/cpu/ppc/vm/register_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/register_ppc.hpp @@ -627,6 +627,9 @@ REGISTER_DECLARATION(Register, R27_constPoolCache, R27); REGISTER_DECLARATION(Register, R28_mdx, R28); #endif // CC_INTERP +REGISTER_DECLARATION(Register, R19_inline_cache_reg, R19); +REGISTER_DECLARATION(Register, R29_TOC, R29); + #ifndef DONT_USE_REGISTER_DEFINES #define R21_tmp1 AS_REGISTER(Register, R21) #define R22_tmp2 AS_REGISTER(Register, R22) @@ -648,6 +651,9 @@ REGISTER_DECLARATION(Register, R28_mdx, R28); #define R28_mdx AS_REGISTER(Register, R28) #endif +#define R19_inline_cache_reg AS_REGISTER(Register, R19) +#define R29_TOC AS_REGISTER(Register, R29) + #define CCR4_is_synced AS_REGISTER(ConditionRegister, CCR4) #endif diff --git a/hotspot/src/cpu/ppc/vm/relocInfo_ppc.cpp b/hotspot/src/cpu/ppc/vm/relocInfo_ppc.cpp index 74e72ba62b6..9c5065d0dd4 100644 --- a/hotspot/src/cpu/ppc/vm/relocInfo_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/relocInfo_ppc.cpp @@ -84,13 +84,11 @@ address Relocation::pd_call_destination(address orig_addr) { NativeConditionalFarBranch* branch = NativeConditionalFarBranch_at(inst_loc); return branch->branch_destination(); } else { - // There are two instructions at the beginning of a stub, therefore we - // load at orig_addr + 8. orig_addr = nativeCall_at(inst_loc)->get_trampoline(); if (orig_addr == NULL) { return (address) -1; } else { - return (address) nativeMovConstReg_at(orig_addr + 8)->data(); + return ((NativeCallTrampolineStub*)orig_addr)->destination(); } } } diff --git a/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp b/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp index 404df938777..e887877d14e 100644 --- a/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/runtime_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,16 +45,6 @@ #ifdef COMPILER2 -// SP adjustment (must use unextended SP) for method handle call sites -// during exception handling. -static intptr_t adjust_SP_for_methodhandle_callsite(JavaThread *thread) { - RegisterMap map(thread, false); - // The frame constructor will do the correction for us (see frame::adjust_unextended_SP). - frame mh_caller_frame = thread->last_frame().sender(&map); - assert(mh_caller_frame.is_compiled_frame(), "Only may reach here for compiled MH call sites"); - return (intptr_t) mh_caller_frame.unextended_sp(); -} - //------------------------------generate_exception_blob--------------------------- // Creates exception blob at the end. // Using exception blob, this code is jumped from a compiled method. @@ -129,17 +119,10 @@ void OptoRuntime::generate_exception_blob() { OopMapSet* oop_maps = new OopMapSet(); oop_maps->add_gc_map(calls_return_pc - start, map); - // Get unextended_sp for method handle call sites. - Label mh_callsite, mh_done; // Use a 2nd c call if it's a method handle call site. - __ lwa(R4_ARG2, in_bytes(JavaThread::is_method_handle_return_offset()), R16_thread); - __ cmpwi(CCR0, R4_ARG2, 0); - __ bne(CCR0, mh_callsite); - __ mtctr(R3_RET); // Move address of exception handler to SR_CTR. __ reset_last_Java_frame(); __ pop_frame(); - __ bind(mh_done); // We have a handler in register SR_CTR (could be deopt blob). // Get the exception oop. @@ -161,25 +144,6 @@ void OptoRuntime::generate_exception_blob() { __ mtlr(R4_ARG2); __ bctr(); - - // Same as above, but also set sp to unextended_sp. - __ bind(mh_callsite); - __ mr(R31, R3_RET); // Save branch address. - __ mr(R3_ARG1, R16_thread); -#if defined(ABI_ELFv2) - __ call_c((address) adjust_SP_for_methodhandle_callsite, relocInfo::none); -#else - __ call_c(CAST_FROM_FN_PTR(FunctionDescriptor*, adjust_SP_for_methodhandle_callsite), relocInfo::none); -#endif - // Returns unextended_sp in R3_RET. - - __ mtctr(R31); // Move address of exception handler to SR_CTR. - __ reset_last_Java_frame(); - - __ mr(R1_SP, R3_RET); // Set sp to unextended_sp. - __ b(mh_done); - - // Make sure all code is generated. masm->flush(); diff --git a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp index 141891d0a16..ec9f568516e 100644 --- a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp @@ -62,7 +62,7 @@ class RegisterSaver { // Support different return pc locations. enum ReturnPCLocation { return_pc_is_lr, - return_pc_is_r4, + return_pc_is_pre_saved, return_pc_is_thread_saved_exception_pc }; @@ -241,16 +241,17 @@ OopMap* RegisterSaver::push_frame_reg_args_and_save_live_registers(MacroAssemble __ mfcr(R31); __ std(R31, _abi(cr), R1_SP); switch (return_pc_location) { - case return_pc_is_lr: __ mflr(R31); break; - case return_pc_is_r4: __ mr(R31, R4); break; - case return_pc_is_thread_saved_exception_pc: - __ ld(R31, thread_(saved_exception_pc)); break; + case return_pc_is_lr: __ mflr(R31); break; + case return_pc_is_pre_saved: assert(return_pc_adjustment == 0, "unsupported"); break; + case return_pc_is_thread_saved_exception_pc: __ ld(R31, thread_(saved_exception_pc)); break; default: ShouldNotReachHere(); } - if (return_pc_adjustment != 0) { - __ addi(R31, R31, return_pc_adjustment); + if (return_pc_location != return_pc_is_pre_saved) { + if (return_pc_adjustment != 0) { + __ addi(R31, R31, return_pc_adjustment); + } + __ std(R31, _abi(lr), R1_SP); } - __ std(R31, _abi(lr), R1_SP); // push a new frame __ push_frame(frame_size_in_bytes, R31); @@ -646,7 +647,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt, return round_to(stk, 2); } -#ifdef COMPILER2 +#if defined(COMPILER1) || defined(COMPILER2) // Calling convention for calling C code. int SharedRuntime::c_calling_convention(const BasicType *sig_bt, VMRegPair *regs, @@ -2576,7 +2577,7 @@ uint SharedRuntime::out_preserve_stack_slots() { #endif } -#ifdef COMPILER2 +#if defined(COMPILER1) || defined(COMPILER2) // Frame generation for deopt and uncommon trap blobs. static void push_skeleton_frame(MacroAssembler* masm, bool deopt, /* Read */ @@ -2734,7 +2735,7 @@ void SharedRuntime::generate_deopt_blob() { const address start = __ pc(); -#ifdef COMPILER2 +#if defined(COMPILER1) || defined(COMPILER2) // -------------------------------------------------------------------------- // Prolog for non exception case! @@ -2783,28 +2784,43 @@ void SharedRuntime::generate_deopt_blob() { BLOCK_COMMENT("Prolog for exception case"); - // The RegisterSaves doesn't need to adjust the return pc for this situation. - const int return_pc_adjustment_exception = 0; - - // Push the "unpack frame". - // Save everything in sight. - assert(R4 == R4_ARG2, "exception pc must be in r4"); - RegisterSaver::push_frame_reg_args_and_save_live_registers(masm, - &first_frame_size_in_bytes, - /*generate_oop_map=*/ false, - return_pc_adjustment_exception, - RegisterSaver::return_pc_is_r4); - - // Deopt during an exception. Save exec mode for unpack_frames. - __ li(exec_mode_reg, Deoptimization::Unpack_exception); - // Store exception oop and pc in thread (location known to GC). // This is needed since the call to "fetch_unroll_info()" may safepoint. __ std(R3_ARG1, in_bytes(JavaThread::exception_oop_offset()), R16_thread); __ std(R4_ARG2, in_bytes(JavaThread::exception_pc_offset()), R16_thread); + __ std(R4_ARG2, _abi(lr), R1_SP); + + // Vanilla deoptimization with an exception pending in exception_oop. + int exception_in_tls_offset = __ pc() - start; + + // Push the "unpack frame". + // Save everything in sight. + RegisterSaver::push_frame_reg_args_and_save_live_registers(masm, + &first_frame_size_in_bytes, + /*generate_oop_map=*/ false, + /*return_pc_adjustment_exception=*/ 0, + RegisterSaver::return_pc_is_pre_saved); + + // Deopt during an exception. Save exec mode for unpack_frames. + __ li(exec_mode_reg, Deoptimization::Unpack_exception); // fall through + int reexecute_offset = 0; +#ifdef COMPILER1 + __ b(exec_mode_initialized); + + // Reexecute entry, similar to c2 uncommon trap + reexecute_offset = __ pc() - start; + + RegisterSaver::push_frame_reg_args_and_save_live_registers(masm, + &first_frame_size_in_bytes, + /*generate_oop_map=*/ false, + /*return_pc_adjustment_reexecute=*/ 0, + RegisterSaver::return_pc_is_pre_saved); + __ li(exec_mode_reg, Deoptimization::Unpack_reexecute); +#endif + // -------------------------------------------------------------------------- __ BIND(exec_mode_initialized); @@ -2918,7 +2934,9 @@ void SharedRuntime::generate_deopt_blob() { int exception_offset = __ pc() - start; #endif // COMPILER2 - _deopt_blob = DeoptimizationBlob::create(&buffer, oop_maps, 0, exception_offset, 0, first_frame_size_in_bytes / wordSize); + _deopt_blob = DeoptimizationBlob::create(&buffer, oop_maps, 0, exception_offset, + reexecute_offset, first_frame_size_in_bytes / wordSize); + _deopt_blob->set_unpack_with_exception_in_tls_offset(exception_in_tls_offset); } #ifdef COMPILER2 diff --git a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp index 1dbb5c04f29..28f2ca60425 100644 --- a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp @@ -48,6 +48,12 @@ #define BLOCK_COMMENT(str) __ block_comment(str) #endif +#if defined(ABI_ELFv2) +#define STUB_ENTRY(name) StubRoutines::name() +#else +#define STUB_ENTRY(name) ((FunctionDescriptor*)StubRoutines::name())->entry() +#endif + class StubGenerator: public StubCodeGenerator { private: @@ -259,8 +265,7 @@ class StubGenerator: public StubCodeGenerator { // // global toc register - __ load_const(R29, MacroAssembler::global_toc(), R11_scratch1); - + __ load_const_optimized(R29_TOC, MacroAssembler::global_toc(), R11_scratch1); // Remember the senderSP so we interpreter can pop c2i arguments off of the stack // when called via a c2i. @@ -619,14 +624,17 @@ class StubGenerator: public StubCodeGenerator { // Kills: // nothing // - void gen_write_ref_array_pre_barrier(Register from, Register to, Register count, bool dest_uninitialized, Register Rtmp1) { + void gen_write_ref_array_pre_barrier(Register from, Register to, Register count, bool dest_uninitialized, Register Rtmp1, + Register preserve1 = noreg, Register preserve2 = noreg) { BarrierSet* const bs = Universe::heap()->barrier_set(); switch (bs->kind()) { case BarrierSet::G1SATBCTLogging: // With G1, don't generate the call if we statically know that the target in uninitialized if (!dest_uninitialized) { - const int spill_slots = 4 * wordSize; - const int frame_size = frame::abi_reg_args_size + spill_slots; + int spill_slots = 3; + if (preserve1 != noreg) { spill_slots++; } + if (preserve2 != noreg) { spill_slots++; } + const int frame_size = align_size_up(frame::abi_reg_args_size + spill_slots * BytesPerWord, frame::alignment_in_bytes); Label filtered; // Is marking active? @@ -640,17 +648,23 @@ class StubGenerator: public StubCodeGenerator { __ beq(CCR0, filtered); __ save_LR_CR(R0); - __ push_frame_reg_args(spill_slots, R0); - __ std(from, frame_size - 1 * wordSize, R1_SP); - __ std(to, frame_size - 2 * wordSize, R1_SP); - __ std(count, frame_size - 3 * wordSize, R1_SP); + __ push_frame(frame_size, R0); + int slot_nr = 0; + __ std(from, frame_size - (++slot_nr) * wordSize, R1_SP); + __ std(to, frame_size - (++slot_nr) * wordSize, R1_SP); + __ std(count, frame_size - (++slot_nr) * wordSize, R1_SP); + if (preserve1 != noreg) { __ std(preserve1, frame_size - (++slot_nr) * wordSize, R1_SP); } + if (preserve2 != noreg) { __ std(preserve2, frame_size - (++slot_nr) * wordSize, R1_SP); } __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_pre), to, count); - __ ld(from, frame_size - 1 * wordSize, R1_SP); - __ ld(to, frame_size - 2 * wordSize, R1_SP); - __ ld(count, frame_size - 3 * wordSize, R1_SP); - __ pop_frame(); + slot_nr = 0; + __ ld(from, frame_size - (++slot_nr) * wordSize, R1_SP); + __ ld(to, frame_size - (++slot_nr) * wordSize, R1_SP); + __ ld(count, frame_size - (++slot_nr) * wordSize, R1_SP); + if (preserve1 != noreg) { __ ld(preserve1, frame_size - (++slot_nr) * wordSize, R1_SP); } + if (preserve2 != noreg) { __ ld(preserve2, frame_size - (++slot_nr) * wordSize, R1_SP); } + __ addi(R1_SP, R1_SP, frame_size); // pop_frame() __ restore_LR_CR(R0); __ bind(filtered); @@ -674,27 +688,22 @@ class StubGenerator: public StubCodeGenerator { // // The input registers and R0 are overwritten. // - void gen_write_ref_array_post_barrier(Register addr, Register count, Register tmp, bool branchToEnd) { + void gen_write_ref_array_post_barrier(Register addr, Register count, Register tmp, Register preserve = noreg) { BarrierSet* const bs = Universe::heap()->barrier_set(); switch (bs->kind()) { case BarrierSet::G1SATBCTLogging: { - if (branchToEnd) { - __ save_LR_CR(R0); - // We need this frame only to spill LR. - __ push_frame_reg_args(0, R0); - __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post), addr, count); - __ pop_frame(); - __ restore_LR_CR(R0); - } else { - // Tail call: fake call from stub caller by branching without linking. - address entry_point = (address)CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post); - __ mr_if_needed(R3_ARG1, addr); - __ mr_if_needed(R4_ARG2, count); - __ load_const(R11, entry_point, R0); - __ call_c_and_return_to_caller(R11); - } + int spill_slots = (preserve != noreg) ? 1 : 0; + const int frame_size = align_size_up(frame::abi_reg_args_size + spill_slots * BytesPerWord, frame::alignment_in_bytes); + + __ save_LR_CR(R0); + __ push_frame(frame_size, R0); + if (preserve != noreg) { __ std(preserve, frame_size - 1 * wordSize, R1_SP); } + __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post), addr, count); + if (preserve != noreg) { __ ld(preserve, frame_size - 1 * wordSize, R1_SP); } + __ addi(R1_SP, R1_SP, frame_size); // pop_frame(); + __ restore_LR_CR(R0); } break; case BarrierSet::CardTableForRS: @@ -729,12 +738,9 @@ class StubGenerator: public StubCodeGenerator { __ addi(addr, addr, 1); __ bdnz(Lstore_loop); __ bind(Lskip_loop); - - if (!branchToEnd) __ blr(); } break; case BarrierSet::ModRef: - if (!branchToEnd) __ blr(); break; default: ShouldNotReachHere(); @@ -763,8 +769,10 @@ class StubGenerator: public StubCodeGenerator { // Procedure for large arrays (uses data cache block zero instruction). Label dwloop, fast, fastloop, restloop, lastdword, done; - int cl_size=VM_Version::get_cache_line_size(), cl_dwords=cl_size>>3, cl_dwordaddr_bits=exact_log2(cl_dwords); - int min_dcbz=2; // Needs to be positive, apply dcbz only to at least min_dcbz cache lines. + int cl_size = VM_Version::L1_data_cache_line_size(); + int cl_dwords = cl_size >> 3; + int cl_dwordaddr_bits = exact_log2(cl_dwords); + int min_dcbz = 2; // Needs to be positive, apply dcbz only to at least min_dcbz cache lines. // Clear up to 128byte boundary if long enough, dword_cnt=(16-(base>>3))%16. __ dcbtst(base_ptr_reg); // Indicate write access to first cache line ... @@ -1081,7 +1089,6 @@ class StubGenerator: public StubCodeGenerator { Register tmp1 = R6_ARG4; Register tmp2 = R7_ARG5; - Label l_overlap; #ifdef ASSERT __ srdi_(tmp2, R5_ARG3, 31); __ asm_assert_eq("missing zero extend", 0xAFFE); @@ -1091,19 +1098,11 @@ class StubGenerator: public StubCodeGenerator { __ sldi(tmp2, R5_ARG3, log2_elem_size); // size in bytes __ cmpld(CCR0, R3_ARG1, R4_ARG2); // Use unsigned comparison! __ cmpld(CCR1, tmp1, tmp2); - __ crand(CCR0, Assembler::less, CCR1, Assembler::less); - __ blt(CCR0, l_overlap); // Src before dst and distance smaller than size. + __ crnand(CCR0, Assembler::less, CCR1, Assembler::less); + // Overlaps if Src before dst and distance smaller than size. + // Branch to forward copy routine otherwise (within range of 32kB). + __ bc(Assembler::bcondCRbiIs1, Assembler::bi0(CCR0, Assembler::less), no_overlap_target); - // need to copy forwards - if (__ is_within_range_of_b(no_overlap_target, __ pc())) { - __ b(no_overlap_target); - } else { - __ load_const(tmp1, no_overlap_target, tmp2); - __ mtctr(tmp1); - __ bctr(); - } - - __ bind(l_overlap); // need to copy backwards } @@ -1248,6 +1247,7 @@ class StubGenerator: public StubCodeGenerator { } __ bind(l_4); + __ li(R3_RET, 0); // return 0 __ blr(); return start; @@ -1269,15 +1269,9 @@ class StubGenerator: public StubCodeGenerator { Register tmp2 = R7_ARG5; Register tmp3 = R8_ARG6; -#if defined(ABI_ELFv2) address nooverlap_target = aligned ? - StubRoutines::arrayof_jbyte_disjoint_arraycopy() : - StubRoutines::jbyte_disjoint_arraycopy(); -#else - address nooverlap_target = aligned ? - ((FunctionDescriptor*)StubRoutines::arrayof_jbyte_disjoint_arraycopy())->entry() : - ((FunctionDescriptor*)StubRoutines::jbyte_disjoint_arraycopy())->entry(); -#endif + STUB_ENTRY(arrayof_jbyte_disjoint_arraycopy) : + STUB_ENTRY(jbyte_disjoint_arraycopy); array_overlap_test(nooverlap_target, 0); // Do reverse copy. We assume the case of actual overlap is rare enough @@ -1292,6 +1286,7 @@ class StubGenerator: public StubCodeGenerator { __ lbzx(tmp1, R3_ARG1, R5_ARG3); __ bge(CCR0, l_1); + __ li(R3_RET, 0); // return 0 __ blr(); return start; @@ -1474,6 +1469,7 @@ class StubGenerator: public StubCodeGenerator { __ bdnz(l_5); } __ bind(l_4); + __ li(R3_RET, 0); // return 0 __ blr(); return start; @@ -1495,15 +1491,9 @@ class StubGenerator: public StubCodeGenerator { Register tmp2 = R7_ARG5; Register tmp3 = R8_ARG6; -#if defined(ABI_ELFv2) address nooverlap_target = aligned ? - StubRoutines::arrayof_jshort_disjoint_arraycopy() : - StubRoutines::jshort_disjoint_arraycopy(); -#else - address nooverlap_target = aligned ? - ((FunctionDescriptor*)StubRoutines::arrayof_jshort_disjoint_arraycopy())->entry() : - ((FunctionDescriptor*)StubRoutines::jshort_disjoint_arraycopy())->entry(); -#endif + STUB_ENTRY(arrayof_jshort_disjoint_arraycopy) : + STUB_ENTRY(jshort_disjoint_arraycopy); array_overlap_test(nooverlap_target, 1); @@ -1517,6 +1507,7 @@ class StubGenerator: public StubCodeGenerator { __ lhzx(tmp2, R3_ARG1, tmp1); __ bge(CCR0, l_1); + __ li(R3_RET, 0); // return 0 __ blr(); return start; @@ -1620,6 +1611,7 @@ class StubGenerator: public StubCodeGenerator { StubCodeMark mark(this, "StubRoutines", name); address start = __ function_entry(); generate_disjoint_int_copy_core(aligned); + __ li(R3_RET, 0); // return 0 __ blr(); return start; } @@ -1704,20 +1696,15 @@ class StubGenerator: public StubCodeGenerator { StubCodeMark mark(this, "StubRoutines", name); address start = __ function_entry(); -#if defined(ABI_ELFv2) address nooverlap_target = aligned ? - StubRoutines::arrayof_jint_disjoint_arraycopy() : - StubRoutines::jint_disjoint_arraycopy(); -#else - address nooverlap_target = aligned ? - ((FunctionDescriptor*)StubRoutines::arrayof_jint_disjoint_arraycopy())->entry() : - ((FunctionDescriptor*)StubRoutines::jint_disjoint_arraycopy())->entry(); -#endif + STUB_ENTRY(arrayof_jint_disjoint_arraycopy) : + STUB_ENTRY(jint_disjoint_arraycopy); array_overlap_test(nooverlap_target, 2); generate_conjoint_int_copy_core(aligned); + __ li(R3_RET, 0); // return 0 __ blr(); return start; @@ -1796,6 +1783,7 @@ class StubGenerator: public StubCodeGenerator { StubCodeMark mark(this, "StubRoutines", name); address start = __ function_entry(); generate_disjoint_long_copy_core(aligned); + __ li(R3_RET, 0); // return 0 __ blr(); return start; @@ -1878,19 +1866,14 @@ class StubGenerator: public StubCodeGenerator { StubCodeMark mark(this, "StubRoutines", name); address start = __ function_entry(); -#if defined(ABI_ELFv2) address nooverlap_target = aligned ? - StubRoutines::arrayof_jlong_disjoint_arraycopy() : - StubRoutines::jlong_disjoint_arraycopy(); -#else - address nooverlap_target = aligned ? - ((FunctionDescriptor*)StubRoutines::arrayof_jlong_disjoint_arraycopy())->entry() : - ((FunctionDescriptor*)StubRoutines::jlong_disjoint_arraycopy())->entry(); -#endif + STUB_ENTRY(arrayof_jlong_disjoint_arraycopy) : + STUB_ENTRY(jlong_disjoint_arraycopy); array_overlap_test(nooverlap_target, 3); generate_conjoint_long_copy_core(aligned); + __ li(R3_RET, 0); // return 0 __ blr(); return start; @@ -1910,15 +1893,9 @@ class StubGenerator: public StubCodeGenerator { address start = __ function_entry(); -#if defined(ABI_ELFv2) address nooverlap_target = aligned ? - StubRoutines::arrayof_oop_disjoint_arraycopy() : - StubRoutines::oop_disjoint_arraycopy(); -#else - address nooverlap_target = aligned ? - ((FunctionDescriptor*)StubRoutines::arrayof_oop_disjoint_arraycopy())->entry() : - ((FunctionDescriptor*)StubRoutines::oop_disjoint_arraycopy())->entry(); -#endif + STUB_ENTRY(arrayof_oop_disjoint_arraycopy) : + STUB_ENTRY(oop_disjoint_arraycopy); gen_write_ref_array_pre_barrier(R3_ARG1, R4_ARG2, R5_ARG3, dest_uninitialized, R9_ARG7); @@ -1934,7 +1911,9 @@ class StubGenerator: public StubCodeGenerator { generate_conjoint_long_copy_core(aligned); } - gen_write_ref_array_post_barrier(R9_ARG7, R10_ARG8, R11_scratch1, /*branchToEnd*/ false); + gen_write_ref_array_post_barrier(R9_ARG7, R10_ARG8, R11_scratch1); + __ li(R3_RET, 0); // return 0 + __ blr(); return start; } @@ -1964,11 +1943,460 @@ class StubGenerator: public StubCodeGenerator { generate_disjoint_long_copy_core(aligned); } - gen_write_ref_array_post_barrier(R9_ARG7, R10_ARG8, R11_scratch1, /*branchToEnd*/ false); + gen_write_ref_array_post_barrier(R9_ARG7, R10_ARG8, R11_scratch1); + __ li(R3_RET, 0); // return 0 + __ blr(); return start; } + + // Helper for generating a dynamic type check. + // Smashes only the given temp registers. + void generate_type_check(Register sub_klass, + Register super_check_offset, + Register super_klass, + Register temp, + Label& L_success) { + assert_different_registers(sub_klass, super_check_offset, super_klass); + + BLOCK_COMMENT("type_check:"); + + Label L_miss; + + __ check_klass_subtype_fast_path(sub_klass, super_klass, temp, R0, &L_success, &L_miss, NULL, + super_check_offset); + __ check_klass_subtype_slow_path(sub_klass, super_klass, temp, R0, &L_success, NULL); + + // Fall through on failure! + __ bind(L_miss); + } + + + // Generate stub for checked oop copy. + // + // Arguments for generated stub: + // from: R3 + // to: R4 + // count: R5 treated as signed + // ckoff: R6 (super_check_offset) + // ckval: R7 (super_klass) + // ret: R3 zero for success; (-1^K) where K is partial transfer count + // + address generate_checkcast_copy(const char *name, bool dest_uninitialized) { + + const Register R3_from = R3_ARG1; // source array address + const Register R4_to = R4_ARG2; // destination array address + const Register R5_count = R5_ARG3; // elements count + const Register R6_ckoff = R6_ARG4; // super_check_offset + const Register R7_ckval = R7_ARG5; // super_klass + + const Register R8_offset = R8_ARG6; // loop var, with stride wordSize + const Register R9_remain = R9_ARG7; // loop var, with stride -1 + const Register R10_oop = R10_ARG8; // actual oop copied + const Register R11_klass = R11_scratch1; // oop._klass + const Register R12_tmp = R12_scratch2; + + const Register R2_minus1 = R2; + + //__ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", name); + address start = __ function_entry(); + + // TODO: Assert that int is 64 bit sign extended and arrays are not conjoint. + + gen_write_ref_array_pre_barrier(R3_from, R4_to, R5_count, dest_uninitialized, R12_tmp, /* preserve: */ R6_ckoff, R7_ckval); + + //inc_counter_np(SharedRuntime::_checkcast_array_copy_ctr, R12_tmp, R3_RET); + + Label load_element, store_element, store_null, success, do_card_marks; + __ or_(R9_remain, R5_count, R5_count); // Initialize loop index, and test it. + __ li(R8_offset, 0); // Offset from start of arrays. + __ li(R2_minus1, -1); + __ bne(CCR0, load_element); + + // Empty array: Nothing to do. + __ li(R3_RET, 0); // Return 0 on (trivial) success. + __ blr(); + + // ======== begin loop ======== + // (Entry is load_element.) + __ align(OptoLoopAlignment); + __ bind(store_element); + if (UseCompressedOops) { + __ encode_heap_oop_not_null(R10_oop); + __ bind(store_null); + __ stw(R10_oop, R8_offset, R4_to); + } else { + __ bind(store_null); + __ std(R10_oop, R8_offset, R4_to); + } + + __ addi(R8_offset, R8_offset, heapOopSize); // Step to next offset. + __ add_(R9_remain, R2_minus1, R9_remain); // Decrement the count. + __ beq(CCR0, success); + + // ======== loop entry is here ======== + __ bind(load_element); + __ load_heap_oop(R10_oop, R8_offset, R3_from, &store_null); // Load the oop. + + __ load_klass(R11_klass, R10_oop); // Query the object klass. + + generate_type_check(R11_klass, R6_ckoff, R7_ckval, R12_tmp, + // Branch to this on success: + store_element); + // ======== end loop ======== + + // It was a real error; we must depend on the caller to finish the job. + // Register R9_remain has number of *remaining* oops, R5_count number of *total* oops. + // Emit GC store barriers for the oops we have copied (R5_count minus R9_remain), + // and report their number to the caller. + __ subf_(R5_count, R9_remain, R5_count); + __ nand(R3_RET, R5_count, R5_count); // report (-1^K) to caller + __ bne(CCR0, do_card_marks); + __ blr(); + + __ bind(success); + __ li(R3_RET, 0); + + __ bind(do_card_marks); + // Store check on R4_to[0..R5_count-1]. + gen_write_ref_array_post_barrier(R4_to, R5_count, R12_tmp, /* preserve: */ R3_RET); + __ blr(); + return start; + } + + + // Generate 'unsafe' array copy stub. + // Though just as safe as the other stubs, it takes an unscaled + // size_t argument instead of an element count. + // + // Arguments for generated stub: + // from: R3 + // to: R4 + // count: R5 byte count, treated as ssize_t, can be zero + // + // Examines the alignment of the operands and dispatches + // to a long, int, short, or byte copy loop. + // + address generate_unsafe_copy(const char* name, + address byte_copy_entry, + address short_copy_entry, + address int_copy_entry, + address long_copy_entry) { + + const Register R3_from = R3_ARG1; // source array address + const Register R4_to = R4_ARG2; // destination array address + const Register R5_count = R5_ARG3; // elements count (as long on PPC64) + + const Register R6_bits = R6_ARG4; // test copy of low bits + const Register R7_tmp = R7_ARG5; + + //__ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", name); + address start = __ function_entry(); + + // Bump this on entry, not on exit: + //inc_counter_np(SharedRuntime::_unsafe_array_copy_ctr, R6_bits, R7_tmp); + + Label short_copy, int_copy, long_copy; + + __ orr(R6_bits, R3_from, R4_to); + __ orr(R6_bits, R6_bits, R5_count); + __ andi_(R0, R6_bits, (BytesPerLong-1)); + __ beq(CCR0, long_copy); + + __ andi_(R0, R6_bits, (BytesPerInt-1)); + __ beq(CCR0, int_copy); + + __ andi_(R0, R6_bits, (BytesPerShort-1)); + __ beq(CCR0, short_copy); + + // byte_copy: + __ b(byte_copy_entry); + + __ bind(short_copy); + __ srwi(R5_count, R5_count, LogBytesPerShort); + __ b(short_copy_entry); + + __ bind(int_copy); + __ srwi(R5_count, R5_count, LogBytesPerInt); + __ b(int_copy_entry); + + __ bind(long_copy); + __ srwi(R5_count, R5_count, LogBytesPerLong); + __ b(long_copy_entry); + + return start; + } + + + // Perform range checks on the proposed arraycopy. + // Kills the two temps, but nothing else. + // Also, clean the sign bits of src_pos and dst_pos. + void arraycopy_range_checks(Register src, // source array oop + Register src_pos, // source position + Register dst, // destination array oop + Register dst_pos, // destination position + Register length, // length of copy + Register temp1, Register temp2, + Label& L_failed) { + BLOCK_COMMENT("arraycopy_range_checks:"); + + const Register array_length = temp1; // scratch + const Register end_pos = temp2; // scratch + + // if (src_pos + length > arrayOop(src)->length() ) FAIL; + __ lwa(array_length, arrayOopDesc::length_offset_in_bytes(), src); + __ add(end_pos, src_pos, length); // src_pos + length + __ cmpd(CCR0, end_pos, array_length); + __ bgt(CCR0, L_failed); + + // if (dst_pos + length > arrayOop(dst)->length() ) FAIL; + __ lwa(array_length, arrayOopDesc::length_offset_in_bytes(), dst); + __ add(end_pos, dst_pos, length); // src_pos + length + __ cmpd(CCR0, end_pos, array_length); + __ bgt(CCR0, L_failed); + + BLOCK_COMMENT("arraycopy_range_checks done"); + } + + + // + // Generate generic array copy stubs + // + // Input: + // R3 - src oop + // R4 - src_pos + // R5 - dst oop + // R6 - dst_pos + // R7 - element count + // + // Output: + // R3 == 0 - success + // R3 == -1 - need to call System.arraycopy + // + address generate_generic_copy(const char *name, + address entry_jbyte_arraycopy, + address entry_jshort_arraycopy, + address entry_jint_arraycopy, + address entry_oop_arraycopy, + address entry_disjoint_oop_arraycopy, + address entry_jlong_arraycopy, + address entry_checkcast_arraycopy) { + Label L_failed, L_objArray; + + // Input registers + const Register src = R3_ARG1; // source array oop + const Register src_pos = R4_ARG2; // source position + const Register dst = R5_ARG3; // destination array oop + const Register dst_pos = R6_ARG4; // destination position + const Register length = R7_ARG5; // elements count + + // registers used as temp + const Register src_klass = R8_ARG6; // source array klass + const Register dst_klass = R9_ARG7; // destination array klass + const Register lh = R10_ARG8; // layout handler + const Register temp = R2; + + //__ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", name); + address start = __ function_entry(); + + // Bump this on entry, not on exit: + //inc_counter_np(SharedRuntime::_generic_array_copy_ctr, lh, temp); + + // In principle, the int arguments could be dirty. + + //----------------------------------------------------------------------- + // Assembler stubs will be used for this call to arraycopy + // if the following conditions are met: + // + // (1) src and dst must not be null. + // (2) src_pos must not be negative. + // (3) dst_pos must not be negative. + // (4) length must not be negative. + // (5) src klass and dst klass should be the same and not NULL. + // (6) src and dst should be arrays. + // (7) src_pos + length must not exceed length of src. + // (8) dst_pos + length must not exceed length of dst. + BLOCK_COMMENT("arraycopy initial argument checks"); + + __ cmpdi(CCR1, src, 0); // if (src == NULL) return -1; + __ extsw_(src_pos, src_pos); // if (src_pos < 0) return -1; + __ cmpdi(CCR5, dst, 0); // if (dst == NULL) return -1; + __ cror(CCR1, Assembler::equal, CCR0, Assembler::less); + __ extsw_(dst_pos, dst_pos); // if (src_pos < 0) return -1; + __ cror(CCR5, Assembler::equal, CCR0, Assembler::less); + __ extsw_(length, length); // if (length < 0) return -1; + __ cror(CCR1, Assembler::equal, CCR5, Assembler::equal); + __ cror(CCR1, Assembler::equal, CCR0, Assembler::less); + __ beq(CCR1, L_failed); + + BLOCK_COMMENT("arraycopy argument klass checks"); + __ load_klass(src_klass, src); + __ load_klass(dst_klass, dst); + + // Load layout helper + // + // |array_tag| | header_size | element_type | |log2_element_size| + // 32 30 24 16 8 2 0 + // + // array_tag: typeArray = 0x3, objArray = 0x2, non-array = 0x0 + // + + int lh_offset = in_bytes(Klass::layout_helper_offset()); + + // Load 32-bits signed value. Use br() instruction with it to check icc. + __ lwz(lh, lh_offset, src_klass); + + // Handle objArrays completely differently... + jint objArray_lh = Klass::array_layout_helper(T_OBJECT); + __ load_const_optimized(temp, objArray_lh, R0); + __ cmpw(CCR0, lh, temp); + __ beq(CCR0, L_objArray); + + __ cmpd(CCR5, src_klass, dst_klass); // if (src->klass() != dst->klass()) return -1; + __ cmpwi(CCR6, lh, Klass::_lh_neutral_value); // if (!src->is_Array()) return -1; + + __ crnand(CCR5, Assembler::equal, CCR6, Assembler::less); + __ beq(CCR5, L_failed); + + // At this point, it is known to be a typeArray (array_tag 0x3). +#ifdef ASSERT + { Label L; + jint lh_prim_tag_in_place = (Klass::_lh_array_tag_type_value << Klass::_lh_array_tag_shift); + __ load_const_optimized(temp, lh_prim_tag_in_place, R0); + __ cmpw(CCR0, lh, temp); + __ bge(CCR0, L); + __ stop("must be a primitive array"); + __ bind(L); + } +#endif + + arraycopy_range_checks(src, src_pos, dst, dst_pos, length, + temp, dst_klass, L_failed); + + // TypeArrayKlass + // + // src_addr = (src + array_header_in_bytes()) + (src_pos << log2elemsize); + // dst_addr = (dst + array_header_in_bytes()) + (dst_pos << log2elemsize); + // + + const Register offset = dst_klass; // array offset + const Register elsize = src_klass; // log2 element size + + __ rldicl(offset, lh, 64 - Klass::_lh_header_size_shift, 64 - exact_log2(Klass::_lh_header_size_mask + 1)); + __ andi(elsize, lh, Klass::_lh_log2_element_size_mask); + __ add(src, offset, src); // src array offset + __ add(dst, offset, dst); // dst array offset + + // Next registers should be set before the jump to corresponding stub. + const Register from = R3_ARG1; // source array address + const Register to = R4_ARG2; // destination array address + const Register count = R5_ARG3; // elements count + + // 'from', 'to', 'count' registers should be set in this order + // since they are the same as 'src', 'src_pos', 'dst'. + + BLOCK_COMMENT("scale indexes to element size"); + __ sld(src_pos, src_pos, elsize); + __ sld(dst_pos, dst_pos, elsize); + __ add(from, src_pos, src); // src_addr + __ add(to, dst_pos, dst); // dst_addr + __ mr(count, length); // length + + BLOCK_COMMENT("choose copy loop based on element size"); + // Using conditional branches with range 32kB. + const int bo = Assembler::bcondCRbiIs1, bi = Assembler::bi0(CCR0, Assembler::equal); + __ cmpwi(CCR0, elsize, 0); + __ bc(bo, bi, entry_jbyte_arraycopy); + __ cmpwi(CCR0, elsize, LogBytesPerShort); + __ bc(bo, bi, entry_jshort_arraycopy); + __ cmpwi(CCR0, elsize, LogBytesPerInt); + __ bc(bo, bi, entry_jint_arraycopy); +#ifdef ASSERT + { Label L; + __ cmpwi(CCR0, elsize, LogBytesPerLong); + __ beq(CCR0, L); + __ stop("must be long copy, but elsize is wrong"); + __ bind(L); + } +#endif + __ b(entry_jlong_arraycopy); + + // ObjArrayKlass + __ bind(L_objArray); + // live at this point: src_klass, dst_klass, src[_pos], dst[_pos], length + + Label L_disjoint_plain_copy, L_checkcast_copy; + // test array classes for subtyping + __ cmpd(CCR0, src_klass, dst_klass); // usual case is exact equality + __ bne(CCR0, L_checkcast_copy); + + // Identically typed arrays can be copied without element-wise checks. + arraycopy_range_checks(src, src_pos, dst, dst_pos, length, + temp, lh, L_failed); + + __ addi(src, src, arrayOopDesc::base_offset_in_bytes(T_OBJECT)); //src offset + __ addi(dst, dst, arrayOopDesc::base_offset_in_bytes(T_OBJECT)); //dst offset + __ sldi(src_pos, src_pos, LogBytesPerHeapOop); + __ sldi(dst_pos, dst_pos, LogBytesPerHeapOop); + __ add(from, src_pos, src); // src_addr + __ add(to, dst_pos, dst); // dst_addr + __ mr(count, length); // length + __ b(entry_oop_arraycopy); + + __ bind(L_checkcast_copy); + // live at this point: src_klass, dst_klass + { + // Before looking at dst.length, make sure dst is also an objArray. + __ lwz(temp, lh_offset, dst_klass); + __ cmpw(CCR0, lh, temp); + __ bne(CCR0, L_failed); + + // It is safe to examine both src.length and dst.length. + arraycopy_range_checks(src, src_pos, dst, dst_pos, length, + temp, lh, L_failed); + + // Marshal the base address arguments now, freeing registers. + __ addi(src, src, arrayOopDesc::base_offset_in_bytes(T_OBJECT)); //src offset + __ addi(dst, dst, arrayOopDesc::base_offset_in_bytes(T_OBJECT)); //dst offset + __ sldi(src_pos, src_pos, LogBytesPerHeapOop); + __ sldi(dst_pos, dst_pos, LogBytesPerHeapOop); + __ add(from, src_pos, src); // src_addr + __ add(to, dst_pos, dst); // dst_addr + __ mr(count, length); // length + + Register sco_temp = R6_ARG4; // This register is free now. + assert_different_registers(from, to, count, sco_temp, + dst_klass, src_klass); + + // Generate the type check. + int sco_offset = in_bytes(Klass::super_check_offset_offset()); + __ lwz(sco_temp, sco_offset, dst_klass); + generate_type_check(src_klass, sco_temp, dst_klass, + temp, L_disjoint_plain_copy); + + // Fetch destination element klass from the ObjArrayKlass header. + int ek_offset = in_bytes(ObjArrayKlass::element_klass_offset()); + + // The checkcast_copy loop needs two extra arguments: + __ ld(R7_ARG5, ek_offset, dst_klass); // dest elem klass + __ lwz(R6_ARG4, sco_offset, R7_ARG5); // sco of elem klass + __ b(entry_checkcast_arraycopy); + } + + __ bind(L_disjoint_plain_copy); + __ b(entry_disjoint_oop_arraycopy); + + __ bind(L_failed); + __ li(R3_RET, -1); // return -1 + __ blr(); + return start; + } + + void generate_arraycopy_stubs() { // Note: the disjoint stubs must be generated first, some of // the conjoint stubs use them. @@ -2005,6 +2433,24 @@ class StubGenerator: public StubCodeGenerator { StubRoutines::_arrayof_oop_arraycopy = generate_conjoint_oop_copy(true, "arrayof_oop_arraycopy", false); StubRoutines::_arrayof_oop_arraycopy_uninit = generate_conjoint_oop_copy(true, "arrayof_oop_arraycopy", true); + // special/generic versions + StubRoutines::_checkcast_arraycopy = generate_checkcast_copy("checkcast_arraycopy", false); + StubRoutines::_checkcast_arraycopy_uninit = generate_checkcast_copy("checkcast_arraycopy_uninit", true); + + StubRoutines::_unsafe_arraycopy = generate_unsafe_copy("unsafe_arraycopy", + STUB_ENTRY(jbyte_arraycopy), + STUB_ENTRY(jshort_arraycopy), + STUB_ENTRY(jint_arraycopy), + STUB_ENTRY(jlong_arraycopy)); + StubRoutines::_generic_arraycopy = generate_generic_copy("generic_arraycopy", + STUB_ENTRY(jbyte_arraycopy), + STUB_ENTRY(jshort_arraycopy), + STUB_ENTRY(jint_arraycopy), + STUB_ENTRY(oop_arraycopy), + STUB_ENTRY(oop_disjoint_arraycopy), + STUB_ENTRY(jlong_arraycopy), + STUB_ENTRY(checkcast_arraycopy)); + // fill routines StubRoutines::_jbyte_fill = generate_fill(T_BYTE, false, "jbyte_fill"); StubRoutines::_jshort_fill = generate_fill(T_SHORT, false, "jshort_fill"); diff --git a/hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.cpp index 65239dd317d..1f49fe1de26 100644 --- a/hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.cpp +++ b/hotspot/src/cpu/ppc/vm/stubRoutines_ppc_64.cpp @@ -34,7 +34,7 @@ // CRC32 Intrinsics. void StubRoutines::ppc64::generate_load_crc_table_addr(MacroAssembler* masm, Register table) { - __ load_const(table, StubRoutines::_crc_table_adr); + __ load_const_optimized(table, StubRoutines::_crc_table_adr, R0); } // CRC32 Intrinsics. diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp index 361e637d253..4691f70f8eb 100644 --- a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp @@ -255,34 +255,33 @@ void TemplateInterpreterGenerator::generate_counter_incr(Label* overflow, Label* if (TieredCompilation) { const int increment = InvocationCounter::count_increment; - const int mask = ((1 << Tier0InvokeNotifyFreqLog) - 1) << InvocationCounter::count_shift; Label no_mdo; if (ProfileInterpreter) { - const Register Rmdo = Rscratch1; + const Register Rmdo = R3_counters; // If no method data exists, go to profile_continue. __ ld(Rmdo, in_bytes(Method::method_data_offset()), R19_method); __ cmpdi(CCR0, Rmdo, 0); __ beq(CCR0, no_mdo); // Increment backedge counter in the MDO. - const int mdo_bc_offs = in_bytes(MethodData::backedge_counter_offset()) + in_bytes(InvocationCounter::counter_offset()); - __ lwz(Rscratch2, mdo_bc_offs, Rmdo); + const int mdo_ic_offs = in_bytes(MethodData::invocation_counter_offset()) + in_bytes(InvocationCounter::counter_offset()); + __ lwz(Rscratch2, mdo_ic_offs, Rmdo); + __ lwz(Rscratch1, in_bytes(MethodData::invoke_mask_offset()), Rmdo); __ addi(Rscratch2, Rscratch2, increment); - __ stw(Rscratch2, mdo_bc_offs, Rmdo); - __ load_const_optimized(Rscratch1, mask, R0); + __ stw(Rscratch2, mdo_ic_offs, Rmdo); __ and_(Rscratch1, Rscratch2, Rscratch1); __ bne(CCR0, done); __ b(*overflow); } // Increment counter in MethodCounters*. - const int mo_bc_offs = in_bytes(MethodCounters::backedge_counter_offset()) + in_bytes(InvocationCounter::counter_offset()); + const int mo_bc_offs = in_bytes(MethodCounters::invocation_counter_offset()) + in_bytes(InvocationCounter::counter_offset()); __ bind(no_mdo); __ get_method_counters(R19_method, R3_counters, done); __ lwz(Rscratch2, mo_bc_offs, R3_counters); + __ lwz(Rscratch1, in_bytes(MethodCounters::invoke_mask_offset()), R3_counters); __ addi(Rscratch2, Rscratch2, increment); __ stw(Rscratch2, mo_bc_offs, R3_counters); - __ load_const_optimized(Rscratch1, mask, R0); __ and_(Rscratch1, Rscratch2, Rscratch1); __ beq(CCR0, *overflow); @@ -303,8 +302,7 @@ void TemplateInterpreterGenerator::generate_counter_incr(Label* overflow, Label* // Check if we must create a method data obj. if (ProfileInterpreter && profile_method != NULL) { const Register profile_limit = Rscratch1; - int pl_offs = __ load_const_optimized(profile_limit, &InvocationCounter::InterpreterProfileLimit, R0, true); - __ lwz(profile_limit, pl_offs, profile_limit); + __ lwz(profile_limit, in_bytes(MethodCounters::interpreter_profile_limit_offset()), R3_counters); // Test to see if we should create a method data oop. __ cmpw(CCR0, Rsum_ivc_bec, profile_limit); __ blt(CCR0, *profile_method_continue); @@ -314,9 +312,7 @@ void TemplateInterpreterGenerator::generate_counter_incr(Label* overflow, Label* // Finally check for counter overflow. if (overflow) { const Register invocation_limit = Rscratch1; - int il_offs = __ load_const_optimized(invocation_limit, &InvocationCounter::InterpreterInvocationLimit, R0, true); - __ lwz(invocation_limit, il_offs, invocation_limit); - assert(4 == sizeof(InvocationCounter::InterpreterInvocationLimit), "unexpected field size"); + __ lwz(invocation_limit, in_bytes(MethodCounters::interpreter_invocation_limit_offset()), R3_counters); __ cmpw(CCR0, Rsum_ivc_bec, invocation_limit); __ bge(CCR0, *overflow); } @@ -1484,9 +1480,9 @@ void AbstractInterpreter::layout_activation(Method* method, intptr_t* locals_base = (caller->is_interpreted_frame()) ? caller->interpreter_frame_esp() + caller_actual_parameters : - caller->sp() + method->max_locals() - 1 + (frame::abi_minframe_size / Interpreter::stackElementSize) ; + caller->sp() + method->max_locals() - 1 + (frame::abi_minframe_size / Interpreter::stackElementSize); - intptr_t* monitor_base = caller->sp() - frame::ijava_state_size / Interpreter::stackElementSize ; + intptr_t* monitor_base = caller->sp() - frame::ijava_state_size / Interpreter::stackElementSize; intptr_t* monitor = monitor_base - (moncount * frame::interpreter_frame_monitor_size()); intptr_t* esp_base = monitor - 1; intptr_t* esp = esp_base - tempcount - popframe_extra_args; diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp index 4450dd71897..c08e6d44cf7 100644 --- a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp @@ -37,5 +37,3 @@ const static int InterpreterCodeSize = 230*K; #endif // CPU_PPC_VM_TEMPLATEINTERPRETER_PPC_HPP - - diff --git a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp index 0660726181c..4a1c44a4ce3 100644 --- a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp +++ b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp @@ -1626,12 +1626,13 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { // -------------------------------------------------------------------------- // Normal (non-jsr) branch handling + // Bump bytecode pointer by displacement (take the branch). + __ add(R14_bcp, Rdisp, R14_bcp); // Add to bc addr. + const bool increment_invocation_counter_for_backward_branches = UseCompiler && UseLoopCounter; if (increment_invocation_counter_for_backward_branches) { - //__ unimplemented("branch invocation counter"); - Label Lforward; - __ add(R14_bcp, Rdisp, R14_bcp); // Add to bc addr. + __ dispatch_prolog(vtos); // Check branch direction. __ cmpdi(CCR0, Rdisp, 0); @@ -1642,7 +1643,6 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { if (TieredCompilation) { Label Lno_mdo, Loverflow; const int increment = InvocationCounter::count_increment; - const int mask = ((1 << Tier0BackedgeNotifyFreqLog) - 1) << InvocationCounter::count_shift; if (ProfileInterpreter) { Register Rmdo = Rscratch1; @@ -1654,7 +1654,7 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { // Increment backedge counter in the MDO. const int mdo_bc_offs = in_bytes(MethodData::backedge_counter_offset()) + in_bytes(InvocationCounter::counter_offset()); __ lwz(Rscratch2, mdo_bc_offs, Rmdo); - __ load_const_optimized(Rscratch3, mask, R0); + __ lwz(Rscratch3, in_bytes(MethodData::backedge_mask_offset()), Rmdo); __ addi(Rscratch2, Rscratch2, increment); __ stw(Rscratch2, mdo_bc_offs, Rmdo); __ and_(Rscratch3, Rscratch2, Rscratch3); @@ -1666,19 +1666,19 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { const int mo_bc_offs = in_bytes(MethodCounters::backedge_counter_offset()) + in_bytes(InvocationCounter::counter_offset()); __ bind(Lno_mdo); __ lwz(Rscratch2, mo_bc_offs, R4_counters); - __ load_const_optimized(Rscratch3, mask, R0); + __ lwz(Rscratch3, in_bytes(MethodCounters::backedge_mask_offset()), R4_counters); __ addi(Rscratch2, Rscratch2, increment); - __ stw(Rscratch2, mo_bc_offs, R19_method); + __ stw(Rscratch2, mo_bc_offs, R4_counters); __ and_(Rscratch3, Rscratch2, Rscratch3); __ bne(CCR0, Lforward); __ bind(Loverflow); // Notify point for loop, pass branch bytecode. - __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::frequency_counter_overflow), R14_bcp, true); + __ subf(R4_ARG2, Rdisp, R14_bcp); // Compute branch bytecode (previous bcp). + __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::frequency_counter_overflow), R4_ARG2, true); // Was an OSR adapter generated? - // O0 = osr nmethod __ cmpdi(CCR0, R3_RET, 0); __ beq(CCR0, Lforward); @@ -1714,27 +1714,23 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { __ increment_backedge_counter(R4_counters, invoke_ctr, Rscratch2, Rscratch3); if (ProfileInterpreter) { - __ test_invocation_counter_for_mdp(invoke_ctr, Rscratch2, Lforward); + __ test_invocation_counter_for_mdp(invoke_ctr, R4_counters, Rscratch2, Lforward); if (UseOnStackReplacement) { - __ test_backedge_count_for_osr(bumped_count, R14_bcp, Rscratch2); + __ test_backedge_count_for_osr(bumped_count, R4_counters, R14_bcp, Rdisp, Rscratch2); } } else { if (UseOnStackReplacement) { - __ test_backedge_count_for_osr(invoke_ctr, R14_bcp, Rscratch2); + __ test_backedge_count_for_osr(invoke_ctr, R4_counters, R14_bcp, Rdisp, Rscratch2); } } } __ bind(Lforward); + __ dispatch_epilog(vtos); } else { - // Bump bytecode pointer by displacement (take the branch). - __ add(R14_bcp, Rdisp, R14_bcp); // Add to bc addr. + __ dispatch_next(vtos); } - // Continue with bytecode @ target. - // %%%%% Like Intel, could speed things up by moving bytecode fetch to code above, - // %%%%% and changing dispatch_next to dispatch_only. - __ dispatch_next(vtos); } // Helper function for if_cmp* methods below. diff --git a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp index 90bd9c2ad7a..774d90b5cf1 100644 --- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp @@ -38,7 +38,6 @@ # include int VM_Version::_features = VM_Version::unknown_m; -int VM_Version::_measured_cache_line_size = 32; // pessimistic init value const char* VM_Version::_features_str = ""; bool VM_Version::_is_determine_features_test_running = false; @@ -56,7 +55,7 @@ void VM_Version::initialize() { // If PowerArchitecturePPC64 hasn't been specified explicitly determine from features. if (FLAG_IS_DEFAULT(PowerArchitecturePPC64)) { - if (VM_Version::has_lqarx()) { + if (VM_Version::has_tcheck() && VM_Version::has_lqarx()) { FLAG_SET_ERGO(uintx, PowerArchitecturePPC64, 8); } else if (VM_Version::has_popcntw()) { FLAG_SET_ERGO(uintx, PowerArchitecturePPC64, 7); @@ -68,10 +67,19 @@ void VM_Version::initialize() { FLAG_SET_ERGO(uintx, PowerArchitecturePPC64, 0); } } - guarantee(PowerArchitecturePPC64 == 0 || PowerArchitecturePPC64 == 5 || - PowerArchitecturePPC64 == 6 || PowerArchitecturePPC64 == 7 || - PowerArchitecturePPC64 == 8, - "PowerArchitecturePPC64 should be 0, 5, 6, 7, or 8"); + + bool PowerArchitecturePPC64_ok = false; + switch (PowerArchitecturePPC64) { + case 8: if (!VM_Version::has_tcheck() ) break; + if (!VM_Version::has_lqarx() ) break; + case 7: if (!VM_Version::has_popcntw()) break; + case 6: if (!VM_Version::has_cmpb() ) break; + case 5: if (!VM_Version::has_popcntb()) break; + case 0: PowerArchitecturePPC64_ok = true; break; + default: break; + } + guarantee(PowerArchitecturePPC64_ok, "PowerArchitecturePPC64 cannot be set to " + UINTX_FORMAT " on this machine", PowerArchitecturePPC64); // Power 8: Configure Data Stream Control Register. if (PowerArchitecturePPC64 >= 8) { @@ -132,9 +140,15 @@ void VM_Version::initialize() { // and 'atomic long memory ops' (see Unsafe_GetLongVolatile). _supports_cx8 = true; + // Used by C1. + _supports_atomic_getset4 = true; + _supports_atomic_getadd4 = true; + _supports_atomic_getset8 = true; + _supports_atomic_getadd8 = true; + UseSSE = 0; // Only on x86 and x64 - intx cache_line_size = _measured_cache_line_size; + intx cache_line_size = L1_data_cache_line_size(); if (FLAG_IS_DEFAULT(AllocatePrefetchStyle)) AllocatePrefetchStyle = 1; @@ -261,11 +275,9 @@ void VM_Version::initialize() { } } - // This machine does not allow unaligned memory accesses - if (UseUnalignedAccesses) { - if (!FLAG_IS_DEFAULT(UseUnalignedAccesses)) - warning("Unaligned memory access is not available on this CPU"); - FLAG_SET_DEFAULT(UseUnalignedAccesses, false); + // This machine allows unaligned memory accesses + if (FLAG_IS_DEFAULT(UseUnalignedAccesses)) { + FLAG_SET_DEFAULT(UseUnalignedAccesses, true); } } @@ -291,7 +303,7 @@ bool VM_Version::use_biased_locking() { } void VM_Version::print_features() { - tty->print_cr("Version: %s cache_line_size = %d", cpu_features(), (int) get_cache_line_size()); + tty->print_cr("Version: %s L1_data_cache_line_size=%d", cpu_features(), L1_data_cache_line_size()); } #ifdef COMPILER2 @@ -592,7 +604,7 @@ void VM_Version::determine_features() { int count = 0; // count zeroed bytes for (int i = 0; i < BUFFER_SIZE; i++) if (test_area[i] == 0) count++; guarantee(is_power_of_2(count), "cache line size needs to be a power of 2"); - _measured_cache_line_size = count; + _L1_data_cache_line_size = count; // Execute code. Illegal instructions will be replaced by 0 in the signal handler. VM_Version::_is_determine_features_test_running = true; diff --git a/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp b/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp index 6fc76e4cd41..d5f6dc6cc81 100644 --- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp @@ -65,7 +65,6 @@ protected: all_features_m = -1 }; static int _features; - static int _measured_cache_line_size; static const char* _features_str; static bool _is_determine_features_test_running; @@ -99,8 +98,6 @@ public: static const char* cpu_features() { return _features_str; } - static int get_cache_line_size() { return _measured_cache_line_size; } - // Assembler testing static void allow_all(); static void revert(); diff --git a/hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp index 0165fb22e34..d19c211300f 100644 --- a/hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp +++ b/hotspot/src/cpu/ppc/vm/vtableStubs_ppc_64.cpp @@ -76,7 +76,8 @@ VtableStub* VtableStubs::create_vtable_stub(int vtable_index) { // We might implicit NULL fault here. address npe_addr = __ pc(); // npe = null pointer exception - __ load_klass_with_trap_null_check(rcvr_klass, R3); + __ null_check(R3, oopDesc::klass_offset_in_bytes(), /*implicit only*/NULL); + __ load_klass(rcvr_klass, R3); // Set method (in case of interpreted method), and destination address. int entry_offset = InstanceKlass::vtable_start_offset() + vtable_index*vtableEntry::size(); @@ -111,8 +112,8 @@ VtableStub* VtableStubs::create_vtable_stub(int vtable_index) { // If the vtable entry is null, the method is abstract. address ame_addr = __ pc(); // ame = abstract method error - - __ load_with_trap_null_check(R12_scratch2, in_bytes(Method::from_compiled_offset()), R19_method); + __ null_check(R19_method, in_bytes(Method::from_compiled_offset()), /*implicit only*/NULL); + __ ld(R12_scratch2, in_bytes(Method::from_compiled_offset()), R19_method); __ mtctr(R12_scratch2); __ bctr(); masm->flush(); @@ -158,7 +159,8 @@ VtableStub* VtableStubs::create_itable_stub(int vtable_index) { // We might implicit NULL fault here. address npe_addr = __ pc(); // npe = null pointer exception - __ load_klass_with_trap_null_check(rcvr_klass, R3_ARG1); + __ null_check(R3_ARG1, oopDesc::klass_offset_in_bytes(), /*implicit only*/NULL); + __ load_klass(rcvr_klass, R3_ARG1); BLOCK_COMMENT("Load start of itable entries into itable_entry."); __ lwz(vtable_len, InstanceKlass::vtable_length_offset() * wordSize, rcvr_klass); @@ -217,15 +219,7 @@ VtableStub* VtableStubs::create_itable_stub(int vtable_index) { address ame_addr = __ pc(); // ame = abstract method error // Must do an explicit check if implicit checks are disabled. - assert(!MacroAssembler::needs_explicit_null_check(in_bytes(Method::from_compiled_offset())), "sanity"); - if (!ImplicitNullChecks || !os::zero_page_read_protected()) { - if (TrapBasedNullChecks) { - __ trap_null_check(R19_method); - } else { - __ cmpdi(CCR0, R19_method, 0); - __ beq(CCR0, throw_icce); - } - } + __ null_check(R19_method, in_bytes(Method::from_compiled_offset()), &throw_icce); __ ld(R12_scratch2, in_bytes(Method::from_compiled_offset()), R19_method); __ mtctr(R12_scratch2); __ bctr(); diff --git a/hotspot/src/os/aix/vm/c1_globals_aix.hpp b/hotspot/src/os/aix/vm/c1_globals_aix.hpp new file mode 100644 index 00000000000..45b57f71954 --- /dev/null +++ b/hotspot/src/os/aix/vm/c1_globals_aix.hpp @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, 2015 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef OS_AIX_VM_C1_GLOBALS_AIX_HPP +#define OS_AIX_VM_C1_GLOBALS_AIX_HPP + +#include "utilities/globalDefinitions.hpp" +#include "utilities/macros.hpp" + +// +// Sets the default values for operating system dependent flags used by the +// client compiler. (see c1_globals.hpp) +// + +#endif // OS_AIX_VM_C1_GLOBALS_AIX_HPP From d60a09e9c5c58cb7c32e362b778008c625b16ab1 Mon Sep 17 00:00:00 2001 From: Vladimir Ivanov Date: Fri, 4 Dec 2015 23:46:19 +0300 Subject: [PATCH 012/146] 8072008: Emit direct call instead of linkTo* for recursive indy/MH.invoke* calls Reviewed-by: jrose, dlong, aph, forax --- hotspot/src/cpu/aarch64/vm/aarch64.ad | 20 +- .../cpu/aarch64/vm/macroAssembler_aarch64.cpp | 4 +- .../cpu/aarch64/vm/macroAssembler_aarch64.hpp | 2 +- hotspot/src/cpu/ppc/vm/ppc.ad | 10 +- hotspot/src/cpu/sparc/vm/assembler_sparc.hpp | 2 + .../cpu/sparc/vm/assembler_sparc.inline.hpp | 2 + .../src/cpu/sparc/vm/macroAssembler_sparc.cpp | 5 +- .../src/cpu/sparc/vm/macroAssembler_sparc.hpp | 6 +- .../sparc/vm/macroAssembler_sparc.inline.hpp | 10 +- hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp | 5 +- hotspot/src/cpu/sparc/vm/sparc.ad | 34 +-- hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp | 4 +- hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp | 2 +- hotspot/src/cpu/x86/vm/x86_32.ad | 19 +- hotspot/src/cpu/x86/vm/x86_64.ad | 21 +- hotspot/src/share/vm/asm/codeBuffer.cpp | 25 ++ hotspot/src/share/vm/asm/codeBuffer.hpp | 5 +- hotspot/src/share/vm/ci/ciMethod.hpp | 6 + hotspot/src/share/vm/classfile/vmSymbols.hpp | 5 + hotspot/src/share/vm/code/compiledIC.cpp | 2 +- hotspot/src/share/vm/code/nmethod.cpp | 84 ++++++- hotspot/src/share/vm/code/nmethod.hpp | 11 +- hotspot/src/share/vm/code/relocInfo.cpp | 61 ++++- hotspot/src/share/vm/code/relocInfo.hpp | 54 +++-- .../src/share/vm/interpreter/linkResolver.cpp | 27 +++ .../src/share/vm/interpreter/linkResolver.hpp | 6 + hotspot/src/share/vm/opto/callGenerator.cpp | 38 ++- hotspot/src/share/vm/opto/callGenerator.hpp | 5 +- hotspot/src/share/vm/opto/callnode.cpp | 3 +- hotspot/src/share/vm/opto/callnode.hpp | 20 +- hotspot/src/share/vm/opto/doCall.cpp | 96 ++++++++ hotspot/src/share/vm/opto/library_call.cpp | 14 ++ hotspot/src/share/vm/opto/machnode.cpp | 3 +- hotspot/src/share/vm/opto/machnode.hpp | 22 +- hotspot/src/share/vm/opto/matcher.cpp | 1 + hotspot/src/share/vm/prims/methodHandles.cpp | 13 ++ hotspot/src/share/vm/prims/methodHandles.hpp | 6 + hotspot/src/share/vm/prims/whitebox.cpp | 6 + .../src/share/vm/runtime/sharedRuntime.cpp | 90 ++++++-- .../src/share/vm/runtime/sharedRuntime.hpp | 2 + .../src/share/vm/runtime/vm_operations.hpp | 9 + .../compiler/jsr292/NonInlinedCall/Agent.java | 48 ++++ .../jsr292/NonInlinedCall/GCTest.java | 105 +++++++++ .../jsr292/NonInlinedCall/InvokeTest.java | 218 ++++++++++++++++++ .../NonInlinedCall/NonInlinedReinvoker.java | 48 ++++ .../jsr292/NonInlinedCall/RedefineTest.java | 157 +++++++++++++ .../sanity/MismatchedWhiteBox/WhiteBox.java | 2 +- 47 files changed, 1190 insertions(+), 148 deletions(-) create mode 100644 hotspot/test/compiler/jsr292/NonInlinedCall/Agent.java create mode 100644 hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java create mode 100644 hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java create mode 100644 hotspot/test/compiler/jsr292/NonInlinedCall/NonInlinedReinvoker.java create mode 100644 hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java diff --git a/hotspot/src/cpu/aarch64/vm/aarch64.ad b/hotspot/src/cpu/aarch64/vm/aarch64.ad index afa30b74491..75b598e902c 100644 --- a/hotspot/src/cpu/aarch64/vm/aarch64.ad +++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad @@ -4667,17 +4667,12 @@ encode %{ if (!_method) { // A call to a runtime wrapper, e.g. new, new_typeArray_Java, uncommon_trap. call = __ trampoline_call(Address(addr, relocInfo::runtime_call_type), &cbuf); - } else if (_optimized_virtual) { - call = __ trampoline_call(Address(addr, relocInfo::opt_virtual_call_type), &cbuf); } else { - call = __ trampoline_call(Address(addr, relocInfo::static_call_type), &cbuf); - } - if (call == NULL) { - ciEnv::current()->record_failure("CodeCache is full"); - return; - } + int method_index = resolved_method_index(cbuf); + RelocationHolder rspec = _optimized_virtual ? opt_virtual_call_Relocation::spec(method_index) + : static_call_Relocation::spec(method_index); + call = __ trampoline_call(Address(addr, rspec), &cbuf); - if (_method) { // Emit stub for static call address stub = CompiledStaticCall::emit_to_interp_stub(cbuf); if (stub == NULL) { @@ -4685,11 +4680,16 @@ encode %{ return; } } + if (call == NULL) { + ciEnv::current()->record_failure("CodeCache is full"); + return; + } %} enc_class aarch64_enc_java_dynamic_call(method meth) %{ MacroAssembler _masm(&cbuf); - address call = __ ic_call((address)$meth$$method); + int method_index = resolved_method_index(cbuf); + address call = __ ic_call((address)$meth$$method, method_index); if (call == NULL) { ciEnv::current()->record_failure("CodeCache is full"); return; diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp index c9608bc7492..8fed72e1313 100644 --- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp @@ -732,8 +732,8 @@ address MacroAssembler::emit_trampoline_stub(int insts_call_instruction_offset, return stub; } -address MacroAssembler::ic_call(address entry) { - RelocationHolder rh = virtual_call_Relocation::spec(pc()); +address MacroAssembler::ic_call(address entry, jint method_index) { + RelocationHolder rh = virtual_call_Relocation::spec(pc(), method_index); // address const_ptr = long_constant((jlong)Universe::non_oop_word()); // unsigned long offset; // ldr_constant(rscratch2, const_ptr); diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp index 4c4e79b8629..54c608fada0 100644 --- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp @@ -983,7 +983,7 @@ public: } // Emit the CompiledIC call idiom - address ic_call(address entry); + address ic_call(address entry, jint method_index = 0); public: diff --git a/hotspot/src/cpu/ppc/vm/ppc.ad b/hotspot/src/cpu/ppc/vm/ppc.ad index aefdf28133f..615f74eecf9 100644 --- a/hotspot/src/cpu/ppc/vm/ppc.ad +++ b/hotspot/src/cpu/ppc/vm/ppc.ad @@ -3396,11 +3396,13 @@ encode %{ } const int entry_point_toc_offset = __ offset_to_method_toc(entry_point_toc_addr); + // Emit the trampoline stub which will be related to the branch-and-link below. CallStubImpl::emit_trampoline_stub(_masm, entry_point_toc_offset, start_offset); if (ciEnv::current()->failing()) { return; } // Code cache may be full. - __ relocate(_optimized_virtual ? - relocInfo::opt_virtual_call_type : relocInfo::static_call_type); + int method_index = resolved_method_index(cbuf); + __ relocate(_optimized_virtual ? opt_virtual_call_Relocate::spec(method_index) + : static_call_Relocate::spec(method_index)); } // The real call. @@ -3450,8 +3452,8 @@ encode %{ const address virtual_call_oop_addr = __ addr_at(virtual_call_oop_addr_offset); assert(MacroAssembler::is_load_const_from_method_toc_at(virtual_call_oop_addr), "should be load from TOC"); - - __ relocate(virtual_call_Relocation::spec(virtual_call_oop_addr)); + int method_index = resolved_method_index(cbuf); + __ relocate(virtual_call_Relocation::spec(virtual_call_oop_addr, method_index)); } // At this point I do not have the address of the trampoline stub, diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp index e2ef96c727c..7c9c86a1466 100644 --- a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp @@ -816,6 +816,8 @@ public: inline void call( address d, relocInfo::relocType rt = relocInfo::runtime_call_type ); inline void call( Label& L, relocInfo::relocType rt = relocInfo::runtime_call_type ); + inline void call( address d, RelocationHolder const& rspec ); + public: // pp 150 diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp index 2bbf95e3b61..197e26fa6f8 100644 --- a/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp +++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp @@ -76,6 +76,8 @@ inline void Assembler::cbcond(Condition c, CC cc, Register s1, int simm5, Label& inline void Assembler::call( address d, relocInfo::relocType rt ) { insert_nop_after_cbcond(); cti(); emit_data( op(call_op) | wdisp(intptr_t(d), intptr_t(pc()), 30), rt); has_delay_slot(); assert(rt != relocInfo::virtual_call_type, "must use virtual_call_Relocation::spec"); } inline void Assembler::call( Label& L, relocInfo::relocType rt ) { insert_nop_after_cbcond(); call( target(L), rt); } +inline void Assembler::call( address d, RelocationHolder const& rspec ) { insert_nop_after_cbcond(); cti(); emit_data( op(call_op) | wdisp(intptr_t(d), intptr_t(pc()), 30), rspec); has_delay_slot(); assert(rspec.type() != relocInfo::virtual_call_type, "must use virtual_call_Relocation::spec"); } + inline void Assembler::flush( Register s1, Register s2) { emit_int32( op(arith_op) | op3(flush_op3) | rs1(s1) | rs2(s2)); } inline void Assembler::flush( Register s1, int simm13a) { emit_data( op(arith_op) | op3(flush_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp index 59b5b41a0d8..0c4fc97cc6b 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp @@ -770,8 +770,8 @@ void MacroAssembler::set_vm_result(Register oop_result) { } -void MacroAssembler::ic_call(address entry, bool emit_delay) { - RelocationHolder rspec = virtual_call_Relocation::spec(pc()); +void MacroAssembler::ic_call(address entry, bool emit_delay, jint method_index) { + RelocationHolder rspec = virtual_call_Relocation::spec(pc(), method_index); patchable_set((intptr_t)Universe::non_oop_word(), G5_inline_cache_reg); relocate(rspec); call(entry, relocInfo::none); @@ -780,7 +780,6 @@ void MacroAssembler::ic_call(address entry, bool emit_delay) { } } - void MacroAssembler::card_table_write(jbyte* byte_map_base, Register tmp, Register obj) { #ifdef _LP64 diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp index d58fc54f1c9..b9e34133328 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp @@ -729,7 +729,11 @@ class MacroAssembler : public Assembler { // Check if the call target is out of wdisp30 range (relative to the code cache) static inline bool is_far_target(address d); inline void call( address d, relocInfo::relocType rt = relocInfo::runtime_call_type ); + inline void call( address d, RelocationHolder const& rspec); + inline void call( Label& L, relocInfo::relocType rt = relocInfo::runtime_call_type ); + inline void call( Label& L, RelocationHolder const& rspec); + inline void callr( Register s1, Register s2 ); inline void callr( Register s1, int simm13a, RelocationHolder const& rspec = RelocationHolder() ); @@ -1146,7 +1150,7 @@ public: void set_vm_result(Register oop_result); // Emit the CompiledIC call idiom - void ic_call(address entry, bool emit_delay = true); + void ic_call(address entry, bool emit_delay = true, jint method_index = 0); // if call_VM_base was called with check_exceptions=false, then call // check_and_forward_exception to handle exceptions when it is safe diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp index 3518d0b6336..4dd8772e010 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp @@ -298,6 +298,10 @@ inline bool MacroAssembler::is_far_target(address d) { // expense of relocation and if we overflow the displacement // of the quick call instruction. inline void MacroAssembler::call( address d, relocInfo::relocType rt ) { + MacroAssembler::call(d, Relocation::spec_simple(rt)); +} + +inline void MacroAssembler::call( address d, RelocationHolder const& rspec ) { #ifdef _LP64 intptr_t disp; // NULL is ok because it will be relocated later. @@ -309,14 +313,14 @@ inline void MacroAssembler::call( address d, relocInfo::relocType rt ) { // Is this address within range of the call instruction? // If not, use the expensive instruction sequence if (is_far_target(d)) { - relocate(rt); + relocate(rspec); AddressLiteral dest(d); jumpl_to(dest, O7, O7); } else { - Assembler::call(d, rt); + Assembler::call(d, rspec); } #else - Assembler::call( d, rt ); + Assembler::call( d, rspec ); #endif } diff --git a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp index 3342f51388e..f08eb5be2f2 100644 --- a/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/nativeInst_sparc.cpp @@ -131,8 +131,9 @@ bool NativeInstruction::is_load_store_with_small_offset(Register reg) { void NativeCall::verify() { NativeInstruction::verify(); // make sure code pattern is actually a call instruction - if (!is_op(long_at(0), Assembler::call_op)) { - fatal("not a call"); + int x = long_at(0); + if (!is_op(x, Assembler::call_op)) { + fatal("not a call: 0x%x @ " INTPTR_FORMAT, x, p2i(instruction_address())); } } diff --git a/hotspot/src/cpu/sparc/vm/sparc.ad b/hotspot/src/cpu/sparc/vm/sparc.ad index 15526706f78..510a6a5b156 100644 --- a/hotspot/src/cpu/sparc/vm/sparc.ad +++ b/hotspot/src/cpu/sparc/vm/sparc.ad @@ -1001,7 +1001,7 @@ void emit_form3_mem_reg(CodeBuffer &cbuf, PhaseRegAlloc* ra, const MachNode* n, #endif } -void emit_call_reloc(CodeBuffer &cbuf, intptr_t entry_point, relocInfo::relocType rtype, bool preserve_g2 = false) { +void emit_call_reloc(CodeBuffer &cbuf, intptr_t entry_point, RelocationHolder const& rspec, bool preserve_g2 = false) { // The method which records debug information at every safepoint // expects the call to be the first instruction in the snippet as // it creates a PcDesc structure which tracks the offset of a call @@ -1023,7 +1023,7 @@ void emit_call_reloc(CodeBuffer &cbuf, intptr_t entry_point, relocInfo::relocTyp int startpos = __ offset(); #endif /* ASSERT */ - __ call((address)entry_point, rtype); + __ call((address)entry_point, rspec); if (preserve_g2) __ delayed()->mov(G2, L7); else __ delayed()->nop(); @@ -2593,8 +2593,7 @@ encode %{ enc_class Java_To_Runtime (method meth) %{ // CALL Java_To_Runtime // CALL directly to the runtime // The user of this is responsible for ensuring that R_L7 is empty (killed). - emit_call_reloc(cbuf, $meth$$method, relocInfo::runtime_call_type, - /*preserve_g2=*/true); + emit_call_reloc(cbuf, $meth$$method, runtime_call_Relocation::spec(), /*preserve_g2=*/true); %} enc_class preserve_SP %{ @@ -2611,13 +2610,14 @@ encode %{ // CALL to fixup routine. Fixup routine uses ScopeDesc info to determine // who we intended to call. if (!_method) { - emit_call_reloc(cbuf, $meth$$method, relocInfo::runtime_call_type); - } else if (_optimized_virtual) { - emit_call_reloc(cbuf, $meth$$method, relocInfo::opt_virtual_call_type); + emit_call_reloc(cbuf, $meth$$method, runtime_call_Relocation::spec()); } else { - emit_call_reloc(cbuf, $meth$$method, relocInfo::static_call_type); - } - if (_method) { // Emit stub for static call. + int method_index = resolved_method_index(cbuf); + RelocationHolder rspec = _optimized_virtual ? opt_virtual_call_Relocation::spec(method_index) + : static_call_Relocation::spec(method_index); + emit_call_reloc(cbuf, $meth$$method, rspec); + + // Emit stub for static call. address stub = CompiledStaticCall::emit_to_interp_stub(cbuf); // Stub does not fit into scratch buffer if TraceJumps is enabled if (stub == NULL && !(TraceJumps && Compile::current()->in_scratch_emit_size())) { @@ -2638,7 +2638,7 @@ encode %{ Register G5_ic_reg = reg_to_register_object(Matcher::inline_cache_reg_encode()); assert(G5_ic_reg == G5_inline_cache_reg, "G5_inline_cache_reg used in assemble_ic_buffer_code()"); assert(G5_ic_reg == G5_megamorphic_method, "G5_megamorphic_method used in megamorphic call stub"); - __ ic_call((address)$meth$$method); + __ ic_call((address)$meth$$method, /*emit_delay=*/true, resolved_method_index(cbuf)); } else { assert(!UseInlineCaches, "expect vtable calls only if not using ICs"); // Just go thru the vtable @@ -10069,10 +10069,10 @@ instruct string_compareL(o0RegP str1, o1RegP str2, g3RegI cnt1, g4RegI cnt2, not format %{ "String Compare byte[] $str1,$cnt1,$str2,$cnt2 -> $result // KILL $tmp" %} ins_encode %{ __ string_compare($str1$$Register, $str2$$Register, - $cnt1$$Register, $cnt2$$Register, + $cnt1$$Register, $cnt2$$Register, $tmp$$Register, $tmp$$Register, $result$$Register, StrIntrinsicNode::LL); - %} + %} ins_pipe(long_memory_op); %} @@ -10088,7 +10088,7 @@ instruct string_compareU(o0RegP str1, o1RegP str2, g3RegI cnt1, g4RegI cnt2, not $cnt1$$Register, $cnt2$$Register, $tmp$$Register, $tmp$$Register, $result$$Register, StrIntrinsicNode::UU); - %} + %} ins_pipe(long_memory_op); %} @@ -10104,7 +10104,7 @@ instruct string_compareLU(o0RegP str1, o1RegP str2, g3RegI cnt1, g4RegI cnt2, no $cnt1$$Register, $cnt2$$Register, $tmp1$$Register, $tmp2$$Register, $result$$Register, StrIntrinsicNode::LU); - %} + %} ins_pipe(long_memory_op); %} @@ -10117,10 +10117,10 @@ instruct string_compareUL(o0RegP str1, o1RegP str2, g3RegI cnt1, g4RegI cnt2, no format %{ "String Compare byte[] $str1,$cnt1,$str2,$cnt2 -> $result // KILL $tmp1,$tmp2" %} ins_encode %{ __ string_compare($str2$$Register, $str1$$Register, - $cnt2$$Register, $cnt1$$Register, + $cnt2$$Register, $cnt1$$Register, $tmp1$$Register, $tmp2$$Register, $result$$Register, StrIntrinsicNode::UL); - %} + %} ins_pipe(long_memory_op); %} diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp index 21646e1bc0d..69a0d562df1 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp @@ -2260,8 +2260,8 @@ void MacroAssembler::call(AddressLiteral entry) { } } -void MacroAssembler::ic_call(address entry) { - RelocationHolder rh = virtual_call_Relocation::spec(pc()); +void MacroAssembler::ic_call(address entry, jint method_index) { + RelocationHolder rh = virtual_call_Relocation::spec(pc(), method_index); movptr(rax, (intptr_t)Universe::non_oop_word()); call(AddressLiteral(entry, rh)); } diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp index b4e440f4383..e29d80b12bb 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp @@ -850,7 +850,7 @@ class MacroAssembler: public Assembler { void call(AddressLiteral entry); // Emit the CompiledIC call idiom - void ic_call(address entry); + void ic_call(address entry, jint method_index = 0); // Jumps diff --git a/hotspot/src/cpu/x86/vm/x86_32.ad b/hotspot/src/cpu/x86/vm/x86_32.ad index 1f38927626c..0383a0aa56d 100644 --- a/hotspot/src/cpu/x86/vm/x86_32.ad +++ b/hotspot/src/cpu/x86/vm/x86_32.ad @@ -1898,17 +1898,18 @@ encode %{ // who we intended to call. cbuf.set_insts_mark(); $$$emit8$primary; + if (!_method) { emit_d32_reloc(cbuf, ($meth$$method - (int)(cbuf.insts_end()) - 4), - runtime_call_Relocation::spec(), RELOC_IMM32 ); - } else if (_optimized_virtual) { - emit_d32_reloc(cbuf, ($meth$$method - (int)(cbuf.insts_end()) - 4), - opt_virtual_call_Relocation::spec(), RELOC_IMM32 ); + runtime_call_Relocation::spec(), + RELOC_IMM32); } else { + int method_index = resolved_method_index(cbuf); + RelocationHolder rspec = _optimized_virtual ? opt_virtual_call_Relocation::spec(method_index) + : static_call_Relocation::spec(method_index); emit_d32_reloc(cbuf, ($meth$$method - (int)(cbuf.insts_end()) - 4), - static_call_Relocation::spec(), RELOC_IMM32 ); - } - if (_method) { // Emit stub for static call. + rspec, RELOC_DISP32); + // Emit stubs for static call. address stub = CompiledStaticCall::emit_to_interp_stub(cbuf); if (stub == NULL) { ciEnv::current()->record_failure("CodeCache is full"); @@ -1919,7 +1920,7 @@ encode %{ enc_class Java_Dynamic_Call (method meth) %{ // JAVA DYNAMIC CALL MacroAssembler _masm(&cbuf); - __ ic_call((address)$meth$$method); + __ ic_call((address)$meth$$method, resolved_method_index(cbuf)); %} enc_class Java_Compiled_Call (method meth) %{ // JAVA COMPILED CALL @@ -11504,7 +11505,7 @@ instruct string_equals(eDIRegP str1, eSIRegP str2, eCXRegI cnt, eAXRegI result, __ arrays_equals(false, $str1$$Register, $str2$$Register, $cnt$$Register, $result$$Register, $tmp3$$Register, $tmp1$$XMMRegister, $tmp2$$XMMRegister, false /* char */); - %} + %} ins_pipe( pipe_slow ); %} diff --git a/hotspot/src/cpu/x86/vm/x86_64.ad b/hotspot/src/cpu/x86/vm/x86_64.ad index 9b4f9f9ebce..9fac082c788 100644 --- a/hotspot/src/cpu/x86/vm/x86_64.ad +++ b/hotspot/src/cpu/x86/vm/x86_64.ad @@ -2120,22 +2120,15 @@ encode %{ $$$emit8$primary; if (!_method) { - emit_d32_reloc(cbuf, - (int) ($meth$$method - ((intptr_t) cbuf.insts_end()) - 4), + emit_d32_reloc(cbuf, (int) ($meth$$method - ((intptr_t) cbuf.insts_end()) - 4), runtime_call_Relocation::spec(), RELOC_DISP32); - } else if (_optimized_virtual) { - emit_d32_reloc(cbuf, - (int) ($meth$$method - ((intptr_t) cbuf.insts_end()) - 4), - opt_virtual_call_Relocation::spec(), - RELOC_DISP32); } else { - emit_d32_reloc(cbuf, - (int) ($meth$$method - ((intptr_t) cbuf.insts_end()) - 4), - static_call_Relocation::spec(), - RELOC_DISP32); - } - if (_method) { + int method_index = resolved_method_index(cbuf); + RelocationHolder rspec = _optimized_virtual ? opt_virtual_call_Relocation::spec(method_index) + : static_call_Relocation::spec(method_index); + emit_d32_reloc(cbuf, (int) ($meth$$method - ((intptr_t) cbuf.insts_end()) - 4), + rspec, RELOC_DISP32); // Emit stubs for static call. address mark = cbuf.insts_mark(); address stub = CompiledStaticCall::emit_to_interp_stub(cbuf, mark); @@ -2148,7 +2141,7 @@ encode %{ enc_class Java_Dynamic_Call(method meth) %{ MacroAssembler _masm(&cbuf); - __ ic_call((address)$meth$$method); + __ ic_call((address)$meth$$method, resolved_method_index(cbuf)); %} enc_class Java_Compiled_Call(method meth) diff --git a/hotspot/src/share/vm/asm/codeBuffer.cpp b/hotspot/src/share/vm/asm/codeBuffer.cpp index 4ffcf0c81a2..30828b69751 100644 --- a/hotspot/src/share/vm/asm/codeBuffer.cpp +++ b/hotspot/src/share/vm/asm/codeBuffer.cpp @@ -305,6 +305,31 @@ address CodeSection::target(Label& L, address branch_pc) { } } +void CodeSection::relocate(address at, relocInfo::relocType rtype, int format, jint method_index) { + RelocationHolder rh; + switch (rtype) { + case relocInfo::none: return; + case relocInfo::opt_virtual_call_type: { + rh = opt_virtual_call_Relocation::spec(method_index); + break; + } + case relocInfo::static_call_type: { + rh = static_call_Relocation::spec(method_index); + break; + } + case relocInfo::virtual_call_type: { + assert(method_index == 0, "resolved method overriding is not supported"); + rh = Relocation::spec_simple(rtype); + break; + } + default: { + rh = Relocation::spec_simple(rtype); + break; + } + } + relocate(at, rh, format); +} + void CodeSection::relocate(address at, RelocationHolder const& spec, int format) { Relocation* reloc = spec.reloc(); relocInfo::relocType rtype = (relocInfo::relocType) reloc->type(); diff --git a/hotspot/src/share/vm/asm/codeBuffer.hpp b/hotspot/src/share/vm/asm/codeBuffer.hpp index 387a5b7cced..534a81f0631 100644 --- a/hotspot/src/share/vm/asm/codeBuffer.hpp +++ b/hotspot/src/share/vm/asm/codeBuffer.hpp @@ -209,10 +209,7 @@ class CodeSection VALUE_OBJ_CLASS_SPEC { // Emit a relocation. void relocate(address at, RelocationHolder const& rspec, int format = 0); - void relocate(address at, relocInfo::relocType rtype, int format = 0) { - if (rtype != relocInfo::none) - relocate(at, Relocation::spec_simple(rtype), format); - } + void relocate(address at, relocInfo::relocType rtype, int format = 0, jint method_index = 0); // alignment requirement for starting offset // Requirements are that the instruction area and the diff --git a/hotspot/src/share/vm/ci/ciMethod.hpp b/hotspot/src/share/vm/ci/ciMethod.hpp index 5b19e95d39f..65edcc30ab5 100644 --- a/hotspot/src/share/vm/ci/ciMethod.hpp +++ b/hotspot/src/share/vm/ci/ciMethod.hpp @@ -250,6 +250,12 @@ class ciMethod : public ciMetadata { ciField* get_field_at_bci( int bci, bool &will_link); ciMethod* get_method_at_bci(int bci, bool &will_link, ciSignature* *declared_signature); + ciMethod* get_method_at_bci(int bci) { + bool ignored_will_link; + ciSignature* ignored_declared_signature; + return get_method_at_bci(bci, ignored_will_link, &ignored_declared_signature); + } + // Given a certain calling environment, find the monomorphic target // for the call. Return NULL if the call is not monomorphic in // its calling environment. diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp index df477a8462f..e651ad00ed9 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp @@ -1054,6 +1054,11 @@ do_name( isCompileConstant_name, "isCompileConstant") \ do_alias( isCompileConstant_signature, object_boolean_signature) \ \ + do_class(sun_hotspot_WhiteBox, "sun/hotspot/WhiteBox") \ + do_intrinsic(_deoptimize, sun_hotspot_WhiteBox, deoptimize_name, deoptimize_signature, F_R) \ + do_name( deoptimize_name, "deoptimize") \ + do_alias( deoptimize_signature, void_method_signature) \ + \ /* unsafe memory references (there are a lot of them...) */ \ do_signature(getObject_signature, "(Ljava/lang/Object;J)Ljava/lang/Object;") \ do_signature(putObject_signature, "(Ljava/lang/Object;JLjava/lang/Object;)V") \ diff --git a/hotspot/src/share/vm/code/compiledIC.cpp b/hotspot/src/share/vm/code/compiledIC.cpp index ec3e3a8e072..b2dde314f54 100644 --- a/hotspot/src/share/vm/code/compiledIC.cpp +++ b/hotspot/src/share/vm/code/compiledIC.cpp @@ -434,7 +434,7 @@ void CompiledIC::set_to_monomorphic(CompiledICInfo& info) { InlineCacheBuffer::create_transition_stub(this, info.cached_metadata(), info.entry()); } else { if (is_optimized()) { - set_ic_destination(info.entry()); + set_ic_destination(info.entry()); } else { set_ic_destination_and_value(info.entry(), info.cached_metadata()); } diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp index 307f0f71b98..d8af2c0624b 100644 --- a/hotspot/src/share/vm/code/nmethod.cpp +++ b/hotspot/src/share/vm/code/nmethod.cpp @@ -978,19 +978,23 @@ void nmethod::print_nmethod(bool printmethod) { oop_maps()->print(); } } - if (PrintDebugInfo || CompilerOracle::has_option_string(_method, "PrintDebugInfo")) { + if (printmethod || PrintDebugInfo || CompilerOracle::has_option_string(_method, "PrintDebugInfo")) { print_scopes(); } - if (PrintRelocations || CompilerOracle::has_option_string(_method, "PrintRelocations")) { + if (printmethod || PrintRelocations || CompilerOracle::has_option_string(_method, "PrintRelocations")) { print_relocations(); } - if (PrintDependencies || CompilerOracle::has_option_string(_method, "PrintDependencies")) { + if (printmethod || PrintDependencies || CompilerOracle::has_option_string(_method, "PrintDependencies")) { print_dependencies(); } - if (PrintExceptionHandlers) { + if (printmethod || PrintExceptionHandlers) { print_handler_table(); print_nul_chk_table(); } + if (printmethod) { + print_recorded_oops(); + print_recorded_metadata(); + } if (xtty != NULL) { xtty->tail("print_nmethod"); } @@ -3013,6 +3017,26 @@ void nmethod::print_pcs() { } } +void nmethod::print_recorded_oops() { + tty->print_cr("Recorded oops:"); + for (int i = 0; i < oops_count(); i++) { + oop o = oop_at(i); + tty->print("#%3d: " INTPTR_FORMAT " ", i, p2i(o)); + o->print_value(); + tty->cr(); + } +} + +void nmethod::print_recorded_metadata() { + tty->print_cr("Recorded metadata:"); + for (int i = 0; i < metadata_count(); i++) { + Metadata* m = metadata_at(i); + tty->print("#%3d: " INTPTR_FORMAT " ", i, p2i(m)); + m->print_value_on_maybe_null(tty); + tty->cr(); + } +} + #endif // PRODUCT const char* nmethod::reloc_string_for(u_char* begin, u_char* end) { @@ -3053,9 +3077,39 @@ const char* nmethod::reloc_string_for(u_char* begin, u_char* end) { } return st.as_string(); } - case relocInfo::virtual_call_type: return "virtual_call"; - case relocInfo::opt_virtual_call_type: return "optimized virtual_call"; - case relocInfo::static_call_type: return "static_call"; + case relocInfo::virtual_call_type: { + stringStream st; + st.print_raw("virtual_call"); + virtual_call_Relocation* r = iter.virtual_call_reloc(); + Method* m = r->method_value(); + if (m != NULL) { + assert(m->is_method(), ""); + m->print_short_name(&st); + } + return st.as_string(); + } + case relocInfo::opt_virtual_call_type: { + stringStream st; + st.print_raw("optimized virtual_call"); + opt_virtual_call_Relocation* r = iter.opt_virtual_call_reloc(); + Method* m = r->method_value(); + if (m != NULL) { + assert(m->is_method(), ""); + m->print_short_name(&st); + } + return st.as_string(); + } + case relocInfo::static_call_type: { + stringStream st; + st.print_raw("static_call"); + static_call_Relocation* r = iter.static_call_reloc(); + Method* m = r->method_value(); + if (m != NULL) { + assert(m->is_method(), ""); + m->print_short_name(&st); + } + return st.as_string(); + } case relocInfo::static_stub_type: return "static_stub"; case relocInfo::external_word_type: return "external_word"; case relocInfo::internal_word_type: return "internal_word"; @@ -3393,3 +3447,19 @@ char* nmethod::jvmci_installed_code_name(char* buf, size_t buflen) { return buf; } #endif + +Method* nmethod::attached_method(address call_instr) { + assert(code_contains(call_instr), "not part of the nmethod"); + RelocIterator iter(this, call_instr, call_instr + 1); + while (iter.next()) { + if (iter.addr() == call_instr) { + switch(iter.type()) { + case relocInfo::static_call_type: return iter.static_call_reloc()->method_value(); + case relocInfo::opt_virtual_call_type: return iter.opt_virtual_call_reloc()->method_value(); + case relocInfo::virtual_call_type: return iter.virtual_call_reloc()->method_value(); + } + } + } + return NULL; // not found +} + diff --git a/hotspot/src/share/vm/code/nmethod.hpp b/hotspot/src/share/vm/code/nmethod.hpp index 6134378aac0..3f72547d518 100644 --- a/hotspot/src/share/vm/code/nmethod.hpp +++ b/hotspot/src/share/vm/code/nmethod.hpp @@ -392,6 +392,9 @@ class nmethod : public CodeBlob { int handler_table_size() const { return handler_table_end() - handler_table_begin(); } int nul_chk_table_size() const { return nul_chk_table_end() - nul_chk_table_begin(); } + int oops_count() const { assert(oops_size() % oopSize == 0, ""); return (oops_size() / oopSize) + 1; } + int metadata_count() const { assert(metadata_size() % wordSize == 0, ""); return (metadata_size() / wordSize) + 1; } + int total_size () const; void dec_hotness_counter() { _hotness_counter--; } @@ -491,7 +494,7 @@ class nmethod : public CodeBlob { oop oop_at(int index) const { return index == 0 ? (oop) NULL: *oop_addr_at(index); } oop* oop_addr_at(int index) const { // for GC // relocation indexes are biased by 1 (because 0 is reserved) - assert(index > 0 && index <= oops_size(), "must be a valid non-zero index"); + assert(index > 0 && index <= oops_count(), "must be a valid non-zero index"); assert(!_oops_are_stale, "oops are stale"); return &oops_begin()[index - 1]; } @@ -501,13 +504,15 @@ class nmethod : public CodeBlob { Metadata* metadata_at(int index) const { return index == 0 ? NULL: *metadata_addr_at(index); } Metadata** metadata_addr_at(int index) const { // for GC // relocation indexes are biased by 1 (because 0 is reserved) - assert(index > 0 && index <= metadata_size(), "must be a valid non-zero index"); + assert(index > 0 && index <= metadata_count(), "must be a valid non-zero index"); return &metadata_begin()[index - 1]; } void copy_values(GrowableArray* oops); void copy_values(GrowableArray* metadata); + Method* attached_method(address call_pc); + // Relocation support private: void fix_oop_relocations(address begin, address end, bool initialize_immediates); @@ -696,6 +701,8 @@ public: void print_calls(outputStream* st) PRODUCT_RETURN; void print_handler_table() PRODUCT_RETURN; void print_nul_chk_table() PRODUCT_RETURN; + void print_recorded_oops() PRODUCT_RETURN; + void print_recorded_metadata() PRODUCT_RETURN; void print_nmethod(bool print_code); // need to re-define this from CodeBlob else the overload hides it diff --git a/hotspot/src/share/vm/code/relocInfo.cpp b/hotspot/src/share/vm/code/relocInfo.cpp index 50b0517457d..ec83dad64a8 100644 --- a/hotspot/src/share/vm/code/relocInfo.cpp +++ b/hotspot/src/share/vm/code/relocInfo.cpp @@ -581,13 +581,14 @@ void virtual_call_Relocation::pack_data_to(CodeSection* dest) { normalize_address(_cached_value, dest); jint x0 = scaled_offset_null_special(_cached_value, point); - p = pack_1_int_to(p, x0); + p = pack_2_ints_to(p, x0, _method_index); dest->set_locs_end((relocInfo*) p); } void virtual_call_Relocation::unpack_data() { - jint x0 = unpack_1_int(); + jint x0 = 0; + unpack_2_ints(x0, _method_index); address point = addr(); _cached_value = x0==0? NULL: address_from_scaled_offset(x0, point); } @@ -793,6 +794,12 @@ address virtual_call_Relocation::cached_value() { return _cached_value; } +Method* virtual_call_Relocation::method_value() { + Metadata* m = code()->metadata_at(_method_index); + assert(m != NULL || _method_index == 0, "should be non-null for non-zero index"); + assert(m == NULL || m->is_method(), "not a method"); + return (Method*)m; +} void virtual_call_Relocation::clear_inline_cache() { // No stubs for ICs @@ -803,6 +810,23 @@ void virtual_call_Relocation::clear_inline_cache() { } +void opt_virtual_call_Relocation::pack_data_to(CodeSection* dest) { + short* p = (short*) dest->locs_end(); + p = pack_1_int_to(p, _method_index); + dest->set_locs_end((relocInfo*) p); +} + +void opt_virtual_call_Relocation::unpack_data() { + _method_index = unpack_1_int(); +} + +Method* opt_virtual_call_Relocation::method_value() { + Metadata* m = code()->metadata_at(_method_index); + assert(m != NULL || _method_index == 0, "should be non-null for non-zero index"); + assert(m == NULL || m->is_method(), "not a method"); + return (Method*)m; +} + void opt_virtual_call_Relocation::clear_inline_cache() { // No stubs for ICs // Clean IC @@ -827,6 +851,22 @@ address opt_virtual_call_Relocation::static_stub() { return NULL; } +Method* static_call_Relocation::method_value() { + Metadata* m = code()->metadata_at(_method_index); + assert(m != NULL || _method_index == 0, "should be non-null for non-zero index"); + assert(m == NULL || m->is_method(), "not a method"); + return (Method*)m; +} + +void static_call_Relocation::pack_data_to(CodeSection* dest) { + short* p = (short*) dest->locs_end(); + p = pack_1_int_to(p, _method_index); + dest->set_locs_end((relocInfo*) p); +} + +void static_call_Relocation::unpack_data() { + _method_index = unpack_1_int(); +} void static_call_Relocation::clear_inline_cache() { // Safe call site info @@ -1014,6 +1054,12 @@ void RelocIterator::print_current() { break; } case relocInfo::static_call_type: + { + static_call_Relocation* r = (static_call_Relocation*) reloc(); + tty->print(" | [destination=" INTPTR_FORMAT " metadata=" INTPTR_FORMAT "]", + p2i(r->destination()), p2i(r->method_value())); + break; + } case relocInfo::runtime_call_type: { CallRelocation* r = (CallRelocation*) reloc(); @@ -1023,8 +1069,8 @@ void RelocIterator::print_current() { case relocInfo::virtual_call_type: { virtual_call_Relocation* r = (virtual_call_Relocation*) reloc(); - tty->print(" | [destination=" INTPTR_FORMAT " cached_value=" INTPTR_FORMAT "]", - p2i(r->destination()), p2i(r->cached_value())); + tty->print(" | [destination=" INTPTR_FORMAT " cached_value=" INTPTR_FORMAT " metadata=" INTPTR_FORMAT "]", + p2i(r->destination()), p2i(r->cached_value()), p2i(r->method_value())); break; } case relocInfo::static_stub_type: @@ -1039,6 +1085,13 @@ void RelocIterator::print_current() { tty->print(" | [trampoline owner=" INTPTR_FORMAT "]", p2i(r->owner())); break; } + case relocInfo::opt_virtual_call_type: + { + opt_virtual_call_Relocation* r = (opt_virtual_call_Relocation*) reloc(); + tty->print(" | [destination=" INTPTR_FORMAT " metadata=" INTPTR_FORMAT "]", + p2i(r->destination()), p2i(r->method_value())); + break; + } } tty->cr(); } diff --git a/hotspot/src/share/vm/code/relocInfo.hpp b/hotspot/src/share/vm/code/relocInfo.hpp index dc9b11bbcfe..a243bfdbee7 100644 --- a/hotspot/src/share/vm/code/relocInfo.hpp +++ b/hotspot/src/share/vm/code/relocInfo.hpp @@ -1044,27 +1044,31 @@ class virtual_call_Relocation : public CallRelocation { // "cached_value" points to the first associated set-oop. // The oop_limit helps find the last associated set-oop. // (See comments at the top of this file.) - static RelocationHolder spec(address cached_value) { + static RelocationHolder spec(address cached_value, jint method_index = 0) { RelocationHolder rh = newHolder(); - new(rh) virtual_call_Relocation(cached_value); + new(rh) virtual_call_Relocation(cached_value, method_index); return rh; } - virtual_call_Relocation(address cached_value) { + private: + address _cached_value; // location of set-value instruction + jint _method_index; // resolved method for a Java call + + virtual_call_Relocation(address cached_value, int method_index) { _cached_value = cached_value; + _method_index = method_index; assert(cached_value != NULL, "first oop address must be specified"); } - private: - address _cached_value; // location of set-value instruction - friend class RelocIterator; virtual_call_Relocation() { } - public: address cached_value(); + int method_index() { return _method_index; } + Method* method_value(); + // data is packed as scaled offsets in "2_ints" format: [f l] or [Ff Ll] // oop_limit is set to 0 if the limit falls somewhere within the call. // When unpacking, a zero oop_limit is taken to refer to the end of the call. @@ -1080,17 +1084,29 @@ class opt_virtual_call_Relocation : public CallRelocation { relocInfo::relocType type() { return relocInfo::opt_virtual_call_type; } public: - static RelocationHolder spec() { + static RelocationHolder spec(int method_index = 0) { RelocationHolder rh = newHolder(); - new(rh) opt_virtual_call_Relocation(); + new(rh) opt_virtual_call_Relocation(method_index); return rh; } private: + jint _method_index; // resolved method for a Java call + + opt_virtual_call_Relocation(int method_index) { + _method_index = method_index; + } + friend class RelocIterator; - opt_virtual_call_Relocation() { } + opt_virtual_call_Relocation() {} public: + int method_index() { return _method_index; } + Method* method_value(); + + void pack_data_to(CodeSection* dest); + void unpack_data(); + void clear_inline_cache(); // find the matching static_stub @@ -1102,17 +1118,29 @@ class static_call_Relocation : public CallRelocation { relocInfo::relocType type() { return relocInfo::static_call_type; } public: - static RelocationHolder spec() { + static RelocationHolder spec(int method_index = 0) { RelocationHolder rh = newHolder(); - new(rh) static_call_Relocation(); + new(rh) static_call_Relocation(method_index); return rh; } private: + jint _method_index; // resolved method for a Java call + + static_call_Relocation(int method_index) { + _method_index = method_index; + } + friend class RelocIterator; - static_call_Relocation() { } + static_call_Relocation() {} public: + int method_index() { return _method_index; } + Method* method_value(); + + void pack_data_to(CodeSection* dest); + void unpack_data(); + void clear_inline_cache(); // find the matching static_stub diff --git a/hotspot/src/share/vm/interpreter/linkResolver.cpp b/hotspot/src/share/vm/interpreter/linkResolver.cpp index 173ec0ec667..4c7e891d74a 100644 --- a/hotspot/src/share/vm/interpreter/linkResolver.cpp +++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp @@ -1456,6 +1456,33 @@ void LinkResolver::resolve_invoke(CallInfo& result, Handle recv, const constantP return; } +void LinkResolver::resolve_invoke(CallInfo& result, Handle& recv, + const methodHandle& attached_method, + Bytecodes::Code byte, TRAPS) { + KlassHandle defc = attached_method->method_holder(); + Symbol* name = attached_method->name(); + Symbol* type = attached_method->signature(); + LinkInfo link_info(defc, name, type, KlassHandle(), /*check_access=*/false); + switch(byte) { + case Bytecodes::_invokevirtual: + resolve_virtual_call(result, recv, recv->klass(), link_info, + /*check_null_and_abstract=*/true, CHECK); + break; + case Bytecodes::_invokeinterface: + resolve_interface_call(result, recv, recv->klass(), link_info, + /*check_null_and_abstract=*/true, CHECK); + break; + case Bytecodes::_invokestatic: + resolve_static_call(result, link_info, /*initialize_class=*/false, CHECK); + break; + case Bytecodes::_invokespecial: + resolve_special_call(result, link_info, CHECK); + break; + default: + fatal("bad call: %s", Bytecodes::name(byte)); + } +} + void LinkResolver::resolve_invokestatic(CallInfo& result, const constantPoolHandle& pool, int index, TRAPS) { LinkInfo link_info(pool, index, CHECK); resolve_static_call(result, link_info, /*initialize_class*/true, CHECK); diff --git a/hotspot/src/share/vm/interpreter/linkResolver.hpp b/hotspot/src/share/vm/interpreter/linkResolver.hpp index 198eefbe2c0..7d7a27944c8 100644 --- a/hotspot/src/share/vm/interpreter/linkResolver.hpp +++ b/hotspot/src/share/vm/interpreter/linkResolver.hpp @@ -295,6 +295,12 @@ class LinkResolver: AllStatic { static void resolve_invoke(CallInfo& result, Handle recv, const constantPoolHandle& pool, int index, Bytecodes::Code byte, TRAPS); + + // runtime resolving from attached method + static void resolve_invoke(CallInfo& result, Handle& recv, + const methodHandle& attached_method, + Bytecodes::Code byte, TRAPS); + private: static void trace_method_resolution(const char* prefix, KlassHandle klass, KlassHandle resolved_klass, diff --git a/hotspot/src/share/vm/opto/callGenerator.cpp b/hotspot/src/share/vm/opto/callGenerator.cpp index ff86ad4750d..68a193e246c 100644 --- a/hotspot/src/share/vm/opto/callGenerator.cpp +++ b/hotspot/src/share/vm/opto/callGenerator.cpp @@ -46,6 +46,11 @@ const TypeFunc* CallGenerator::tf() const { return TypeFunc::make(method()); } +bool CallGenerator::is_inlined_mh_linker(JVMState* jvms, ciMethod* callee) { + ciMethod* symbolic_info = jvms->method()->get_method_at_bci(jvms->bci()); + return symbolic_info->is_method_handle_intrinsic() && !callee->is_method_handle_intrinsic(); +} + //-----------------------------ParseGenerator--------------------------------- // Internal class which handles all direct bytecode traversal. class ParseGenerator : public InlineCallGenerator { @@ -137,6 +142,13 @@ JVMState* DirectCallGenerator::generate(JVMState* jvms) { } CallStaticJavaNode *call = new CallStaticJavaNode(kit.C, tf(), target, method(), kit.bci()); + if (is_inlined_mh_linker(jvms, method())) { + // To be able to issue a direct call and skip a call to MH.linkTo*/invokeBasic adapter, + // additional information about the method being invoked should be attached + // to the call site to make resolution logic work + // (see SharedRuntime::resolve_static_call_C). + call->set_override_symbolic_info(true); + } _call_node = call; // Save the call node in case we need it later if (!is_static) { // Make an explicit receiver null_check as part of this call. @@ -192,7 +204,10 @@ JVMState* VirtualCallGenerator::generate(JVMState* jvms) { // the call instruction will have a seemingly deficient out-count. // (The bailout says something misleading about an "infinite loop".) if (kit.gvn().type(receiver)->higher_equal(TypePtr::NULL_PTR)) { - kit.inc_sp(method()->arg_size()); // restore arguments + assert(Bytecodes::is_invoke(kit.java_bc()), "%d: %s", kit.java_bc(), Bytecodes::name(kit.java_bc())); + ciMethod* declared_method = kit.method()->get_method_at_bci(kit.bci()); + int arg_size = declared_method->signature()->arg_size_for_bc(kit.java_bc()); + kit.inc_sp(arg_size); // restore arguments kit.uncommon_trap(Deoptimization::Reason_null_check, Deoptimization::Action_none, NULL, "null receiver"); @@ -226,6 +241,13 @@ JVMState* VirtualCallGenerator::generate(JVMState* jvms) { address target = SharedRuntime::get_resolve_virtual_call_stub(); // Normal inline cache used for call CallDynamicJavaNode *call = new CallDynamicJavaNode(tf(), target, method(), _vtable_index, kit.bci()); + if (is_inlined_mh_linker(jvms, method())) { + // To be able to issue a direct call (optimized virtual or virtual) + // and skip a call to MH.linkTo*/invokeBasic adapter, additional information + // about the method being invoked should be attached to the call site to + // make resolution logic work (see SharedRuntime::resolve_{virtual,opt_virtual}_call_C). + call->set_override_symbolic_info(true); + } kit.set_arguments_for_java_call(call); kit.set_edges_for_java_call(call); Node* ret = kit.set_results_for_java_call(call); @@ -463,8 +485,8 @@ bool LateInlineMHCallGenerator::do_late_inline_check(JVMState* jvms) { _attempt++; } - if (cg != NULL) { - assert(!cg->is_late_inline() && cg->is_inline(), "we're doing late inlining"); + if (cg != NULL && cg->is_inline()) { + assert(!cg->is_late_inline(), "we're doing late inlining"); _inline_cg = cg; Compile::current()->dec_number_of_mh_late_inlines(); return true; @@ -807,8 +829,7 @@ CallGenerator* CallGenerator::for_method_handle_inline(JVMState* jvms, ciMethod* const int vtable_index = Method::invalid_vtable_index; CallGenerator* cg = C->call_generator(target, vtable_index, false, jvms, true, PROB_ALWAYS, NULL, true, true); assert(cg == NULL || !cg->is_late_inline() || cg->is_mh_late_inline(), "no late inline here"); - if (cg != NULL && cg->is_inline()) - return cg; + return cg; } else { const char* msg = "receiver not constant"; if (PrintInlining) C->print_inlining(callee, jvms->depth() - 1, jvms->bci(), msg); @@ -829,7 +850,7 @@ CallGenerator* CallGenerator::for_method_handle_inline(JVMState* jvms, ciMethod* const TypeOopPtr* oop_ptr = member_name->bottom_type()->is_oopptr(); ciMethod* target = oop_ptr->const_oop()->as_member_name()->get_vmtarget(); - // In lamda forms we erase signature types to avoid resolving issues + // In lambda forms we erase signature types to avoid resolving issues // involving class loaders. When we optimize a method handle invoke // to a direct call we must cast the receiver and arguments to its // actual types. @@ -882,10 +903,9 @@ CallGenerator* CallGenerator::for_method_handle_inline(JVMState* jvms, ciMethod* // provide us with a type speculative_receiver_type = (receiver_type != NULL) ? receiver_type->speculative_type() : NULL; } - CallGenerator* cg = C->call_generator(target, vtable_index, call_does_dispatch, jvms, true, PROB_ALWAYS, speculative_receiver_type, true, true); + CallGenerator* cg = C->call_generator(target, vtable_index, call_does_dispatch, jvms, /*allow_inline=*/true, PROB_ALWAYS, speculative_receiver_type, true, true); assert(cg == NULL || !cg->is_late_inline() || cg->is_mh_late_inline(), "no late inline here"); - if (cg != NULL && cg->is_inline()) - return cg; + return cg; } else { const char* msg = "member_name not constant"; if (PrintInlining) C->print_inlining(callee, jvms->depth() - 1, jvms->bci(), msg); diff --git a/hotspot/src/share/vm/opto/callGenerator.hpp b/hotspot/src/share/vm/opto/callGenerator.hpp index 238fba2ce4a..58e8fe9c614 100644 --- a/hotspot/src/share/vm/opto/callGenerator.hpp +++ b/hotspot/src/share/vm/opto/callGenerator.hpp @@ -49,7 +49,7 @@ class CallGenerator : public ResourceObj { public: // Accessors - ciMethod* method() const { return _method; } + ciMethod* method() const { return _method; } // is_inline: At least some code implementing the method is copied here. virtual bool is_inline() const { return false; } @@ -123,7 +123,6 @@ class CallGenerator : public ResourceObj { // How to generate vanilla out-of-line call sites: static CallGenerator* for_direct_call(ciMethod* m, bool separate_io_projs = false); // static, special static CallGenerator* for_virtual_call(ciMethod* m, int vtable_index); // virtual, interface - static CallGenerator* for_dynamic_call(ciMethod* m); // invokedynamic static CallGenerator* for_method_handle_call( JVMState* jvms, ciMethod* caller, ciMethod* callee, bool delayed_forbidden); static CallGenerator* for_method_handle_inline(JVMState* jvms, ciMethod* caller, ciMethod* callee, bool& input_not_const); @@ -170,6 +169,8 @@ class CallGenerator : public ResourceObj { C->print_inlining(callee, inline_level, bci, msg); } } + + static bool is_inlined_mh_linker(JVMState* jvms, ciMethod* m); }; diff --git a/hotspot/src/share/vm/opto/callnode.cpp b/hotspot/src/share/vm/opto/callnode.cpp index c82a149d444..581b6d3bd67 100644 --- a/hotspot/src/share/vm/opto/callnode.cpp +++ b/hotspot/src/share/vm/opto/callnode.cpp @@ -959,7 +959,8 @@ bool CallNode::is_call_to_arraycopystub() const { uint CallJavaNode::size_of() const { return sizeof(*this); } uint CallJavaNode::cmp( const Node &n ) const { CallJavaNode &call = (CallJavaNode&)n; - return CallNode::cmp(call) && _method == call._method; + return CallNode::cmp(call) && _method == call._method && + _override_symbolic_info == call._override_symbolic_info; } #ifndef PRODUCT void CallJavaNode::dump_spec(outputStream *st) const { diff --git a/hotspot/src/share/vm/opto/callnode.hpp b/hotspot/src/share/vm/opto/callnode.hpp index 389f09cab07..40f939a1160 100644 --- a/hotspot/src/share/vm/opto/callnode.hpp +++ b/hotspot/src/share/vm/opto/callnode.hpp @@ -657,25 +657,29 @@ protected: bool _optimized_virtual; bool _method_handle_invoke; - ciMethod* _method; // Method being direct called + bool _override_symbolic_info; // Override symbolic call site info from bytecode + ciMethod* _method; // Method being direct called public: const int _bci; // Byte Code Index of call byte code CallJavaNode(const TypeFunc* tf , address addr, ciMethod* method, int bci) : CallNode(tf, addr, TypePtr::BOTTOM), _method(method), _bci(bci), _optimized_virtual(false), - _method_handle_invoke(false) + _method_handle_invoke(false), + _override_symbolic_info(false) { init_class_id(Class_CallJava); } virtual int Opcode() const; - ciMethod* method() const { return _method; } - void set_method(ciMethod *m) { _method = m; } - void set_optimized_virtual(bool f) { _optimized_virtual = f; } - bool is_optimized_virtual() const { return _optimized_virtual; } - void set_method_handle_invoke(bool f) { _method_handle_invoke = f; } - bool is_method_handle_invoke() const { return _method_handle_invoke; } + ciMethod* method() const { return _method; } + void set_method(ciMethod *m) { _method = m; } + void set_optimized_virtual(bool f) { _optimized_virtual = f; } + bool is_optimized_virtual() const { return _optimized_virtual; } + void set_method_handle_invoke(bool f) { _method_handle_invoke = f; } + bool is_method_handle_invoke() const { return _method_handle_invoke; } + void set_override_symbolic_info(bool f) { _override_symbolic_info = f; } + bool override_symbolic_info() const { return _override_symbolic_info; } #ifndef PRODUCT virtual void dump_spec(outputStream *st) const; diff --git a/hotspot/src/share/vm/opto/doCall.cpp b/hotspot/src/share/vm/opto/doCall.cpp index b8737560b07..1e8c1a465dc 100644 --- a/hotspot/src/share/vm/opto/doCall.cpp +++ b/hotspot/src/share/vm/opto/doCall.cpp @@ -393,6 +393,100 @@ bool Parse::can_not_compile_call_site(ciMethod *dest_method, ciInstanceKlass* kl return false; } +#ifdef ASSERT +static bool check_type(ciType* t1, ciType* t2) { + // Either oop-oop or prim-prim pair. + if (t1->is_primitive_type() && t2->is_primitive_type()) { + return t1->size() == t2->size(); // argument sizes should match + } else { + return !t1->is_primitive_type() && !t2->is_primitive_type(); // oop-oop + } +} + +static bool check_inlined_mh_linker_info(ciMethod* symbolic_info, ciMethod* resolved_method) { + assert(symbolic_info->is_method_handle_intrinsic(), "sanity"); + assert(!resolved_method->is_method_handle_intrinsic(), "sanity"); + + if (!symbolic_info->is_loaded() || !resolved_method->is_loaded()) { + return true; // Don't compare unloaded methods. + } + // Linkers have appendix argument which is not passed to callee. + int has_appendix = MethodHandles::has_member_arg(symbolic_info->intrinsic_id()) ? 1 : 0; + if (symbolic_info->arg_size() != (resolved_method->arg_size() + has_appendix)) { + return false; // Total size of arguments on stack mismatch. + } + if (!check_type(symbolic_info->return_type(), resolved_method->return_type())) { + return false; // Return value size or type mismatch encountered. + } + + switch (symbolic_info->intrinsic_id()) { + case vmIntrinsics::_linkToVirtual: + case vmIntrinsics::_linkToInterface: + case vmIntrinsics::_linkToSpecial: { + if (resolved_method->is_static()) return false; + break; + } + case vmIntrinsics::_linkToStatic: { + if (!resolved_method->is_static()) return false; + break; + } + } + + ciSignature* symbolic_sig = symbolic_info->signature(); + ciSignature* resolved_sig = resolved_method->signature(); + + if (symbolic_sig->count() + (symbolic_info->is_static() ? 0 : 1) != + resolved_sig->count() + (resolved_method->is_static() ? 0 : 1) + has_appendix) { + return false; // Argument count mismatch + } + + int sbase = 0, rbase = 0; + int arg_count = MIN2(symbolic_sig->count() - has_appendix, resolved_sig->count()); + ciType* recv_type = NULL; + if (symbolic_info->is_static() && !resolved_method->is_static()) { + recv_type = symbolic_sig->type_at(0); + sbase = 1; + } else if (!symbolic_info->is_static() && resolved_method->is_static()) { + recv_type = resolved_sig->type_at(0); + rbase = 1; + } + if (recv_type != NULL && recv_type->is_primitive_type()) { + return false; // Receiver should be an oop. + } + for (int i = 0; i < arg_count; i++) { + if (!check_type(symbolic_sig->type_at(sbase + i), resolved_sig->type_at(rbase + i))) { + return false; // Argument size or type mismatch encountered. + } + } + return true; +} + +static bool is_call_consistent_with_jvms(JVMState* jvms, CallGenerator* cg) { + ciMethod* symbolic_info = jvms->method()->get_method_at_bci(jvms->bci()); + ciMethod* resolved_method = cg->method(); + + if (CallGenerator::is_inlined_mh_linker(jvms, resolved_method)) { + return check_inlined_mh_linker_info(symbolic_info, resolved_method); + } else { + // Method name & descriptor should stay the same. + return (symbolic_info->get_Method()->name() == resolved_method->get_Method()->name()) && + (symbolic_info->get_Method()->signature() == resolved_method->get_Method()->signature()); + } +} + +static bool check_call_consistency(JVMState* jvms, CallGenerator* cg) { + if (!is_call_consistent_with_jvms(jvms, cg)) { + tty->print_cr("JVMS:"); + jvms->dump(); + tty->print_cr("Bytecode info:"); + jvms->method()->get_method_at_bci(jvms->bci())->print(); tty->cr(); + tty->print_cr("Resolved method:"); + cg->method()->print(); tty->cr(); + return false; + } + return true; +} +#endif // ASSERT //------------------------------do_call---------------------------------------- // Handle your basic call. Inline if we can & want to, else just setup call. @@ -571,6 +665,8 @@ void Parse::do_call() { set_jvms(new_jvms); } + assert(check_call_consistency(jvms, cg), "inconsistent info"); + if (!stopped()) { // This was some sort of virtual call, which did a null check for us. // Now we can assert receiver-not-null, on the normal return path. diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index ff068a7fd55..694fb6f6834 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -315,6 +315,8 @@ class LibraryCallKit : public GraphKit { bool inline_profileBoolean(); bool inline_isCompileConstant(); + + bool inline_deoptimize(); }; //---------------------------make_vm_intrinsic---------------------------- @@ -750,6 +752,9 @@ bool LibraryCallKit::try_to_inline(int predicate) { case vmIntrinsics::_hasNegatives: return inline_hasNegatives(); + case vmIntrinsics::_deoptimize: + return inline_deoptimize(); + default: // If you get here, it may be that someone has added a new intrinsic // to the list in vmSymbols.hpp without implementing it here. @@ -6574,3 +6579,12 @@ bool LibraryCallKit::inline_isCompileConstant() { set_result(n->is_Con() ? intcon(1) : intcon(0)); return true; } + +bool LibraryCallKit::inline_deoptimize() { + assert(WhiteBoxAPI, ""); + PreserveReexecuteState preexecs(this); + jvms()->set_should_reexecute(false); + uncommon_trap(Deoptimization::Reason_intrinsic, + Deoptimization::Action_none); + return true; +} diff --git a/hotspot/src/share/vm/opto/machnode.cpp b/hotspot/src/share/vm/opto/machnode.cpp index c780d3f5340..c4e6953ab9f 100644 --- a/hotspot/src/share/vm/opto/machnode.cpp +++ b/hotspot/src/share/vm/opto/machnode.cpp @@ -707,7 +707,8 @@ const RegMask &MachCallNode::in_RegMask(uint idx) const { uint MachCallJavaNode::size_of() const { return sizeof(*this); } uint MachCallJavaNode::cmp( const Node &n ) const { MachCallJavaNode &call = (MachCallJavaNode&)n; - return MachCallNode::cmp(call) && _method->equals(call._method); + return MachCallNode::cmp(call) && _method->equals(call._method) && + _override_symbolic_info == call._override_symbolic_info; } #ifndef PRODUCT void MachCallJavaNode::dump_spec(outputStream *st) const { diff --git a/hotspot/src/share/vm/opto/machnode.hpp b/hotspot/src/share/vm/opto/machnode.hpp index ca2ad70c264..25cbdc648e7 100644 --- a/hotspot/src/share/vm/opto/machnode.hpp +++ b/hotspot/src/share/vm/opto/machnode.hpp @@ -885,16 +885,28 @@ protected: virtual uint cmp( const Node &n ) const; virtual uint size_of() const; // Size is bigger public: - ciMethod* _method; // Method being direct called - int _bci; // Byte Code index of call byte code - bool _optimized_virtual; // Tells if node is a static call or an optimized virtual - bool _method_handle_invoke; // Tells if the call has to preserve SP - MachCallJavaNode() : MachCallNode() { + ciMethod* _method; // Method being direct called + bool _override_symbolic_info; // Override symbolic call site info from bytecode + int _bci; // Byte Code index of call byte code + bool _optimized_virtual; // Tells if node is a static call or an optimized virtual + bool _method_handle_invoke; // Tells if the call has to preserve SP + MachCallJavaNode() : MachCallNode(), _override_symbolic_info(false) { init_class_id(Class_MachCallJava); } virtual const RegMask &in_RegMask(uint) const; + int resolved_method_index(CodeBuffer &cbuf) const { + if (_override_symbolic_info) { + // Attach corresponding Method* to the call site, so VM can use it during resolution + // instead of querying symbolic info from bytecode. + assert(_method != NULL, "method should be set"); + assert(_method->constant_encoding()->is_method(), "should point to a Method"); + return cbuf.oop_recorder()->find_index(_method->constant_encoding()); + } + return 0; // Use symbolic info from bytecode (resolved_method == NULL). + } + #ifndef PRODUCT virtual void dump_spec(outputStream *st) const; #endif diff --git a/hotspot/src/share/vm/opto/matcher.cpp b/hotspot/src/share/vm/opto/matcher.cpp index acf3f32ece0..bb18a3da6d8 100644 --- a/hotspot/src/share/vm/opto/matcher.cpp +++ b/hotspot/src/share/vm/opto/matcher.cpp @@ -1201,6 +1201,7 @@ MachNode *Matcher::match_sfpt( SafePointNode *sfpt ) { mcall_java->_optimized_virtual = call_java->is_optimized_virtual(); is_method_handle_invoke = call_java->is_method_handle_invoke(); mcall_java->_method_handle_invoke = is_method_handle_invoke; + mcall_java->_override_symbolic_info = call_java->override_symbolic_info(); if (is_method_handle_invoke) { C->set_has_method_handle_invokes(true); } diff --git a/hotspot/src/share/vm/prims/methodHandles.cpp b/hotspot/src/share/vm/prims/methodHandles.cpp index 99e8a785f10..4f21e410c24 100644 --- a/hotspot/src/share/vm/prims/methodHandles.cpp +++ b/hotspot/src/share/vm/prims/methodHandles.cpp @@ -358,6 +358,19 @@ Symbol* MethodHandles::signature_polymorphic_intrinsic_name(vmIntrinsics::ID iid return 0; } +Bytecodes::Code MethodHandles::signature_polymorphic_intrinsic_bytecode(vmIntrinsics::ID id) { + switch(id) { + case vmIntrinsics::_linkToVirtual: return Bytecodes::_invokevirtual; + case vmIntrinsics::_linkToInterface: return Bytecodes::_invokeinterface; + case vmIntrinsics::_linkToStatic: return Bytecodes::_invokestatic; + case vmIntrinsics::_linkToSpecial: return Bytecodes::_invokespecial; + case vmIntrinsics::_invokeBasic: return Bytecodes::_invokehandle; + default: + fatal("unexpected id: (%d) %s", (uint)id, vmIntrinsics::name_at(id)); + return Bytecodes::_illegal; + } +} + int MethodHandles::signature_polymorphic_intrinsic_ref_kind(vmIntrinsics::ID iid) { switch (iid) { case vmIntrinsics::_invokeBasic: return 0; diff --git a/hotspot/src/share/vm/prims/methodHandles.hpp b/hotspot/src/share/vm/prims/methodHandles.hpp index ab41c31b4a3..22205f2e9da 100644 --- a/hotspot/src/share/vm/prims/methodHandles.hpp +++ b/hotspot/src/share/vm/prims/methodHandles.hpp @@ -91,6 +91,10 @@ class MethodHandles: AllStatic { iid <= vmIntrinsics::LAST_MH_SIG_POLY); } + static bool is_signature_polymorphic_method(Method* m) { + return is_signature_polymorphic(m->intrinsic_id()); + } + static bool is_signature_polymorphic_intrinsic(vmIntrinsics::ID iid) { assert(is_signature_polymorphic(iid), ""); // Most sig-poly methods are intrinsics which do not require an @@ -131,6 +135,8 @@ class MethodHandles: AllStatic { return signature_polymorphic_name_id(klass, name) != vmIntrinsics::_none; } + static Bytecodes::Code signature_polymorphic_intrinsic_bytecode(vmIntrinsics::ID id); + static int get_named_constant(int which, Handle name_box, TRAPS); public: diff --git a/hotspot/src/share/vm/prims/whitebox.cpp b/hotspot/src/share/vm/prims/whitebox.cpp index 6c68a00d29c..c627ee3ca60 100644 --- a/hotspot/src/share/vm/prims/whitebox.cpp +++ b/hotspot/src/share/vm/prims/whitebox.cpp @@ -1290,6 +1290,11 @@ WB_ENTRY(jlong, WB_GetConstantPool(JNIEnv* env, jobject wb, jclass klass)) return (jlong) ikh->constants(); WB_END +WB_ENTRY(void, WB_ClearInlineCaches(JNIEnv* env, jobject wb)) + VM_ClearICs clear_ics; + VMThread::execute(&clear_ics); +WB_END + template static bool GetMethodOption(JavaThread* thread, JNIEnv* env, jobject method, jstring name, T* value) { assert(value != NULL, "sanity"); @@ -1615,6 +1620,7 @@ static JNINativeMethod methods[] = { (void*)&WB_GetMethodStringOption}, {CC"isShared", CC"(Ljava/lang/Object;)Z", (void*)&WB_IsShared }, {CC"areSharedStringsIgnored", CC"()Z", (void*)&WB_AreSharedStringsIgnored }, + {CC"clearInlineCaches", CC"()V", (void*)&WB_ClearInlineCaches }, }; #undef CC diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp index 68440ee89cf..a79ae71fbc6 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp @@ -1070,6 +1070,21 @@ Handle SharedRuntime::find_callee_info(JavaThread* thread, Bytecodes::Code& bc, return find_callee_info_helper(thread, vfst, bc, callinfo, THREAD); } +methodHandle SharedRuntime::extract_attached_method(vframeStream& vfst) { + nmethod* caller_nm = vfst.nm(); + + nmethodLocker caller_lock(caller_nm); + + address pc = vfst.frame_pc(); + { // Get call instruction under lock because another thread may be busy patching it. + MutexLockerEx ml_patch(Patching_lock, Mutex::_no_safepoint_check_flag); + if (NativeCall::is_call_before(pc)) { + NativeCall* ncall = nativeCall_before(pc); + return caller_nm->attached_method(ncall->instruction_address()); + } + } + return NULL; +} // Finds receiver, CallInfo (i.e. receiver method), and calling bytecode // for a call current in progress, i.e., arguments has been pushed on stack @@ -1087,15 +1102,37 @@ Handle SharedRuntime::find_callee_info_helper(JavaThread* thread, methodHandle caller(THREAD, vfst.method()); int bci = vfst.bci(); - // Find bytecode Bytecode_invoke bytecode(caller, bci); - bc = bytecode.invoke_code(); int bytecode_index = bytecode.index(); + methodHandle attached_method = extract_attached_method(vfst); + if (attached_method.not_null()) { + methodHandle callee = bytecode.static_target(CHECK_NH); + vmIntrinsics::ID id = callee->intrinsic_id(); + // When VM replaces MH.invokeBasic/linkTo* call with a direct/virtual call, + // it attaches statically resolved method to the call site. + if (MethodHandles::is_signature_polymorphic(id) && + MethodHandles::is_signature_polymorphic_intrinsic(id)) { + bc = MethodHandles::signature_polymorphic_intrinsic_bytecode(id); + + // Need to adjust invokehandle since inlining through signature-polymorphic + // method happened. + if (bc == Bytecodes::_invokehandle && + !MethodHandles::is_signature_polymorphic_method(attached_method())) { + bc = attached_method->is_static() ? Bytecodes::_invokestatic + : Bytecodes::_invokevirtual; + } + } + } else { + bc = bytecode.invoke_code(); + } + + bool has_receiver = bc != Bytecodes::_invokestatic && + bc != Bytecodes::_invokedynamic && + bc != Bytecodes::_invokehandle; + // Find receiver for non-static call - if (bc != Bytecodes::_invokestatic && - bc != Bytecodes::_invokedynamic && - bc != Bytecodes::_invokehandle) { + if (has_receiver) { // This register map must be update since we need to find the receiver for // compiled frames. The receiver might be in a register. RegisterMap reg_map2(thread); @@ -1103,10 +1140,13 @@ Handle SharedRuntime::find_callee_info_helper(JavaThread* thread, // Caller-frame is a compiled frame frame callerFrame = stubFrame.sender(®_map2); - methodHandle callee = bytecode.static_target(CHECK_(nullHandle)); - if (callee.is_null()) { - THROW_(vmSymbols::java_lang_NoSuchMethodException(), nullHandle); + if (attached_method.is_null()) { + methodHandle callee = bytecode.static_target(CHECK_NH); + if (callee.is_null()) { + THROW_(vmSymbols::java_lang_NoSuchMethodException(), nullHandle); + } } + // Retrieve from a compiled argument list receiver = Handle(THREAD, callerFrame.retrieve_receiver(®_map2)); @@ -1115,26 +1155,35 @@ Handle SharedRuntime::find_callee_info_helper(JavaThread* thread, } } - // Resolve method. This is parameterized by bytecode. - constantPoolHandle constants(THREAD, caller->constants()); assert(receiver.is_null() || receiver->is_oop(), "wrong receiver"); - LinkResolver::resolve_invoke(callinfo, receiver, constants, bytecode_index, bc, CHECK_(nullHandle)); + + // Resolve method + if (attached_method.not_null()) { + // Parameterized by attached method. + LinkResolver::resolve_invoke(callinfo, receiver, attached_method, bc, CHECK_NH); + } else { + // Parameterized by bytecode. + constantPoolHandle constants(THREAD, caller->constants()); + LinkResolver::resolve_invoke(callinfo, receiver, constants, bytecode_index, bc, CHECK_NH); + } #ifdef ASSERT // Check that the receiver klass is of the right subtype and that it is initialized for virtual calls - if (bc != Bytecodes::_invokestatic && bc != Bytecodes::_invokedynamic && bc != Bytecodes::_invokehandle) { + if (has_receiver) { assert(receiver.not_null(), "should have thrown exception"); KlassHandle receiver_klass(THREAD, receiver->klass()); - Klass* rk = constants->klass_ref_at(bytecode_index, CHECK_(nullHandle)); - // klass is already loaded + Klass* rk = NULL; + if (attached_method.not_null()) { + // In case there's resolved method attached, use its holder during the check. + rk = attached_method->method_holder(); + } else { + // Klass is already loaded. + constantPoolHandle constants(THREAD, caller->constants()); + rk = constants->klass_ref_at(bytecode_index, CHECK_NH); + } KlassHandle static_receiver_klass(THREAD, rk); - // Method handle invokes might have been optimized to a direct call - // so don't check for the receiver class. - // FIXME this weakens the assert too much methodHandle callee = callinfo.selected_method(); - assert(receiver_klass->is_subtype_of(static_receiver_klass()) || - callee->is_method_handle_intrinsic() || - callee->is_compiled_lambda_form(), + assert(receiver_klass->is_subtype_of(static_receiver_klass()), "actual receiver must be subclass of static receiver klass"); if (receiver_klass->is_instance_klass()) { if (InstanceKlass::cast(receiver_klass())->is_not_initialized()) { @@ -1670,7 +1719,6 @@ methodHandle SharedRuntime::reresolve_call_site(JavaThread *thread, TRAPS) { inline_cache->set_to_clean(); } } - } methodHandle callee_method = find_callee_method(thread, CHECK_(methodHandle())); diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.hpp b/hotspot/src/share/vm/runtime/sharedRuntime.hpp index acf822f6eb1..39fc4ce818a 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.hpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.hpp @@ -343,6 +343,8 @@ class SharedRuntime: AllStatic { Bytecodes::Code& bc, CallInfo& callinfo, TRAPS); + static methodHandle extract_attached_method(vframeStream& vfst); + static address clean_virtual_call_entry(); static address clean_opt_virtual_call_entry(); static address clean_static_call_entry(); diff --git a/hotspot/src/share/vm/runtime/vm_operations.hpp b/hotspot/src/share/vm/runtime/vm_operations.hpp index ac53ea63913..940f801f170 100644 --- a/hotspot/src/share/vm/runtime/vm_operations.hpp +++ b/hotspot/src/share/vm/runtime/vm_operations.hpp @@ -30,6 +30,7 @@ #include "oops/oop.hpp" #include "runtime/thread.hpp" #include "utilities/top.hpp" +#include "code/codeCache.hpp" // The following classes are used for operations // initiated by a Java thread but that must @@ -44,6 +45,7 @@ template(ThreadDump) \ template(PrintThreads) \ template(FindDeadlocks) \ + template(ClearICs) \ template(ForceSafepoint) \ template(ForceAsyncSafepoint) \ template(Deoptimize) \ @@ -230,6 +232,13 @@ class VM_ThreadStop: public VM_Operation { } }; +class VM_ClearICs: public VM_Operation { + public: + VM_ClearICs() {} + void doit() { CodeCache::clear_inline_caches(); } + VMOp_Type type() const { return VMOp_ClearICs; } +}; + // dummy vm op, evaluated just to force a safepoint class VM_ForceSafepoint: public VM_Operation { public: diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/Agent.java b/hotspot/test/compiler/jsr292/NonInlinedCall/Agent.java new file mode 100644 index 00000000000..415f0b6b903 --- /dev/null +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/Agent.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +import java.io.File; +import java.io.PrintStream; +import java.lang.instrument.Instrumentation; +import java.util.Arrays; + +public class Agent { + public static void main(String[] args) throws Exception { + String jarName = args[0]; + String className = args[1]; + String manifestName = "manifest.mf"; + + System.out.println("Creating "+manifestName); + try (PrintStream out = new PrintStream(new File(manifestName))) { + out.println("Premain-Class: " + className); + out.println("Can-Redefine-Classes: true"); + } + System.out.println("Building "+jarName); + String[] jarArgs = new String[] {"-cfm", jarName, manifestName }; + + System.out.println("Running jar " + Arrays.toString(jarArgs)); + sun.tools.jar.Main jarTool = new sun.tools.jar.Main(System.out, System.err, "jar"); + if (!jarTool.run(jarArgs)) { + throw new Error("jar failed: args=" + Arrays.toString(args)); + } + } +} diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java new file mode 100644 index 00000000000..0a325734db4 --- /dev/null +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8072008 + * @library /testlibrary /../../test/lib + * @build GCTest NonInlinedReinvoker + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * java.lang.invoke.GCTest + * java.lang.invoke.GCTest$T + * java.lang.invoke.NonInlinedReinvoker + * jdk.test.lib.Asserts + * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions + * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1 + * java.lang.invoke.GCTest + */ +package java.lang.invoke; + +import sun.hotspot.WhiteBox; + +import java.lang.ref.*; +import static jdk.test.lib.Asserts.*; + +public class GCTest { + static final MethodHandles.Lookup LOOKUP = MethodHandles.Lookup.IMPL_LOOKUP; + + static class T { + static int f1() { return 0; } + static int f2() { return 1; } + } + + static @Stable MethodHandle mh; + static PhantomReference lform; + + static final ReferenceQueue rq = new ReferenceQueue<>(); + static final WhiteBox WB = WhiteBox.getWhiteBox(); + + @DontInline + static int invokeBasic() { + try { + return (int) mh.invokeBasic(); + } catch (Throwable e) { + throw new Error(e); + } + } + + static void test(int expected) { + for (int i = 0; i < 20_000; i++) { + invokeBasic(); + } + assertEquals(invokeBasic(), expected); + } + + public static void main(String[] args) throws Exception { + mh = NonInlinedReinvoker.make( + LOOKUP.findStatic(T.class, "f1", MethodType.methodType(int.class))); + + // Monitor LambdaForm GC + lform = new PhantomReference<>(mh.form, rq); + + test(0); + WB.clearInlineCaches(); + test(0); + + mh = NonInlinedReinvoker.make( + LOOKUP.findStatic(T.class, "f2", MethodType.methodType(int.class))); + + Reference ref = null; + while (ref == null) { + WB.fullGC(); + try { + ref = rq.remove(1000); + } catch (InterruptedException e) { /*ignore*/ } + } + + test(1); + WB.clearInlineCaches(); + test(1); + + System.out.println("TEST PASSED"); + } +} diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java new file mode 100644 index 00000000000..687ef7242a7 --- /dev/null +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java @@ -0,0 +1,218 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8072008 + * @library /testlibrary /../../test/lib + * @build InvokeTest NonInlinedReinvoker + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * java.lang.invoke.InvokeTest + * java.lang.invoke.InvokeTest$T + * java.lang.invoke.InvokeTest$P1 + * java.lang.invoke.InvokeTest$P2 + * java.lang.invoke.InvokeTest$I + * java.lang.invoke.NonInlinedReinvoker + * jdk.test.lib.Asserts + * @run main/othervm -Xbootclasspath/a:. -XX:+IgnoreUnrecognizedVMOptions + * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1 + * java.lang.invoke.InvokeTest + */ +package java.lang.invoke; + +import sun.hotspot.WhiteBox; +import static jdk.test.lib.Asserts.*; + +public class InvokeTest { + static MethodHandles.Lookup LOOKUP = MethodHandles.Lookup.IMPL_LOOKUP; + + static final MethodHandle virtualMH; // invokevirtual T.f1 + static final MethodHandle staticMH; // invokestatic T.f2 + static final MethodHandle intfMH; // invokeinterface I.f1 + static final MethodHandle specialMH; // invokespecial T.f4 T + static final MethodHandle basicMH; + + static final WhiteBox WB = WhiteBox.getWhiteBox(); + + static volatile boolean doDeopt = false; + + static { + try { + MethodType mtype = MethodType.methodType(Class.class); + + virtualMH = LOOKUP.findVirtual(T.class, "f1", mtype); + staticMH = LOOKUP.findStatic (T.class, "f2", mtype); + intfMH = LOOKUP.findVirtual(I.class, "f3", mtype); + specialMH = LOOKUP.findSpecial(T.class, "f4", mtype, T.class); + basicMH = NonInlinedReinvoker.make(staticMH); + } catch (Exception e) { + throw new Error(e); + } + } + + static class T implements I { + @DontInline public Class f1() { if (doDeopt) WB.deoptimize(); return T.class; } + @DontInline public static Class f2() { if (doDeopt) WB.deoptimize(); return T.class; } + @DontInline private Class f4() { if (doDeopt) WB.deoptimize(); return T.class; } + } + + static class P1 extends T { + @DontInline public Class f1() { if (doDeopt) WB.deoptimize(); return P1.class; } + @DontInline public Class f3() { if (doDeopt) WB.deoptimize(); return P1.class; } + } + + static class P2 extends T { + @DontInline public Class f1() { if (doDeopt) WB.deoptimize(); return P2.class; } + @DontInline public Class f3() { if (doDeopt) WB.deoptimize(); return P2.class; } + } + + static interface I { + @DontInline default Class f3() { if (doDeopt) WB.deoptimize(); return I.class; } + } + + @DontInline + static void linkToVirtual(Object obj, Class extecpted) { + try { + Class cls = (Class)virtualMH.invokeExact((T)obj); + assertEquals(cls, obj.getClass()); + } catch (Throwable e) { + throw new Error(e); + } + } + + @DontInline + static void linkToInterface(Object obj, Class expected) { + try { + Class cls = (Class)intfMH.invokeExact((I)obj); + assertEquals(cls, expected); + } catch (Throwable e) { + throw new Error(e); + } + } + + @DontInline + static void linkToStatic() { + try { + Class cls = (Class)staticMH.invokeExact(); + assertEquals(cls, T.class); + } catch (Throwable e) { + throw new Error(e); + } + } + + @DontInline + static void linkToSpecial(Object obj, Class expected) { + try { + Class cls = (Class)specialMH.invokeExact((T)obj); + assertEquals(cls, expected); + } catch (Throwable e) { + throw new Error(e); + } + } + + @DontInline + static void invokeBasic() { + try { + Class cls = (Class)basicMH.invokeBasic(); + assertEquals(cls, T.class); + } catch (Throwable e) { + throw new Error(e); + } + } + + static void run(Runnable r) { + for (int i = 0; i < 20_000; i++) { + r.run(); + } + + doDeopt = true; + r.run(); + doDeopt = false; + + WB.clearInlineCaches(); + + for (int i = 0; i < 20_000; i++) { + r.run(); + } + + doDeopt = true; + r.run(); + doDeopt = false; + } + + static void testVirtual() { + System.out.println("linkToVirtual"); + + // Monomorphic case (optimized virtual call) + run(() -> linkToVirtual(new T(), T.class)); + + // Megamorphic case (virtual call) + Object[] recv = new Object[] { new T(), new P1(), new P2() }; + run(() -> { + for (Object r : recv) { + linkToVirtual(r, r.getClass()); + }}); + } + + static void testInterface() { + System.out.println("linkToInterface"); + + // Monomorphic case (optimized virtual call) + run(() -> linkToInterface(new T(), I.class)); + + // Megamorphic case (virtual call) + Object[][] recv = new Object[][] {{new T(), I.class}, {new P1(), P1.class}, {new P2(), P2.class}}; + run(() -> { + for (Object[] r : recv) { + linkToInterface(r[0], (Class)r[1]); + }}); + } + + static void testSpecial() { + System.out.println("linkToSpecial"); + // Monomorphic case (optimized virtual call) + run(() -> linkToSpecial(new T(), T.class)); + } + + static void testStatic() { + System.out.println("linkToStatic"); + // static call + run(() -> linkToStatic()); + } + + static void testBasic() { + System.out.println("invokeBasic"); + // static call + run(() -> invokeBasic()); + } + + public static void main(String[] args) { + testVirtual(); + testInterface(); + testSpecial(); + testStatic(); + testBasic(); + } +} diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/NonInlinedReinvoker.java b/hotspot/test/compiler/jsr292/NonInlinedCall/NonInlinedReinvoker.java new file mode 100644 index 00000000000..c4c36d3c49d --- /dev/null +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/NonInlinedReinvoker.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package java.lang.invoke; + +class NonInlinedReinvoker extends DelegatingMethodHandle { + private final MethodHandle target; + + private NonInlinedReinvoker(MethodHandle target, LambdaForm lf) { + super(target.type(), lf); + this.target = target; + } + @Override + protected MethodHandle getTarget() { + return target; + } + + @Override + MethodHandle asTypeUncached(MethodType newType) { + return asTypeCache = target.asType(newType); + } + + static MethodHandle make(MethodHandle target) { + LambdaForm lform = DelegatingMethodHandle.makeReinvokerForm( + target, -1, DelegatingMethodHandle.class, "reinvoker.dontInline", + /*forceInline=*/false, DelegatingMethodHandle.NF_getTarget, null); + return new NonInlinedReinvoker(target, lform); + } +} diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java new file mode 100644 index 00000000000..54ce2221390 --- /dev/null +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8072008 + * @library /testlibrary /../../test/lib + * @build RedefineTest Agent + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * java.lang.invoke.RedefineTest + * Agent + * jdk.test.lib.Asserts + * @run main Agent agent.jar java.lang.invoke.RedefineTest + * @run main/othervm -Xbootclasspath/a:. -javaagent:agent.jar + * -XX:+IgnoreUnrecognizedVMOptions + * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -Xbatch -XX:-TieredCompilation -XX:CICompilerCount=1 + * java.lang.invoke.RedefineTest + */ +package java.lang.invoke; + +import sun.hotspot.WhiteBox; +import sun.misc.Unsafe; + +import jdk.internal.org.objectweb.asm.*; + +import java.lang.instrument.ClassDefinition; +import java.lang.instrument.Instrumentation; + +import static jdk.internal.org.objectweb.asm.Opcodes.*; + +public class RedefineTest { + static final MethodHandles.Lookup LOOKUP = MethodHandles.Lookup.IMPL_LOOKUP; + static final Unsafe UNSAFE = Unsafe.getUnsafe(); + + static final String NAME = "java/lang/invoke/RedefineTest$T"; + + static Class getClass(int r) { + byte[] classFile = getClassFile(r); + return UNSAFE.defineClass(NAME, classFile, 0, classFile.length, null, null); + } + + /** + * Generates a class of the following shape: + * static class T { + * @DontInline public static int f() { return $r; } + * } + */ + static byte[] getClassFile(int r) { + ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS); + MethodVisitor mv; + cw.visit(52, ACC_PUBLIC | ACC_SUPER, NAME, null, "java/lang/Object", null); + { + mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "f", "()I", null, null); + mv.visitAnnotation("Ljava/lang/invoke/DontInline;", true); + mv.visitCode(); + mv.visitLdcInsn(r); + mv.visitInsn(IRETURN); + mv.visitMaxs(0, 0); + mv.visitEnd(); + } + cw.visitEnd(); + return cw.toByteArray(); + } + + static final MethodHandle mh; + static final Class CLS = getClass(0); + static { + try { + mh = LOOKUP.findStatic(CLS, "f", MethodType.methodType(int.class)); + } catch (Exception e) { + throw new Error(e); + } + } + + static final WhiteBox WB = WhiteBox.getWhiteBox(); + + @DontInline + static int invokeBasic() { + try { + return (int)mh.invokeExact(); + } catch (Throwable e) { + throw new Error(e); + } + } + + static Instrumentation instr; + public static void premain(String args, Instrumentation instr) { + RedefineTest.instr = instr; + } + + + public static void main(String[] args) throws Exception { + for (int i = 0; i < 20_000; i++) { + int r = invokeBasic(); + if (r != 0) { + throw new Error(r + " != 0"); + } + } + // WB.ensureCompiled(); + + redefine(); + + int exp = (instr != null) ? 1 : 0; + + for (int i = 0; i < 20_000; i++) { + if (invokeBasic() != exp) { + throw new Error(); + } + } + + WB.clearInlineCaches(); + + for (int i = 0; i < 20_000; i++) { + if (invokeBasic() != exp) { + throw new Error(); + } + } + + // WB.ensureCompiled(); + } + + static void redefine() { + if (instr == null) { + System.out.println("NOT REDEFINED"); + return; + } + ClassDefinition cd = new ClassDefinition(CLS, getClassFile(1)); + try { + instr.redefineClasses(cd); + } catch (Exception e) { + throw new Error(e); + } + System.out.println("REDEFINED"); + } +} diff --git a/hotspot/test/sanity/MismatchedWhiteBox/WhiteBox.java b/hotspot/test/sanity/MismatchedWhiteBox/WhiteBox.java index 8841c1362ab..87d56e442cb 100644 --- a/hotspot/test/sanity/MismatchedWhiteBox/WhiteBox.java +++ b/hotspot/test/sanity/MismatchedWhiteBox/WhiteBox.java @@ -29,7 +29,7 @@ * @library /testlibrary * @compile WhiteBox.java * @run main ClassFileInstaller sun.hotspot.WhiteBox - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI sun.hotspot.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:-CheckIntrinsics sun.hotspot.WhiteBox */ package sun.hotspot; From 7caf70643cacf9b6683dbb6b521f943434ce3c92 Mon Sep 17 00:00:00 2001 From: Mikael Vidstedt Date: Fri, 4 Dec 2015 13:36:10 -0800 Subject: [PATCH 013/146] 8144657: Invalid format specifiers in jvmci trace messages Reviewed-by: kvn --- hotspot/src/cpu/sparc/vm/jvmciCodeInstaller_sparc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hotspot/src/cpu/sparc/vm/jvmciCodeInstaller_sparc.cpp b/hotspot/src/cpu/sparc/vm/jvmciCodeInstaller_sparc.cpp index c50844963d0..50431ccca89 100644 --- a/hotspot/src/cpu/sparc/vm/jvmciCodeInstaller_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/jvmciCodeInstaller_sparc.cpp @@ -73,7 +73,7 @@ void CodeInstaller::pd_patch_MetaspaceConstant(int pc_offset, Handle constant, T NativeMovConstReg32* move = nativeMovConstReg32_at(pc); narrowKlass narrowOop = record_narrow_metadata_reference(constant, CHECK); move->set_data((intptr_t)narrowOop); - TRACE_jvmci_3("relocating (narrow metaspace constant) at %p/%p", pc, narrowOop); + TRACE_jvmci_3("relocating (narrow metaspace constant) at " PTR_FORMAT "/0x%x", p2i(pc), narrowOop); #else JVMCI_ERROR("compressed Klass* on 32bit"); #endif @@ -81,7 +81,7 @@ void CodeInstaller::pd_patch_MetaspaceConstant(int pc_offset, Handle constant, T NativeMovConstReg* move = nativeMovConstReg_at(pc); Metadata* reference = record_metadata_reference(constant, CHECK); move->set_data((intptr_t)reference); - TRACE_jvmci_3("relocating (metaspace constant) at %p/%p", pc, reference); + TRACE_jvmci_3("relocating (metaspace constant) at " PTR_FORMAT "/" PTR_FORMAT, p2i(pc), p2i(reference)); } } From b5691de477939a174faa904adb7e10867d8d563b Mon Sep 17 00:00:00 2001 From: Mikael Vidstedt Date: Fri, 4 Dec 2015 15:08:49 -0800 Subject: [PATCH 014/146] 8144748: Move assembler/macroAssembler inline function definitions to corresponding inline.hpp files Reviewed-by: kvn, coleenp --- hotspot/src/cpu/sparc/vm/assembler_sparc.hpp | 421 +++++++++--------- .../cpu/sparc/vm/assembler_sparc.inline.hpp | 303 +++++++++++++ .../src/cpu/sparc/vm/macroAssembler_sparc.cpp | 13 - .../src/cpu/sparc/vm/macroAssembler_sparc.hpp | 120 ++--- .../sparc/vm/macroAssembler_sparc.inline.hpp | 109 +++++ 5 files changed, 659 insertions(+), 307 deletions(-) diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp index 7c9c86a1466..ec1a2423aa0 100644 --- a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp @@ -677,11 +677,8 @@ class Assembler : public AbstractAssembler { protected: // Insert a nop if the previous is cbcond - void insert_nop_after_cbcond() { - if (UseCBCond && cbcond_before()) { - nop(); - } - } + inline void insert_nop_after_cbcond(); + // Delay slot helpers // cti is called when emitting control-transfer instruction, // BEFORE doing the emitting. @@ -739,7 +736,7 @@ public: } inline void emit_int32(int); // shadows AbstractAssembler::emit_int32 - inline void emit_data(int x) { emit_int32(x); } + inline void emit_data(int x); inline void emit_data(int, RelocationHolder const&); inline void emit_data(int, relocInfo::relocType rtype); // helper for above fcns @@ -754,31 +751,31 @@ public: inline void add(Register s1, Register s2, Register d ); inline void add(Register s1, int simm13a, Register d ); - void addcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(add_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); } - void addcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(add_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void addc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(addc_op3 ) | rs1(s1) | rs2(s2) ); } - void addc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(addc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void addccc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(addc_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); } - void addccc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(addc_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + inline void addcc( Register s1, Register s2, Register d ); + inline void addcc( Register s1, int simm13a, Register d ); + inline void addc( Register s1, Register s2, Register d ); + inline void addc( Register s1, int simm13a, Register d ); + inline void addccc( Register s1, Register s2, Register d ); + inline void addccc( Register s1, int simm13a, Register d ); // 4-operand AES instructions - void aes_eround01( FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_eround01_op5) | fs2(s2, FloatRegisterImpl::D) ); } - void aes_eround23( FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_eround23_op5) | fs2(s2, FloatRegisterImpl::D) ); } - void aes_dround01( FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_dround01_op5) | fs2(s2, FloatRegisterImpl::D) ); } - void aes_dround23( FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_dround23_op5) | fs2(s2, FloatRegisterImpl::D) ); } - void aes_eround01_l( FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_eround01_l_op5) | fs2(s2, FloatRegisterImpl::D) ); } - void aes_eround23_l( FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_eround23_l_op5) | fs2(s2, FloatRegisterImpl::D) ); } - void aes_dround01_l( FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_dround01_l_op5) | fs2(s2, FloatRegisterImpl::D) ); } - void aes_dround23_l( FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_dround23_l_op5) | fs2(s2, FloatRegisterImpl::D) ); } - void aes_kexpand1( FloatRegister s1, FloatRegister s2, int imm5a, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | u_field(imm5a, 13, 9) | op5(aes_kexpand1_op5) | fs2(s2, FloatRegisterImpl::D) ); } + inline void aes_eround01( FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ); + inline void aes_eround23( FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ); + inline void aes_dround01( FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ); + inline void aes_dround23( FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ); + inline void aes_eround01_l( FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ); + inline void aes_eround23_l( FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ); + inline void aes_dround01_l( FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ); + inline void aes_dround23_l( FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ); + inline void aes_kexpand1( FloatRegister s1, FloatRegister s2, int imm5a, FloatRegister d ); // 3-operand AES instructions - void aes_kexpand0( FloatRegister s1, FloatRegister s2, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes3_op3) | fs1(s1, FloatRegisterImpl::D) | opf(aes_kexpand0_opf) | fs2(s2, FloatRegisterImpl::D) ); } - void aes_kexpand2( FloatRegister s1, FloatRegister s2, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes3_op3) | fs1(s1, FloatRegisterImpl::D) | opf(aes_kexpand2_opf) | fs2(s2, FloatRegisterImpl::D) ); } + inline void aes_kexpand0( FloatRegister s1, FloatRegister s2, FloatRegister d ); + inline void aes_kexpand2( FloatRegister s1, FloatRegister s2, FloatRegister d ); // pp 136 @@ -827,70 +824,70 @@ public: // at address s1 is swapped with the data in d. If the values are not equal, // the the contents of memory at s1 is loaded into d, without the swap. - void casa( Register s1, Register s2, Register d, int ia = -1 ) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(casa_op3 ) | rs1(s1) | (ia == -1 ? immed(true) : imm_asi(ia)) | rs2(s2)); } - void casxa( Register s1, Register s2, Register d, int ia = -1 ) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(casxa_op3) | rs1(s1) | (ia == -1 ? immed(true) : imm_asi(ia)) | rs2(s2)); } + inline void casa( Register s1, Register s2, Register d, int ia = -1 ); + inline void casxa( Register s1, Register s2, Register d, int ia = -1 ); // pp 152 - void udiv( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(udiv_op3 ) | rs1(s1) | rs2(s2)); } - void udiv( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(udiv_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void sdiv( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sdiv_op3 ) | rs1(s1) | rs2(s2)); } - void sdiv( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sdiv_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void udivcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(udiv_op3 | cc_bit_op3) | rs1(s1) | rs2(s2)); } - void udivcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(udiv_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void sdivcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sdiv_op3 | cc_bit_op3) | rs1(s1) | rs2(s2)); } - void sdivcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sdiv_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + inline void udiv( Register s1, Register s2, Register d ); + inline void udiv( Register s1, int simm13a, Register d ); + inline void sdiv( Register s1, Register s2, Register d ); + inline void sdiv( Register s1, int simm13a, Register d ); + inline void udivcc( Register s1, Register s2, Register d ); + inline void udivcc( Register s1, int simm13a, Register d ); + inline void sdivcc( Register s1, Register s2, Register d ); + inline void sdivcc( Register s1, int simm13a, Register d ); // pp 155 - void done() { v9_only(); cti(); emit_int32( op(arith_op) | fcn(0) | op3(done_op3) ); } - void retry() { v9_only(); cti(); emit_int32( op(arith_op) | fcn(1) | op3(retry_op3) ); } + inline void done(); + inline void retry(); // pp 156 - void fadd( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | fs1(s1, w) | opf(0x40 + w) | fs2(s2, w)); } - void fsub( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | fs1(s1, w) | opf(0x44 + w) | fs2(s2, w)); } + inline void fadd( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ); + inline void fsub( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ); // pp 157 - void fcmp( FloatRegisterImpl::Width w, CC cc, FloatRegister s1, FloatRegister s2) { emit_int32( op(arith_op) | cmpcc(cc) | op3(fpop2_op3) | fs1(s1, w) | opf(0x50 + w) | fs2(s2, w)); } - void fcmpe( FloatRegisterImpl::Width w, CC cc, FloatRegister s1, FloatRegister s2) { emit_int32( op(arith_op) | cmpcc(cc) | op3(fpop2_op3) | fs1(s1, w) | opf(0x54 + w) | fs2(s2, w)); } + inline void fcmp( FloatRegisterImpl::Width w, CC cc, FloatRegister s1, FloatRegister s2); + inline void fcmpe( FloatRegisterImpl::Width w, CC cc, FloatRegister s1, FloatRegister s2); // pp 159 - void ftox( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { v9_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(fpop1_op3) | opf(0x80 + w) | fs2(s, w)); } - void ftoi( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::S) | op3(fpop1_op3) | opf(0xd0 + w) | fs2(s, w)); } + inline void ftox( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ); + inline void ftoi( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ); // pp 160 - void ftof( FloatRegisterImpl::Width sw, FloatRegisterImpl::Width dw, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, dw) | op3(fpop1_op3) | opf(0xc0 + sw + dw*4) | fs2(s, sw)); } + inline void ftof( FloatRegisterImpl::Width sw, FloatRegisterImpl::Width dw, FloatRegister s, FloatRegister d ); // pp 161 - void fxtof( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { v9_only(); emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x80 + w*4) | fs2(s, FloatRegisterImpl::D)); } - void fitof( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0xc0 + w*4) | fs2(s, FloatRegisterImpl::S)); } + inline void fxtof( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ); + inline void fitof( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ); // pp 162 - void fmov( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x00 + w) | fs2(s, w)); } + inline void fmov( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ); - void fneg( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x04 + w) | fs2(s, w)); } + inline void fneg( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ); - void fabs( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x08 + w) | fs2(s, w)); } + inline void fabs( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ); // pp 163 - void fmul( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | fs1(s1, w) | opf(0x48 + w) | fs2(s2, w)); } - void fmul( FloatRegisterImpl::Width sw, FloatRegisterImpl::Width dw, FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, dw) | op3(fpop1_op3) | fs1(s1, sw) | opf(0x60 + sw + dw*4) | fs2(s2, sw)); } - void fdiv( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | fs1(s1, w) | opf(0x4c + w) | fs2(s2, w)); } + inline void fmul( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ); + inline void fmul( FloatRegisterImpl::Width sw, FloatRegisterImpl::Width dw, FloatRegister s1, FloatRegister s2, FloatRegister d ); + inline void fdiv( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ); // FXORs/FXORd instructions - void fxor( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, w) | op3(flog3_op3) | fs1(s1, w) | opf(0x6E - w) | fs2(s2, w)); } + inline void fxor( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ); // pp 164 - void fsqrt( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x28 + w) | fs2(s, w)); } + inline void fsqrt( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ); // pp 165 @@ -899,17 +896,17 @@ public: // pp 167 - void flushw() { v9_only(); emit_int32( op(arith_op) | op3(flushw_op3) ); } + void flushw(); // pp 168 - void illtrap( int const22a) { if (const22a != 0) v9_only(); emit_int32( op(branch_op) | u_field(const22a, 21, 0) ); } + void illtrap( int const22a); // v8 unimp == illtrap(0) // pp 169 - void impdep1( int id1, int const19a ) { v9_only(); emit_int32( op(arith_op) | fcn(id1) | op3(impdep1_op3) | u_field(const19a, 18, 0)); } - void impdep2( int id1, int const19a ) { v9_only(); emit_int32( op(arith_op) | fcn(id1) | op3(impdep2_op3) | u_field(const19a, 18, 0)); } + void impdep1( int id1, int const19a ); + void impdep2( int id1, int const19a ); // pp 170 @@ -929,8 +926,8 @@ public: // 173 - void ldfa( FloatRegisterImpl::Width w, Register s1, Register s2, int ia, FloatRegister d ) { v9_only(); emit_int32( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3 | alt_bit_op3, w) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } - void ldfa( FloatRegisterImpl::Width w, Register s1, int simm13a, FloatRegister d ) { v9_only(); emit_int32( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3 | alt_bit_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + inline void ldfa( FloatRegisterImpl::Width w, Register s1, Register s2, int ia, FloatRegister d ); + inline void ldfa( FloatRegisterImpl::Width w, Register s1, int simm13a, FloatRegister d ); // pp 175, lduw is ld on v8 @@ -953,119 +950,119 @@ public: // pp 177 - void ldsba( Register s1, Register s2, int ia, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(ldsb_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } - void ldsba( Register s1, int simm13a, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(ldsb_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void ldsha( Register s1, Register s2, int ia, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(ldsh_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } - void ldsha( Register s1, int simm13a, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(ldsh_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void ldswa( Register s1, Register s2, int ia, Register d ) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(ldsw_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } - void ldswa( Register s1, int simm13a, Register d ) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(ldsw_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void lduba( Register s1, Register s2, int ia, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(ldub_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } - void lduba( Register s1, int simm13a, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(ldub_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void lduha( Register s1, Register s2, int ia, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(lduh_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } - void lduha( Register s1, int simm13a, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(lduh_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void lduwa( Register s1, Register s2, int ia, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(lduw_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } - void lduwa( Register s1, int simm13a, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(lduw_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void ldxa( Register s1, Register s2, int ia, Register d ) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(ldx_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } - void ldxa( Register s1, int simm13a, Register d ) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(ldx_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + inline void ldsba( Register s1, Register s2, int ia, Register d ); + inline void ldsba( Register s1, int simm13a, Register d ); + inline void ldsha( Register s1, Register s2, int ia, Register d ); + inline void ldsha( Register s1, int simm13a, Register d ); + inline void ldswa( Register s1, Register s2, int ia, Register d ); + inline void ldswa( Register s1, int simm13a, Register d ); + inline void lduba( Register s1, Register s2, int ia, Register d ); + inline void lduba( Register s1, int simm13a, Register d ); + inline void lduha( Register s1, Register s2, int ia, Register d ); + inline void lduha( Register s1, int simm13a, Register d ); + inline void lduwa( Register s1, Register s2, int ia, Register d ); + inline void lduwa( Register s1, int simm13a, Register d ); + inline void ldxa( Register s1, Register s2, int ia, Register d ); + inline void ldxa( Register s1, int simm13a, Register d ); // pp 181 - void and3( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(and_op3 ) | rs1(s1) | rs2(s2) ); } - void and3( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(and_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void andcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(and_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); } - void andcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(and_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void andn( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(andn_op3 ) | rs1(s1) | rs2(s2) ); } - void andn( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(andn_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void andncc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(andn_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); } - void andncc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(andn_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void or3( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(or_op3 ) | rs1(s1) | rs2(s2) ); } - void or3( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(or_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void orcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(or_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); } - void orcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(or_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void orn( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(orn_op3) | rs1(s1) | rs2(s2) ); } - void orn( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(orn_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void orncc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(orn_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); } - void orncc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(orn_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void xor3( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xor_op3 ) | rs1(s1) | rs2(s2) ); } - void xor3( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xor_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void xorcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xor_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); } - void xorcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xor_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void xnor( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xnor_op3 ) | rs1(s1) | rs2(s2) ); } - void xnor( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xnor_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void xnorcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xnor_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); } - void xnorcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xnor_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + inline void and3( Register s1, Register s2, Register d ); + inline void and3( Register s1, int simm13a, Register d ); + inline void andcc( Register s1, Register s2, Register d ); + inline void andcc( Register s1, int simm13a, Register d ); + inline void andn( Register s1, Register s2, Register d ); + inline void andn( Register s1, int simm13a, Register d ); + inline void andncc( Register s1, Register s2, Register d ); + inline void andncc( Register s1, int simm13a, Register d ); + inline void or3( Register s1, Register s2, Register d ); + inline void or3( Register s1, int simm13a, Register d ); + inline void orcc( Register s1, Register s2, Register d ); + inline void orcc( Register s1, int simm13a, Register d ); + inline void orn( Register s1, Register s2, Register d ); + inline void orn( Register s1, int simm13a, Register d ); + inline void orncc( Register s1, Register s2, Register d ); + inline void orncc( Register s1, int simm13a, Register d ); + inline void xor3( Register s1, Register s2, Register d ); + inline void xor3( Register s1, int simm13a, Register d ); + inline void xorcc( Register s1, Register s2, Register d ); + inline void xorcc( Register s1, int simm13a, Register d ); + inline void xnor( Register s1, Register s2, Register d ); + inline void xnor( Register s1, int simm13a, Register d ); + inline void xnorcc( Register s1, Register s2, Register d ); + inline void xnorcc( Register s1, int simm13a, Register d ); // pp 183 - void membar( Membar_mask_bits const7a ) { v9_only(); emit_int32( op(arith_op) | op3(membar_op3) | rs1(O7) | immed(true) | u_field( int(const7a), 6, 0)); } + inline void membar( Membar_mask_bits const7a ); // pp 185 - void fmov( FloatRegisterImpl::Width w, Condition c, bool floatCC, CC cca, FloatRegister s2, FloatRegister d ) { v9_only(); emit_int32( op(arith_op) | fd(d, w) | op3(fpop2_op3) | cond_mov(c) | opf_cc(cca, floatCC) | opf_low6(w) | fs2(s2, w)); } + inline void fmov( FloatRegisterImpl::Width w, Condition c, bool floatCC, CC cca, FloatRegister s2, FloatRegister d ); // pp 189 - void fmov( FloatRegisterImpl::Width w, RCondition c, Register s1, FloatRegister s2, FloatRegister d ) { v9_only(); emit_int32( op(arith_op) | fd(d, w) | op3(fpop2_op3) | rs1(s1) | rcond(c) | opf_low5(4 + w) | fs2(s2, w)); } + inline void fmov( FloatRegisterImpl::Width w, RCondition c, Register s1, FloatRegister s2, FloatRegister d ); // pp 191 - void movcc( Condition c, bool floatCC, CC cca, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(movcc_op3) | mov_cc(cca, floatCC) | cond_mov(c) | rs2(s2) ); } - void movcc( Condition c, bool floatCC, CC cca, int simm11a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(movcc_op3) | mov_cc(cca, floatCC) | cond_mov(c) | immed(true) | simm(simm11a, 11) ); } + inline void movcc( Condition c, bool floatCC, CC cca, Register s2, Register d ); + inline void movcc( Condition c, bool floatCC, CC cca, int simm11a, Register d ); // pp 195 - void movr( RCondition c, Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(movr_op3) | rs1(s1) | rcond(c) | rs2(s2) ); } - void movr( RCondition c, Register s1, int simm10a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(movr_op3) | rs1(s1) | rcond(c) | immed(true) | simm(simm10a, 10) ); } + inline void movr( RCondition c, Register s1, Register s2, Register d ); + inline void movr( RCondition c, Register s1, int simm10a, Register d ); // pp 196 - void mulx( Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(mulx_op3 ) | rs1(s1) | rs2(s2) ); } - void mulx( Register s1, int simm13a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(mulx_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void sdivx( Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(sdivx_op3) | rs1(s1) | rs2(s2) ); } - void sdivx( Register s1, int simm13a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(sdivx_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void udivx( Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(udivx_op3) | rs1(s1) | rs2(s2) ); } - void udivx( Register s1, int simm13a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(udivx_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + inline void mulx( Register s1, Register s2, Register d ); + inline void mulx( Register s1, int simm13a, Register d ); + inline void sdivx( Register s1, Register s2, Register d ); + inline void sdivx( Register s1, int simm13a, Register d ); + inline void udivx( Register s1, Register s2, Register d ); + inline void udivx( Register s1, int simm13a, Register d ); // pp 197 - void umul( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(umul_op3 ) | rs1(s1) | rs2(s2) ); } - void umul( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(umul_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void smul( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(smul_op3 ) | rs1(s1) | rs2(s2) ); } - void smul( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(smul_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void umulcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(umul_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); } - void umulcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(umul_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void smulcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(smul_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); } - void smulcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(smul_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + inline void umul( Register s1, Register s2, Register d ); + inline void umul( Register s1, int simm13a, Register d ); + inline void smul( Register s1, Register s2, Register d ); + inline void smul( Register s1, int simm13a, Register d ); + inline void umulcc( Register s1, Register s2, Register d ); + inline void umulcc( Register s1, int simm13a, Register d ); + inline void smulcc( Register s1, Register s2, Register d ); + inline void smulcc( Register s1, int simm13a, Register d ); // pp 201 - void nop() { emit_int32( op(branch_op) | op2(sethi_op2) ); } + inline void nop(); - void sw_count() { emit_int32( op(branch_op) | op2(sethi_op2) | 0x3f0 ); } + inline void sw_count(); // pp 202 - void popc( Register s, Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(popc_op3) | rs2(s)); } - void popc( int simm13a, Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(popc_op3) | immed(true) | simm(simm13a, 13)); } + inline void popc( Register s, Register d); + inline void popc( int simm13a, Register d); // pp 203 - void prefetch( Register s1, Register s2, PrefetchFcn f) { v9_only(); emit_int32( op(ldst_op) | fcn(f) | op3(prefetch_op3) | rs1(s1) | rs2(s2) ); } - void prefetch( Register s1, int simm13a, PrefetchFcn f) { v9_only(); emit_data( op(ldst_op) | fcn(f) | op3(prefetch_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } + inline void prefetch( Register s1, Register s2, PrefetchFcn f); + inline void prefetch( Register s1, int simm13a, PrefetchFcn f); - void prefetcha( Register s1, Register s2, int ia, PrefetchFcn f ) { v9_only(); emit_int32( op(ldst_op) | fcn(f) | op3(prefetch_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } - void prefetcha( Register s1, int simm13a, PrefetchFcn f ) { v9_only(); emit_int32( op(ldst_op) | fcn(f) | op3(prefetch_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + inline void prefetcha( Register s1, Register s2, int ia, PrefetchFcn f ); + inline void prefetcha( Register s1, int simm13a, PrefetchFcn f ); // pp 208 // not implementing read privileged register - inline void rdy( Register d) { v9_dep(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(0, 18, 14)); } - inline void rdccr( Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(2, 18, 14)); } - inline void rdasi( Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(3, 18, 14)); } - inline void rdtick( Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(4, 18, 14)); } // Spoon! - inline void rdpc( Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(5, 18, 14)); } - inline void rdfprs( Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(6, 18, 14)); } + inline void rdy( Register d); + inline void rdccr( Register d); + inline void rdasi( Register d); + inline void rdtick( Register d); + inline void rdpc( Register d); + inline void rdfprs( Register d); // pp 213 @@ -1074,47 +1071,43 @@ public: // pp 214 - void save( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(save_op3) | rs1(s1) | rs2(s2) ); } - void save( Register s1, int simm13a, Register d ) { - // make sure frame is at least large enough for the register save area - assert(-simm13a >= 16 * wordSize, "frame too small"); - emit_int32( op(arith_op) | rd(d) | op3(save_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); - } + inline void save( Register s1, Register s2, Register d ); + inline void save( Register s1, int simm13a, Register d ); - void restore( Register s1 = G0, Register s2 = G0, Register d = G0 ) { emit_int32( op(arith_op) | rd(d) | op3(restore_op3) | rs1(s1) | rs2(s2) ); } - void restore( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(restore_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + inline void restore( Register s1 = G0, Register s2 = G0, Register d = G0 ); + inline void restore( Register s1, int simm13a, Register d ); // pp 216 - void saved() { v9_only(); emit_int32( op(arith_op) | fcn(0) | op3(saved_op3)); } - void restored() { v9_only(); emit_int32( op(arith_op) | fcn(1) | op3(saved_op3)); } + inline void saved(); + inline void restored(); // pp 217 inline void sethi( int imm22a, Register d, RelocationHolder const& rspec = RelocationHolder() ); // pp 218 - void sll( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(0) | rs2(s2) ); } - void sll( Register s1, int imm5a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(0) | immed(true) | u_field(imm5a, 4, 0) ); } - void srl( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(0) | rs2(s2) ); } - void srl( Register s1, int imm5a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(0) | immed(true) | u_field(imm5a, 4, 0) ); } - void sra( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(0) | rs2(s2) ); } - void sra( Register s1, int imm5a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(0) | immed(true) | u_field(imm5a, 4, 0) ); } + inline void sll( Register s1, Register s2, Register d ); + inline void sll( Register s1, int imm5a, Register d ); + inline void srl( Register s1, Register s2, Register d ); + inline void srl( Register s1, int imm5a, Register d ); + inline void sra( Register s1, Register s2, Register d ); + inline void sra( Register s1, int imm5a, Register d ); - void sllx( Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(1) | rs2(s2) ); } - void sllx( Register s1, int imm6a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(1) | immed(true) | u_field(imm6a, 5, 0) ); } - void srlx( Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(1) | rs2(s2) ); } - void srlx( Register s1, int imm6a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(1) | immed(true) | u_field(imm6a, 5, 0) ); } - void srax( Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(1) | rs2(s2) ); } - void srax( Register s1, int imm6a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(1) | immed(true) | u_field(imm6a, 5, 0) ); } + inline void sllx( Register s1, Register s2, Register d ); + inline void sllx( Register s1, int imm6a, Register d ); + inline void srlx( Register s1, Register s2, Register d ); + inline void srlx( Register s1, int imm6a, Register d ); + inline void srax( Register s1, Register s2, Register d ); + inline void srax( Register s1, int imm6a, Register d ); // pp 220 - void sir( int simm13a ) { emit_int32( op(arith_op) | fcn(15) | op3(sir_op3) | immed(true) | simm(simm13a, 13)); } + inline void sir( int simm13a ); // pp 221 - void stbar() { emit_int32( op(arith_op) | op3(membar_op3) | u_field(15, 18, 14)); } + inline void stbar(); // pp 222 @@ -1128,8 +1121,8 @@ public: // pp 224 - void stfa( FloatRegisterImpl::Width w, FloatRegister d, Register s1, Register s2, int ia ) { v9_only(); emit_int32( op(ldst_op) | fd(d, w) | alt_op3(stf_op3 | alt_bit_op3, w) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } - void stfa( FloatRegisterImpl::Width w, FloatRegister d, Register s1, int simm13a ) { v9_only(); emit_int32( op(ldst_op) | fd(d, w) | alt_op3(stf_op3 | alt_bit_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + inline void stfa( FloatRegisterImpl::Width w, FloatRegister d, Register s1, Register s2, int ia ); + inline void stfa( FloatRegisterImpl::Width w, FloatRegister d, Register s1, int simm13a ); // p 226 @@ -1146,28 +1139,28 @@ public: // pp 177 - void stba( Register d, Register s1, Register s2, int ia ) { emit_int32( op(ldst_op) | rd(d) | op3(stb_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } - void stba( Register d, Register s1, int simm13a ) { emit_int32( op(ldst_op) | rd(d) | op3(stb_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void stha( Register d, Register s1, Register s2, int ia ) { emit_int32( op(ldst_op) | rd(d) | op3(sth_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } - void stha( Register d, Register s1, int simm13a ) { emit_int32( op(ldst_op) | rd(d) | op3(sth_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void stwa( Register d, Register s1, Register s2, int ia ) { emit_int32( op(ldst_op) | rd(d) | op3(stw_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } - void stwa( Register d, Register s1, int simm13a ) { emit_int32( op(ldst_op) | rd(d) | op3(stw_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void stxa( Register d, Register s1, Register s2, int ia ) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(stx_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } - void stxa( Register d, Register s1, int simm13a ) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(stx_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void stda( Register d, Register s1, Register s2, int ia ) { emit_int32( op(ldst_op) | rd(d) | op3(std_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } - void stda( Register d, Register s1, int simm13a ) { emit_int32( op(ldst_op) | rd(d) | op3(std_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + inline void stba( Register d, Register s1, Register s2, int ia ); + inline void stba( Register d, Register s1, int simm13a ); + inline void stha( Register d, Register s1, Register s2, int ia ); + inline void stha( Register d, Register s1, int simm13a ); + inline void stwa( Register d, Register s1, Register s2, int ia ); + inline void stwa( Register d, Register s1, int simm13a ); + inline void stxa( Register d, Register s1, Register s2, int ia ); + inline void stxa( Register d, Register s1, int simm13a ); + inline void stda( Register d, Register s1, Register s2, int ia ); + inline void stda( Register d, Register s1, int simm13a ); // pp 230 - void sub( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sub_op3 ) | rs1(s1) | rs2(s2) ); } - void sub( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sub_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + inline void sub( Register s1, Register s2, Register d ); + inline void sub( Register s1, int simm13a, Register d ); - void subcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sub_op3 | cc_bit_op3 ) | rs1(s1) | rs2(s2) ); } - void subcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sub_op3 | cc_bit_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void subc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(subc_op3 ) | rs1(s1) | rs2(s2) ); } - void subc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(subc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } - void subccc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(subc_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); } - void subccc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(subc_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + inline void subcc( Register s1, Register s2, Register d ); + inline void subcc( Register s1, int simm13a, Register d ); + inline void subc( Register s1, Register s2, Register d ); + inline void subc( Register s1, int simm13a, Register d ); + inline void subccc( Register s1, Register s2, Register d ); + inline void subccc( Register s1, int simm13a, Register d ); // pp 231 @@ -1176,86 +1169,80 @@ public: // pp 232 - void swapa( Register s1, Register s2, int ia, Register d ) { v9_dep(); emit_int32( op(ldst_op) | rd(d) | op3(swap_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } - void swapa( Register s1, int simm13a, Register d ) { v9_dep(); emit_int32( op(ldst_op) | rd(d) | op3(swap_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + inline void swapa( Register s1, Register s2, int ia, Register d ); + inline void swapa( Register s1, int simm13a, Register d ); // pp 234, note op in book is wrong, see pp 268 - void taddcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(taddcc_op3 ) | rs1(s1) | rs2(s2) ); } - void taddcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(taddcc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + inline void taddcc( Register s1, Register s2, Register d ); + inline void taddcc( Register s1, int simm13a, Register d ); // pp 235 - void tsubcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(tsubcc_op3 ) | rs1(s1) | rs2(s2) ); } - void tsubcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(tsubcc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + inline void tsubcc( Register s1, Register s2, Register d ); + inline void tsubcc( Register s1, int simm13a, Register d ); // pp 237 - void trap( Condition c, CC cc, Register s1, Register s2 ) { emit_int32( op(arith_op) | cond(c) | op3(trap_op3) | rs1(s1) | trapcc(cc) | rs2(s2)); } - void trap( Condition c, CC cc, Register s1, int trapa ) { emit_int32( op(arith_op) | cond(c) | op3(trap_op3) | rs1(s1) | trapcc(cc) | immed(true) | u_field(trapa, 6, 0)); } + inline void trap( Condition c, CC cc, Register s1, Register s2 ); + inline void trap( Condition c, CC cc, Register s1, int trapa ); // simple uncond. trap - void trap( int trapa ) { trap( always, icc, G0, trapa ); } + inline void trap( int trapa ); // pp 239 omit write priv register for now - inline void wry( Register d) { v9_dep(); emit_int32( op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(0, 29, 25)); } - inline void wrccr(Register s) { v9_only(); emit_int32( op(arith_op) | rs1(s) | op3(wrreg_op3) | u_field(2, 29, 25)); } - inline void wrccr(Register s, int simm13a) { v9_only(); emit_int32( op(arith_op) | - rs1(s) | - op3(wrreg_op3) | - u_field(2, 29, 25) | - immed(true) | - simm(simm13a, 13)); } - inline void wrasi(Register d) { v9_only(); emit_int32( op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(3, 29, 25)); } + inline void wry( Register d); + inline void wrccr(Register s); + inline void wrccr(Register s, int simm13a); + inline void wrasi(Register d); // wrasi(d, imm) stores (d xor imm) to asi - inline void wrasi(Register d, int simm13a) { v9_only(); emit_int32( op(arith_op) | rs1(d) | op3(wrreg_op3) | - u_field(3, 29, 25) | immed(true) | simm(simm13a, 13)); } - inline void wrfprs( Register d) { v9_only(); emit_int32( op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(6, 29, 25)); } + inline void wrasi(Register d, int simm13a); + inline void wrfprs( Register d); // VIS1 instructions - void alignaddr( Register s1, Register s2, Register d ) { vis1_only(); emit_int32( op(arith_op) | rd(d) | op3(alignaddr_op3) | rs1(s1) | opf(alignaddr_opf) | rs2(s2)); } + inline void alignaddr( Register s1, Register s2, Register d ); - void faligndata( FloatRegister s1, FloatRegister s2, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(faligndata_op3) | fs1(s1, FloatRegisterImpl::D) | opf(faligndata_opf) | fs2(s2, FloatRegisterImpl::D)); } + inline void faligndata( FloatRegister s1, FloatRegister s2, FloatRegister d ); - void fzero( FloatRegisterImpl::Width w, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, w) | op3(fzero_op3) | opf(0x62 - w)); } + inline void fzero( FloatRegisterImpl::Width w, FloatRegister d ); - void fsrc2( FloatRegisterImpl::Width w, FloatRegister s2, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, w) | op3(fsrc_op3) | opf(0x7A - w) | fs2(s2, w)); } + inline void fsrc2( FloatRegisterImpl::Width w, FloatRegister s2, FloatRegister d ); - void fnot1( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, w) | op3(fnot_op3) | fs1(s1, w) | opf(0x6C - w)); } + inline void fnot1( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister d ); - void fpmerge( FloatRegister s1, FloatRegister s2, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(0x36) | fs1(s1, FloatRegisterImpl::S) | opf(0x4b) | fs2(s2, FloatRegisterImpl::S)); } + inline void fpmerge( FloatRegister s1, FloatRegister s2, FloatRegister d ); - void stpartialf( Register s1, Register s2, FloatRegister d, int ia = -1 ) { vis1_only(); emit_int32( op(ldst_op) | fd(d, FloatRegisterImpl::D) | op3(stpartialf_op3) | rs1(s1) | imm_asi(ia) | rs2(s2)); } + inline void stpartialf( Register s1, Register s2, FloatRegister d, int ia = -1 ); // VIS2 instructions - void edge8n( Register s1, Register s2, Register d ) { vis2_only(); emit_int32( op(arith_op) | rd(d) | op3(edge_op3) | rs1(s1) | opf(edge8n_opf) | rs2(s2)); } + inline void edge8n( Register s1, Register s2, Register d ); - void bmask( Register s1, Register s2, Register d ) { vis2_only(); emit_int32( op(arith_op) | rd(d) | op3(bmask_op3) | rs1(s1) | opf(bmask_opf) | rs2(s2)); } - void bshuffle( FloatRegister s1, FloatRegister s2, FloatRegister d ) { vis2_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(bshuffle_op3) | fs1(s1, FloatRegisterImpl::D) | opf(bshuffle_opf) | fs2(s2, FloatRegisterImpl::D)); } + inline void bmask( Register s1, Register s2, Register d ); + inline void bshuffle( FloatRegister s1, FloatRegister s2, FloatRegister d ); // VIS3 instructions - void movstosw( FloatRegister s, Register d ) { vis3_only(); emit_int32( op(arith_op) | rd(d) | op3(mftoi_op3) | opf(mstosw_opf) | fs2(s, FloatRegisterImpl::S)); } - void movstouw( FloatRegister s, Register d ) { vis3_only(); emit_int32( op(arith_op) | rd(d) | op3(mftoi_op3) | opf(mstouw_opf) | fs2(s, FloatRegisterImpl::S)); } - void movdtox( FloatRegister s, Register d ) { vis3_only(); emit_int32( op(arith_op) | rd(d) | op3(mftoi_op3) | opf(mdtox_opf) | fs2(s, FloatRegisterImpl::D)); } + inline void movstosw( FloatRegister s, Register d ); + inline void movstouw( FloatRegister s, Register d ); + inline void movdtox( FloatRegister s, Register d ); - void movwtos( Register s, FloatRegister d ) { vis3_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::S) | op3(mftoi_op3) | opf(mwtos_opf) | rs2(s)); } - void movxtod( Register s, FloatRegister d ) { vis3_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(mftoi_op3) | opf(mxtod_opf) | rs2(s)); } + inline void movwtos( Register s, FloatRegister d ); + inline void movxtod( Register s, FloatRegister d ); - void xmulx(Register s1, Register s2, Register d) { vis3_only(); emit_int32( op(arith_op) | rd(d) | op3(xmulx_op3) | rs1(s1) | opf(xmulx_opf) | rs2(s2)); } - void xmulxhi(Register s1, Register s2, Register d) { vis3_only(); emit_int32( op(arith_op) | rd(d) | op3(xmulx_op3) | rs1(s1) | opf(xmulxhi_opf) | rs2(s2)); } + inline void xmulx(Register s1, Register s2, Register d); + inline void xmulxhi(Register s1, Register s2, Register d); // Crypto SHA instructions - void sha1() { sha1_only(); emit_int32( op(arith_op) | op3(sha_op3) | opf(sha1_opf)); } - void sha256() { sha256_only(); emit_int32( op(arith_op) | op3(sha_op3) | opf(sha256_opf)); } - void sha512() { sha512_only(); emit_int32( op(arith_op) | op3(sha_op3) | opf(sha512_opf)); } + inline void sha1(); + inline void sha256(); + inline void sha512(); // CRC32C instruction - void crc32c( FloatRegister s1, FloatRegister s2, FloatRegister d ) { crc32c_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(crc32c_op3) | fs1(s1, FloatRegisterImpl::D) | opf(crc32c_opf) | fs2(s2, FloatRegisterImpl::D)); } + inline void crc32c( FloatRegister s1, FloatRegister s2, FloatRegister d ); // Creation Assembler(CodeBuffer* code) : AbstractAssembler(code) { diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp index 197e26fa6f8..c18b07ec019 100644 --- a/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp +++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp @@ -28,6 +28,12 @@ #include "asm/assembler.hpp" +inline void Assembler::insert_nop_after_cbcond() { + if (UseCBCond && cbcond_before()) { + nop(); + } +} + inline void Assembler::check_delay() { # ifdef CHECK_DELAY guarantee( delay_state != at_delay_slot, "must say delayed() when filling delay slot"); @@ -40,6 +46,10 @@ inline void Assembler::emit_int32(int x) { AbstractAssembler::emit_int32(x); } +inline void Assembler::emit_data(int x) { + emit_int32(x); +} + inline void Assembler::emit_data(int x, relocInfo::relocType rtype) { relocate(rtype); emit_int32(x); @@ -54,6 +64,29 @@ inline void Assembler::emit_data(int x, RelocationHolder const& rspec) { inline void Assembler::add(Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(add_op3) | rs1(s1) | rs2(s2) ); } inline void Assembler::add(Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(add_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::addcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(add_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); } +inline void Assembler::addcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(add_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::addc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(addc_op3 ) | rs1(s1) | rs2(s2) ); } +inline void Assembler::addc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(addc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::addccc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(addc_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); } +inline void Assembler::addccc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(addc_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + +inline void Assembler::aes_eround01( FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_eround01_op5) | fs2(s2, FloatRegisterImpl::D) ); } +inline void Assembler::aes_eround23( FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_eround23_op5) | fs2(s2, FloatRegisterImpl::D) ); } +inline void Assembler::aes_dround01( FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_dround01_op5) | fs2(s2, FloatRegisterImpl::D) ); } +inline void Assembler::aes_dround23( FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_dround23_op5) | fs2(s2, FloatRegisterImpl::D) ); } +inline void Assembler::aes_eround01_l( FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_eround01_l_op5) | fs2(s2, FloatRegisterImpl::D) ); } +inline void Assembler::aes_eround23_l( FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_eround23_l_op5) | fs2(s2, FloatRegisterImpl::D) ); } +inline void Assembler::aes_dround01_l( FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_dround01_l_op5) | fs2(s2, FloatRegisterImpl::D) ); } +inline void Assembler::aes_dround23_l( FloatRegister s1, FloatRegister s2, FloatRegister s3, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | fs3(s3, FloatRegisterImpl::D) | op5(aes_dround23_l_op5) | fs2(s2, FloatRegisterImpl::D) ); } +inline void Assembler::aes_kexpand1( FloatRegister s1, FloatRegister s2, int imm5a, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes4_op3) | fs1(s1, FloatRegisterImpl::D) | u_field(imm5a, 13, 9) | op5(aes_kexpand1_op5) | fs2(s2, FloatRegisterImpl::D) ); } + + +// 3-operand AES instructions + +inline void Assembler::aes_kexpand0( FloatRegister s1, FloatRegister s2, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes3_op3) | fs1(s1, FloatRegisterImpl::D) | opf(aes_kexpand0_opf) | fs2(s2, FloatRegisterImpl::D) ); } +inline void Assembler::aes_kexpand2( FloatRegister s1, FloatRegister s2, FloatRegister d ) { aes_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(aes3_op3) | fs1(s1, FloatRegisterImpl::D) | opf(aes_kexpand2_opf) | fs2(s2, FloatRegisterImpl::D) ); } + inline void Assembler::bpr( RCondition c, bool a, Predict p, Register s1, address d, relocInfo::relocType rt ) { v9_only(); insert_nop_after_cbcond(); cti(); emit_data( op(branch_op) | annul(a) | cond(c) | op2(bpr_op2) | wdisp16(intptr_t(d), intptr_t(pc())) | predict(p) | rs1(s1), rt); has_delay_slot(); } inline void Assembler::bpr( RCondition c, bool a, Predict p, Register s1, Label& L) { insert_nop_after_cbcond(); bpr( c, a, p, s1, target(L)); } @@ -78,9 +111,56 @@ inline void Assembler::call( Label& L, relocInfo::relocType rt ) { insert_nop_ inline void Assembler::call( address d, RelocationHolder const& rspec ) { insert_nop_after_cbcond(); cti(); emit_data( op(call_op) | wdisp(intptr_t(d), intptr_t(pc()), 30), rspec); has_delay_slot(); assert(rspec.type() != relocInfo::virtual_call_type, "must use virtual_call_Relocation::spec"); } +inline void Assembler::casa( Register s1, Register s2, Register d, int ia ) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(casa_op3 ) | rs1(s1) | (ia == -1 ? immed(true) : imm_asi(ia)) | rs2(s2)); } +inline void Assembler::casxa( Register s1, Register s2, Register d, int ia ) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(casxa_op3) | rs1(s1) | (ia == -1 ? immed(true) : imm_asi(ia)) | rs2(s2)); } + +inline void Assembler::udiv( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(udiv_op3 ) | rs1(s1) | rs2(s2)); } +inline void Assembler::udiv( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(udiv_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::sdiv( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sdiv_op3 ) | rs1(s1) | rs2(s2)); } +inline void Assembler::sdiv( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sdiv_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::udivcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(udiv_op3 | cc_bit_op3) | rs1(s1) | rs2(s2)); } +inline void Assembler::udivcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(udiv_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::sdivcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sdiv_op3 | cc_bit_op3) | rs1(s1) | rs2(s2)); } +inline void Assembler::sdivcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sdiv_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + +inline void Assembler::done() { v9_only(); cti(); emit_int32( op(arith_op) | fcn(0) | op3(done_op3) ); } +inline void Assembler::retry() { v9_only(); cti(); emit_int32( op(arith_op) | fcn(1) | op3(retry_op3) ); } + +inline void Assembler::fadd( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | fs1(s1, w) | opf(0x40 + w) | fs2(s2, w)); } +inline void Assembler::fsub( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | fs1(s1, w) | opf(0x44 + w) | fs2(s2, w)); } + +inline void Assembler::fcmp( FloatRegisterImpl::Width w, CC cc, FloatRegister s1, FloatRegister s2) { emit_int32( op(arith_op) | cmpcc(cc) | op3(fpop2_op3) | fs1(s1, w) | opf(0x50 + w) | fs2(s2, w)); } +inline void Assembler::fcmpe( FloatRegisterImpl::Width w, CC cc, FloatRegister s1, FloatRegister s2) { emit_int32( op(arith_op) | cmpcc(cc) | op3(fpop2_op3) | fs1(s1, w) | opf(0x54 + w) | fs2(s2, w)); } + +inline void Assembler::ftox( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { v9_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(fpop1_op3) | opf(0x80 + w) | fs2(s, w)); } +inline void Assembler::ftoi( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::S) | op3(fpop1_op3) | opf(0xd0 + w) | fs2(s, w)); } + +inline void Assembler::ftof( FloatRegisterImpl::Width sw, FloatRegisterImpl::Width dw, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, dw) | op3(fpop1_op3) | opf(0xc0 + sw + dw*4) | fs2(s, sw)); } + +inline void Assembler::fxtof( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { v9_only(); emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x80 + w*4) | fs2(s, FloatRegisterImpl::D)); } +inline void Assembler::fitof( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0xc0 + w*4) | fs2(s, FloatRegisterImpl::S)); } + +inline void Assembler::fmov( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x00 + w) | fs2(s, w)); } +inline void Assembler::fneg( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x04 + w) | fs2(s, w)); } +inline void Assembler::fabs( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x08 + w) | fs2(s, w)); } +inline void Assembler::fmul( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | fs1(s1, w) | opf(0x48 + w) | fs2(s2, w)); } +inline void Assembler::fmul( FloatRegisterImpl::Width sw, FloatRegisterImpl::Width dw, FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, dw) | op3(fpop1_op3) | fs1(s1, sw) | opf(0x60 + sw + dw*4) | fs2(s2, sw)); } +inline void Assembler::fdiv( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | fs1(s1, w) | opf(0x4c + w) | fs2(s2, w)); } + +inline void Assembler::fxor( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister s2, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, w) | op3(flog3_op3) | fs1(s1, w) | opf(0x6E - w) | fs2(s2, w)); } + +inline void Assembler::fsqrt( FloatRegisterImpl::Width w, FloatRegister s, FloatRegister d ) { emit_int32( op(arith_op) | fd(d, w) | op3(fpop1_op3) | opf(0x28 + w) | fs2(s, w)); } + inline void Assembler::flush( Register s1, Register s2) { emit_int32( op(arith_op) | op3(flush_op3) | rs1(s1) | rs2(s2)); } inline void Assembler::flush( Register s1, int simm13a) { emit_data( op(arith_op) | op3(flush_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } +inline void Assembler::flushw() { v9_only(); emit_int32( op(arith_op) | op3(flushw_op3) ); } + +inline void Assembler::illtrap( int const22a) { if (const22a != 0) v9_only(); emit_int32( op(branch_op) | u_field(const22a, 21, 0) ); } + +inline void Assembler::impdep1( int id1, int const19a ) { v9_only(); emit_int32( op(arith_op) | fcn(id1) | op3(impdep1_op3) | u_field(const19a, 18, 0)); } +inline void Assembler::impdep2( int id1, int const19a ) { v9_only(); emit_int32( op(arith_op) | fcn(id1) | op3(impdep2_op3) | u_field(const19a, 18, 0)); } + inline void Assembler::jmpl( Register s1, Register s2, Register d ) { insert_nop_after_cbcond(); cti(); emit_int32( op(arith_op) | rd(d) | op3(jmpl_op3) | rs1(s1) | rs2(s2)); has_delay_slot(); } inline void Assembler::jmpl( Register s1, int simm13a, Register d, RelocationHolder const& rspec ) { insert_nop_after_cbcond(); cti(); emit_data( op(arith_op) | rd(d) | op3(jmpl_op3) | rs1(s1) | immed(true) | simm(simm13a, 13), rspec); has_delay_slot(); } @@ -90,6 +170,9 @@ inline void Assembler::ldf(FloatRegisterImpl::Width w, Register s1, int simm13a, inline void Assembler::ldxfsr( Register s1, Register s2) { v9_only(); emit_int32( op(ldst_op) | rd(G1) | op3(ldfsr_op3) | rs1(s1) | rs2(s2) ); } inline void Assembler::ldxfsr( Register s1, int simm13a) { v9_only(); emit_data( op(ldst_op) | rd(G1) | op3(ldfsr_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } +inline void Assembler::ldfa( FloatRegisterImpl::Width w, Register s1, Register s2, int ia, FloatRegister d ) { v9_only(); emit_int32( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3 | alt_bit_op3, w) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } +inline void Assembler::ldfa( FloatRegisterImpl::Width w, Register s1, int simm13a, FloatRegister d ) { v9_only(); emit_int32( op(ldst_op) | fd(d, w) | alt_op3(ldf_op3 | alt_bit_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + inline void Assembler::ldsb( Register s1, Register s2, Register d) { emit_int32( op(ldst_op) | rd(d) | op3(ldsb_op3) | rs1(s1) | rs2(s2) ); } inline void Assembler::ldsb( Register s1, int simm13a, Register d) { emit_data( op(ldst_op) | rd(d) | op3(ldsb_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } @@ -109,11 +192,134 @@ inline void Assembler::ldx( Register s1, int simm13a, Register d) { v9_only(); inline void Assembler::ldd( Register s1, Register s2, Register d) { v9_dep(); assert(d->is_even(), "not even"); emit_int32( op(ldst_op) | rd(d) | op3(ldd_op3) | rs1(s1) | rs2(s2) ); } inline void Assembler::ldd( Register s1, int simm13a, Register d) { v9_dep(); assert(d->is_even(), "not even"); emit_data( op(ldst_op) | rd(d) | op3(ldd_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } +inline void Assembler::ldsba( Register s1, Register s2, int ia, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(ldsb_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } +inline void Assembler::ldsba( Register s1, int simm13a, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(ldsb_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::ldsha( Register s1, Register s2, int ia, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(ldsh_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } +inline void Assembler::ldsha( Register s1, int simm13a, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(ldsh_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::ldswa( Register s1, Register s2, int ia, Register d ) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(ldsw_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } +inline void Assembler::ldswa( Register s1, int simm13a, Register d ) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(ldsw_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::lduba( Register s1, Register s2, int ia, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(ldub_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } +inline void Assembler::lduba( Register s1, int simm13a, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(ldub_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::lduha( Register s1, Register s2, int ia, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(lduh_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } +inline void Assembler::lduha( Register s1, int simm13a, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(lduh_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::lduwa( Register s1, Register s2, int ia, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(lduw_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } +inline void Assembler::lduwa( Register s1, int simm13a, Register d ) { emit_int32( op(ldst_op) | rd(d) | op3(lduw_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::ldxa( Register s1, Register s2, int ia, Register d ) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(ldx_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } +inline void Assembler::ldxa( Register s1, int simm13a, Register d ) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(ldx_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + +inline void Assembler::and3( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(and_op3 ) | rs1(s1) | rs2(s2) ); } +inline void Assembler::and3( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(and_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::andcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(and_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); } +inline void Assembler::andcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(and_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::andn( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(andn_op3 ) | rs1(s1) | rs2(s2) ); } +inline void Assembler::andn( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(andn_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::andncc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(andn_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); } +inline void Assembler::andncc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(andn_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::or3( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(or_op3 ) | rs1(s1) | rs2(s2) ); } +inline void Assembler::or3( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(or_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::orcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(or_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); } +inline void Assembler::orcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(or_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::orn( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(orn_op3) | rs1(s1) | rs2(s2) ); } +inline void Assembler::orn( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(orn_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::orncc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(orn_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); } +inline void Assembler::orncc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(orn_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::xor3( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xor_op3 ) | rs1(s1) | rs2(s2) ); } +inline void Assembler::xor3( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xor_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::xorcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xor_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); } +inline void Assembler::xorcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xor_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::xnor( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xnor_op3 ) | rs1(s1) | rs2(s2) ); } +inline void Assembler::xnor( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xnor_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::xnorcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xnor_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); } +inline void Assembler::xnorcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(xnor_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + +inline void Assembler::membar( Membar_mask_bits const7a ) { v9_only(); emit_int32( op(arith_op) | op3(membar_op3) | rs1(O7) | immed(true) | u_field( int(const7a), 6, 0)); } + +inline void Assembler::fmov( FloatRegisterImpl::Width w, Condition c, bool floatCC, CC cca, FloatRegister s2, FloatRegister d ) { v9_only(); emit_int32( op(arith_op) | fd(d, w) | op3(fpop2_op3) | cond_mov(c) | opf_cc(cca, floatCC) | opf_low6(w) | fs2(s2, w)); } + +inline void Assembler::fmov( FloatRegisterImpl::Width w, RCondition c, Register s1, FloatRegister s2, FloatRegister d ) { v9_only(); emit_int32( op(arith_op) | fd(d, w) | op3(fpop2_op3) | rs1(s1) | rcond(c) | opf_low5(4 + w) | fs2(s2, w)); } + +inline void Assembler::movcc( Condition c, bool floatCC, CC cca, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(movcc_op3) | mov_cc(cca, floatCC) | cond_mov(c) | rs2(s2) ); } +inline void Assembler::movcc( Condition c, bool floatCC, CC cca, int simm11a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(movcc_op3) | mov_cc(cca, floatCC) | cond_mov(c) | immed(true) | simm(simm11a, 11) ); } + +inline void Assembler::movr( RCondition c, Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(movr_op3) | rs1(s1) | rcond(c) | rs2(s2) ); } +inline void Assembler::movr( RCondition c, Register s1, int simm10a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(movr_op3) | rs1(s1) | rcond(c) | immed(true) | simm(simm10a, 10) ); } + +inline void Assembler::mulx( Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(mulx_op3 ) | rs1(s1) | rs2(s2) ); } +inline void Assembler::mulx( Register s1, int simm13a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(mulx_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::sdivx( Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(sdivx_op3) | rs1(s1) | rs2(s2) ); } +inline void Assembler::sdivx( Register s1, int simm13a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(sdivx_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::udivx( Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(udivx_op3) | rs1(s1) | rs2(s2) ); } +inline void Assembler::udivx( Register s1, int simm13a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(udivx_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + +inline void Assembler::umul( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(umul_op3 ) | rs1(s1) | rs2(s2) ); } +inline void Assembler::umul( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(umul_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::smul( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(smul_op3 ) | rs1(s1) | rs2(s2) ); } +inline void Assembler::smul( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(smul_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::umulcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(umul_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); } +inline void Assembler::umulcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(umul_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::smulcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(smul_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); } +inline void Assembler::smulcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(smul_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + +inline void Assembler::nop() { emit_int32( op(branch_op) | op2(sethi_op2) ); } + +inline void Assembler::sw_count() { emit_int32( op(branch_op) | op2(sethi_op2) | 0x3f0 ); } + +inline void Assembler::popc( Register s, Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(popc_op3) | rs2(s)); } +inline void Assembler::popc( int simm13a, Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(popc_op3) | immed(true) | simm(simm13a, 13)); } + +inline void Assembler::prefetch( Register s1, Register s2, PrefetchFcn f) { v9_only(); emit_int32( op(ldst_op) | fcn(f) | op3(prefetch_op3) | rs1(s1) | rs2(s2) ); } +inline void Assembler::prefetch( Register s1, int simm13a, PrefetchFcn f) { v9_only(); emit_data( op(ldst_op) | fcn(f) | op3(prefetch_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } + +inline void Assembler::prefetcha( Register s1, Register s2, int ia, PrefetchFcn f ) { v9_only(); emit_int32( op(ldst_op) | fcn(f) | op3(prefetch_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } +inline void Assembler::prefetcha( Register s1, int simm13a, PrefetchFcn f ) { v9_only(); emit_int32( op(ldst_op) | fcn(f) | op3(prefetch_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + +inline void Assembler::rdy( Register d) { v9_dep(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(0, 18, 14)); } +inline void Assembler::rdccr( Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(2, 18, 14)); } +inline void Assembler::rdasi( Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(3, 18, 14)); } +inline void Assembler::rdtick( Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(4, 18, 14)); } // Spoon! +inline void Assembler::rdpc( Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(5, 18, 14)); } +inline void Assembler::rdfprs( Register d) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(rdreg_op3) | u_field(6, 18, 14)); } + inline void Assembler::rett( Register s1, Register s2 ) { cti(); emit_int32( op(arith_op) | op3(rett_op3) | rs1(s1) | rs2(s2)); has_delay_slot(); } inline void Assembler::rett( Register s1, int simm13a, relocInfo::relocType rt) { cti(); emit_data( op(arith_op) | op3(rett_op3) | rs1(s1) | immed(true) | simm(simm13a, 13), rt); has_delay_slot(); } +inline void Assembler::save( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(save_op3) | rs1(s1) | rs2(s2) ); } +inline void Assembler::save( Register s1, int simm13a, Register d ) { + // make sure frame is at least large enough for the register save area + assert(-simm13a >= 16 * wordSize, "frame too small"); + emit_int32( op(arith_op) | rd(d) | op3(save_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); +} + +inline void Assembler::restore( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(restore_op3) | rs1(s1) | rs2(s2) ); } +inline void Assembler::restore( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(restore_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + +// pp 216 + +inline void Assembler::saved() { v9_only(); emit_int32( op(arith_op) | fcn(0) | op3(saved_op3)); } +inline void Assembler::restored() { v9_only(); emit_int32( op(arith_op) | fcn(1) | op3(saved_op3)); } + inline void Assembler::sethi( int imm22a, Register d, RelocationHolder const& rspec ) { emit_data( op(branch_op) | rd(d) | op2(sethi_op2) | hi22(imm22a), rspec); } +inline void Assembler::sll( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(0) | rs2(s2) ); } +inline void Assembler::sll( Register s1, int imm5a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(0) | immed(true) | u_field(imm5a, 4, 0) ); } +inline void Assembler::srl( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(0) | rs2(s2) ); } +inline void Assembler::srl( Register s1, int imm5a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(0) | immed(true) | u_field(imm5a, 4, 0) ); } +inline void Assembler::sra( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(0) | rs2(s2) ); } +inline void Assembler::sra( Register s1, int imm5a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(0) | immed(true) | u_field(imm5a, 4, 0) ); } + +inline void Assembler::sllx( Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(1) | rs2(s2) ); } +inline void Assembler::sllx( Register s1, int imm6a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(sll_op3) | rs1(s1) | sx(1) | immed(true) | u_field(imm6a, 5, 0) ); } +inline void Assembler::srlx( Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(1) | rs2(s2) ); } +inline void Assembler::srlx( Register s1, int imm6a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(srl_op3) | rs1(s1) | sx(1) | immed(true) | u_field(imm6a, 5, 0) ); } +inline void Assembler::srax( Register s1, Register s2, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(1) | rs2(s2) ); } +inline void Assembler::srax( Register s1, int imm6a, Register d ) { v9_only(); emit_int32( op(arith_op) | rd(d) | op3(sra_op3) | rs1(s1) | sx(1) | immed(true) | u_field(imm6a, 5, 0) ); } + +inline void Assembler::sir( int simm13a ) { emit_int32( op(arith_op) | fcn(15) | op3(sir_op3) | immed(true) | simm(simm13a, 13)); } + + // pp 221 + +inline void Assembler::stbar() { emit_int32( op(arith_op) | op3(membar_op3) | u_field(15, 18, 14)); } + // pp 222 inline void Assembler::stf( FloatRegisterImpl::Width w, FloatRegister d, Register s1, Register s2) { emit_int32( op(ldst_op) | fd(d, w) | alt_op3(stf_op3, w) | rs1(s1) | rs2(s2) ); } @@ -122,6 +328,9 @@ inline void Assembler::stf( FloatRegisterImpl::Width w, FloatRegister d, Regi inline void Assembler::stxfsr( Register s1, Register s2) { v9_only(); emit_int32( op(ldst_op) | rd(G1) | op3(stfsr_op3) | rs1(s1) | rs2(s2) ); } inline void Assembler::stxfsr( Register s1, int simm13a) { v9_only(); emit_data( op(ldst_op) | rd(G1) | op3(stfsr_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } +inline void Assembler::stfa( FloatRegisterImpl::Width w, FloatRegister d, Register s1, Register s2, int ia ) { v9_only(); emit_int32( op(ldst_op) | fd(d, w) | alt_op3(stf_op3 | alt_bit_op3, w) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } +inline void Assembler::stfa( FloatRegisterImpl::Width w, FloatRegister d, Register s1, int simm13a ) { v9_only(); emit_int32( op(ldst_op) | fd(d, w) | alt_op3(stf_op3 | alt_bit_op3, w) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + // p 226 inline void Assembler::stb( Register d, Register s1, Register s2) { emit_int32( op(ldst_op) | rd(d) | op3(stb_op3) | rs1(s1) | rs2(s2) ); } @@ -137,9 +346,103 @@ inline void Assembler::stx( Register d, Register s1, int simm13a) { v9_only(); inline void Assembler::std( Register d, Register s1, Register s2) { v9_dep(); assert(d->is_even(), "not even"); emit_int32( op(ldst_op) | rd(d) | op3(std_op3) | rs1(s1) | rs2(s2) ); } inline void Assembler::std( Register d, Register s1, int simm13a) { v9_dep(); assert(d->is_even(), "not even"); emit_data( op(ldst_op) | rd(d) | op3(std_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } +inline void Assembler::stba( Register d, Register s1, Register s2, int ia ) { emit_int32( op(ldst_op) | rd(d) | op3(stb_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } +inline void Assembler::stba( Register d, Register s1, int simm13a ) { emit_int32( op(ldst_op) | rd(d) | op3(stb_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::stha( Register d, Register s1, Register s2, int ia ) { emit_int32( op(ldst_op) | rd(d) | op3(sth_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } +inline void Assembler::stha( Register d, Register s1, int simm13a ) { emit_int32( op(ldst_op) | rd(d) | op3(sth_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::stwa( Register d, Register s1, Register s2, int ia ) { emit_int32( op(ldst_op) | rd(d) | op3(stw_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } +inline void Assembler::stwa( Register d, Register s1, int simm13a ) { emit_int32( op(ldst_op) | rd(d) | op3(stw_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::stxa( Register d, Register s1, Register s2, int ia ) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(stx_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } +inline void Assembler::stxa( Register d, Register s1, int simm13a ) { v9_only(); emit_int32( op(ldst_op) | rd(d) | op3(stx_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::stda( Register d, Register s1, Register s2, int ia ) { emit_int32( op(ldst_op) | rd(d) | op3(std_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } +inline void Assembler::stda( Register d, Register s1, int simm13a ) { emit_int32( op(ldst_op) | rd(d) | op3(std_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + +// pp 230 + +inline void Assembler::sub( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sub_op3 ) | rs1(s1) | rs2(s2) ); } +inline void Assembler::sub( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sub_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + +inline void Assembler::subcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sub_op3 | cc_bit_op3 ) | rs1(s1) | rs2(s2) ); } +inline void Assembler::subcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(sub_op3 | cc_bit_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::subc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(subc_op3 ) | rs1(s1) | rs2(s2) ); } +inline void Assembler::subc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(subc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } +inline void Assembler::subccc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(subc_op3 | cc_bit_op3) | rs1(s1) | rs2(s2) ); } +inline void Assembler::subccc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(subc_op3 | cc_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + // pp 231 inline void Assembler::swap( Register s1, Register s2, Register d) { v9_dep(); emit_int32( op(ldst_op) | rd(d) | op3(swap_op3) | rs1(s1) | rs2(s2) ); } inline void Assembler::swap( Register s1, int simm13a, Register d) { v9_dep(); emit_data( op(ldst_op) | rd(d) | op3(swap_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); } +inline void Assembler::swapa( Register s1, Register s2, int ia, Register d ) { v9_dep(); emit_int32( op(ldst_op) | rd(d) | op3(swap_op3 | alt_bit_op3) | rs1(s1) | imm_asi(ia) | rs2(s2) ); } +inline void Assembler::swapa( Register s1, int simm13a, Register d ) { v9_dep(); emit_int32( op(ldst_op) | rd(d) | op3(swap_op3 | alt_bit_op3) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + +// pp 234, note op in book is wrong, see pp 268 + +inline void Assembler::taddcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(taddcc_op3 ) | rs1(s1) | rs2(s2) ); } +inline void Assembler::taddcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(taddcc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + +// pp 235 + +inline void Assembler::tsubcc( Register s1, Register s2, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(tsubcc_op3 ) | rs1(s1) | rs2(s2) ); } +inline void Assembler::tsubcc( Register s1, int simm13a, Register d ) { emit_int32( op(arith_op) | rd(d) | op3(tsubcc_op3 ) | rs1(s1) | immed(true) | simm(simm13a, 13) ); } + +// pp 237 + +inline void Assembler::trap( Condition c, CC cc, Register s1, Register s2 ) { emit_int32( op(arith_op) | cond(c) | op3(trap_op3) | rs1(s1) | trapcc(cc) | rs2(s2)); } +inline void Assembler::trap( Condition c, CC cc, Register s1, int trapa ) { emit_int32( op(arith_op) | cond(c) | op3(trap_op3) | rs1(s1) | trapcc(cc) | immed(true) | u_field(trapa, 6, 0)); } +// simple uncond. trap +inline void Assembler::trap( int trapa ) { trap( always, icc, G0, trapa ); } + +inline void Assembler::wry(Register d) { v9_dep(); emit_int32(op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(0, 29, 25)); } +inline void Assembler::wrccr(Register s) { v9_only(); emit_int32(op(arith_op) | rs1(s) | op3(wrreg_op3) | u_field(2, 29, 25)); } +inline void Assembler::wrccr(Register s, int simm13a) { v9_only(); emit_int32(op(arith_op) | rs1(s) | op3(wrreg_op3) | u_field(2, 29, 25) | immed(true) | simm(simm13a, 13)); } +inline void Assembler::wrasi(Register d) { v9_only(); emit_int32(op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(3, 29, 25)); } +// wrasi(d, imm) stores (d xor imm) to asi +inline void Assembler::wrasi(Register d, int simm13a) { v9_only(); emit_int32(op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(3, 29, 25) | immed(true) | simm(simm13a, 13)); } +inline void Assembler::wrfprs(Register d) { v9_only(); emit_int32(op(arith_op) | rs1(d) | op3(wrreg_op3) | u_field(6, 29, 25)); } + +inline void Assembler::alignaddr( Register s1, Register s2, Register d ) { vis1_only(); emit_int32( op(arith_op) | rd(d) | op3(alignaddr_op3) | rs1(s1) | opf(alignaddr_opf) | rs2(s2)); } + +inline void Assembler::faligndata( FloatRegister s1, FloatRegister s2, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(faligndata_op3) | fs1(s1, FloatRegisterImpl::D) | opf(faligndata_opf) | fs2(s2, FloatRegisterImpl::D)); } + +inline void Assembler::fzero( FloatRegisterImpl::Width w, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, w) | op3(fzero_op3) | opf(0x62 - w)); } + +inline void Assembler::fsrc2( FloatRegisterImpl::Width w, FloatRegister s2, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, w) | op3(fsrc_op3) | opf(0x7A - w) | fs2(s2, w)); } + +inline void Assembler::fnot1( FloatRegisterImpl::Width w, FloatRegister s1, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, w) | op3(fnot_op3) | fs1(s1, w) | opf(0x6C - w)); } + +inline void Assembler::fpmerge( FloatRegister s1, FloatRegister s2, FloatRegister d ) { vis1_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(0x36) | fs1(s1, FloatRegisterImpl::S) | opf(0x4b) | fs2(s2, FloatRegisterImpl::S)); } + +inline void Assembler::stpartialf( Register s1, Register s2, FloatRegister d, int ia ) { vis1_only(); emit_int32( op(ldst_op) | fd(d, FloatRegisterImpl::D) | op3(stpartialf_op3) | rs1(s1) | imm_asi(ia) | rs2(s2)); } + +// VIS2 instructions + +inline void Assembler::edge8n( Register s1, Register s2, Register d ) { vis2_only(); emit_int32( op(arith_op) | rd(d) | op3(edge_op3) | rs1(s1) | opf(edge8n_opf) | rs2(s2)); } + +inline void Assembler::bmask( Register s1, Register s2, Register d ) { vis2_only(); emit_int32( op(arith_op) | rd(d) | op3(bmask_op3) | rs1(s1) | opf(bmask_opf) | rs2(s2)); } +inline void Assembler::bshuffle( FloatRegister s1, FloatRegister s2, FloatRegister d ) { vis2_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(bshuffle_op3) | fs1(s1, FloatRegisterImpl::D) | opf(bshuffle_opf) | fs2(s2, FloatRegisterImpl::D)); } + +// VIS3 instructions + +inline void Assembler::movstosw( FloatRegister s, Register d ) { vis3_only(); emit_int32( op(arith_op) | rd(d) | op3(mftoi_op3) | opf(mstosw_opf) | fs2(s, FloatRegisterImpl::S)); } +inline void Assembler::movstouw( FloatRegister s, Register d ) { vis3_only(); emit_int32( op(arith_op) | rd(d) | op3(mftoi_op3) | opf(mstouw_opf) | fs2(s, FloatRegisterImpl::S)); } +inline void Assembler::movdtox( FloatRegister s, Register d ) { vis3_only(); emit_int32( op(arith_op) | rd(d) | op3(mftoi_op3) | opf(mdtox_opf) | fs2(s, FloatRegisterImpl::D)); } + +inline void Assembler::movwtos( Register s, FloatRegister d ) { vis3_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::S) | op3(mftoi_op3) | opf(mwtos_opf) | rs2(s)); } +inline void Assembler::movxtod( Register s, FloatRegister d ) { vis3_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(mftoi_op3) | opf(mxtod_opf) | rs2(s)); } + +inline void Assembler::xmulx(Register s1, Register s2, Register d) { vis3_only(); emit_int32( op(arith_op) | rd(d) | op3(xmulx_op3) | rs1(s1) | opf(xmulx_opf) | rs2(s2)); } +inline void Assembler::xmulxhi(Register s1, Register s2, Register d) { vis3_only(); emit_int32( op(arith_op) | rd(d) | op3(xmulx_op3) | rs1(s1) | opf(xmulxhi_opf) | rs2(s2)); } + +// Crypto SHA instructions + +inline void Assembler::sha1() { sha1_only(); emit_int32( op(arith_op) | op3(sha_op3) | opf(sha1_opf)); } +inline void Assembler::sha256() { sha256_only(); emit_int32( op(arith_op) | op3(sha_op3) | opf(sha256_opf)); } +inline void Assembler::sha512() { sha512_only(); emit_int32( op(arith_op) | op3(sha_op3) | opf(sha512_opf)); } + +// CRC32C instruction + +inline void Assembler::crc32c( FloatRegister s1, FloatRegister s2, FloatRegister d ) { crc32c_only(); emit_int32( op(arith_op) | fd(d, FloatRegisterImpl::D) | op3(crc32c_op3) | fs1(s1, FloatRegisterImpl::D) | opf(crc32c_opf) | fs2(s2, FloatRegisterImpl::D)); } + #endif // CPU_SPARC_VM_ASSEMBLER_SPARC_INLINE_HPP diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp index 0c4fc97cc6b..baee6280a47 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp @@ -181,19 +181,6 @@ void MacroAssembler::null_check(Register reg, int offset) { // Ring buffer jumps -#ifndef PRODUCT -void MacroAssembler::ret( bool trace ) { if (trace) { - mov(I7, O7); // traceable register - JMP(O7, 2 * BytesPerInstWord); - } else { - jmpl( I7, 2 * BytesPerInstWord, G0 ); - } - } - -void MacroAssembler::retl( bool trace ) { if (trace) JMP(O7, 2 * BytesPerInstWord); - else jmpl( O7, 2 * BytesPerInstWord, G0 ); } -#endif /* PRODUCT */ - void MacroAssembler::jmp2(Register r1, Register r2, const char* file, int line ) { assert_not_delayed(); diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp index b9e34133328..3443c3f3a87 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp @@ -720,8 +720,8 @@ class MacroAssembler : public Assembler { inline int get_pc( Register d ); // Sparc shorthands(pp 85, V8 manual, pp 289 V9 manual) - inline void cmp( Register s1, Register s2 ) { subcc( s1, s2, G0 ); } - inline void cmp( Register s1, int simm13a ) { subcc( s1, simm13a, G0 ); } + inline void cmp( Register s1, Register s2 ); + inline void cmp( Register s1, int simm13a ); inline void jmp( Register s1, Register s2 ); inline void jmp( Register s1, int simm13a, RelocationHolder const& rspec = RelocationHolder() ); @@ -741,23 +741,10 @@ class MacroAssembler : public Assembler { inline void iprefetch( address d, relocInfo::relocType rt = relocInfo::none ); inline void iprefetch( Label& L); - inline void tst( Register s ) { orcc( G0, s, G0 ); } + inline void tst( Register s ); -#ifdef PRODUCT - inline void ret( bool trace = TraceJumps ) { if (trace) { - mov(I7, O7); // traceable register - JMP(O7, 2 * BytesPerInstWord); - } else { - jmpl( I7, 2 * BytesPerInstWord, G0 ); - } - } - - inline void retl( bool trace = TraceJumps ) { if (trace) JMP(O7, 2 * BytesPerInstWord); - else jmpl( O7, 2 * BytesPerInstWord, G0 ); } -#else - void ret( bool trace = TraceJumps ); - void retl( bool trace = TraceJumps ); -#endif /* PRODUCT */ + inline void ret( bool trace = TraceJumps ); + inline void retl( bool trace = TraceJumps ); // Required platform-specific helpers for Label::patch_instructions. // They _shadow_ the declarations in AbstractAssembler, which are undefined. @@ -790,26 +777,20 @@ public: static int insts_for_set64(jlong value); // sign-extend 32 to 64 - inline void signx( Register s, Register d ) { sra( s, G0, d); } - inline void signx( Register d ) { sra( d, G0, d); } + inline void signx( Register s, Register d ); + inline void signx( Register d ); - inline void not1( Register s, Register d ) { xnor( s, G0, d ); } - inline void not1( Register d ) { xnor( d, G0, d ); } + inline void not1( Register s, Register d ); + inline void not1( Register d ); - inline void neg( Register s, Register d ) { sub( G0, s, d ); } - inline void neg( Register d ) { sub( G0, d, d ); } + inline void neg( Register s, Register d ); + inline void neg( Register d ); - inline void cas( Register s1, Register s2, Register d) { casa( s1, s2, d, ASI_PRIMARY); } - inline void casx( Register s1, Register s2, Register d) { casxa(s1, s2, d, ASI_PRIMARY); } + inline void cas( Register s1, Register s2, Register d); + inline void casx( Register s1, Register s2, Register d); // Functions for isolating 64 bit atomic swaps for LP64 // cas_ptr will perform cas for 32 bit VM's and casx for 64 bit VM's - inline void cas_ptr( Register s1, Register s2, Register d) { -#ifdef _LP64 - casx( s1, s2, d ); -#else - cas( s1, s2, d ); -#endif - } + inline void cas_ptr( Register s1, Register s2, Register d); // Functions for isolating 64 bit shifts for LP64 inline void sll_ptr( Register s1, Register s2, Register d ); @@ -819,14 +800,14 @@ public: inline void srl_ptr( Register s1, int imm6a, Register d ); // little-endian - inline void casl( Register s1, Register s2, Register d) { casa( s1, s2, d, ASI_PRIMARY_LITTLE); } - inline void casxl( Register s1, Register s2, Register d) { casxa(s1, s2, d, ASI_PRIMARY_LITTLE); } + inline void casl( Register s1, Register s2, Register d); + inline void casxl( Register s1, Register s2, Register d); - inline void inc( Register d, int const13 = 1 ) { add( d, const13, d); } - inline void inccc( Register d, int const13 = 1 ) { addcc( d, const13, d); } + inline void inc( Register d, int const13 = 1 ); + inline void inccc( Register d, int const13 = 1 ); - inline void dec( Register d, int const13 = 1 ) { sub( d, const13, d); } - inline void deccc( Register d, int const13 = 1 ) { subcc( d, const13, d); } + inline void dec( Register d, int const13 = 1 ); + inline void deccc( Register d, int const13 = 1 ); using Assembler::add; inline void add(Register s1, int simm13a, Register d, relocInfo::relocType rtype); @@ -837,19 +818,19 @@ public: using Assembler::andn; inline void andn( Register s1, RegisterOrConstant s2, Register d); - inline void btst( Register s1, Register s2 ) { andcc( s1, s2, G0 ); } - inline void btst( int simm13a, Register s ) { andcc( s, simm13a, G0 ); } + inline void btst( Register s1, Register s2 ); + inline void btst( int simm13a, Register s ); - inline void bset( Register s1, Register s2 ) { or3( s1, s2, s2 ); } - inline void bset( int simm13a, Register s ) { or3( s, simm13a, s ); } + inline void bset( Register s1, Register s2 ); + inline void bset( int simm13a, Register s ); - inline void bclr( Register s1, Register s2 ) { andn( s1, s2, s2 ); } - inline void bclr( int simm13a, Register s ) { andn( s, simm13a, s ); } + inline void bclr( Register s1, Register s2 ); + inline void bclr( int simm13a, Register s ); - inline void btog( Register s1, Register s2 ) { xor3( s1, s2, s2 ); } - inline void btog( int simm13a, Register s ) { xor3( s, simm13a, s ); } + inline void btog( Register s1, Register s2 ); + inline void btog( int simm13a, Register s ); - inline void clr( Register d ) { or3( G0, G0, d ); } + inline void clr( Register d ); inline void clrb( Register s1, Register s2); inline void clrh( Register s1, Register s2); @@ -862,9 +843,9 @@ public: inline void clrx( Register s1, int simm13a); // copy & clear upper word - inline void clruw( Register s, Register d ) { srl( s, G0, d); } + inline void clruw( Register s, Register d ); // clear upper word - inline void clruwu( Register d ) { srl( d, G0, d); } + inline void clruwu( Register d ); using Assembler::ldsb; using Assembler::ldsh; @@ -908,10 +889,10 @@ public: inline void ldf(FloatRegisterImpl::Width w, const Address& a, FloatRegister d, int offset = 0); // little-endian - inline void lduwl(Register s1, Register s2, Register d) { lduwa(s1, s2, ASI_PRIMARY_LITTLE, d); } - inline void ldswl(Register s1, Register s2, Register d) { ldswa(s1, s2, ASI_PRIMARY_LITTLE, d);} - inline void ldxl( Register s1, Register s2, Register d) { ldxa(s1, s2, ASI_PRIMARY_LITTLE, d); } - inline void ldfl(FloatRegisterImpl::Width w, Register s1, Register s2, FloatRegister d) { ldfa(w, s1, s2, ASI_PRIMARY_LITTLE, d); } + inline void lduwl(Register s1, Register s2, Register d); + inline void ldswl(Register s1, Register s2, Register d); + inline void ldxl( Register s1, Register s2, Register d); + inline void ldfl(FloatRegisterImpl::Width w, Register s1, Register s2, FloatRegister d); // membar psuedo instruction. takes into account target memory model. inline void membar( Assembler::Membar_mask_bits const7a ); @@ -920,17 +901,11 @@ public: inline bool membar_has_effect( Assembler::Membar_mask_bits const7a ); // mov pseudo instructions - inline void mov( Register s, Register d) { - if ( s != d ) or3( G0, s, d); - else assert_not_delayed(); // Put something useful in the delay slot! - } + inline void mov( Register s, Register d); - inline void mov_or_nop( Register s, Register d) { - if ( s != d ) or3( G0, s, d); - else nop(); - } + inline void mov_or_nop( Register s, Register d); - inline void mov( int simm13a, Register d) { or3( G0, simm13a, d); } + inline void mov( int simm13a, Register d); using Assembler::prefetch; inline void prefetch(const Address& a, PrefetchFcn F, int offset = 0); @@ -1005,11 +980,7 @@ public: // handy macros: - inline void round_to( Register r, int modulus ) { - assert_not_delayed(); - inc( r, modulus - 1 ); - and3( r, -modulus, r ); - } + inline void round_to( Register r, int modulus ); // -------------------------------------------------- @@ -1077,9 +1048,9 @@ public: // These are idioms to flag the need for care with accessing bools but on // this platform we assume byte size - inline void stbool(Register d, const Address& a) { stb(d, a); } - inline void ldbool(const Address& a, Register d) { ldub(a, d); } - inline void movbool( bool boolconst, Register d) { mov( (int) boolconst, d); } + inline void stbool(Register d, const Address& a); + inline void ldbool(const Address& a, Register d); + inline void movbool( bool boolconst, Register d); // klass oop manipulations if compressed void load_klass(Register src_oop, Register klass); @@ -1415,12 +1386,7 @@ public: // Stack overflow checking // Note: this clobbers G3_scratch - void bang_stack_with_offset(int offset) { - // stack grows down, caller passes positive offset - assert(offset > 0, "must bang with negative offset"); - set((-offset)+STACK_BIAS, G3_scratch); - st(G0, SP, G3_scratch); - } + inline void bang_stack_with_offset(int offset); // Writes to stack successive pages until offset reached to check for // stack overflow + shadow pages. Clobbers tsp and scratch registers. diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp index 4dd8772e010..2f1c949bb7f 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.inline.hpp @@ -187,6 +187,33 @@ inline void MacroAssembler::st_long( Register d, const Address& a, int offset ) #endif } +inline void MacroAssembler::stbool(Register d, const Address& a) { stb(d, a); } +inline void MacroAssembler::ldbool(const Address& a, Register d) { ldub(a, d); } +inline void MacroAssembler::movbool( bool boolconst, Register d) { mov( (int) boolconst, d); } + + +inline void MacroAssembler::signx( Register s, Register d ) { sra( s, G0, d); } +inline void MacroAssembler::signx( Register d ) { sra( d, G0, d); } + +inline void MacroAssembler::not1( Register s, Register d ) { xnor( s, G0, d ); } +inline void MacroAssembler::not1( Register d ) { xnor( d, G0, d ); } + +inline void MacroAssembler::neg( Register s, Register d ) { sub( G0, s, d ); } +inline void MacroAssembler::neg( Register d ) { sub( G0, d, d ); } + +inline void MacroAssembler::cas( Register s1, Register s2, Register d) { casa( s1, s2, d, ASI_PRIMARY); } +inline void MacroAssembler::casx( Register s1, Register s2, Register d) { casxa(s1, s2, d, ASI_PRIMARY); } + +// Functions for isolating 64 bit atomic swaps for LP64 +// cas_ptr will perform cas for 32 bit VM's and casx for 64 bit VM's +inline void MacroAssembler::cas_ptr( Register s1, Register s2, Register d) { +#ifdef _LP64 + casx( s1, s2, d ); +#else + cas( s1, s2, d ); +#endif +} + // Functions for isolating 64 bit shifts for LP64 inline void MacroAssembler::sll_ptr( Register s1, Register s2, Register d ) { @@ -226,6 +253,15 @@ inline void MacroAssembler::sll_ptr( Register s1, RegisterOrConstant s2, Registe else sll_ptr(s1, s2.as_constant(), d); } +inline void MacroAssembler::casl( Register s1, Register s2, Register d) { casa( s1, s2, d, ASI_PRIMARY_LITTLE); } +inline void MacroAssembler::casxl( Register s1, Register s2, Register d) { casxa(s1, s2, d, ASI_PRIMARY_LITTLE); } + +inline void MacroAssembler::inc( Register d, int const13 ) { add( d, const13, d); } +inline void MacroAssembler::inccc( Register d, int const13 ) { addcc( d, const13, d); } + +inline void MacroAssembler::dec( Register d, int const13 ) { sub( d, const13, d); } +inline void MacroAssembler::deccc( Register d, int const13 ) { subcc( d, const13, d); } + // Use the right branch for the platform inline void MacroAssembler::br( Condition c, bool a, Predict p, address d, relocInfo::relocType rt ) { @@ -341,6 +377,24 @@ inline void MacroAssembler::iprefetch( address d, relocInfo::relocType rt ) { } inline void MacroAssembler::iprefetch( Label& L) { iprefetch( target(L) ); } +inline void MacroAssembler::tst( Register s ) { orcc( G0, s, G0 ); } + +inline void MacroAssembler::ret( bool trace ) { + if (trace) { + mov(I7, O7); // traceable register + JMP(O7, 2 * BytesPerInstWord); + } else { + jmpl( I7, 2 * BytesPerInstWord, G0 ); + } +} + +inline void MacroAssembler::retl( bool trace ) { + if (trace) { + JMP(O7, 2 * BytesPerInstWord); + } else { + jmpl( O7, 2 * BytesPerInstWord, G0 ); + } +} // clobbers o7 on V8!! // returns delta from gotten pc to addr after @@ -350,6 +404,8 @@ inline int MacroAssembler::get_pc( Register d ) { return offset() - x; } +inline void MacroAssembler::cmp( Register s1, Register s2 ) { subcc( s1, s2, G0 ); } +inline void MacroAssembler::cmp( Register s1, int simm13a ) { subcc( s1, simm13a, G0 ); } // Note: All MacroAssembler::set_foo functions are defined out-of-line. @@ -525,6 +581,12 @@ inline void MacroAssembler::store_long_argument( Register s, Argument& a ) { } #endif +inline void MacroAssembler::round_to( Register r, int modulus ) { + assert_not_delayed(); + inc( r, modulus - 1 ); + and3( r, -modulus, r ); +} + inline void MacroAssembler::add(Register s1, int simm13a, Register d, relocInfo::relocType rtype) { relocate(rtype); add(s1, simm13a, d); @@ -551,6 +613,20 @@ inline void MacroAssembler::andn(Register s1, RegisterOrConstant s2, Register d) else andn(s1, s2.as_constant(), d); } +inline void MacroAssembler::btst( Register s1, Register s2 ) { andcc( s1, s2, G0 ); } +inline void MacroAssembler::btst( int simm13a, Register s ) { andcc( s, simm13a, G0 ); } + +inline void MacroAssembler::bset( Register s1, Register s2 ) { or3( s1, s2, s2 ); } +inline void MacroAssembler::bset( int simm13a, Register s ) { or3( s, simm13a, s ); } + +inline void MacroAssembler::bclr( Register s1, Register s2 ) { andn( s1, s2, s2 ); } +inline void MacroAssembler::bclr( int simm13a, Register s ) { andn( s, simm13a, s ); } + +inline void MacroAssembler::btog( Register s1, Register s2 ) { xor3( s1, s2, s2 ); } +inline void MacroAssembler::btog( int simm13a, Register s ) { xor3( s, simm13a, s ); } + +inline void MacroAssembler::clr( Register d ) { or3( G0, G0, d ); } + inline void MacroAssembler::clrb( Register s1, Register s2) { stb( G0, s1, s2 ); } inline void MacroAssembler::clrh( Register s1, Register s2) { sth( G0, s1, s2 ); } inline void MacroAssembler::clr( Register s1, Register s2) { stw( G0, s1, s2 ); } @@ -561,6 +637,9 @@ inline void MacroAssembler::clrh( Register s1, int simm13a) { sth( G0, s1, simm1 inline void MacroAssembler::clr( Register s1, int simm13a) { stw( G0, s1, simm13a); } inline void MacroAssembler::clrx( Register s1, int simm13a) { stx( G0, s1, simm13a); } +inline void MacroAssembler::clruw( Register s, Register d ) { srl( s, G0, d); } +inline void MacroAssembler::clruwu( Register d ) { srl( d, G0, d); } + #ifdef _LP64 // Make all 32 bit loads signed so 64 bit registers maintain proper sign inline void MacroAssembler::ld( Register s1, Register s2, Register d) { ldsw( s1, s2, d); } @@ -642,6 +721,11 @@ inline void MacroAssembler::ldf(FloatRegisterImpl::Width w, const Address& a, Fl } } +inline void MacroAssembler::lduwl(Register s1, Register s2, Register d) { lduwa(s1, s2, ASI_PRIMARY_LITTLE, d); } +inline void MacroAssembler::ldswl(Register s1, Register s2, Register d) { ldswa(s1, s2, ASI_PRIMARY_LITTLE, d);} +inline void MacroAssembler::ldxl( Register s1, Register s2, Register d) { ldxa(s1, s2, ASI_PRIMARY_LITTLE, d); } +inline void MacroAssembler::ldfl(FloatRegisterImpl::Width w, Register s1, Register s2, FloatRegister d) { ldfa(w, s1, s2, ASI_PRIMARY_LITTLE, d); } + // returns if membar generates anything, obviously this code should mirror // membar below. inline bool MacroAssembler::membar_has_effect( Membar_mask_bits const7a ) { @@ -668,6 +752,24 @@ inline void MacroAssembler::membar( Membar_mask_bits const7a ) { } } +inline void MacroAssembler::mov(Register s, Register d) { + if (s != d) { + or3(G0, s, d); + } else { + assert_not_delayed(); // Put something useful in the delay slot! + } +} + +inline void MacroAssembler::mov_or_nop(Register s, Register d) { + if (s != d) { + or3(G0, s, d); + } else { + nop(); + } +} + +inline void MacroAssembler::mov( int simm13a, Register d) { or3( G0, simm13a, d); } + inline void MacroAssembler::prefetch(const Address& a, PrefetchFcn f, int offset) { relocate(a.rspec(offset)); assert(!a.has_index(), ""); @@ -738,4 +840,11 @@ inline void MacroAssembler::swap(const Address& a, Register d, int offset) { else { swap(a.base(), a.disp() + offset, d); } } +inline void MacroAssembler::bang_stack_with_offset(int offset) { + // stack grows down, caller passes positive offset + assert(offset > 0, "must bang with negative offset"); + set((-offset)+STACK_BIAS, G3_scratch); + st(G0, SP, G3_scratch); +} + #endif // CPU_SPARC_VM_MACROASSEMBLER_SPARC_INLINE_HPP From 449bf68d35017f83481edd12ace5b349ccbf8aae Mon Sep 17 00:00:00 2001 From: Tom Rodriguez Date: Fri, 4 Dec 2015 15:18:46 -1000 Subject: [PATCH 015/146] 8143571: [JVMCI] Double unregistering of nmethod during unloading Reviewed-by: iveresov, twisti --- hotspot/src/share/vm/code/nmethod.cpp | 107 ++++++++++++++---- hotspot/src/share/vm/code/nmethod.hpp | 14 ++- .../src/share/vm/jvmci/jvmciCompilerToVM.cpp | 48 +++----- .../src/share/vm/jvmci/jvmciCompilerToVM.hpp | 2 - 4 files changed, 114 insertions(+), 57 deletions(-) diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp index d8af2c0624b..18625bcbbe3 100644 --- a/hotspot/src/share/vm/code/nmethod.cpp +++ b/hotspot/src/share/vm/code/nmethod.cpp @@ -1348,6 +1348,9 @@ void nmethod::make_unloaded(BoolObjectClosure* is_alive, oop cause) { _state = unloaded; + // Log the unloading. + log_state_change(); + #if INCLUDE_JVMCI // The method can only be unloaded after the pointer to the installed code // Java wrapper is no longer alive. Here we need to clear out this weak @@ -1355,11 +1358,12 @@ void nmethod::make_unloaded(BoolObjectClosure* is_alive, oop cause) { // after the method is unregistered since the original value may be still // tracked by the rset. maybe_invalidate_installed_code(); + // Clear these out after the nmethod has been unregistered and any + // updates to the InstalledCode instance have been performed. + _jvmci_installed_code = NULL; + _speculation_log = NULL; #endif - // Log the unloading. - log_state_change(); - // The Method* is gone at this point assert(_method == NULL, "Tautology"); @@ -1470,6 +1474,9 @@ bool nmethod::make_not_entrant_or_zombie(unsigned int state) { // Log the transition once log_state_change(); + // Invalidate while holding the patching lock + JVMCI_ONLY(maybe_invalidate_installed_code()); + // Remove nmethod from method. // We need to check if both the _code and _from_compiled_code_entry_point // refer to this nmethod because there is a race in setting these two fields @@ -1496,6 +1503,10 @@ bool nmethod::make_not_entrant_or_zombie(unsigned int state) { MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); if (nmethod_needs_unregister) { Universe::heap()->unregister_nmethod(this); +#ifdef JVMCI + _jvmci_installed_code = NULL; + _speculation_log = NULL; +#endif } flush_dependencies(NULL); } @@ -1519,8 +1530,6 @@ bool nmethod::make_not_entrant_or_zombie(unsigned int state) { assert(state == not_entrant, "other cases may need to be handled differently"); } - JVMCI_ONLY(maybe_invalidate_installed_code()); - if (TraceCreateZombies) { ResourceMark m; tty->print_cr("nmethod <" INTPTR_FORMAT "> %s code made %s", p2i(this), this->method() ? this->method()->name_and_sig_as_C_string() : "null", (state == not_entrant) ? "not entrant" : "zombie"); @@ -3403,26 +3412,80 @@ void nmethod::print_statistics() { #if INCLUDE_JVMCI void nmethod::clear_jvmci_installed_code() { - // This must be done carefully to maintain nmethod remembered sets properly - BarrierSet* bs = Universe::heap()->barrier_set(); - bs->write_ref_nmethod_pre(&_jvmci_installed_code, this); - _jvmci_installed_code = NULL; - bs->write_ref_nmethod_post(&_jvmci_installed_code, this); + // write_ref_method_pre/post can only be safely called at a + // safepoint or while holding the CodeCache_lock + assert(CodeCache_lock->is_locked() || + SafepointSynchronize::is_at_safepoint(), "should be performed under a lock for consistency"); + if (_jvmci_installed_code != NULL) { + // This must be done carefully to maintain nmethod remembered sets properly + BarrierSet* bs = Universe::heap()->barrier_set(); + bs->write_ref_nmethod_pre(&_jvmci_installed_code, this); + _jvmci_installed_code = NULL; + bs->write_ref_nmethod_post(&_jvmci_installed_code, this); + } } void nmethod::maybe_invalidate_installed_code() { - if (_jvmci_installed_code != NULL) { - if (!is_alive()) { - // Break the link between nmethod and InstalledCode such that the nmethod - // can subsequently be flushed safely. The link must be maintained while - // the method could have live activations since invalidateInstalledCode - // might want to invalidate all existing activations. - InstalledCode::set_address(_jvmci_installed_code, 0); - InstalledCode::set_entryPoint(_jvmci_installed_code, 0); - clear_jvmci_installed_code(); - } else if (is_not_entrant()) { - InstalledCode::set_entryPoint(_jvmci_installed_code, 0); - } + assert(Patching_lock->is_locked() || + SafepointSynchronize::is_at_safepoint(), "should be performed under a lock for consistency"); + oop installed_code = jvmci_installed_code(); + if (installed_code != NULL) { + nmethod* nm = (nmethod*)InstalledCode::address(installed_code); + if (nm == NULL || nm != this) { + // The link has been broken or the InstalledCode instance is + // associated with another nmethod so do nothing. + return; + } + if (!is_alive()) { + // Break the link between nmethod and InstalledCode such that the nmethod + // can subsequently be flushed safely. The link must be maintained while + // the method could have live activations since invalidateInstalledCode + // might want to invalidate all existing activations. + InstalledCode::set_address(installed_code, 0); + InstalledCode::set_entryPoint(installed_code, 0); + } else if (is_not_entrant()) { + // Remove the entry point so any invocation will fail but keep + // the address link around that so that existing activations can + // be invalidated. + InstalledCode::set_entryPoint(installed_code, 0); + } + } +} + +void nmethod::invalidate_installed_code(Handle installedCode, TRAPS) { + if (installedCode() == NULL) { + THROW(vmSymbols::java_lang_NullPointerException()); + } + jlong nativeMethod = InstalledCode::address(installedCode); + nmethod* nm = (nmethod*)nativeMethod; + if (nm == NULL) { + // Nothing to do + return; + } + + nmethodLocker nml(nm); +#ifdef ASSERT + { + MutexLockerEx pl(Patching_lock, Mutex::_no_safepoint_check_flag); + // This relationship can only be checked safely under a lock + assert(nm == NULL || !nm->is_alive() || nm->jvmci_installed_code() == installedCode(), "sanity check"); + } +#endif + + if (nm->is_alive()) { + // The nmethod state machinery maintains the link between the + // HotSpotInstalledCode and nmethod* so as long as the nmethod appears to be + // alive assume there is work to do and deoptimize the nmethod. + nm->mark_for_deoptimization(); + VM_Deoptimize op; + VMThread::execute(&op); + } + + MutexLockerEx pl(Patching_lock, Mutex::_no_safepoint_check_flag); + // Check that it's still associated with the same nmethod and break + // the link if it is. + if (InstalledCode::address(installedCode) == nativeMethod) { + InstalledCode::set_address(installedCode, 0); } } diff --git a/hotspot/src/share/vm/code/nmethod.hpp b/hotspot/src/share/vm/code/nmethod.hpp index 3f72547d518..5f9b1aa320f 100644 --- a/hotspot/src/share/vm/code/nmethod.hpp +++ b/hotspot/src/share/vm/code/nmethod.hpp @@ -607,10 +607,20 @@ public: #if INCLUDE_JVMCI oop jvmci_installed_code() { return _jvmci_installed_code ; } char* jvmci_installed_code_name(char* buf, size_t buflen); - void clear_jvmci_installed_code(); + + // Update the state of any InstalledCode instance associated with + // this nmethod based on the current value of _state. void maybe_invalidate_installed_code(); + + // Helper function to invalidate InstalledCode instances + static void invalidate_installed_code(Handle installed_code, TRAPS); + oop speculation_log() { return _speculation_log ; } - void set_speculation_log(oop speculation_log) { _speculation_log = speculation_log; } + + private: + void clear_jvmci_installed_code(); + + public: #endif // GC support diff --git a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp index 558331e64a7..694513cc4a7 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp @@ -84,24 +84,6 @@ oop CompilerToVM::get_jvmci_type(KlassHandle klass, TRAPS) { return NULL; } -void CompilerToVM::invalidate_installed_code(Handle installedCode, TRAPS) { - if (installedCode() == NULL) { - THROW(vmSymbols::java_lang_NullPointerException()); - } - jlong nativeMethod = InstalledCode::address(installedCode); - nmethod* nm = (nmethod*)nativeMethod; - assert(nm == NULL || nm->jvmci_installed_code() == installedCode(), "sanity check"); - if (nm != NULL && nm->is_alive()) { - // The nmethod state machinery maintains the link between the - // HotSpotInstalledCode and nmethod* so as long as the nmethod appears to be - // alive assume there is work to do and deoptimize the nmethod. - nm->mark_for_deoptimization(); - VM_Deoptimize op; - VMThread::execute(&op); - } - InstalledCode::set_address(installedCode, 0); -} - extern "C" { extern VMStructEntry* gHotSpotVMStructs; extern uint64_t gHotSpotVMStructEntryTypeNameOffset; @@ -688,18 +670,22 @@ C2V_VMENTRY(jint, installCode, (JNIEnv *jniEnv, jobject, jobject target, jobject } else { if (!installed_code_handle.is_null()) { assert(installed_code_handle->is_a(InstalledCode::klass()), "wrong type"); - CompilerToVM::invalidate_installed_code(installed_code_handle, CHECK_0); - InstalledCode::set_address(installed_code_handle, (jlong) cb); - InstalledCode::set_version(installed_code_handle, InstalledCode::version(installed_code_handle) + 1); - if (cb->is_nmethod()) { - InstalledCode::set_entryPoint(installed_code_handle, (jlong) cb->as_nmethod_or_null()->verified_entry_point()); - } else { - InstalledCode::set_entryPoint(installed_code_handle, (jlong) cb->code_begin()); - } - if (installed_code_handle->is_a(HotSpotInstalledCode::klass())) { - HotSpotInstalledCode::set_size(installed_code_handle, cb->size()); - HotSpotInstalledCode::set_codeStart(installed_code_handle, (jlong) cb->code_begin()); - HotSpotInstalledCode::set_codeSize(installed_code_handle, cb->code_size()); + nmethod::invalidate_installed_code(installed_code_handle, CHECK_0); + { + // Ensure that all updates to the InstalledCode fields are consistent. + MutexLockerEx pl(Patching_lock, Mutex::_no_safepoint_check_flag); + InstalledCode::set_address(installed_code_handle, (jlong) cb); + InstalledCode::set_version(installed_code_handle, InstalledCode::version(installed_code_handle) + 1); + if (cb->is_nmethod()) { + InstalledCode::set_entryPoint(installed_code_handle, (jlong) cb->as_nmethod_or_null()->verified_entry_point()); + } else { + InstalledCode::set_entryPoint(installed_code_handle, (jlong) cb->code_begin()); + } + if (installed_code_handle->is_a(HotSpotInstalledCode::klass())) { + HotSpotInstalledCode::set_size(installed_code_handle, cb->size()); + HotSpotInstalledCode::set_codeStart(installed_code_handle, (jlong) cb->code_begin()); + HotSpotInstalledCode::set_codeSize(installed_code_handle, cb->code_size()); + } } nmethod* nm = cb->as_nmethod_or_null(); if (nm != NULL && installed_code_handle->is_scavengable()) { @@ -971,7 +957,7 @@ C2V_END C2V_VMENTRY(void, invalidateInstalledCode, (JNIEnv*, jobject, jobject installed_code)) Handle installed_code_handle = JNIHandles::resolve(installed_code); - CompilerToVM::invalidate_installed_code(installed_code_handle, CHECK); + nmethod::invalidate_installed_code(installed_code_handle, CHECK); C2V_END C2V_VMENTRY(jobject, readUncompressedOop, (JNIEnv*, jobject, jlong addr)) diff --git a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp index 4acce0bcb93..35f17689f1e 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp +++ b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp @@ -97,8 +97,6 @@ public: static oop get_jvmci_method(const methodHandle& method, TRAPS); static oop get_jvmci_type(KlassHandle klass, TRAPS); - - static void invalidate_installed_code(Handle installedCode, TRAPS); }; class JavaArgumentUnboxer : public SignatureIterator { From b7ad80c79fde16d00a6e9a3f5d920b3ef8fd6cf3 Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Mon, 7 Dec 2015 15:01:24 +0100 Subject: [PATCH 016/146] 8144822: PPC64: Fix build after 8072008 Reviewed-by: goetz --- hotspot/src/cpu/ppc/vm/ppc.ad | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hotspot/src/cpu/ppc/vm/ppc.ad b/hotspot/src/cpu/ppc/vm/ppc.ad index 615f74eecf9..781b4038229 100644 --- a/hotspot/src/cpu/ppc/vm/ppc.ad +++ b/hotspot/src/cpu/ppc/vm/ppc.ad @@ -3401,8 +3401,8 @@ encode %{ CallStubImpl::emit_trampoline_stub(_masm, entry_point_toc_offset, start_offset); if (ciEnv::current()->failing()) { return; } // Code cache may be full. int method_index = resolved_method_index(cbuf); - __ relocate(_optimized_virtual ? opt_virtual_call_Relocate::spec(method_index) - : static_call_Relocate::spec(method_index)); + __ relocate(_optimized_virtual ? opt_virtual_call_Relocation::spec(method_index) + : static_call_Relocation::spec(method_index)); } // The real call. From 2d9a6cfd3f4ebe81428fb759be0498e7e2bff129 Mon Sep 17 00:00:00 2001 From: Vivek R Deshpande Date: Mon, 7 Dec 2015 16:35:07 -0800 Subject: [PATCH 017/146] 8143355: Update for addition of vectorizedMismatch intrinsic for x86 Co-authored-by: Liqi Yi Reviewed-by: kvn --- .../src/cpu/aarch64/vm/vm_version_aarch64.cpp | 5 + hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp | 5 + hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp | 5 + hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp | 173 +++++++++++++++++- hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp | 4 +- .../src/cpu/x86/vm/stubGenerator_x86_64.cpp | 52 +++++- hotspot/src/cpu/x86/vm/vm_version_x86.cpp | 19 ++ hotspot/src/share/vm/classfile/vmSymbols.cpp | 3 + hotspot/src/share/vm/classfile/vmSymbols.hpp | 5 + hotspot/src/share/vm/opto/c2compiler.cpp | 1 + hotspot/src/share/vm/opto/escape.cpp | 3 +- hotspot/src/share/vm/opto/library_call.cpp | 48 +++++ hotspot/src/share/vm/opto/runtime.cpp | 20 ++ hotspot/src/share/vm/opto/runtime.hpp | 2 + hotspot/src/share/vm/runtime/globals.hpp | 3 + hotspot/src/share/vm/runtime/stubRoutines.cpp | 2 + hotspot/src/share/vm/runtime/stubRoutines.hpp | 4 + hotspot/src/share/vm/runtime/vmStructs.cpp | 1 + 18 files changed, 351 insertions(+), 4 deletions(-) diff --git a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp index 37c0e5bbb63..72cd0375f52 100644 --- a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp @@ -182,6 +182,11 @@ void VM_Version::get_processor_features() { FLAG_SET_DEFAULT(UseAdler32Intrinsics, true); } + if (UseVectorizedMismatchIntrinsic) { + warning("UseVectorizedMismatchIntrinsic specified, but not available on this CPU."); + FLAG_SET_DEFAULT(UseVectorizedMismatchIntrinsic, false); + } + if (auxv & HWCAP_AES) { UseAES = UseAES || FLAG_IS_DEFAULT(UseAES); UseAESIntrinsics = diff --git a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp index 774d90b5cf1..5228c2749e3 100644 --- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp @@ -223,6 +223,11 @@ void VM_Version::initialize() { UseMultiplyToLenIntrinsic = true; } + if (UseVectorizedMismatchIntrinsic) { + warning("UseVectorizedMismatchIntrinsic specified, but not available on this CPU."); + FLAG_SET_DEFAULT(UseVectorizedMismatchIntrinsic, false); + } + // Adjust RTM (Restricted Transactional Memory) flags. if (!has_tcheck() && UseRTMLocking) { // Can't continue because UseRTMLocking affects UseBiasedLocking flag diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp index e6a79435447..a8b7964e3f7 100644 --- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp @@ -356,6 +356,11 @@ void VM_Version::initialize() { FLAG_SET_DEFAULT(UseCRC32Intrinsics, false); } + if (UseVectorizedMismatchIntrinsic) { + warning("UseVectorizedMismatchIntrinsic specified, but not available on this CPU."); + FLAG_SET_DEFAULT(UseVectorizedMismatchIntrinsic, false); + } + if (FLAG_IS_DEFAULT(ContendedPaddingWidth) && (cache_line_size > ContendedPaddingWidth)) ContendedPaddingWidth = cache_line_size; diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp index 69a0d562df1..2ccee91a6cd 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp @@ -9439,13 +9439,184 @@ void MacroAssembler::multiply_to_len(Register x, Register xlen, Register y, Regi pop(tmp1); } +void MacroAssembler::vectorized_mismatch(Register obja, Register objb, Register length, Register log2_array_indxscale, + Register result, Register tmp1, Register tmp2, XMMRegister rymm0, XMMRegister rymm1, XMMRegister rymm2){ + assert(UseSSE42Intrinsics, "SSE4.2 must be enabled."); + Label VECTOR32_LOOP, VECTOR16_LOOP, VECTOR8_LOOP, VECTOR4_LOOP; + Label VECTOR16_TAIL, VECTOR8_TAIL, VECTOR4_TAIL; + Label VECTOR32_NOT_EQUAL, VECTOR16_NOT_EQUAL, VECTOR8_NOT_EQUAL, VECTOR4_NOT_EQUAL; + Label SAME_TILL_END, DONE; + Label BYTES_LOOP, BYTES_TAIL, BYTES_NOT_EQUAL; + + //scale is in rcx in both Win64 and Unix + ShortBranchVerifier sbv(this); + + shlq(length); + xorq(result, result); + + cmpq(length, 8); + jcc(Assembler::equal, VECTOR8_LOOP); + jcc(Assembler::less, VECTOR4_TAIL); + + if (UseAVX >= 2){ + + cmpq(length, 16); + jcc(Assembler::equal, VECTOR16_LOOP); + jcc(Assembler::less, VECTOR8_LOOP); + + cmpq(length, 32); + jccb(Assembler::less, VECTOR16_TAIL); + + subq(length, 32); + bind(VECTOR32_LOOP); + vmovdqu(rymm0, Address(obja, result)); + vmovdqu(rymm1, Address(objb, result)); + vpxor(rymm2, rymm0, rymm1, Assembler::AVX_256bit); + vptest(rymm2, rymm2); + jcc(Assembler::notZero, VECTOR32_NOT_EQUAL);//mismatch found + addq(result, 32); + subq(length, 32); + jccb(Assembler::greaterEqual, VECTOR32_LOOP); + addq(length, 32); + jcc(Assembler::equal, SAME_TILL_END); + //falling through if less than 32 bytes left //close the branch here. + + bind(VECTOR16_TAIL); + cmpq(length, 16); + jccb(Assembler::less, VECTOR8_TAIL); + bind(VECTOR16_LOOP); + movdqu(rymm0, Address(obja, result)); + movdqu(rymm1, Address(objb, result)); + vpxor(rymm2, rymm0, rymm1, Assembler::AVX_128bit); + ptest(rymm2, rymm2); + jcc(Assembler::notZero, VECTOR16_NOT_EQUAL);//mismatch found + addq(result, 16); + subq(length, 16); + jcc(Assembler::equal, SAME_TILL_END); + //falling through if less than 16 bytes left + } else {//regular intrinsics + + cmpq(length, 16); + jccb(Assembler::less, VECTOR8_TAIL); + + subq(length, 16); + bind(VECTOR16_LOOP); + movdqu(rymm0, Address(obja, result)); + movdqu(rymm1, Address(objb, result)); + pxor(rymm0, rymm1); + ptest(rymm0, rymm0); + jcc(Assembler::notZero, VECTOR16_NOT_EQUAL);//mismatch found + addq(result, 16); + subq(length, 16); + jccb(Assembler::greaterEqual, VECTOR16_LOOP); + addq(length, 16); + jcc(Assembler::equal, SAME_TILL_END); + //falling through if less than 16 bytes left + } + + bind(VECTOR8_TAIL); + cmpq(length, 8); + jccb(Assembler::less, VECTOR4_TAIL); + bind(VECTOR8_LOOP); + movq(tmp1, Address(obja, result)); + movq(tmp2, Address(objb, result)); + xorq(tmp1, tmp2); + testq(tmp1, tmp1); + jcc(Assembler::notZero, VECTOR8_NOT_EQUAL);//mismatch found + addq(result, 8); + subq(length, 8); + jcc(Assembler::equal, SAME_TILL_END); + //falling through if less than 8 bytes left + + bind(VECTOR4_TAIL); + cmpq(length, 4); + jccb(Assembler::less, BYTES_TAIL); + bind(VECTOR4_LOOP); + movl(tmp1, Address(obja, result)); + xorl(tmp1, Address(objb, result)); + testl(tmp1, tmp1); + jcc(Assembler::notZero, VECTOR4_NOT_EQUAL);//mismatch found + addq(result, 4); + subq(length, 4); + jcc(Assembler::equal, SAME_TILL_END); + //falling through if less than 4 bytes left + + bind(BYTES_TAIL); + bind(BYTES_LOOP); + load_unsigned_byte(tmp1, Address(obja, result)); + load_unsigned_byte(tmp2, Address(objb, result)); + xorl(tmp1, tmp2); + testl(tmp1, tmp1); + jccb(Assembler::notZero, BYTES_NOT_EQUAL);//mismatch found + decq(length); + jccb(Assembler::zero, SAME_TILL_END); + incq(result); + load_unsigned_byte(tmp1, Address(obja, result)); + load_unsigned_byte(tmp2, Address(objb, result)); + xorl(tmp1, tmp2); + testl(tmp1, tmp1); + jccb(Assembler::notZero, BYTES_NOT_EQUAL);//mismatch found + decq(length); + jccb(Assembler::zero, SAME_TILL_END); + incq(result); + load_unsigned_byte(tmp1, Address(obja, result)); + load_unsigned_byte(tmp2, Address(objb, result)); + xorl(tmp1, tmp2); + testl(tmp1, tmp1); + jccb(Assembler::notZero, BYTES_NOT_EQUAL);//mismatch found + jmpb(SAME_TILL_END); + + if (UseAVX >= 2){ + bind(VECTOR32_NOT_EQUAL); + vpcmpeqb(rymm2, rymm2, rymm2, Assembler::AVX_256bit); + vpcmpeqb(rymm0, rymm0, rymm1, Assembler::AVX_256bit); + vpxor(rymm0, rymm0, rymm2, Assembler::AVX_256bit); + vpmovmskb(tmp1, rymm0); + bsfq(tmp1, tmp1); + addq(result, tmp1); + shrq(result); + jmpb(DONE); + } + + bind(VECTOR16_NOT_EQUAL); + if (UseAVX >= 2){ + vpcmpeqb(rymm2, rymm2, rymm2, Assembler::AVX_128bit); + vpcmpeqb(rymm0, rymm0, rymm1, Assembler::AVX_128bit); + pxor(rymm0, rymm2); + } else { + pcmpeqb(rymm2, rymm2); + pxor(rymm0, rymm1); + pcmpeqb(rymm0, rymm1); + pxor(rymm0, rymm2); + } + pmovmskb(tmp1, rymm0); + bsfq(tmp1, tmp1); + addq(result, tmp1); + shrq(result); + jmpb(DONE); + + bind(VECTOR8_NOT_EQUAL); + bind(VECTOR4_NOT_EQUAL); + bsfq(tmp1, tmp1); + shrq(tmp1, 3); + addq(result, tmp1); + bind(BYTES_NOT_EQUAL); + shrq(result); + jmpb(DONE); + + bind(SAME_TILL_END); + mov64(result, -1); + + bind(DONE); +} + + //Helper functions for square_to_len() /** * Store the squares of x[], right shifted one bit (divided by 2) into z[] * Preserves x and z and modifies rest of the registers. */ - void MacroAssembler::square_rshift(Register x, Register xlen, Register z, Register tmp1, Register tmp3, Register tmp4, Register tmp5, Register rdxReg, Register raxReg) { // Perform square and right shift by 1 // Handle odd xlen case first, then for even xlen do the following diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp index e29d80b12bb..719d745b3ed 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp @@ -1346,7 +1346,6 @@ public: Register carry2); void multiply_to_len(Register x, Register xlen, Register y, Register ylen, Register z, Register zlen, Register tmp1, Register tmp2, Register tmp3, Register tmp4, Register tmp5); - void square_rshift(Register x, Register len, Register z, Register tmp1, Register tmp3, Register tmp4, Register tmp5, Register rdxReg, Register raxReg); void multiply_add_64_bmi2(Register sum, Register op1, Register op2, Register carry, @@ -1365,6 +1364,9 @@ public: void mul_add(Register out, Register in, Register offset, Register len, Register k, Register tmp1, Register tmp2, Register tmp3, Register tmp4, Register tmp5, Register rdxReg, Register raxReg); + void vectorized_mismatch(Register obja, Register objb, Register length, Register log2_array_indxscale, + Register result, Register tmp1, Register tmp2, + XMMRegister vec1, XMMRegister vec2, XMMRegister vec3); #endif // CRC32 code for java.util.zip.CRC32::updateBytes() intrinsic. diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp index b68bedf1ad6..c704975870f 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp @@ -4054,6 +4054,54 @@ class StubGenerator: public StubCodeGenerator { return start; } + /** + * Arguments: + * + * Input: + * c_rarg0 - obja address + * c_rarg1 - objb address + * c_rarg3 - length length + * c_rarg4 - scale log2_array_indxscale + */ + address generate_vectorizedMismatch() { + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", "vectorizedMismatch"); + address start = __ pc(); + + BLOCK_COMMENT("Entry:"); + __ enter(); + +#ifdef _WIN64 // Win64: rcx, rdx, r8, r9 (c_rarg0, c_rarg1, ...) + const Register scale = c_rarg0; //rcx, will exchange with r9 + const Register objb = c_rarg1; //rdx + const Register length = c_rarg2; //r8 + const Register obja = c_rarg3; //r9 + __ xchgq(obja, scale); //now obja and scale contains the correct contents + + const Register tmp1 = r10; + const Register tmp2 = r11; +#endif +#ifndef _WIN64 // Unix: rdi, rsi, rdx, rcx, r8, r9 (c_rarg0, c_rarg1, ...) + const Register obja = c_rarg0; //U:rdi + const Register objb = c_rarg1; //U:rsi + const Register length = c_rarg2; //U:rdx + const Register scale = c_rarg3; //U:rcx + const Register tmp1 = r8; + const Register tmp2 = r9; +#endif + const Register result = rax; //return value + const XMMRegister vec0 = xmm0; + const XMMRegister vec1 = xmm1; + const XMMRegister vec2 = xmm2; + + __ vectorized_mismatch(obja, objb, length, scale, result, tmp1, tmp2, vec0, vec1, vec2); + + __ leave(); + __ ret(0); + + return start; + } + /** * Arguments: * @@ -4505,7 +4553,9 @@ class StubGenerator: public StubCodeGenerator { if (UseMulAddIntrinsic) { StubRoutines::_mulAdd = generate_mulAdd(); } - + if (UseVectorizedMismatchIntrinsic) { + StubRoutines::_vectorizedMismatch = generate_vectorizedMismatch(); + } #ifndef _WINDOWS if (UseMontgomeryMultiplyIntrinsic) { StubRoutines::_montgomeryMultiply diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp index eed88e81342..b458f99fac0 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp @@ -1041,6 +1041,25 @@ void VM_Version::get_processor_features() { } } +#ifdef _LP64 + if (UseSSE42Intrinsics) { + if (FLAG_IS_DEFAULT(UseVectorizedMismatchIntrinsic)) { + UseVectorizedMismatchIntrinsic = true; + } + } else if (UseVectorizedMismatchIntrinsic) { + if (!FLAG_IS_DEFAULT(UseVectorizedMismatchIntrinsic)) + warning("vectorizedMismatch intrinsics are not available on this CPU"); + FLAG_SET_DEFAULT(UseVectorizedMismatchIntrinsic, false); + } +#else + if (UseVectorizedMismatchIntrinsic) { + if (!FLAG_IS_DEFAULT(UseVectorizedMismatchIntrinsic)) { + warning("vectorizedMismatch intrinsic is not available in 32-bit VM"); + } + FLAG_SET_DEFAULT(UseVectorizedMismatchIntrinsic, false); + } +#endif // _LP64 + // Use count leading zeros count instruction if available. if (supports_lzcnt()) { if (FLAG_IS_DEFAULT(UseCountLeadingZerosInstruction)) { diff --git a/hotspot/src/share/vm/classfile/vmSymbols.cpp b/hotspot/src/share/vm/classfile/vmSymbols.cpp index bfb99c67630..6f0089a77f5 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.cpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.cpp @@ -681,6 +681,9 @@ bool vmIntrinsics::is_disabled_by_flags(const methodHandle& method) { case vmIntrinsics::_montgomerySquare: if (!UseMontgomerySquareIntrinsic) return true; break; + case vmIntrinsics::_vectorizedMismatch: + if (!UseVectorizedMismatchIntrinsic) return true; + break; case vmIntrinsics::_addExactI: case vmIntrinsics::_addExactL: case vmIntrinsics::_decrementExactI: diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp index e651ad00ed9..0146b37a4ec 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp @@ -957,6 +957,11 @@ do_name( montgomerySquare_name, "implMontgomerySquare") \ do_signature(montgomerySquare_signature, "([I[IIJ[I)[I") \ \ + do_class(java_util_ArraysSupport, "java/util/ArraysSupport") \ + do_intrinsic(_vectorizedMismatch, java_util_ArraysSupport, vectorizedMismatch_name, vectorizedMismatch_signature, F_S)\ + do_name(vectorizedMismatch_name, "vectorizedMismatch") \ + do_signature(vectorizedMismatch_signature, "(Ljava/lang/Object;JLjava/lang/Object;JII)I") \ + \ /* java/lang/ref/Reference */ \ do_intrinsic(_Reference_get, java_lang_ref_Reference, get_name, void_object_signature, F_R) \ \ diff --git a/hotspot/src/share/vm/opto/c2compiler.cpp b/hotspot/src/share/vm/opto/c2compiler.cpp index c8ff9804039..689147d9f97 100644 --- a/hotspot/src/share/vm/opto/c2compiler.cpp +++ b/hotspot/src/share/vm/opto/c2compiler.cpp @@ -441,6 +441,7 @@ bool C2Compiler::is_intrinsic_supported(const methodHandle& method, bool is_virt case vmIntrinsics::_mulAdd: case vmIntrinsics::_montgomeryMultiply: case vmIntrinsics::_montgomerySquare: + case vmIntrinsics::_vectorizedMismatch: case vmIntrinsics::_ghash_processBlocks: case vmIntrinsics::_updateCRC32: case vmIntrinsics::_updateBytesCRC32: diff --git a/hotspot/src/share/vm/opto/escape.cpp b/hotspot/src/share/vm/opto/escape.cpp index 92ed15ca3da..169cfc0113f 100644 --- a/hotspot/src/share/vm/opto/escape.cpp +++ b/hotspot/src/share/vm/opto/escape.cpp @@ -987,7 +987,8 @@ void ConnectionGraph::process_call_arguments(CallNode *call) { strcmp(call->as_CallLeaf()->_name, "squareToLen") == 0 || strcmp(call->as_CallLeaf()->_name, "mulAdd") == 0 || strcmp(call->as_CallLeaf()->_name, "montgomery_multiply") == 0 || - strcmp(call->as_CallLeaf()->_name, "montgomery_square") == 0) + strcmp(call->as_CallLeaf()->_name, "montgomery_square") == 0 || + strcmp(call->as_CallLeaf()->_name, "vectorizedMismatch") == 0) ))) { call->dump(); fatal("EA unexpected CallLeaf %s", call->as_CallLeaf()->_name); diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index 694fb6f6834..6620e57be72 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -312,6 +312,7 @@ class LibraryCallKit : public GraphKit { bool inline_mulAdd(); bool inline_montgomeryMultiply(); bool inline_montgomerySquare(); + bool inline_vectorizedMismatch(); bool inline_profileBoolean(); bool inline_isCompileConstant(); @@ -720,6 +721,9 @@ bool LibraryCallKit::try_to_inline(int predicate) { case vmIntrinsics::_montgomerySquare: return inline_montgomerySquare(); + case vmIntrinsics::_vectorizedMismatch: + return inline_vectorizedMismatch(); + case vmIntrinsics::_ghash_processBlocks: return inline_ghash_processBlocks(); @@ -5581,6 +5585,50 @@ bool LibraryCallKit::inline_montgomerySquare() { return true; } +//-------------inline_vectorizedMismatch------------------------------ +bool LibraryCallKit::inline_vectorizedMismatch() { + assert(UseVectorizedMismatchIntrinsic, "not implementated on this platform"); + + address stubAddr = StubRoutines::vectorizedMismatch(); + if (stubAddr == NULL) { + return false; // Intrinsic's stub is not implemented on this platform + } + const char* stubName = "vectorizedMismatch"; + int size_l = callee()->signature()->size(); + assert(callee()->signature()->size() == 8, "vectorizedMismatch has 6 parameters"); + + Node* obja = argument(0); + Node* aoffset = argument(1); + Node* objb = argument(3); + Node* boffset = argument(4); + Node* length = argument(6); + Node* scale = argument(7); + + const Type* a_type = obja->Value(&_gvn); + const Type* b_type = objb->Value(&_gvn); + const TypeAryPtr* top_a = a_type->isa_aryptr(); + const TypeAryPtr* top_b = b_type->isa_aryptr(); + if (top_a == NULL || top_a->klass() == NULL || + top_b == NULL || top_b->klass() == NULL) { + // failed array check + return false; + } + + Node* call; + jvms()->set_should_reexecute(true); + + Node* obja_adr = make_unsafe_address(obja, aoffset); + Node* objb_adr = make_unsafe_address(objb, boffset); + + call = make_runtime_call(RC_LEAF, + OptoRuntime::vectorizedMismatch_Type(), + stubAddr, stubName, TypePtr::BOTTOM, + obja_adr, objb_adr, length, scale); + + Node* result = _gvn.transform(new ProjNode(call, TypeFunc::Parms)); + set_result(result); + return true; +} /** * Calculate CRC32 for byte. diff --git a/hotspot/src/share/vm/opto/runtime.cpp b/hotspot/src/share/vm/opto/runtime.cpp index 1ae727c105a..a42c750d465 100644 --- a/hotspot/src/share/vm/opto/runtime.cpp +++ b/hotspot/src/share/vm/opto/runtime.cpp @@ -1103,6 +1103,26 @@ const TypeFunc* OptoRuntime::montgomerySquare_Type() { return TypeFunc::make(domain, range); } +const TypeFunc* OptoRuntime::vectorizedMismatch_Type() { + // create input type (domain) + int num_args = 4; + int argcnt = num_args; + const Type** fields = TypeTuple::fields(argcnt); + int argp = TypeFunc::Parms; + fields[argp++] = TypePtr::NOTNULL; // obja + fields[argp++] = TypePtr::NOTNULL; // objb + fields[argp++] = TypeInt::INT; // length, number of elements + fields[argp++] = TypeInt::INT; // log2scale, element size + assert(argp == TypeFunc::Parms + argcnt, "correct decoding"); + const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms + argcnt, fields); + + //return mismatch index (int) + fields = TypeTuple::fields(1); + fields[TypeFunc::Parms + 0] = TypeInt::INT; + const TypeTuple* range = TypeTuple::make(TypeFunc::Parms + 1, fields); + return TypeFunc::make(domain, range); +} + // GHASH block processing const TypeFunc* OptoRuntime::ghash_processBlocks_Type() { int argcnt = 4; diff --git a/hotspot/src/share/vm/opto/runtime.hpp b/hotspot/src/share/vm/opto/runtime.hpp index 8e38f3f3a15..69e78aa8ff7 100644 --- a/hotspot/src/share/vm/opto/runtime.hpp +++ b/hotspot/src/share/vm/opto/runtime.hpp @@ -299,6 +299,8 @@ private: static const TypeFunc* mulAdd_Type(); + static const TypeFunc* vectorizedMismatch_Type(); + static const TypeFunc* ghash_processBlocks_Type(); static const TypeFunc* updateBytesCRC32_Type(); diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index 9b8b1311a76..acfcd6735f4 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -855,6 +855,9 @@ public: product(bool, UseAdler32Intrinsics, false, \ "use intrinsics for java.util.zip.Adler32") \ \ + product(bool, UseVectorizedMismatchIntrinsic, false, \ + "Enables intrinsification of ArraysSupport.vectorizedMismatch()") \ + \ diagnostic(ccstrlist, DisableIntrinsic, "", \ "do not expand intrinsics whose (internal) names appear here") \ \ diff --git a/hotspot/src/share/vm/runtime/stubRoutines.cpp b/hotspot/src/share/vm/runtime/stubRoutines.cpp index fef7c0b3b03..330ca9d0a55 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.cpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.cpp @@ -148,6 +148,8 @@ address StubRoutines::_mulAdd = NULL; address StubRoutines::_montgomeryMultiply = NULL; address StubRoutines::_montgomerySquare = NULL; +address StubRoutines::_vectorizedMismatch = NULL; + address StubRoutines::_dexp = NULL; address StubRoutines::_dlog = NULL; diff --git a/hotspot/src/share/vm/runtime/stubRoutines.hpp b/hotspot/src/share/vm/runtime/stubRoutines.hpp index ac198d0746c..2a9c7084786 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.hpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp @@ -207,6 +207,8 @@ class StubRoutines: AllStatic { static address _montgomeryMultiply; static address _montgomerySquare; + static address _vectorizedMismatch; + static address _dexp; static address _dlog; @@ -376,6 +378,8 @@ class StubRoutines: AllStatic { static address montgomeryMultiply() { return _montgomeryMultiply; } static address montgomerySquare() { return _montgomerySquare; } + static address vectorizedMismatch() { return _vectorizedMismatch; } + static address dexp() { return _dexp; } static address dlog() { return _dlog; } diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index bda425a96df..d3e1b44de02 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -860,6 +860,7 @@ typedef CompactHashtable SymbolCompactHashTable; static_field(StubRoutines, _mulAdd, address) \ static_field(StubRoutines, _dexp, address) \ static_field(StubRoutines, _dlog, address) \ + static_field(StubRoutines, _vectorizedMismatch, address) \ static_field(StubRoutines, _jbyte_arraycopy, address) \ static_field(StubRoutines, _jshort_arraycopy, address) \ static_field(StubRoutines, _jint_arraycopy, address) \ From 682da7441854744f3be7ec3c64b3108d69ad8d49 Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Tue, 8 Dec 2015 14:44:00 +0100 Subject: [PATCH 018/146] 8143817: C1: Platform dependent stack space not preserved for all runtime calls Reviewed-by: roland --- hotspot/src/share/vm/c1/c1_LIRGenerator.cpp | 23 ++++++++++++--------- hotspot/src/share/vm/c1/c1_LIRGenerator.hpp | 2 +- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp index 98b519b58eb..8fa61f1e975 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp @@ -3055,13 +3055,16 @@ void LIRGenerator::do_IfOp(IfOp* x) { __ cmove(lir_cond(x->cond()), t_val.result(), f_val.result(), reg, as_BasicType(x->x()->type())); } -void LIRGenerator::do_RuntimeCall(address routine, int expected_arguments, Intrinsic* x) { - assert(x->number_of_arguments() == expected_arguments, "wrong type"); - LIR_Opr reg = result_register_for(x->type()); - __ call_runtime_leaf(routine, getThreadTemp(), - reg, new LIR_OprList()); - LIR_Opr result = rlock_result(x); - __ move(reg, result); +void LIRGenerator::do_RuntimeCall(address routine, Intrinsic* x) { + assert(x->number_of_arguments() == 0, "wrong type"); + // Enforce computation of _reserved_argument_area_size which is required on some platforms. + BasicTypeList signature; + CallingConvention* cc = frame_map()->c_calling_convention(&signature); + LIR_Opr reg = result_register_for(x->type()); + __ call_runtime_leaf(routine, getThreadTemp(), + reg, new LIR_OprList()); + LIR_Opr result = rlock_result(x); + __ move(reg, result); } #ifdef TRACE_HAVE_INTRINSICS @@ -3115,16 +3118,16 @@ void LIRGenerator::do_Intrinsic(Intrinsic* x) { case vmIntrinsics::_threadID: do_ThreadIDIntrinsic(x); break; case vmIntrinsics::_classID: do_ClassIDIntrinsic(x); break; case vmIntrinsics::_counterTime: - do_RuntimeCall(CAST_FROM_FN_PTR(address, TRACE_TIME_METHOD), 0, x); + do_RuntimeCall(CAST_FROM_FN_PTR(address, TRACE_TIME_METHOD), x); break; #endif case vmIntrinsics::_currentTimeMillis: - do_RuntimeCall(CAST_FROM_FN_PTR(address, os::javaTimeMillis), 0, x); + do_RuntimeCall(CAST_FROM_FN_PTR(address, os::javaTimeMillis), x); break; case vmIntrinsics::_nanoTime: - do_RuntimeCall(CAST_FROM_FN_PTR(address, os::javaTimeNanos), 0, x); + do_RuntimeCall(CAST_FROM_FN_PTR(address, os::javaTimeNanos), x); break; case vmIntrinsics::_Object_init: do_RegisterFinalizer(x); break; diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp index 89f5960182a..47dd33df54e 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp @@ -439,7 +439,7 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure { SwitchRangeArray* create_lookup_ranges(LookupSwitch* x); void do_SwitchRanges(SwitchRangeArray* x, LIR_Opr value, BlockBegin* default_sux); - void do_RuntimeCall(address routine, int expected_arguments, Intrinsic* x); + void do_RuntimeCall(address routine, Intrinsic* x); #ifdef TRACE_HAVE_INTRINSICS void do_ThreadIDIntrinsic(Intrinsic* x); void do_ClassIDIntrinsic(Intrinsic* x); From 6f27a97d77d7eab89bbb79a447168056a882c1f7 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 7 Dec 2015 15:42:47 +0100 Subject: [PATCH 019/146] 8144466: ppc64: fix argument passing through opto stubs Reviewed-by: kvn --- hotspot/make/test/JtregNative.gmk | 1 + .../aarch64/vm/globalDefinitions_aarch64.hpp | 4 ++ .../src/cpu/ppc/vm/globalDefinitions_ppc.hpp | 4 ++ .../cpu/sparc/vm/globalDefinitions_sparc.hpp | 4 ++ .../src/cpu/x86/vm/globalDefinitions_x86.hpp | 4 ++ .../cpu/zero/vm/globalDefinitions_zero.hpp | 4 ++ .../src/share/vm/opto/generateOptoStub.cpp | 59 ++++++++++------ .../TestArrayCopyOverflowArguments.java | 69 +++++++++++++++++++ .../floatingpoint/Test15FloatJNIArgs.java | 61 ++++++++++++++++ .../floatingpoint/libTest15FloatJNIArgs.c | 41 +++++++++++ 10 files changed, 229 insertions(+), 22 deletions(-) create mode 100644 hotspot/test/compiler/arraycopy/TestArrayCopyOverflowArguments.java create mode 100644 hotspot/test/compiler/floatingpoint/Test15FloatJNIArgs.java create mode 100644 hotspot/test/compiler/floatingpoint/libTest15FloatJNIArgs.c diff --git a/hotspot/make/test/JtregNative.gmk b/hotspot/make/test/JtregNative.gmk index 09c48d77aba..d49a03757e7 100644 --- a/hotspot/make/test/JtregNative.gmk +++ b/hotspot/make/test/JtregNative.gmk @@ -46,6 +46,7 @@ BUILD_HOTSPOT_JTREG_NATIVE_SRC := \ $(HOTSPOT_TOPDIR)/test/runtime/jni/8033445 \ $(HOTSPOT_TOPDIR)/test/runtime/jni/ToStringInInterfaceTest \ $(HOTSPOT_TOPDIR)/test/runtime/SameObject \ + $(HOTSPOT_TOPDIR)/test/compiler/floatingpoint/ \ # # Add conditional directories here when needed. diff --git a/hotspot/src/cpu/aarch64/vm/globalDefinitions_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/globalDefinitions_aarch64.hpp index d392ccf5e48..4c9d377ff09 100644 --- a/hotspot/src/cpu/aarch64/vm/globalDefinitions_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/globalDefinitions_aarch64.hpp @@ -28,6 +28,10 @@ const int StackAlignmentInBytes = 16; +// Indicates whether the C calling conventions require that +// 32-bit integer argument values are extended to 64 bits. +const bool CCallingConventionRequiresIntsAsLongs = false; + #define SUPPORTS_NATIVE_CX8 // The maximum B/BL offset range on AArch64 is 128MB. diff --git a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp index 542abd1bdb6..86fddbc1751 100644 --- a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp @@ -31,6 +31,10 @@ const int BytesPerInstWord = 4; const int StackAlignmentInBytes = 16; +// Indicates whether the C calling conventions require that +// 32-bit integer argument values are extended to 64 bits. +const bool CCallingConventionRequiresIntsAsLongs = true; + #define SUPPORTS_NATIVE_CX8 // The PPC CPUs are NOT multiple-copy-atomic. diff --git a/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp b/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp index 93432223e8d..427b7ab5f14 100644 --- a/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp @@ -30,6 +30,10 @@ const int BytesPerInstWord = 4; const int StackAlignmentInBytes = (2*wordSize); +// Indicates whether the C calling conventions require that +// 32-bit integer argument values are extended to 64 bits. +const bool CCallingConventionRequiresIntsAsLongs = false; + #define SUPPORTS_NATIVE_CX8 // The expected size in bytes of a cache line, used to pad data structures. diff --git a/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp b/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp index 8ddbdf82ca4..b7abbacd052 100644 --- a/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp +++ b/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp @@ -27,6 +27,10 @@ const int StackAlignmentInBytes = 16; +// Indicates whether the C calling conventions require that +// 32-bit integer argument values are extended to 64 bits. +const bool CCallingConventionRequiresIntsAsLongs = false; + #define SUPPORTS_NATIVE_CX8 // The expected size in bytes of a cache line, used to pad data structures. diff --git a/hotspot/src/cpu/zero/vm/globalDefinitions_zero.hpp b/hotspot/src/cpu/zero/vm/globalDefinitions_zero.hpp index 5956fe1cfcc..144c47e3cb9 100644 --- a/hotspot/src/cpu/zero/vm/globalDefinitions_zero.hpp +++ b/hotspot/src/cpu/zero/vm/globalDefinitions_zero.hpp @@ -28,4 +28,8 @@ #include +// Indicates whether the C calling conventions require that +// 32-bit integer argument values are extended to 64 bits. +const bool CCallingConventionRequiresIntsAsLongs = false; + #endif // CPU_ZERO_VM_GLOBALDEFINITIONS_ZERO_HPP diff --git a/hotspot/src/share/vm/opto/generateOptoStub.cpp b/hotspot/src/share/vm/opto/generateOptoStub.cpp index b3bc8999daa..48166b491fc 100644 --- a/hotspot/src/share/vm/opto/generateOptoStub.cpp +++ b/hotspot/src/share/vm/opto/generateOptoStub.cpp @@ -72,16 +72,18 @@ void GraphKit::gen_stub(address C_function, // Make up the parameters uint i; - for( i = 0; i < parm_cnt; i++ ) + for (i = 0; i < parm_cnt; i++) { map()->init_req(i, _gvn.transform(new ParmNode(start, i))); - for( ; ireq(); i++ ) + } + for ( ; ireq(); i++) { map()->init_req(i, top()); // For nicer debugging + } // GraphKit requires memory to be a MergeMemNode: set_all_memory(map()->memory()); // Get base of thread-local storage area - Node* thread = _gvn.transform( new ThreadLocalNode() ); + Node* thread = _gvn.transform(new ThreadLocalNode()); const int NoAlias = Compile::AliasIdxBot; @@ -113,21 +115,27 @@ void GraphKit::gen_stub(address C_function, //----------------------------- // Compute signature for C call. Varies from the Java signature! + const Type **fields = TypeTuple::fields(2*parm_cnt+2); uint cnt = TypeFunc::Parms; // The C routines gets the base of thread-local storage passed in as an - // extra argument. Not all calls need it, but its cheap to add here. + // extra argument. Not all calls need it, but it is cheap to add here. for (uint pcnt = cnt; pcnt < parm_cnt; pcnt++, cnt++) { - fields[cnt] = jdomain->field_at(pcnt); + const Type *f = jdomain->field_at(pcnt); + if (CCallingConventionRequiresIntsAsLongs && f->isa_int()) { + fields[cnt++] = TypeLong::LONG; + fields[cnt] = Type::HALF; // Must add an additional half for a long. + } else { + fields[cnt] = f; + } } - fields[cnt++] = TypeRawPtr::BOTTOM; // Thread-local storage // Also pass in the caller's PC, if asked for. if (return_pc) { fields[cnt++] = TypeRawPtr::BOTTOM; // Return PC } + const TypeTuple* domain = TypeTuple::make(cnt, fields); - const TypeTuple* domain = TypeTuple::make(cnt,fields); // The C routine we are about to call cannot return an oop; it can block on // exit and a GC will trash the oop while it sits in C-land. Instead, we // return the oop through TLS for runtime calls. @@ -155,37 +163,44 @@ void GraphKit::gen_stub(address C_function, rfields[TypeFunc::Parms+1] = jrange->field_at(TypeFunc::Parms+1); } } - const TypeTuple* range = TypeTuple::make(jrange->cnt(),rfields); + const TypeTuple* range = TypeTuple::make(jrange->cnt(), rfields); // Final C signature - const TypeFunc *c_sig = TypeFunc::make(domain,range); + const TypeFunc *c_sig = TypeFunc::make(domain, range); //----------------------------- - // Make the call node + // Make the call node. CallRuntimeNode *call = new CallRuntimeNode(c_sig, C_function, name, TypePtr::BOTTOM); //----------------------------- - // Fix-up the debug info for the call - call->set_jvms( new (C) JVMState(0) ); + // Fix-up the debug info for the call. + call->set_jvms(new (C) JVMState(0)); call->jvms()->set_bci(0); call->jvms()->set_offsets(cnt); - // Set fixed predefined input arguments + // Set fixed predefined input arguments. cnt = 0; - for (i = 0; i < TypeFunc::Parms; i++) - call->init_req(cnt++, map()->in(i)); - // A little too aggressive on the parm copy; return address is not an input - call->set_req(TypeFunc::ReturnAdr, top()); - for (; i < parm_cnt; i++) { // Regular input arguments + for (i = 0; i < TypeFunc::Parms; i++) { call->init_req(cnt++, map()->in(i)); } + // A little too aggressive on the parm copy; return address is not an input. + call->set_req(TypeFunc::ReturnAdr, top()); + for (; i < parm_cnt; i++) { // Regular input arguments. + const Type *f = jdomain->field_at(i); + if (CCallingConventionRequiresIntsAsLongs && f->isa_int()) { + call->init_req(cnt++, _gvn.transform(new ConvI2LNode(map()->in(i)))); + call->init_req(cnt++, top()); + } else { + call->init_req(cnt++, map()->in(i)); + } + } + call->init_req(cnt++, thread); + if (return_pc) { // Return PC, if asked for. + call->init_req(cnt++, returnadr()); + } - call->init_req( cnt++, thread ); - if( return_pc ) // Return PC, if asked for - call->init_req( cnt++, returnadr() ); _gvn.transform_no_reclaim(call); - //----------------------------- // Now set up the return results set_control( _gvn.transform( new ProjNode(call,TypeFunc::Control)) ); diff --git a/hotspot/test/compiler/arraycopy/TestArrayCopyOverflowArguments.java b/hotspot/test/compiler/arraycopy/TestArrayCopyOverflowArguments.java new file mode 100644 index 00000000000..1bfaa35e578 --- /dev/null +++ b/hotspot/test/compiler/arraycopy/TestArrayCopyOverflowArguments.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2015 SAP SE. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary Test that overflowed integers passed to arraycopy don't do any harm. This might + * be the case on platforms where C-code expects that ints passed to a call + * are properly sign extended to 64 bit (e.g., PPC64, s390x). This can fail + * if slow_arraycopy_C() is commpiled by the C compiler without any imlicit + * casts (as spill stores to the stack that are done with 4-byte instruction). + * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement TestArrayCopyOverflowArguments + * + */ + +public class TestArrayCopyOverflowArguments { + + // Without volatile the overflowing computation was moved up and then + // spilled to the stack. The 32-bit spill store caused proper rounding. + static volatile int mod = Integer.MAX_VALUE; + + public static int[] m1(Object src) { + if (src == null) return null; + int[] dest = new int[10]; + try { + // PPC C calling conventions require that ints are properly expanded + // to longs when passed to a function. + int pos = 8 + mod + mod; // = 0x1_0000_0006. + int start = 2 + mod + mod; // = 0x1_0000_0000. + int len = 12 + mod + mod; // = 0x1_0000_0010. + // This is supposed to call SharedRuntime::slow_arraycopy_C(). + System.arraycopy(src, pos, dest, 0, 10); + } catch (ArrayStoreException npe) { + } + return dest; + } + + static public void main(String[] args) throws Exception { + int[] src = new int[20]; + + for (int i = 0; i < 20; ++i) { + src[i] = i * (i-1); + } + + for (int i = 0; i < 20000; i++) { + m1(src); + } + } +} + diff --git a/hotspot/test/compiler/floatingpoint/Test15FloatJNIArgs.java b/hotspot/test/compiler/floatingpoint/Test15FloatJNIArgs.java new file mode 100644 index 00000000000..1425d3da016 --- /dev/null +++ b/hotspot/test/compiler/floatingpoint/Test15FloatJNIArgs.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2015 SAP SE. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* @test + * @bug 8139258 + * @summary Regression test for 8139258 which failed to properly pass float args + * to a jni function on ppc64le. + * @run main/othervm -Xint Test15FloatJNIArgs + * @run main/othervm -XX:+TieredCompilation -Xcomp Test15FloatJNIArgs + * @run main/othervm -XX:-TieredCompilation -Xcomp Test15FloatJNIArgs + */ + +public class Test15FloatJNIArgs { + static { + try { + System.loadLibrary("Test15FloatJNIArgs"); + } catch (UnsatisfiedLinkError e) { + System.out.println("could not load native lib: " + e); + } + } + + public static native float add15floats( + float f1, float f2, float f3, float f4, + float f5, float f6, float f7, float f8, + float f9, float f10, float f11, float f12, + float f13, float f14, float f15); + + static void test() throws Exception { + float sum = Test15FloatJNIArgs.add15floats(1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, + 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f); + if (sum != 15.0f) { + throw new Error("Passed 15 times 1.0f to jni function which didn't add them properly: " + sum); + } + } + + public static void main(String[] args) throws Exception { + for (int i = 0; i < 200; ++i) { + test(); + } + } +} diff --git a/hotspot/test/compiler/floatingpoint/libTest15FloatJNIArgs.c b/hotspot/test/compiler/floatingpoint/libTest15FloatJNIArgs.c new file mode 100644 index 00000000000..e31627955ca --- /dev/null +++ b/hotspot/test/compiler/floatingpoint/libTest15FloatJNIArgs.c @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2015. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +JNIEXPORT jfloat JNICALL Java_Test15FloatJNIArgs_add15floats + (JNIEnv *env, jclass cls, + jfloat f1, jfloat f2, jfloat f3, jfloat f4, + jfloat f5, jfloat f6, jfloat f7, jfloat f8, + jfloat f9, jfloat f10, jfloat f11, jfloat f12, + jfloat f13, jfloat f14, jfloat f15) { + return f1 + f2 + f3 + f4 + f5 + f6 + f7 + f8 + f9 + f10 + f11 + f12 + f13 + f14 + f15; +} + +#ifdef __cplusplus +} +#endif From 9fc9cf684a7097829591a7e36dcb3e9146562f64 Mon Sep 17 00:00:00 2001 From: Volker Simonis Date: Tue, 15 Dec 2015 00:16:09 -0500 Subject: [PATCH 020/146] 8145015: jni_GetStringCritical asserts for empty strings Reviewed-by: thartmann, dholmes --- hotspot/src/share/vm/prims/jni.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp index 724d75b8495..a0f5665d276 100644 --- a/hotspot/src/share/vm/prims/jni.cpp +++ b/hotspot/src/share/vm/prims/jni.cpp @@ -3194,17 +3194,20 @@ JNI_ENTRY(const jchar*, jni_GetStringCritical(JNIEnv *env, jstring string, jbool if (isCopy != NULL) { *isCopy = is_latin1 ? JNI_TRUE : JNI_FALSE; } - const jchar* ret; + jchar* ret; if (!is_latin1) { - ret = s_value->char_at_addr(0); + ret = (jchar*) s_value->base(T_CHAR); } else { // Inflate latin1 encoded string to UTF16 int s_len = java_lang_String::length(s); - jchar* buf = NEW_C_HEAP_ARRAY(jchar, s_len, mtInternal); - for (int i = 0; i < s_len; i++) { - buf[i] = ((jchar) s_value->byte_at(i)) & 0xff; + ret = NEW_C_HEAP_ARRAY_RETURN_NULL(jchar, s_len + 1, mtInternal); // add one for zero termination + /* JNI Specification states return NULL on OOM */ + if (ret != NULL) { + for (int i = 0; i < s_len; i++) { + ret[i] = ((jchar) s_value->byte_at(i)) & 0xff; + } + ret[s_len] = 0; } - ret = &buf[0]; } HOTSPOT_JNI_GETSTRINGCRITICAL_RETURN((uint16_t *) ret); return ret; From 9ecd60a8dc199a58128580dc581b3402255ca1f3 Mon Sep 17 00:00:00 2001 From: Bengt Rutisson Date: Tue, 15 Dec 2015 09:58:29 +0100 Subject: [PATCH 021/146] 8145303: Clean up the units for log_gc_footer Reviewed-by: david, tschatzl, goetz --- hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp | 9 ++++----- hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp | 2 +- hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp | 4 ++-- hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp | 2 +- hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp | 4 ++-- hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp | 2 +- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp index 2b6106391bc..3fba02e69a7 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp @@ -3600,13 +3600,13 @@ void G1CollectedHeap::reset_taskqueue_stats() { } #endif // TASKQUEUE_STATS -void G1CollectedHeap::log_gc_footer(double pause_time_counter) { +void G1CollectedHeap::log_gc_footer(jlong pause_time_counter) { if (evacuation_failed()) { log_info(gc)("To-space exhausted"); } - double pause_time_sec = TimeHelper::counter_to_seconds(pause_time_counter); - g1_policy()->print_phases(pause_time_sec); + double pause_time_ms = TimeHelper::counter_to_millis(pause_time_counter); + g1_policy()->print_phases(pause_time_ms); g1_policy()->print_detailed_heap_transition(); } @@ -3698,8 +3698,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { } GCTraceTime(Info, gc) tm(gc_string, NULL, gc_cause(), true); - double pause_start_sec = os::elapsedTime(); - double pause_start_counter = os::elapsed_counter(); + jlong pause_start_counter = os::elapsed_counter(); g1_policy()->note_gc_start(active_workers); TraceCollectorStats tcs(g1mm()->incremental_collection_counters()); diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp index dafd2cd102b..b6d0dd3e762 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp @@ -290,7 +290,7 @@ private: void verify_before_gc(); void verify_after_gc(); - void log_gc_footer(double pause_time_counter); + void log_gc_footer(jlong pause_time_counter); void trace_heap(GCWhen::Type when, const GCTracer* tracer); diff --git a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp index d19bf2faab8..4e603475391 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp @@ -1299,8 +1299,8 @@ void G1CollectorPolicy::print_detailed_heap_transition() const { MetaspaceAux::print_metaspace_change(_metaspace_used_bytes_before_gc); } -void G1CollectorPolicy::print_phases(double pause_time_sec) { - phase_times()->print(pause_time_sec); +void G1CollectorPolicy::print_phases(double pause_time_ms) { + phase_times()->print(pause_time_ms); } void G1CollectorPolicy::adjust_concurrent_refinement(double update_rs_time, diff --git a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp index 7c7cf4d0a5e..d0687a1c1e6 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp @@ -661,7 +661,7 @@ public: void print_detailed_heap_transition() const; - virtual void print_phases(double pause_time_sec); + virtual void print_phases(double pause_time_ms); void record_stop_world_start(); void record_concurrent_pause(); diff --git a/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp b/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp index 84e749c2ab9..c6b7fed4fdf 100644 --- a/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp +++ b/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp @@ -349,7 +349,7 @@ class G1GCParPhasePrinter : public StackObj { } }; -void G1GCPhaseTimes::print(double pause_time_sec) { +void G1GCPhaseTimes::print(double pause_time_ms) { note_gc_end(); G1GCParPhasePrinter par_phase_printer(this); @@ -373,7 +373,7 @@ void G1GCPhaseTimes::print(double pause_time_sec) { } print_stats(Indents[1], "Clear CT", _cur_clear_ct_time_ms); print_stats(Indents[1], "Expand Heap After Collection", _cur_expand_heap_time_ms); - double misc_time_ms = pause_time_sec * MILLIUNITS - accounted_time_ms(); + double misc_time_ms = pause_time_ms - accounted_time_ms(); print_stats(Indents[1], "Other", misc_time_ms); if (_cur_verify_before_time_ms > 0.0) { print_stats(Indents[2], "Verify Before", _cur_verify_before_time_ms); diff --git a/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp b/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp index 9803fef0c5b..1e4b166459a 100644 --- a/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp +++ b/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp @@ -126,7 +126,7 @@ class G1GCPhaseTimes : public CHeapObj { public: G1GCPhaseTimes(uint max_gc_threads); void note_gc_start(uint active_gc_threads); - void print(double pause_time_sec); + void print(double pause_time_ms); // record the time a phase took in seconds void record_time_secs(GCParPhases phase, uint worker_i, double secs); From 6e05599081640f65af8f3dc5696a7ba69ffa571f Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Tue, 15 Dec 2015 10:55:07 +0100 Subject: [PATCH 022/146] 8142909: Integration of minor fixes from the build-infra project Reviewed-by: dholmes, erikj --- hotspot/make/bsd/makefiles/saproc.make | 175 ----------------------- hotspot/make/windows/create_obj_files.sh | 1 + hotspot/src/share/vm/adlc/adlparse.cpp | 8 +- 3 files changed, 6 insertions(+), 178 deletions(-) delete mode 100644 hotspot/make/bsd/makefiles/saproc.make diff --git a/hotspot/make/bsd/makefiles/saproc.make b/hotspot/make/bsd/makefiles/saproc.make deleted file mode 100644 index c1783c470a7..00000000000 --- a/hotspot/make/bsd/makefiles/saproc.make +++ /dev/null @@ -1,175 +0,0 @@ -# -# Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -# Rules to build serviceability agent library, used by vm.make - -# libsaproc.so(dylib): serviceability agent -SAPROC = saproc - -ifeq ($(OS_VENDOR), Darwin) - LIBSAPROC = lib$(SAPROC).$(LIBRARY_SUFFIX) - - LIBSAPROC_DEBUGINFO = lib$(SAPROC).$(LIBRARY_SUFFIX).dSYM - LIBSAPROC_DIZ = lib$(SAPROC).diz -else - LIBSAPROC = lib$(SAPROC).so - - LIBSAPROC_DEBUGINFO = lib$(SAPROC).debuginfo - LIBSAPROC_DIZ = lib$(SAPROC).diz -endif - -AGENT_DIR = $(GAMMADIR)/agent - -SASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family) - -BSD_NON_STUB_SASRCFILES = $(SASRCDIR)/salibelf.c \ - $(SASRCDIR)/symtab.c \ - $(SASRCDIR)/libproc_impl.c \ - $(SASRCDIR)/ps_proc.c \ - $(SASRCDIR)/ps_core.c \ - $(SASRCDIR)/BsdDebuggerLocal.c \ - $(AGENT_DIR)/src/share/native/sadis.c - -DARWIN_NON_STUB_SASRCFILES = $(SASRCDIR)/symtab.c \ - $(SASRCDIR)/libproc_impl.c \ - $(SASRCDIR)/ps_core.c \ - $(SASRCDIR)/MacosxDebuggerLocal.m \ - $(AGENT_DIR)/src/share/native/sadis.c - -ifeq ($(OS_VENDOR), FreeBSD) - SASRCFILES = $(BSD_NON_STUB_SASRCFILES) - SALIBS = -lutil -lthread_db - SAARCH = $(ARCHFLAG) -else - ifeq ($(OS_VENDOR), Darwin) - SASRCFILES = $(DARWIN_NON_STUB_SASRCFILES) - SALIBS = -g \ - -framework Foundation \ - -framework JavaNativeFoundation \ - -framework Security \ - -framework CoreFoundation - #objc compiler blows up on -march=i586, perhaps it should not be included in the macosx intel 32-bit C++ compiles? - SAARCH = $(subst -march=i586,,$(ARCHFLAG)) - - # This is needed to locate JavaNativeFoundation.framework - ifeq ($(SYSROOT_CFLAGS),) - # this will happen when building without spec.gmk, set SDKROOT to a valid SDK - # path if your system does not have headers installed in the system frameworks - SA_SYSROOT_FLAGS = -F"$(SDKROOT)/System/Library/Frameworks/JavaVM.framework/Frameworks" - else - # Just use SYSROOT_CFLAGS - SA_SYSROOT_FLAGS=$(SYSROOT_CFLAGS) - endif - else - SASRCFILES = $(SASRCDIR)/StubDebuggerLocal.c - SALIBS = - SAARCH = $(ARCHFLAG) - endif -endif - -SAMAPFILE = $(SASRCDIR)/mapfile - -DEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC) -DEST_SAPROC_DEBUGINFO = $(JDK_LIBDIR)/$(LIBSAPROC_DEBUGINFO) -DEST_SAPROC_DIZ = $(JDK_LIBDIR)/$(LIBSAPROC_DIZ) - -# DEBUG_BINARIES overrides everything, use full -g debug information -ifeq ($(DEBUG_BINARIES), true) - SA_DEBUG_CFLAGS = -g -endif - -# if $(AGENT_DIR) does not exist, we don't build SA -# also, we don't build SA on Itanium, PPC, ARM or zero. - -ifneq ($(wildcard $(AGENT_DIR)),) -ifneq ($(filter-out ia64 arm ppc zero,$(SRCARCH)),) - BUILDLIBSAPROC = $(LIBSAPROC) -endif -endif - - -ifneq ($(OS_VENDOR), Darwin) -SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE)) -endif -SA_LFLAGS += $(LDFLAGS_HASH_STYLE) - -BOOT_JAVA_INCLUDES = -I$(BOOT_JAVA_HOME)/include \ - -I$(BOOT_JAVA_HOME)/include/$(shell uname -s | tr "[:upper:]" "[:lower:]") - -$(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE) - $(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \ - echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \ - exit 1; \ - fi - @echo $(LOG_INFO) Making SA debugger back-end... - $(QUIETLY) $(CC) -D$(BUILDARCH) -D_GNU_SOURCE \ - $(SA_SYSROOT_FLAGS) \ - $(SYMFLAG) $(SAARCH) $(SHARED_FLAG) $(PICFLAG) \ - -I$(SASRCDIR) \ - -I$(GENERATED) \ - $(BOOT_JAVA_INCLUDES) \ - $(SASRCFILES) \ - $(SA_LFLAGS) \ - $(SA_DEBUG_CFLAGS) \ - -o $@ \ - $(SALIBS) -ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) - ifeq ($(OS_VENDOR), Darwin) - $(DSYMUTIL) $@ - ifeq ($(ZIP_DEBUGINFO_FILES),1) - $(ZIPEXE) -q -r -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO) - $(RM) -r $(LIBSAPROC_DEBUGINFO) - endif - else - $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBSAPROC_DEBUGINFO) - $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBSAPROC_DEBUGINFO) $@ - ifeq ($(STRIP_POLICY),all_strip) - $(QUIETLY) $(STRIP) $@ - else - ifeq ($(STRIP_POLICY),min_strip) - $(QUIETLY) $(STRIP) -g $@ - # implied else here is no stripping at all - endif - endif - ifeq ($(ZIP_DEBUGINFO_FILES),1) - $(ZIPEXE) -q -y $(LIBSAPROC_DIZ) $(LIBSAPROC_DEBUGINFO) - $(RM) $(LIBSAPROC_DEBUGINFO) - endif - endif -endif - -install_saproc: $(BUILDLIBSAPROC) - @echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)" -ifeq ($(OS_VENDOR), Darwin) - $(QUIETLY) test ! -d $(LIBSAPROC_DEBUGINFO) || \ - $(CP) -f -r $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO) -else - $(QUIETLY) test ! -f $(LIBSAPROC_DEBUGINFO) || \ - $(CP) -f $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO) -endif - $(QUIETLY) test ! -f $(LIBSAPROC_DIZ) || \ - $(CP) -f $(LIBSAPROC_DIZ) $(DEST_SAPROC_DIZ) - $(QUIETLY) $(CP) -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done" - -.PHONY: install_saproc diff --git a/hotspot/make/windows/create_obj_files.sh b/hotspot/make/windows/create_obj_files.sh index a6481549bd6..cc3d276ff24 100644 --- a/hotspot/make/windows/create_obj_files.sh +++ b/hotspot/make/windows/create_obj_files.sh @@ -158,5 +158,6 @@ for e in ${Src_Files}; do fi Obj_Files="${Obj_Files}$o " done +Obj_Files=`echo ${Obj_Files} | tr ' ' '\n' | sort` echo Obj_Files=${Obj_Files} diff --git a/hotspot/src/share/vm/adlc/adlparse.cpp b/hotspot/src/share/vm/adlc/adlparse.cpp index 54bff63ad6d..e385bf93d1a 100644 --- a/hotspot/src/share/vm/adlc/adlparse.cpp +++ b/hotspot/src/share/vm/adlc/adlparse.cpp @@ -48,9 +48,11 @@ ADLParser::~ADLParser() { if (!_AD._quiet_mode) fprintf(stderr,"---------------------------- Errors and Warnings ----------------------------\n"); #ifndef ASSERT - fprintf(stderr, "**************************************************************\n"); - fprintf(stderr, "***** WARNING: ASSERT is undefined, assertions disabled. *****\n"); - fprintf(stderr, "**************************************************************\n"); + if (!_AD._quiet_mode) { + fprintf(stderr, "**************************************************************\n"); + fprintf(stderr, "***** WARNING: ASSERT is undefined, assertions disabled. *****\n"); + fprintf(stderr, "**************************************************************\n"); + } #endif if( _AD._syntax_errs + _AD._semantic_errs + _AD._warnings == 0 ) { if (!_AD._quiet_mode) From 39e280e4e36ca4225f57e20fc82785722d0b4c19 Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Thu, 10 Dec 2015 16:18:25 +0100 Subject: [PATCH 023/146] 8145117: PPC64: Remove cpp interpreter implementation Reviewed-by: coleenp, mdoerr --- hotspot/src/cpu/ppc/vm/frame_ppc.cpp | 37 +-- hotspot/src/cpu/ppc/vm/frame_ppc.hpp | 147 ++---------- hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp | 80 ------- .../src/cpu/ppc/vm/globalDefinitions_ppc.hpp | 4 + hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp | 225 +++++------------- hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp | 42 ---- hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp | 7 +- hotspot/src/cpu/ppc/vm/interpreter_ppc.hpp | 2 - hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp | 4 - hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp | 28 +-- hotspot/src/cpu/ppc/vm/register_ppc.hpp | 14 -- hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp | 41 +--- hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp | 9 +- .../vm/templateInterpreterGenerator_ppc.cpp | 2 - .../src/cpu/ppc/vm/templateTable_ppc_64.cpp | 3 - 15 files changed, 106 insertions(+), 539 deletions(-) diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp index 2e051d99918..69646f74c77 100644 --- a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp @@ -84,10 +84,7 @@ frame frame::sender_for_entry_frame(RegisterMap *map) const { frame frame::sender_for_interpreter_frame(RegisterMap *map) const { // Pass callers initial_caller_sp as unextended_sp. - return frame(sender_sp(), sender_pc(), - CC_INTERP_ONLY((intptr_t*)((parent_ijava_frame_abi *)callers_abi())->initial_caller_sp) - NOT_CC_INTERP((intptr_t*)get_ijava_state()->sender_sp) - ); + return frame(sender_sp(), sender_pc(), (intptr_t*)get_ijava_state()->sender_sp); } frame frame::sender_for_compiled_frame(RegisterMap *map) const { @@ -168,14 +165,8 @@ BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result) if (method->is_native()) { // Prior to calling into the runtime to notify the method exit the possible // result value is saved into the interpreter frame. -#ifdef CC_INTERP - interpreterState istate = get_interpreterState(); - address lresult = (address)istate + in_bytes(BytecodeInterpreter::native_lresult_offset()); - address fresult = (address)istate + in_bytes(BytecodeInterpreter::native_fresult_offset()); -#else address lresult = (address)&(get_ijava_state()->lresult); address fresult = (address)&(get_ijava_state()->fresult); -#endif switch (method->result_type()) { case T_OBJECT: @@ -226,31 +217,6 @@ BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result) void frame::describe_pd(FrameValues& values, int frame_no) { if (is_interpreted_frame()) { -#ifdef CC_INTERP - interpreterState istate = get_interpreterState(); - values.describe(frame_no, (intptr_t*)istate, "istate"); - values.describe(frame_no, (intptr_t*)&(istate->_thread), " thread"); - values.describe(frame_no, (intptr_t*)&(istate->_bcp), " bcp"); - values.describe(frame_no, (intptr_t*)&(istate->_locals), " locals"); - values.describe(frame_no, (intptr_t*)&(istate->_constants), " constants"); - values.describe(frame_no, (intptr_t*)&(istate->_method), err_msg(" method = %s", istate->_method->name_and_sig_as_C_string())); - values.describe(frame_no, (intptr_t*)&(istate->_mdx), " mdx"); - values.describe(frame_no, (intptr_t*)&(istate->_stack), " stack"); - values.describe(frame_no, (intptr_t*)&(istate->_msg), err_msg(" msg = %s", BytecodeInterpreter::C_msg(istate->_msg))); - values.describe(frame_no, (intptr_t*)&(istate->_result), " result"); - values.describe(frame_no, (intptr_t*)&(istate->_prev_link), " prev_link"); - values.describe(frame_no, (intptr_t*)&(istate->_oop_temp), " oop_temp"); - values.describe(frame_no, (intptr_t*)&(istate->_stack_base), " stack_base"); - values.describe(frame_no, (intptr_t*)&(istate->_stack_limit), " stack_limit"); - values.describe(frame_no, (intptr_t*)&(istate->_monitor_base), " monitor_base"); - values.describe(frame_no, (intptr_t*)&(istate->_frame_bottom), " frame_bottom"); - values.describe(frame_no, (intptr_t*)&(istate->_last_Java_pc), " last_Java_pc"); - values.describe(frame_no, (intptr_t*)&(istate->_last_Java_fp), " last_Java_fp"); - values.describe(frame_no, (intptr_t*)&(istate->_last_Java_sp), " last_Java_sp"); - values.describe(frame_no, (intptr_t*)&(istate->_self_link), " self_link"); - values.describe(frame_no, (intptr_t*)&(istate->_native_fresult), " native_fresult"); - values.describe(frame_no, (intptr_t*)&(istate->_native_lresult), " native_lresult"); -#else #define DESCRIBE_ADDRESS(name) \ values.describe(frame_no, (intptr_t*)&(get_ijava_state()->name), #name); @@ -266,7 +232,6 @@ void frame::describe_pd(FrameValues& values, int frame_no) { DESCRIBE_ADDRESS(oop_tmp); DESCRIBE_ADDRESS(lresult); DESCRIBE_ADDRESS(fresult); -#endif } } #endif diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.hpp b/hotspot/src/cpu/ppc/vm/frame_ppc.hpp index f327d2ce424..8a1ff5c63b3 100644 --- a/hotspot/src/cpu/ppc/vm/frame_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.hpp @@ -193,33 +193,48 @@ #define _spill_nonvolatiles_neg(_component) \ (int)(-frame::spill_nonvolatiles_size + offset_of(frame::spill_nonvolatiles, _component)) - - -#ifndef CC_INTERP - // Frame layout for the Java template interpreter on PPC64. + // Frame layout for the Java template interpreter on PPC64. // - // Diffs to the CC_INTERP are marked with 'X'. + // In these figures the stack grows upwards, while memory grows + // downwards. Square brackets denote regions possibly larger than + // single 64 bit slots. // + // STACK (interpreter is active): + // 0 [TOP_IJAVA_FRAME] + // [PARENT_IJAVA_FRAME] + // ... + // [PARENT_IJAVA_FRAME] + // [ENTRY_FRAME] + // [C_FRAME] + // ... + // [C_FRAME] + // + // With the following frame layouts: // TOP_IJAVA_FRAME: - // // 0 [TOP_IJAVA_FRAME_ABI] // alignment (optional) // [operand stack] // [monitors] (optional) - // X[IJAVA_STATE] + // [IJAVA_STATE] // note: own locals are located in the caller frame. // // PARENT_IJAVA_FRAME: - // // 0 [PARENT_IJAVA_FRAME_ABI] // alignment (optional) // [callee's Java result] // [callee's locals w/o arguments] // [outgoing arguments] // [used part of operand stack w/o arguments] - // [monitors] (optional) - // X[IJAVA_STATE] + // [monitors] (optional) + // [IJAVA_STATE] // + // ENTRY_FRAME: + // 0 [PARENT_IJAVA_FRAME_ABI] + // alignment (optional) + // [callee's Java result] + // [callee's locals w/o arguments] + // [outgoing arguments] + // [ENTRY_FRAME_LOCALS] struct parent_ijava_frame_abi : abi_minframe { }; @@ -269,113 +284,6 @@ #define _ijava_state_neg(_component) \ (int) (-frame::ijava_state_size + offset_of(frame::ijava_state, _component)) -#else // CC_INTERP: - - // Frame layout for the Java C++ interpreter on PPC64. - // - // This frame layout provides a C-like frame for every Java frame. - // - // In these figures the stack grows upwards, while memory grows - // downwards. Square brackets denote regions possibly larger than - // single 64 bit slots. - // - // STACK (no JNI, no compiled code, no library calls, - // interpreter-loop is active): - // 0 [InterpretMethod] - // [TOP_IJAVA_FRAME] - // [PARENT_IJAVA_FRAME] - // ... - // [PARENT_IJAVA_FRAME] - // [ENTRY_FRAME] - // [C_FRAME] - // ... - // [C_FRAME] - // - // TOP_IJAVA_FRAME: - // 0 [TOP_IJAVA_FRAME_ABI] - // alignment (optional) - // [operand stack] - // [monitors] (optional) - // [cInterpreter object] - // result, locals, and arguments are in parent frame! - // - // PARENT_IJAVA_FRAME: - // 0 [PARENT_IJAVA_FRAME_ABI] - // alignment (optional) - // [callee's Java result] - // [callee's locals w/o arguments] - // [outgoing arguments] - // [used part of operand stack w/o arguments] - // [monitors] (optional) - // [cInterpreter object] - // - // ENTRY_FRAME: - // 0 [PARENT_IJAVA_FRAME_ABI] - // alignment (optional) - // [callee's Java result] - // [callee's locals w/o arguments] - // [outgoing arguments] - // [ENTRY_FRAME_LOCALS] - // - // PARENT_IJAVA_FRAME_ABI: - // 0 [ABI_MINFRAME] - // top_frame_sp - // initial_caller_sp - // - // TOP_IJAVA_FRAME_ABI: - // 0 [PARENT_IJAVA_FRAME_ABI] - // carg_3_unused - // carg_4_unused - // carg_5_unused - // carg_6_unused - // carg_7_unused - // frame_manager_lr - // - - // PARENT_IJAVA_FRAME_ABI - - struct parent_ijava_frame_abi : abi_minframe { - // SOE registers. - // C2i adapters spill their top-frame stack-pointer here. - uint64_t top_frame_sp; // carg_1 - // Sp of calling compiled frame before it was resized by the c2i - // adapter or sp of call stub. Does not contain a valid value for - // non-initial frames. - uint64_t initial_caller_sp; // carg_2 - // aligned to frame::alignment_in_bytes (16) - }; - - enum { - parent_ijava_frame_abi_size = sizeof(parent_ijava_frame_abi) - }; - - #define _parent_ijava_frame_abi(_component) \ - (offset_of(frame::parent_ijava_frame_abi, _component)) - - // TOP_IJAVA_FRAME_ABI - - struct top_ijava_frame_abi : parent_ijava_frame_abi { - uint64_t carg_3_unused; // carg_3 - uint64_t card_4_unused; //_16 carg_4 - uint64_t carg_5_unused; // carg_5 - uint64_t carg_6_unused; //_16 carg_6 - uint64_t carg_7_unused; // carg_7 - // Use arg8 for storing frame_manager_lr. The size of - // top_ijava_frame_abi must match abi_reg_args. - uint64_t frame_manager_lr; //_16 carg_8 - // nothing to add here! - // aligned to frame::alignment_in_bytes (16) - }; - - enum { - top_ijava_frame_abi_size = sizeof(top_ijava_frame_abi) - }; - - #define _top_ijava_frame_abi(_component) \ - (offset_of(frame::top_ijava_frame_abi, _component)) - -#endif // CC_INTERP - // ENTRY_FRAME struct entry_frame_locals { @@ -496,10 +404,6 @@ public: -#ifdef CC_INTERP - // Additional interface for interpreter frames: - inline interpreterState get_interpreterState() const; -#else inline ijava_state* get_ijava_state() const; // Some convenient register frame setters/getters for deoptimization. inline intptr_t* interpreter_frame_esp() const; @@ -507,7 +411,6 @@ inline void interpreter_frame_set_esp(intptr_t* esp); inline void interpreter_frame_set_top_frame_sp(intptr_t* top_frame_sp); inline void interpreter_frame_set_sender_sp(intptr_t* sender_sp); -#endif // CC_INTERP // Size of a monitor in bytes. static int interpreter_frame_monitor_size_in_bytes(); diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp index 4945d7f827b..097ac0da6a1 100644 --- a/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.inline.hpp @@ -123,84 +123,6 @@ inline intptr_t* frame::real_fp() const { return fp(); } -#ifdef CC_INTERP - -inline interpreterState frame::get_interpreterState() const { - return (interpreterState)(((address)callers_abi()) - - frame::interpreter_frame_cinterpreterstate_size_in_bytes()); -} - -inline intptr_t** frame::interpreter_frame_locals_addr() const { - interpreterState istate = get_interpreterState(); - return (intptr_t**)&istate->_locals; -} - -inline intptr_t* frame::interpreter_frame_bcp_addr() const { - interpreterState istate = get_interpreterState(); - return (intptr_t*)&istate->_bcp; -} - -inline intptr_t* frame::interpreter_frame_mdp_addr() const { - interpreterState istate = get_interpreterState(); - return (intptr_t*)&istate->_mdx; -} - -inline intptr_t* frame::interpreter_frame_expression_stack() const { - return (intptr_t*)interpreter_frame_monitor_end() - 1; -} - -inline jint frame::interpreter_frame_expression_stack_direction() { - return -1; -} - -// top of expression stack -inline intptr_t* frame::interpreter_frame_tos_address() const { - interpreterState istate = get_interpreterState(); - return istate->_stack + 1; -} - -inline intptr_t* frame::interpreter_frame_tos_at(jint offset) const { - return &interpreter_frame_tos_address()[offset]; -} - -// monitor elements - -// in keeping with Intel side: end is lower in memory than begin; -// and beginning element is oldest element -// Also begin is one past last monitor. - -inline BasicObjectLock* frame::interpreter_frame_monitor_begin() const { - return get_interpreterState()->monitor_base(); -} - -inline BasicObjectLock* frame::interpreter_frame_monitor_end() const { - return (BasicObjectLock*)get_interpreterState()->stack_base(); -} - -inline int frame::interpreter_frame_cinterpreterstate_size_in_bytes() { - // Size of an interpreter object. Not aligned with frame size. - return round_to(sizeof(BytecodeInterpreter), 8); -} - -inline Method** frame::interpreter_frame_method_addr() const { - interpreterState istate = get_interpreterState(); - return &istate->_method; -} - -// Constant pool cache - -inline ConstantPoolCache** frame::interpreter_frame_cpoolcache_addr() const { - interpreterState istate = get_interpreterState(); - return &istate->_constants; // should really use accessor -} - -inline ConstantPoolCache** frame::interpreter_frame_cache_addr() const { - interpreterState istate = get_interpreterState(); - return &istate->_constants; -} - -#else // !CC_INTERP - // Template Interpreter frame value accessors. inline frame::ijava_state* frame::get_ijava_state() const { @@ -267,8 +189,6 @@ inline intptr_t* frame::interpreter_frame_tos_at(jint offset) const { return &interpreter_frame_tos_address()[offset]; } -#endif // CC_INTERP - inline int frame::interpreter_frame_monitor_size() { // Number of stack slots for a monitor. return round_to(BasicObjectLock::size(), // number of stack slots diff --git a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp index 43fe93146a9..c7d33304bd1 100644 --- a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp @@ -26,6 +26,10 @@ #ifndef CPU_PPC_VM_GLOBALDEFINITIONS_PPC_HPP #define CPU_PPC_VM_GLOBALDEFINITIONS_PPC_HPP +#ifdef CC_INTERP +#error "CC_INTERP no more supported. Removed in change 8145117." +#endif + // Size of PPC Instructions const int BytesPerInstWord = 4; diff --git a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp index be9c8da7124..80350fe4c5d 100644 --- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp +++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,11 +38,7 @@ #endif void InterpreterMacroAssembler::null_check_throw(Register a, int offset, Register temp_reg) { -#ifdef CC_INTERP - address exception_entry = StubRoutines::throw_NullPointerException_at_call_entry(); -#else address exception_entry = Interpreter::throw_NullPointerException_entry(); -#endif MacroAssembler::null_check_throw(a, offset, temp_reg, exception_entry); } @@ -57,8 +53,6 @@ void InterpreterMacroAssembler::jump_to_entry(address entry, Register Rscratch) } } -#ifndef CC_INTERP - void InterpreterMacroAssembler::dispatch_next(TosState state, int bcp_incr) { Register bytecode = R12_scratch2; if (bcp_incr != 0) { @@ -207,7 +201,8 @@ void InterpreterMacroAssembler::load_dispatch_table(Register dst, address* table } } -void InterpreterMacroAssembler::dispatch_Lbyte_code(TosState state, Register bytecode, address* table, bool verify) { +void InterpreterMacroAssembler::dispatch_Lbyte_code(TosState state, Register bytecode, + address* table, bool verify) { if (verify) { unimplemented("dispatch_Lbyte_code: verify"); // See Sparc Implementation to implement this } @@ -394,7 +389,8 @@ void InterpreterMacroAssembler::get_4_byte_integer_at_bcp(int bcp_offset // // Kills / writes: // - Rdst, Rscratch -void InterpreterMacroAssembler::get_cache_index_at_bcp(Register Rdst, int bcp_offset, size_t index_size) { +void InterpreterMacroAssembler::get_cache_index_at_bcp(Register Rdst, int bcp_offset, + size_t index_size) { assert(bcp_offset > 0, "bcp is still pointing to start of bytecode"); // Cache index is always in the native format, courtesy of Rewriter. if (index_size == sizeof(u2)) { @@ -416,7 +412,8 @@ void InterpreterMacroAssembler::get_cache_index_at_bcp(Register Rdst, int bcp_of // Rdst now contains cp cache index. } -void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, int bcp_offset, size_t index_size) { +void InterpreterMacroAssembler::get_cache_and_index_at_bcp(Register cache, int bcp_offset, + size_t index_size) { get_cache_index_at_bcp(cache, bcp_offset, index_size); sldi(cache, cache, exact_log2(in_words(ConstantPoolCacheEntry::size()) * BytesPerWord)); add(cache, R27_constPoolCache, cache); @@ -514,7 +511,8 @@ void InterpreterMacroAssembler::generate_stack_overflow_check_with_compare_and_t // and put arrayOop + shifted_index into res. // Note: res is still shy of address by array offset into object. -void InterpreterMacroAssembler::index_check_without_pop(Register Rarray, Register Rindex, int index_shift, Register Rtmp, Register Rres) { +void InterpreterMacroAssembler::index_check_without_pop(Register Rarray, Register Rindex, + int index_shift, Register Rtmp, Register Rres) { // Check that index is in range for array, then shift index by index_shift, // and put arrayOop + shifted_index into res. // Note: res is still shy of address by array offset into object. @@ -566,7 +564,8 @@ void InterpreterMacroAssembler::index_check_without_pop(Register Rarray, Registe add(Rres, RsxtIndex, Rarray); } -void InterpreterMacroAssembler::index_check(Register array, Register index, int index_shift, Register tmp, Register res) { +void InterpreterMacroAssembler::index_check(Register array, Register index, + int index_shift, Register tmp, Register res) { // pop array pop_ptr(array); @@ -637,7 +636,8 @@ void InterpreterMacroAssembler::unlock_if_synchronized_method(TosState state, Label Lunlock; // If it's still locked, everything is ok, unlock it. ld(Rmonitor_base, 0, R1_SP); - addi(Rmonitor_base, Rmonitor_base, - (frame::ijava_state_size + frame::interpreter_frame_monitor_size_in_bytes())); // Monitor base + addi(Rmonitor_base, Rmonitor_base, + -(frame::ijava_state_size + frame::interpreter_frame_monitor_size_in_bytes())); // Monitor base ld(R0, BasicObjectLock::obj_offset_in_bytes(), Rmonitor_base); cmpdi(CCR0, R0, 0); @@ -677,7 +677,8 @@ void InterpreterMacroAssembler::unlock_if_synchronized_method(TosState state, subf_(Riterations, R26_monitor, Rmonitor_base); ble(CCR0, Lno_unlock); - addi(Rcurrent_obj_addr, Rmonitor_base, BasicObjectLock::obj_offset_in_bytes() - frame::interpreter_frame_monitor_size_in_bytes()); + addi(Rcurrent_obj_addr, Rmonitor_base, + BasicObjectLock::obj_offset_in_bytes() - frame::interpreter_frame_monitor_size_in_bytes()); // Check if any monitor is on stack, bail out if not srdi(Riterations, Riterations, exact_log2(delta)); mtctr(Riterations); @@ -727,7 +728,8 @@ void InterpreterMacroAssembler::unlock_if_synchronized_method(TosState state, } // Support function for remove_activation & Co. -void InterpreterMacroAssembler::merge_frames(Register Rsender_sp, Register return_pc, Register Rscratch1, Register Rscratch2) { +void InterpreterMacroAssembler::merge_frames(Register Rsender_sp, Register return_pc, + Register Rscratch1, Register Rscratch2) { // Pop interpreter frame. ld(Rscratch1, 0, R1_SP); // *SP ld(Rsender_sp, _ijava_state_neg(sender_sp), Rscratch1); // top_frame_sp @@ -779,8 +781,6 @@ void InterpreterMacroAssembler::remove_activation(TosState state, mtlr(R0); } -#endif // !CC_INTERP - // Lock object // // Registers alive @@ -791,7 +791,7 @@ void InterpreterMacroAssembler::remove_activation(TosState state, void InterpreterMacroAssembler::lock_object(Register monitor, Register object) { if (UseHeavyMonitors) { call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter), - monitor, /*check_for_exceptions=*/true CC_INTERP_ONLY(&& false)); + monitor, /*check_for_exceptions=*/true); } else { // template code: // @@ -888,7 +888,7 @@ void InterpreterMacroAssembler::lock_object(Register monitor, Register object) { // slow case of monitor enter. bind(slow_case); call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorenter), - monitor, /*check_for_exceptions=*/true CC_INTERP_ONLY(&& false)); + monitor, /*check_for_exceptions=*/true); // } align(32, 12); bind(done); @@ -905,7 +905,7 @@ void InterpreterMacroAssembler::lock_object(Register monitor, Register object) { void InterpreterMacroAssembler::unlock_object(Register monitor, bool check_for_exceptions) { if (UseHeavyMonitors) { call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorexit), - monitor, check_for_exceptions CC_INTERP_ONLY(&& false)); + monitor, check_for_exceptions); } else { // template code: @@ -978,7 +978,7 @@ void InterpreterMacroAssembler::unlock_object(Register monitor, bool check_for_e // we need to get into the slow case. bind(slow_case); call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::monitorexit), - monitor, check_for_exceptions CC_INTERP_ONLY(&& false)); + monitor, check_for_exceptions); // } Label done; @@ -993,8 +993,6 @@ void InterpreterMacroAssembler::unlock_object(Register monitor, bool check_for_e } } -#ifndef CC_INTERP - // Load compiled (i2c) or interpreter entry when calling from interpreted and // do the call. Centralized so that all interpreter calls will do the same actions. // If jvmti single stepping is on for a thread we must not call compiled code. @@ -1004,7 +1002,8 @@ void InterpreterMacroAssembler::unlock_object(Register monitor, bool check_for_e // - Rret_addr: return address // - 2 scratch regs // -void InterpreterMacroAssembler::call_from_interpreter(Register Rtarget_method, Register Rret_addr, Register Rscratch1, Register Rscratch2) { +void InterpreterMacroAssembler::call_from_interpreter(Register Rtarget_method, Register Rret_addr, + Register Rscratch1, Register Rscratch2) { assert_different_registers(Rscratch1, Rscratch2, Rtarget_method, Rret_addr); // Assume we want to go compiled if available. const Register Rtarget_addr = Rscratch1; @@ -1488,7 +1487,8 @@ void InterpreterMacroAssembler::profile_typecheck_failed(Register Rscratch1, Reg } // Count a ret in the bytecodes. -void InterpreterMacroAssembler::profile_ret(TosState state, Register return_bci, Register scratch1, Register scratch2) { +void InterpreterMacroAssembler::profile_ret(TosState state, Register return_bci, + Register scratch1, Register scratch2) { if (ProfileInterpreter) { Label profile_continue; uint row; @@ -1684,7 +1684,8 @@ void InterpreterMacroAssembler::record_klass_in_profile_helper( // Argument and return type profilig. // kills: tmp, tmp2, R0, CR0, CR1 void InterpreterMacroAssembler::profile_obj_type(Register obj, Register mdo_addr_base, - RegisterOrConstant mdo_addr_offs, Register tmp, Register tmp2) { + RegisterOrConstant mdo_addr_offs, + Register tmp, Register tmp2) { Label do_nothing, do_update; // tmp2 = obj is allowed @@ -1730,7 +1731,9 @@ void InterpreterMacroAssembler::profile_obj_type(Register obj, Register mdo_addr bind(do_nothing); } -void InterpreterMacroAssembler::profile_arguments_type(Register callee, Register tmp1, Register tmp2, bool is_virtual) { +void InterpreterMacroAssembler::profile_arguments_type(Register callee, + Register tmp1, Register tmp2, + bool is_virtual) { if (!ProfileInterpreter) { return; } @@ -1742,7 +1745,8 @@ void InterpreterMacroAssembler::profile_arguments_type(Register callee, Register test_method_data_pointer(profile_continue); - int off_to_start = is_virtual ? in_bytes(VirtualCallData::virtual_call_data_size()) : in_bytes(CounterData::counter_data_size()); + int off_to_start = is_virtual ? + in_bytes(VirtualCallData::virtual_call_data_size()) : in_bytes(CounterData::counter_data_size()); lbz(tmp1, in_bytes(DataLayout::tag_offset()) - off_to_start, R28_mdx); cmpwi(CCR0, tmp1, is_virtual ? DataLayout::virtual_call_type_data_tag : DataLayout::call_type_data_tag); @@ -1792,7 +1796,8 @@ void InterpreterMacroAssembler::profile_arguments_type(Register callee, Register // argument. tmp1 is the number of cells left in the // CallTypeData/VirtualCallTypeData to reach its end. Non null // if there's a return to profile. - assert(ReturnTypeEntry::static_cell_count() < TypeStackSlotEntries::per_arg_count(), "can't move past ret type"); + assert(ReturnTypeEntry::static_cell_count() < TypeStackSlotEntries::per_arg_count(), + "can't move past ret type"); sldi(tmp1, tmp1, exact_log2(DataLayout::cell_size)); add(R28_mdx, tmp1, R28_mdx); } @@ -1841,7 +1846,8 @@ void InterpreterMacroAssembler::profile_return_type(Register ret, Register tmp1, } } -void InterpreterMacroAssembler::profile_parameters_type(Register tmp1, Register tmp2, Register tmp3, Register tmp4) { +void InterpreterMacroAssembler::profile_parameters_type(Register tmp1, Register tmp2, + Register tmp3, Register tmp4) { if (ProfileInterpreter && MethodData::profile_parameters()) { Label profile_continue, done; @@ -1984,7 +1990,9 @@ void InterpreterMacroAssembler::load_local_long(Register Rdst_value, Register Rd // Kills: // - Rdst_value // - Rdst_address -void InterpreterMacroAssembler::load_local_ptr(Register Rdst_value, Register Rdst_address, Register Rindex) { +void InterpreterMacroAssembler::load_local_ptr(Register Rdst_value, + Register Rdst_address, + Register Rindex) { sldi(Rdst_address, Rindex, Interpreter::logStackElementSize); subf(Rdst_address, Rdst_address, R18_locals); ld(Rdst_value, 0, Rdst_address); @@ -1995,7 +2003,9 @@ void InterpreterMacroAssembler::load_local_ptr(Register Rdst_value, Register Rds // Kills: // - Rdst_value // - Rdst_address -void InterpreterMacroAssembler::load_local_float(FloatRegister Rdst_value, Register Rdst_address, Register Rindex) { +void InterpreterMacroAssembler::load_local_float(FloatRegister Rdst_value, + Register Rdst_address, + Register Rindex) { sldi(Rdst_address, Rindex, Interpreter::logStackElementSize); subf(Rdst_address, Rdst_address, R18_locals); lfs(Rdst_value, 0, Rdst_address); @@ -2006,7 +2016,9 @@ void InterpreterMacroAssembler::load_local_float(FloatRegister Rdst_value, Regis // Kills: // - Rdst_value // - Rdst_address -void InterpreterMacroAssembler::load_local_double(FloatRegister Rdst_value, Register Rdst_address, Register Rindex) { +void InterpreterMacroAssembler::load_local_double(FloatRegister Rdst_value, + Register Rdst_address, + Register Rindex) { sldi(Rdst_address, Rindex, Interpreter::logStackElementSize); subf(Rdst_address, Rdst_address, R18_locals); lfd(Rdst_value, -8, Rdst_address); @@ -2102,13 +2114,16 @@ void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point } } -void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point, Register arg_1, bool check_exceptions) { +void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point, + Register arg_1, bool check_exceptions) { // ARG1 is reserved for the thread. mr_if_needed(R4_ARG2, arg_1); call_VM(oop_result, entry_point, check_exceptions); } -void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point, Register arg_1, Register arg_2, bool check_exceptions) { +void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point, + Register arg_1, Register arg_2, + bool check_exceptions) { // ARG1 is reserved for the thread. mr_if_needed(R4_ARG2, arg_1); assert(arg_2 != R4_ARG2, "smashed argument"); @@ -2116,7 +2131,9 @@ void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point call_VM(oop_result, entry_point, check_exceptions); } -void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point, Register arg_1, Register arg_2, Register arg_3, bool check_exceptions) { +void InterpreterMacroAssembler::call_VM(Register oop_result, address entry_point, + Register arg_1, Register arg_2, Register arg_3, + bool check_exceptions) { // ARG1 is reserved for the thread. mr_if_needed(R4_ARG2, arg_1); assert(arg_2 != R4_ARG2, "smashed argument"); @@ -2168,8 +2185,6 @@ void InterpreterMacroAssembler::restore_interpreter_state(Register scratch, bool #endif } -#endif // !CC_INTERP - void InterpreterMacroAssembler::get_method_counters(Register method, Register Rcounters, Label& skip) { @@ -2188,7 +2203,9 @@ void InterpreterMacroAssembler::get_method_counters(Register method, bind(has_counters); } -void InterpreterMacroAssembler::increment_invocation_counter(Register Rcounters, Register iv_be_count, Register Rtmp_r0) { +void InterpreterMacroAssembler::increment_invocation_counter(Register Rcounters, + Register iv_be_count, + Register Rtmp_r0) { assert(UseCompiler || LogTouchedMethods, "incrementing must be useful"); Register invocation_count = iv_be_count; Register backedge_count = Rtmp_r0; @@ -2230,7 +2247,6 @@ void InterpreterMacroAssembler::verify_oop(Register reg, TosState state) { if (state == atos) { MacroAssembler::verify_oop(reg); } } -#ifndef CC_INTERP // Local helper function for the verify_oop_or_return_address macro. static bool verify_return_address(Method* m, int bci) { #ifndef PRODUCT @@ -2287,7 +2303,6 @@ void InterpreterMacroAssembler::verify_oop_or_return_address(Register reg, Regis verify_oop(reg); bind(skip); } -#endif // !CC_INTERP // Inline assembly for: // @@ -2311,7 +2326,7 @@ void InterpreterMacroAssembler::notify_method_entry() { cmpwi(CCR0, R0, 0); beq(CCR0, jvmti_post_done); call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_method_entry), - /*check_exceptions=*/true CC_INTERP_ONLY(&& false)); + /*check_exceptions=*/true); bind(jvmti_post_done); } @@ -2345,11 +2360,10 @@ void InterpreterMacroAssembler::notify_method_exit(bool is_native_method, TosSta lwz(R0, in_bytes(JavaThread::interp_only_mode_offset()), R16_thread); cmpwi(CCR0, R0, 0); beq(CCR0, jvmti_post_done); - CC_INTERP_ONLY(assert(is_native_method && !check_exceptions, "must not push state")); - if (!is_native_method) push(state); // Expose tos to GC. + if (!is_native_method) { push(state); } // Expose tos to GC. call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_method_exit), /*check_exceptions=*/check_exceptions); - if (!is_native_method) pop(state); + if (!is_native_method) { pop(state); } align(32, 12); bind(jvmti_post_done); @@ -2358,124 +2372,3 @@ void InterpreterMacroAssembler::notify_method_exit(bool is_native_method, TosSta // Dtrace support not implemented. } -#ifdef CC_INTERP -// Convert the current TOP_IJAVA_FRAME into a PARENT_IJAVA_FRAME -// (using parent_frame_resize) and push a new interpreter -// TOP_IJAVA_FRAME (using frame_size). -void InterpreterMacroAssembler::push_interpreter_frame(Register top_frame_size, Register parent_frame_resize, - Register tmp1, Register tmp2, Register tmp3, - Register tmp4, Register pc) { - assert_different_registers(top_frame_size, parent_frame_resize, tmp1, tmp2, tmp3, tmp4); - ld(tmp1, _top_ijava_frame_abi(frame_manager_lr), R1_SP); - mr(tmp2/*top_frame_sp*/, R1_SP); - // Move initial_caller_sp. - ld(tmp4, _top_ijava_frame_abi(initial_caller_sp), R1_SP); - neg(parent_frame_resize, parent_frame_resize); - resize_frame(parent_frame_resize/*-parent_frame_resize*/, tmp3); - - // Set LR in new parent frame. - std(tmp1, _abi(lr), R1_SP); - // Set top_frame_sp info for new parent frame. - std(tmp2, _parent_ijava_frame_abi(top_frame_sp), R1_SP); - std(tmp4, _parent_ijava_frame_abi(initial_caller_sp), R1_SP); - - // Push new TOP_IJAVA_FRAME. - push_frame(top_frame_size, tmp2); - - get_PC_trash_LR(tmp3); - std(tmp3, _top_ijava_frame_abi(frame_manager_lr), R1_SP); - // Used for non-initial callers by unextended_sp(). - std(R1_SP, _top_ijava_frame_abi(initial_caller_sp), R1_SP); -} - -// Pop the topmost TOP_IJAVA_FRAME and convert the previous -// PARENT_IJAVA_FRAME back into a TOP_IJAVA_FRAME. -void InterpreterMacroAssembler::pop_interpreter_frame(Register tmp1, Register tmp2, Register tmp3, Register tmp4) { - assert_different_registers(tmp1, tmp2, tmp3, tmp4); - - ld(tmp1/*caller's sp*/, _abi(callers_sp), R1_SP); - ld(tmp3, _abi(lr), tmp1); - - ld(tmp4, _parent_ijava_frame_abi(initial_caller_sp), tmp1); - - ld(tmp2/*caller's caller's sp*/, _abi(callers_sp), tmp1); - // Merge top frame. - std(tmp2, _abi(callers_sp), R1_SP); - - ld(tmp2, _parent_ijava_frame_abi(top_frame_sp), tmp1); - - // Update C stack pointer to caller's top_abi. - resize_frame_absolute(tmp2/*addr*/, tmp1/*tmp*/, tmp2/*tmp*/); - - // Update LR in top_frame. - std(tmp3, _top_ijava_frame_abi(frame_manager_lr), R1_SP); - - std(tmp4, _top_ijava_frame_abi(initial_caller_sp), R1_SP); - - // Store the top-frame stack-pointer for c2i adapters. - std(R1_SP, _top_ijava_frame_abi(top_frame_sp), R1_SP); -} - -// Turn state's interpreter frame into the current TOP_IJAVA_FRAME. -void InterpreterMacroAssembler::pop_interpreter_frame_to_state(Register state, Register tmp1, Register tmp2, Register tmp3) { - assert_different_registers(R14_state, R15_prev_state, tmp1, tmp2, tmp3); - - if (state == R14_state) { - ld(tmp1/*state's fp*/, state_(_last_Java_fp)); - ld(tmp2/*state's sp*/, state_(_last_Java_sp)); - } else if (state == R15_prev_state) { - ld(tmp1/*state's fp*/, prev_state_(_last_Java_fp)); - ld(tmp2/*state's sp*/, prev_state_(_last_Java_sp)); - } else { - ShouldNotReachHere(); - } - - // Merge top frames. - std(tmp1, _abi(callers_sp), R1_SP); - - // Tmp2 is new SP. - // Tmp1 is parent's SP. - resize_frame_absolute(tmp2/*addr*/, tmp1/*tmp*/, tmp2/*tmp*/); - - // Update LR in top_frame. - // Must be interpreter frame. - get_PC_trash_LR(tmp3); - std(tmp3, _top_ijava_frame_abi(frame_manager_lr), R1_SP); - // Used for non-initial callers by unextended_sp(). - std(R1_SP, _top_ijava_frame_abi(initial_caller_sp), R1_SP); -} - -// Set SP to initial caller's sp, but before fix the back chain. -void InterpreterMacroAssembler::resize_frame_to_initial_caller(Register tmp1, Register tmp2) { - ld(tmp1, _parent_ijava_frame_abi(initial_caller_sp), R1_SP); - ld(tmp2, _parent_ijava_frame_abi(callers_sp), R1_SP); - std(tmp2, _parent_ijava_frame_abi(callers_sp), tmp1); // Fix back chain ... - mr(R1_SP, tmp1); // ... and resize to initial caller. -} - -// Pop the current interpreter state (without popping the correspoding -// frame) and restore R14_state and R15_prev_state accordingly. -// Use prev_state_may_be_0 to indicate whether prev_state may be 0 -// in order to generate an extra check before retrieving prev_state_(_prev_link). -void InterpreterMacroAssembler::pop_interpreter_state(bool prev_state_may_be_0) -{ - // Move prev_state to state and restore prev_state from state_(_prev_link). - Label prev_state_is_0; - mr(R14_state, R15_prev_state); - - // Don't retrieve /*state==*/prev_state_(_prev_link) - // if /*state==*/prev_state is 0. - if (prev_state_may_be_0) { - cmpdi(CCR0, R15_prev_state, 0); - beq(CCR0, prev_state_is_0); - } - - ld(R15_prev_state, /*state==*/prev_state_(_prev_link)); - bind(prev_state_is_0); -} - -void InterpreterMacroAssembler::restore_prev_state() { - // _prev_link is private, but cInterpreter is a friend. - ld(R15_prev_state, state_(_prev_link)); -} -#endif // CC_INTERP diff --git a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp index 9692e65225c..7fd60ead67d 100644 --- a/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp +++ b/hotspot/src/cpu/ppc/vm/interp_masm_ppc_64.hpp @@ -45,14 +45,6 @@ class InterpreterMacroAssembler: public MacroAssembler { #define thread_(field_name) in_bytes(JavaThread::field_name ## _offset()), R16_thread #define method_(field_name) in_bytes(Method::field_name ## _offset()), R19_method -#ifdef CC_INTERP -#define state_(field_name) in_bytes(byte_offset_of(BytecodeInterpreter, field_name)), R14_state -#define prev_state_(field_name) in_bytes(byte_offset_of(BytecodeInterpreter, field_name)), R15_prev_state - void pop (TosState state) {}; // Not needed. - void push(TosState state) {}; // Not needed. -#endif - -#ifndef CC_INTERP virtual void check_and_handle_popframe(Register java_thread); virtual void check_and_handle_earlyret(Register java_thread); @@ -207,7 +199,6 @@ class InterpreterMacroAssembler: public MacroAssembler { void record_static_call_in_profile(Register Rentry, Register Rtmp); void record_receiver_call_in_profile(Register Rklass, Register Rentry, Register Rtmp); -#endif // !CC_INTERP void get_method_counters(Register method, Register Rcounters, Label& skip); void increment_invocation_counter(Register iv_be_count, Register Rtmp1, Register Rtmp2_r0); @@ -216,8 +207,6 @@ class InterpreterMacroAssembler: public MacroAssembler { void lock_object (Register lock_reg, Register obj_reg); void unlock_object(Register lock_reg, bool check_for_exceptions = true); -#ifndef CC_INTERP - // Interpreter profiling operations void set_method_data_pointer_for_bcp(); void test_method_data_pointer(Label& zero_continue); @@ -260,14 +249,10 @@ class InterpreterMacroAssembler: public MacroAssembler { void profile_return_type(Register ret, Register tmp1, Register tmp2); void profile_parameters_type(Register tmp1, Register tmp2, Register tmp3, Register tmp4); -#endif // !CC_INTERP - // Debugging void verify_oop(Register reg, TosState state = atos); // only if +VerifyOops && state == atos -#ifndef CC_INTERP void verify_oop_or_return_address(Register reg, Register rtmp); // for astore void verify_FPU(int stack_depth, TosState state = ftos); -#endif // !CC_INTERP typedef enum { NotifyJVMTI, SkipNotifyJVMTI } NotifyMethodExitMode; @@ -275,33 +260,6 @@ class InterpreterMacroAssembler: public MacroAssembler { void notify_method_entry(); void notify_method_exit(bool is_native_method, TosState state, NotifyMethodExitMode mode, bool check_exceptions); - -#ifdef CC_INTERP - // Convert the current TOP_IJAVA_FRAME into a PARENT_IJAVA_FRAME - // (using parent_frame_resize) and push a new interpreter - // TOP_IJAVA_FRAME (using frame_size). - void push_interpreter_frame(Register top_frame_size, Register parent_frame_resize, - Register tmp1, Register tmp2, Register tmp3, Register tmp4, Register pc=noreg); - - // Pop the topmost TOP_IJAVA_FRAME and convert the previous - // PARENT_IJAVA_FRAME back into a TOP_IJAVA_FRAME. - void pop_interpreter_frame(Register tmp1, Register tmp2, Register tmp3, Register tmp4); - - // Turn state's interpreter frame into the current TOP_IJAVA_FRAME. - void pop_interpreter_frame_to_state(Register state, Register tmp1, Register tmp2, Register tmp3); - - // Set SP to initial caller's sp, but before fix the back chain. - void resize_frame_to_initial_caller(Register tmp1, Register tmp2); - - // Pop the current interpreter state (without popping the - // correspoding frame) and restore R14_state and R15_prev_state - // accordingly. Use prev_state_may_be_0 to indicate whether - // prev_state may be 0 in order to generate an extra check before - // retrieving prev_state_(_prev_link). - void pop_interpreter_state(bool prev_state_may_be_0); - - void restore_prev_state(); -#endif }; #endif // CPU_PPC_VM_INTERP_MASM_PPC_64_HPP diff --git a/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp index 280ebd5148b..b887d17828d 100644 --- a/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp @@ -457,17 +457,12 @@ address InterpreterGenerator::generate_abstract_entry(void) { // Reset JavaFrameAnchor from call_VM_leaf above. __ reset_last_Java_frame(); -#ifdef CC_INTERP - // Return to frame manager, it will handle the pending exception. - __ blr(); -#else // We don't know our caller, so jump to the general forward exception stub, // which will also pop our full frame off. Satisfy the interface of // SharedRuntime::generate_forward_exception() __ load_const_optimized(R11_scratch1, StubRoutines::forward_exception_entry(), R0); __ mtctr(R11_scratch1); __ bctr(); -#endif return entry; } @@ -518,7 +513,7 @@ address InterpreterGenerator::generate_Reference_get_entry(void) { // continue and the thread will safepoint at the next bytecode dispatch. // If the receiver is null then it is OK to jump to the slow path. - __ ld(R3_RET, Interpreter::stackElementSize, CC_INTERP_ONLY(R17_tos) NOT_CC_INTERP(R15_esp)); // get receiver + __ ld(R3_RET, Interpreter::stackElementSize, R15_esp); // get receiver // Check if receiver == NULL and go the slow path. __ cmpdi(CCR0, R3_RET, 0); diff --git a/hotspot/src/cpu/ppc/vm/interpreter_ppc.hpp b/hotspot/src/cpu/ppc/vm/interpreter_ppc.hpp index e42e66c6914..50dc2a2c567 100644 --- a/hotspot/src/cpu/ppc/vm/interpreter_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/interpreter_ppc.hpp @@ -39,12 +39,10 @@ return stackElementWords * i; } -#ifndef CC_INTERP // The offset in bytes to access a expression stack slot // relative to the esp pointer. static int expr_offset_in_bytes(int slot) { return stackElementSize * slot + wordSize; } -#endif #endif // CPU_PPC_VM_INTERPRETER_PPC_HPP diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp index 38cf28d094a..87b16e0e572 100644 --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp @@ -2822,12 +2822,8 @@ void MacroAssembler::set_top_ijava_frame_at_SP_as_last_Java_frame(Register sp, R // sp points to a TOP_IJAVA_FRAME, retrieve frame's PC via // TOP_IJAVA_FRAME_ABI. // FIXME: assert that we really have a TOP_IJAVA_FRAME here! -#ifdef CC_INTERP - ld(tmp1/*pc*/, _top_ijava_frame_abi(frame_manager_lr), sp); -#else address entry = pc(); load_const_optimized(tmp1, entry); -#endif set_last_Java_frame(/*sp=*/sp, /*pc=*/tmp1); } diff --git a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp index fed5e53c206..168aacb6326 100644 --- a/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/methodHandles_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2014 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,12 +32,6 @@ #define __ _masm-> -#ifdef CC_INTERP -#define EXCEPTION_ENTRY StubRoutines::throw_NullPointerException_at_call_entry() -#else -#define EXCEPTION_ENTRY Interpreter::throw_NullPointerException_entry() -#endif - #ifdef PRODUCT #define BLOCK_COMMENT(str) // nothing #else @@ -51,10 +45,12 @@ inline static RegisterOrConstant constant(int value) { return RegisterOrConstant(value); } -void MethodHandles::load_klass_from_Class(MacroAssembler* _masm, Register klass_reg, Register temp_reg, Register temp2_reg) { - if (VerifyMethodHandles) - verify_klass(_masm, klass_reg, SystemDictionary::WK_KLASS_ENUM_NAME(java_lang_Class), temp_reg, temp2_reg, - "MH argument is a Class"); +void MethodHandles::load_klass_from_Class(MacroAssembler* _masm, Register klass_reg, + Register temp_reg, Register temp2_reg) { + if (VerifyMethodHandles) { + verify_klass(_masm, klass_reg, SystemDictionary::WK_KLASS_ENUM_NAME(java_lang_Class), + temp_reg, temp2_reg, "MH argument is a Class"); + } __ ld(klass_reg, java_lang_Class::klass_offset_in_bytes(), klass_reg); } @@ -187,7 +183,7 @@ void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm, sizeof(u2), /*is_signed*/ false); // assert(sizeof(u2) == sizeof(ConstMethod::_size_of_parameters), ""); Label L; - __ ld(temp2, __ argument_offset(temp2, temp2, 0), CC_INTERP_ONLY(R17_tos) NOT_CC_INTERP(R15_esp)); + __ ld(temp2, __ argument_offset(temp2, temp2, 0), R15_esp); __ cmpd(CCR1, temp2, recv); __ beq(CCR1, L); __ stop("receiver not on stack"); @@ -214,7 +210,7 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler* return NULL; } - Register argbase = CC_INTERP_ONLY(R17_tos) NOT_CC_INTERP(R15_esp); // parameter (preserved) + Register argbase = R15_esp; // parameter (preserved) Register argslot = R3; Register temp1 = R6; Register param_size = R7; @@ -317,10 +313,12 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm, __ verify_oop(receiver_reg); if (iid == vmIntrinsics::_linkToSpecial) { // Don't actually load the klass; just null-check the receiver. - __ null_check_throw(receiver_reg, -1, temp1, EXCEPTION_ENTRY); + __ null_check_throw(receiver_reg, -1, temp1, + Interpreter::throw_NullPointerException_entry()); } else { // load receiver klass itself - __ null_check_throw(receiver_reg, oopDesc::klass_offset_in_bytes(), temp1, EXCEPTION_ENTRY); + __ null_check_throw(receiver_reg, oopDesc::klass_offset_in_bytes(), temp1, + Interpreter::throw_NullPointerException_entry()); __ load_klass(temp1_recv_klass, receiver_reg); __ verify_klass_ptr(temp1_recv_klass); } diff --git a/hotspot/src/cpu/ppc/vm/register_ppc.hpp b/hotspot/src/cpu/ppc/vm/register_ppc.hpp index 9dc765ab4a2..d97d3aea93b 100644 --- a/hotspot/src/cpu/ppc/vm/register_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/register_ppc.hpp @@ -578,27 +578,17 @@ REGISTER_DECLARATION(FloatRegister, F13_ARG13, F13); // volatile // Register declarations to be used in frame manager assembly code. // Use only non-volatile registers in order to keep values across C-calls. -#ifdef CC_INTERP -REGISTER_DECLARATION(Register, R14_state, R14); // address of new cInterpreter. -REGISTER_DECLARATION(Register, R15_prev_state, R15); // address of old cInterpreter -#else // CC_INTERP REGISTER_DECLARATION(Register, R14_bcp, R14); REGISTER_DECLARATION(Register, R15_esp, R15); REGISTER_DECLARATION(FloatRegister, F15_ftos, F15); -#endif // CC_INTERP REGISTER_DECLARATION(Register, R16_thread, R16); // address of current thread REGISTER_DECLARATION(Register, R17_tos, R17); // address of Java tos (prepushed). REGISTER_DECLARATION(Register, R18_locals, R18); // address of first param slot (receiver). REGISTER_DECLARATION(Register, R19_method, R19); // address of current method #ifndef DONT_USE_REGISTER_DEFINES -#ifdef CC_INTERP -#define R14_state AS_REGISTER(Register, R14) -#define R15_prev_state AS_REGISTER(Register, R15) -#else // CC_INTERP #define R14_bcp AS_REGISTER(Register, R14) #define R15_esp AS_REGISTER(Register, R15) #define F15_ftos AS_REGISTER(FloatRegister, F15) -#endif // CC_INTERP #define R16_thread AS_REGISTER(Register, R16) #define R17_tos AS_REGISTER(Register, R17) #define R18_locals AS_REGISTER(Register, R18) @@ -619,13 +609,11 @@ REGISTER_DECLARATION(Register, R26_tmp6, R26); REGISTER_DECLARATION(Register, R27_tmp7, R27); REGISTER_DECLARATION(Register, R28_tmp8, R28); REGISTER_DECLARATION(Register, R29_tmp9, R29); -#ifndef CC_INTERP REGISTER_DECLARATION(Register, R24_dispatch_addr, R24); REGISTER_DECLARATION(Register, R25_templateTableBase, R25); REGISTER_DECLARATION(Register, R26_monitor, R26); REGISTER_DECLARATION(Register, R27_constPoolCache, R27); REGISTER_DECLARATION(Register, R28_mdx, R28); -#endif // CC_INTERP #ifndef DONT_USE_REGISTER_DEFINES #define R21_tmp1 AS_REGISTER(Register, R21) @@ -637,7 +625,6 @@ REGISTER_DECLARATION(Register, R28_mdx, R28); #define R27_tmp7 AS_REGISTER(Register, R27) #define R28_tmp8 AS_REGISTER(Register, R28) #define R29_tmp9 AS_REGISTER(Register, R29) -#ifndef CC_INTERP // Lmonitors : monitor pointer // LcpoolCache: constant pool cache // mdx: method data index @@ -649,7 +636,6 @@ REGISTER_DECLARATION(Register, R28_mdx, R28); #endif #define CCR4_is_synced AS_REGISTER(ConditionRegister, CCR4) -#endif // Scratch registers are volatile. REGISTER_DECLARATION(Register, R11_scratch1, R11); diff --git a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp index 141891d0a16..098e1ba4da0 100644 --- a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. + * Copyright (c) 2012, 2015 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -954,15 +954,10 @@ static address gen_c2i_adapter(MacroAssembler *masm, // Jump to the interpreter just as if interpreter was doing it. -#ifdef CC_INTERP - const Register tos = R17_tos; -#else - const Register tos = R15_esp; __ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R11_scratch1); -#endif // load TOS - __ addi(tos, R1_SP, st_off); + __ addi(R15_esp, R1_SP, st_off); // Frame_manager expects initial_caller_sp (= SP without resize by c2i) in R21_tmp1. assert(sender_SP == R21_sender_SP, "passing initial caller's SP in wrong register"); @@ -996,12 +991,7 @@ void SharedRuntime::gen_i2c_adapter(MacroAssembler *masm, // save code can segv when fxsave instructions find improperly // aligned stack pointer. -#ifdef CC_INTERP - const Register ld_ptr = R17_tos; -#else const Register ld_ptr = R15_esp; -#endif - const Register value_regs[] = { R22_tmp2, R23_tmp3, R24_tmp4, R25_tmp5, R26_tmp6 }; const int num_value_regs = sizeof(value_regs) / sizeof(Register); int value_regs_index = 0; @@ -2593,15 +2583,11 @@ static void push_skeleton_frame(MacroAssembler* masm, bool deopt, __ ld(frame_size_reg, 0, frame_sizes_reg); __ std(pc_reg, _abi(lr), R1_SP); __ push_frame(frame_size_reg, R0/*tmp*/); -#ifdef CC_INTERP - __ std(R1_SP, _parent_ijava_frame_abi(initial_caller_sp), R1_SP); -#else #ifdef ASSERT __ load_const_optimized(pc_reg, 0x5afe); __ std(pc_reg, _ijava_state_neg(ijava_reserved), R1_SP); #endif __ std(R1_SP, _ijava_state_neg(sender_sp), R1_SP); -#endif // CC_INTERP __ addi(number_of_frames_reg, number_of_frames_reg, -1); __ addi(frame_sizes_reg, frame_sizes_reg, wordSize); __ addi(pcs_reg, pcs_reg, wordSize); @@ -2673,15 +2659,11 @@ static void push_skeleton_frames(MacroAssembler* masm, bool deopt, __ std(R12_scratch2, _abi(lr), R1_SP); // Initialize initial_caller_sp. -#ifdef CC_INTERP - __ std(frame_size_reg/*old_sp*/, _parent_ijava_frame_abi(initial_caller_sp), R1_SP); -#else #ifdef ASSERT __ load_const_optimized(pc_reg, 0x5afe); __ std(pc_reg, _ijava_state_neg(ijava_reserved), R1_SP); #endif __ std(frame_size_reg, _ijava_state_neg(sender_sp), R1_SP); -#endif // CC_INTERP #ifdef ASSERT // Make sure that there is at least one entry in the array. @@ -2708,9 +2690,6 @@ static void push_skeleton_frames(MacroAssembler* masm, bool deopt, // Store it in the top interpreter frame. __ std(R0, _abi(lr), R1_SP); // Initialize frame_manager_lr of interpreter top frame. -#ifdef CC_INTERP - __ std(R0, _top_ijava_frame_abi(frame_manager_lr), R1_SP); -#endif } #endif @@ -2899,16 +2878,8 @@ void SharedRuntime::generate_deopt_blob() { // optional c2i, caller of deoptee, ...). // Initialize R14_state. -#ifdef CC_INTERP - __ ld(R14_state, 0, R1_SP); - __ addi(R14_state, R14_state, -frame::interpreter_frame_cinterpreterstate_size_in_bytes()); - // Also inititialize R15_prev_state. - __ restore_prev_state(); -#else __ restore_interpreter_state(R11_scratch1); __ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R11_scratch1); -#endif // CC_INTERP - // Return to the interpreter entry point. __ blr(); @@ -3034,16 +3005,8 @@ void SharedRuntime::generate_uncommon_trap_blob() { // stack: (top interpreter frame, ..., optional interpreter frame, // optional c2i, caller of deoptee, ...). -#ifdef CC_INTERP - // Initialize R14_state, ... - __ ld(R11_scratch1, 0, R1_SP); - __ addi(R14_state, R11_scratch1, -frame::interpreter_frame_cinterpreterstate_size_in_bytes()); - // also initialize R15_prev_state. - __ restore_prev_state(); -#else __ restore_interpreter_state(R11_scratch1); __ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R11_scratch1); -#endif // CC_INTERP // Return to the interpreter entry point. __ blr(); diff --git a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp index 1dbb5c04f29..1a4493d96a0 100644 --- a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp @@ -225,11 +225,8 @@ class StubGenerator: public StubCodeGenerator { // R16_thread - JavaThread* // Tos must point to last argument - element_size. -#ifdef CC_INTERP - const Register tos = R17_tos; -#else const Register tos = R15_esp; -#endif + __ addi(tos, r_top_of_arguments_addr, -Interpreter::stackElementSize); // initialize call_stub locals (step 2) @@ -243,11 +240,7 @@ class StubGenerator: public StubCodeGenerator { assert(tos != r_arg_thread && R19_method != r_arg_thread, "trashed r_arg_thread"); // Set R15_prev_state to 0 for simplifying checks in callee. -#ifdef CC_INTERP - __ li(R15_prev_state, 0); -#else __ load_const_optimized(R25_templateTableBase, (address)Interpreter::dispatch_table((TosState)0), R11_scratch1); -#endif // Stack on entry to frame manager / native entry: // // F0 [TOP_IJAVA_FRAME_ABI] diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp index 1d99393562f..321a9c0e86d 100644 --- a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp @@ -24,7 +24,6 @@ */ #include "precompiled.hpp" -#ifndef CC_INTERP #include "asm/macroAssembler.inline.hpp" #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/interpreter.hpp" @@ -1799,4 +1798,3 @@ void TemplateInterpreterGenerator::stop_interpreter_at() { } #endif // !PRODUCT -#endif // !CC_INTERP diff --git a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp index 0660726181c..0bb08012e21 100644 --- a/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp +++ b/hotspot/src/cpu/ppc/vm/templateTable_ppc_64.cpp @@ -39,8 +39,6 @@ #include "runtime/synchronizer.hpp" #include "utilities/macros.hpp" -#ifndef CC_INTERP - #undef __ #define __ _masm-> @@ -4145,4 +4143,3 @@ void TemplateTable::wide() { __ bctr(); // Note: the bcp increment step is part of the individual wide bytecode implementations. } -#endif // !CC_INTERP From f238510a5ab86aca761cc4d2f0e039d6271f5f45 Mon Sep 17 00:00:00 2001 From: Kirill Zhaldybin Date: Thu, 10 Dec 2015 20:14:00 +0300 Subject: [PATCH 024/146] 8143933: Create testlibrary for auxiliary methods used in g1/humongousObjects testing Reviewed-by: iignatyev, dfazunen --- .../test/gc/g1/humongousObjects/Helpers.java | 58 ---- .../TestHumongousThreshold.java | 5 +- hotspot/test/gc/testlibrary/Helpers.java | 251 ++++++++++++++++++ 3 files changed, 254 insertions(+), 60 deletions(-) delete mode 100644 hotspot/test/gc/g1/humongousObjects/Helpers.java create mode 100644 hotspot/test/gc/testlibrary/Helpers.java diff --git a/hotspot/test/gc/g1/humongousObjects/Helpers.java b/hotspot/test/gc/g1/humongousObjects/Helpers.java deleted file mode 100644 index 9028fb6bdee..00000000000 --- a/hotspot/test/gc/g1/humongousObjects/Helpers.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -package gc.g1.humongousObjects; - -import sun.hotspot.WhiteBox; - -public class Helpers { - - // In case of 128 byte padding - private static final int MAX_PADDING_SIZE = 128; - - /** - * Detects amount of extra bytes required to allocate a byte array. - * Allocating a byte[n] array takes more then just n bytes in the heap. - * Extra bytes are required to store object reference and the length. - * This amount depends on bitness and other factors. - * - * @return byte[] memory overhead - */ - public static int detectByteArrayAllocationOverhead() { - - WhiteBox whiteBox = WhiteBox.getWhiteBox(); - - int zeroLengthByteArraySize = (int) whiteBox.getObjectSize(new byte[0]); - - // Since we do not know is there any padding in zeroLengthByteArraySize we cannot just take byte[0] size as overhead - for (int i = 1; i < MAX_PADDING_SIZE + 1; ++i) { - int realAllocationSize = (int) whiteBox.getObjectSize(new byte[i]); - if (realAllocationSize != zeroLengthByteArraySize) { - // It means we did not have any padding on previous step - return zeroLengthByteArraySize - (i - 1); - } - } - throw new Error("We cannot find byte[] memory overhead - should not reach here"); - } -} diff --git a/hotspot/test/gc/g1/humongousObjects/TestHumongousThreshold.java b/hotspot/test/gc/g1/humongousObjects/TestHumongousThreshold.java index f372459987c..a9a83728195 100644 --- a/hotspot/test/gc/g1/humongousObjects/TestHumongousThreshold.java +++ b/hotspot/test/gc/g1/humongousObjects/TestHumongousThreshold.java @@ -24,6 +24,7 @@ package gc.g1.humongousObjects; +import gc.testlibrary.Helpers; import jdk.test.lib.Asserts; import sun.hotspot.WhiteBox; @@ -31,10 +32,10 @@ import sun.hotspot.WhiteBox; * @test TestHumongousThreshold * @summary Checks that objects larger than half a region are allocated as humongous * @requires vm.gc=="G1" | vm.gc=="null" - * @library /testlibrary /test/lib + * @library /testlibrary /test/lib / * @modules java.management * @build sun.hotspot.WhiteBox - * gc.g1.humongousObjects.Helpers + * gc.testlibrary.Helpers * gc.g1.humongousObjects.TestHumongousThreshold * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/gc/testlibrary/Helpers.java b/hotspot/test/gc/testlibrary/Helpers.java new file mode 100644 index 00000000000..aa20031cd10 --- /dev/null +++ b/hotspot/test/gc/testlibrary/Helpers.java @@ -0,0 +1,251 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +package gc.testlibrary; + +import jdk.test.lib.JDKToolLauncher; +import jdk.test.lib.OutputAnalyzer; +import sun.hotspot.WhiteBox; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + +public class Helpers { + + /** + * Size of a long field in bytes + */ + public static final int SIZE_OF_LONG = 8; + + // In case of 128 byte padding + private static final int MAX_PADDING_SIZE = 128; + + /** + * According class file format theoretical amount of fields in class is u2 which is (256 * 256 - 1). + * Some service info takes place in constant pool and we really could make a class with only (256 * 256 - 29) + * fields. + * Since the exact value is not so important and I would like to avoid issues that may be caused by future changes/ + * different archs etc I selected (256 * 256 - 32) for this constant. + * The test works with other values too but the smaller the number the more classes we need to generate and it takes + * more time + */ + private static final int MAXIMUM_AMOUNT_OF_FIELDS_IN_CLASS = 256 * 256 - 32; + + /** + * Detects amount of extra bytes required to allocate a byte array. + * Allocating a byte[n] array takes more then just n bytes in the heap. + * Extra bytes are required to store object reference and the length. + * This amount depends on bitness and other factors. + * + * @return byte[] memory overhead + */ + public static int detectByteArrayAllocationOverhead() { + + WhiteBox whiteBox = WhiteBox.getWhiteBox(); + + int zeroLengthByteArraySize = (int) whiteBox.getObjectSize(new byte[0]); + + // Since we do not know is there any padding in zeroLengthByteArraySize we cannot just take byte[0] size as overhead + for (int i = 1; i < MAX_PADDING_SIZE + 1; ++i) { + int realAllocationSize = (int) whiteBox.getObjectSize(new byte[i]); + if (realAllocationSize != zeroLengthByteArraySize) { + // It means we did not have any padding on previous step + return zeroLengthByteArraySize - (i - 1); + } + } + throw new Error("We cannot find byte[] memory overhead - should not reach here"); + } + + /** + * Compiles a java class + * + * @param className class name + * @param root root directory - where .java and .class files will be put + * @param source class source + * @throws IOException if cannot write file to specified directory + */ + public static void compileClass(String className, Path root, String source) throws IOException { + Path sourceFile = root.resolve(className + ".java"); + Files.write(sourceFile, source.getBytes()); + + JDKToolLauncher jar = JDKToolLauncher.create("javac") + .addToolArg("-d") + .addToolArg(root.toAbsolutePath().toString()) + .addToolArg("-cp") + .addToolArg(System.getProperty("java.class.path") + File.pathSeparator + root.toAbsolutePath()) + .addToolArg(sourceFile.toAbsolutePath().toString()); + + ProcessBuilder pb = new ProcessBuilder(jar.getCommand()); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldHaveExitValue(0); + } + + /** + * Generates class with specified name, which extends specified class, with specified constructor and specified + * count of long fields + * Generated class will looks like this: + * public class ClassName extends SuperClass { + * ClassName() {super();} + * long f0; + * ... + * long fNNN; + *

+ * } + * + * @param className class name + * @param superClass super class. if null - no extends clause + * @param constructor constructor. if null - no constructor + * @param fieldCount count of long fields + * @return class text + */ + public static String generate(String className, String superClass, String constructor, long fieldCount) { + + StringBuilder builder = new StringBuilder(); + builder.append(String.format("public class %s%s {\n", className, superClass == null ? "" + : " extends " + superClass)); + + if (constructor != null) { + builder.append(constructor); + } + + for (int i = 0; i < fieldCount; ++i) { + builder.append(String.format("long f%d;\n", i)); + } + + builder.append("}\n"); + return builder.toString(); + } + + /** + * Changes string from enum notation to class notation - i.e. "VERY_SMALL_CAT" to "VerySmallCat" + * + * @param enumName string in enum notation + * @return string in class notation + */ + public static String enumNameToClassName(String enumName) { + if (enumName == null) { + return null; + } + + StringBuilder builder = new StringBuilder(); + boolean toLowerCase = false; + for (int i = 0; i < enumName.length(); ++i) { + if (enumName.charAt(i) == '_') { + toLowerCase = false; + } else { + builder.append(toLowerCase ? String.valueOf(enumName.charAt(i)).toLowerCase() : + String.valueOf(enumName.charAt(i))); + toLowerCase = true; + } + + } + return builder.toString(); + } + + /** + * Generates and compiles class with instance of specified size and load it in specified class loader + * Generated class will looks like this: + * public class ClassName extends SuperClass { + * long f0; + * ... + * long fNNN; + *

+ * } + * + * @param classLoader class loader + * @param className generated class name + * @param instanceSize size of generated class' instance. Size should be aligned by 8 bytes + * @param workDir working dir where generated classes are put and compiled + * @param prefix prefix for service classes (ones we use to create chain of inheritance). + * The names will be prefix_1, prefix_2,.., prefix_n + * @return Class object of generated and compiled class loaded in specified class loader + * @throws IOException + * @throws ClassNotFoundException + */ + public static Class generateCompileAndLoad(ClassLoader classLoader, String className, long instanceSize, + Path workDir, String prefix) + throws IOException, ClassNotFoundException { + + if (instanceSize % SIZE_OF_LONG != 0L) { + throw new Error(String.format("Test bug: only sizes aligned by 8 bytes are supported and %d was specified", + instanceSize)); + } + + long instanceSizeWithoutObjectHeader = instanceSize - WhiteBox.getWhiteBox().getObjectSize(new Object()); + + int generatedClassesCount; + int fieldsInLastClassCount; + + int sizeOfLastFile = (int) (instanceSizeWithoutObjectHeader + % (MAXIMUM_AMOUNT_OF_FIELDS_IN_CLASS * SIZE_OF_LONG)); + + if (sizeOfLastFile != 0) { + generatedClassesCount = (int) instanceSizeWithoutObjectHeader + / (MAXIMUM_AMOUNT_OF_FIELDS_IN_CLASS * SIZE_OF_LONG) + 1; + fieldsInLastClassCount = sizeOfLastFile / SIZE_OF_LONG; + } else { + generatedClassesCount = (int) instanceSizeWithoutObjectHeader + / (MAXIMUM_AMOUNT_OF_FIELDS_IN_CLASS * SIZE_OF_LONG); + fieldsInLastClassCount = MAXIMUM_AMOUNT_OF_FIELDS_IN_CLASS; + } + + for (int i = 0; i < generatedClassesCount; i++) { + // for the last generated class we use specified class name + String clsName = (i == generatedClassesCount - 1) ? className : prefix + i; + + Helpers.compileClass(clsName, workDir, + Helpers.generate( + clsName, + // for first generated class we don't have 'extends' + (i == 0 ? null : prefix + (i - 1)), + null, + // for the last generated class we use different field count + (i == generatedClassesCount - 1) ? fieldsInLastClassCount + : MAXIMUM_AMOUNT_OF_FIELDS_IN_CLASS)); + } + return classLoader.loadClass(className); + } + + /** + * Waits until Concurent Mark Cycle finishes + * @param wb Whitebox instance + * @param sleepTime sleep time + */ + public static void waitTillCMCFinished(WhiteBox wb, int sleepTime) { + while (wb.g1InConcurrentMark()) { + if (sleepTime > -1) { + try { + Thread.sleep(sleepTime); + } catch (InterruptedException e) { + System.out.println("Got InterruptedException while waiting for ConcMarkCycle to finish"); + Thread.currentThread().interrupt(); + break; + } + } + } + } + +} From a74243c3020290837578ee9ff94cbc615c50fc17 Mon Sep 17 00:00:00 2001 From: Rachel Protacio Date: Fri, 11 Dec 2015 14:58:20 -0500 Subject: [PATCH 025/146] 8145153: Convert TraceMonitorInflation to Unified Logging Updated -XX:+TraceMonitorInflation flag to -Xlog:monitorinflation=debug, with an alias (and related alias table) to support the old option. Reviewed-by: dholmes, mockner, coleenp --- hotspot/src/share/vm/logging/logTag.hpp | 1 + hotspot/src/share/vm/runtime/arguments.cpp | 32 ++++++++- hotspot/src/share/vm/runtime/arguments.hpp | 1 + hotspot/src/share/vm/runtime/globals.hpp | 3 - hotspot/src/share/vm/runtime/synchronizer.cpp | 25 ++++--- .../runtime/logging/MonitorInflationTest.java | 68 +++++++++++++++++++ 6 files changed, 115 insertions(+), 15 deletions(-) create mode 100644 hotspot/test/runtime/logging/MonitorInflationTest.java diff --git a/hotspot/src/share/vm/logging/logTag.hpp b/hotspot/src/share/vm/logging/logTag.hpp index de21a9e6f11..7927c7f2a6c 100644 --- a/hotspot/src/share/vm/logging/logTag.hpp +++ b/hotspot/src/share/vm/logging/logTag.hpp @@ -55,6 +55,7 @@ LOG_TAG(logging) \ LOG_TAG(marking) \ LOG_TAG(metaspace) \ + LOG_TAG(monitorinflation) \ LOG_TAG(phases) \ LOG_TAG(plab) \ LOG_TAG(promotion) \ diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index 285e9e228e7..fe8dbf1b183 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -399,6 +399,12 @@ static AliasedFlag const aliased_jvm_flags[] = { { NULL, NULL} }; +static AliasedFlag const aliased_jvm_logging_flags[] = { + { "-XX:+TraceMonitorInflation", "-Xlog:monitorinflation=debug" }, + { "-XX:-TraceMonitorInflation", "-Xlog:monitorinflation=off" }, + { NULL, NULL } +}; + // Return true if "v" is less than "other", where "other" may be "undefined". static bool version_less_than(JDK_Version v, JDK_Version other) { assert(!v.is_undefined(), "must be defined"); @@ -929,6 +935,20 @@ const char* Arguments::handle_aliases_and_deprecation(const char* arg, bool warn return NULL; } +// lookup_logging_aliases +// Called from parse_each_vm_init_arg(). Should be called on -XX options before specific cases are checked. +// If arg matches any aliased_jvm_logging_flags entry, look up the real name and copy it into buffer. +bool Arguments::lookup_logging_aliases(const char* arg, char* buffer) { + for (size_t i = 0; aliased_jvm_logging_flags[i].alias_name != NULL; i++) { + const AliasedFlag& flag_status = aliased_jvm_logging_flags[i]; + if (strcmp(flag_status.alias_name, arg) == 0) { + strcpy(buffer, flag_status.real_name); + return true; + } + } + return false; +} + bool Arguments::parse_argument(const char* arg, Flag::Flags origin) { // range of acceptable characters spelled out for portability reasons @@ -2605,7 +2625,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, for (int index = 0; index < args->nOptions; index++) { bool is_absolute_path = false; // for -agentpath vs -agentlib - const JavaVMOption* option = args->options + index; + JavaVMOption* option = args->options + index; if (!match_option(option, "-Djava.class.path", &tail) && !match_option(option, "-Dsun.java.command", &tail) && @@ -2619,6 +2639,16 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, build_jvm_args(option->optionString); } + // char buffer to store looked up logging option. + char aliased_logging_option[256]; + + // Catch -XX options which are aliased to Unified logging commands. + if (match_option(option, "-XX:", &tail)) { + if (lookup_logging_aliases(option->optionString, aliased_logging_option)) { + option->optionString = aliased_logging_option; + } + } + // -verbose:[class/gc/jni] if (match_option(option, "-verbose", &tail)) { if (!strcmp(tail, ":class") || !strcmp(tail, "")) { diff --git a/hotspot/src/share/vm/runtime/arguments.hpp b/hotspot/src/share/vm/runtime/arguments.hpp index fc07f0f9c0e..8ad75aa506a 100644 --- a/hotspot/src/share/vm/runtime/arguments.hpp +++ b/hotspot/src/share/vm/runtime/arguments.hpp @@ -445,6 +445,7 @@ class Arguments : AllStatic { // Return the "real" name for option arg if arg is an alias, and print a warning if arg is deprecated. // Return NULL if the arg has expired. static const char* handle_aliases_and_deprecation(const char* arg, bool warn); + static bool lookup_logging_aliases(const char* arg, char* buffer); static short CompileOnlyClassesNum; static short CompileOnlyClassesMax; diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index 18625166245..6292486d48e 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -1506,9 +1506,6 @@ public: product(bool, TraceBiasedLocking, false, \ "Trace biased locking in JVM") \ \ - product(bool, TraceMonitorInflation, false, \ - "Trace monitor inflation in JVM") \ - \ /* gc */ \ \ product(bool, UseSerialGC, false, \ diff --git a/hotspot/src/share/vm/runtime/synchronizer.cpp b/hotspot/src/share/vm/runtime/synchronizer.cpp index 7046016299f..f74f78a98ef 100644 --- a/hotspot/src/share/vm/runtime/synchronizer.cpp +++ b/hotspot/src/share/vm/runtime/synchronizer.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "classfile/vmSymbols.hpp" +#include "logging/log.hpp" #include "memory/metaspaceShared.hpp" #include "memory/padded.hpp" #include "memory/resourceArea.hpp" @@ -1414,12 +1415,12 @@ ObjectMonitor * NOINLINE ObjectSynchronizer::inflate(Thread * Self, // to avoid false sharing on MP systems ... OM_PERFDATA_OP(Inflations, inc()); TEVENT(Inflate: overwrite stacklock); - if (TraceMonitorInflation) { + if (log_is_enabled(Debug, monitorinflation)) { if (object->is_instance()) { ResourceMark rm; - tty->print_cr("Inflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s", - p2i(object), p2i(object->mark()), - object->klass()->external_name()); + log_debug(monitorinflation)("Inflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s", + p2i(object), p2i(object->mark()), + object->klass()->external_name()); } } return m; @@ -1462,12 +1463,12 @@ ObjectMonitor * NOINLINE ObjectSynchronizer::inflate(Thread * Self, // cache lines to avoid false sharing on MP systems ... OM_PERFDATA_OP(Inflations, inc()); TEVENT(Inflate: overwrite neutral); - if (TraceMonitorInflation) { + if (log_is_enabled(Debug, monitorinflation)) { if (object->is_instance()) { ResourceMark rm; - tty->print_cr("Inflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s", - p2i(object), p2i(object->mark()), - object->klass()->external_name()); + log_debug(monitorinflation)("Inflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s", + p2i(object), p2i(object->mark()), + object->klass()->external_name()); } } return m; @@ -1526,11 +1527,13 @@ bool ObjectSynchronizer::deflate_monitor(ObjectMonitor* mid, oop obj, // It's idle - scavenge and return to the global free list // plain old deflation ... TEVENT(deflate_idle_monitors - scavenge1); - if (TraceMonitorInflation) { + if (log_is_enabled(Debug, monitorinflation)) { if (obj->is_instance()) { ResourceMark rm; - tty->print_cr("Deflating object " INTPTR_FORMAT " , mark " INTPTR_FORMAT " , type %s", - p2i(obj), p2i(obj->mark()), obj->klass()->external_name()); + log_debug(monitorinflation)("Deflating object " INTPTR_FORMAT " , " + "mark " INTPTR_FORMAT " , type %s", + p2i(obj), p2i(obj->mark()), + obj->klass()->external_name()); } } diff --git a/hotspot/test/runtime/logging/MonitorInflationTest.java b/hotspot/test/runtime/logging/MonitorInflationTest.java new file mode 100644 index 00000000000..3799a016664 --- /dev/null +++ b/hotspot/test/runtime/logging/MonitorInflationTest.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8133885 + * @summary monitorinflation=debug should have logging from each of the statements in the code + * @library /testlibrary + * @modules java.base/sun.misc + * java.management + * @build MonitorInflationTest + * @run driver MonitorInflationTest + */ + +import jdk.test.lib.*; + +public class MonitorInflationTest { + static void analyzeOutputOn(ProcessBuilder pb) throws Exception { + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("Inflating object"); + output.shouldContain("Deflating object "); + output.shouldHaveExitValue(0); + } + + static void analyzeOutputOff(ProcessBuilder pb) throws Exception { + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldNotContain("[monitorinflation]"); + output.shouldHaveExitValue(0); + } + + public static void main(String[] args) throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-Xlog:monitorinflation=debug", "-version"); + analyzeOutputOn(pb); + + pb = ProcessTools.createJavaProcessBuilder( + "-XX:+TraceMonitorInflation", "-version"); + analyzeOutputOn(pb); + + pb = ProcessTools.createJavaProcessBuilder( + "-Xlog:monitorinflation=off", "-version"); + analyzeOutputOff(pb); + + pb = ProcessTools.createJavaProcessBuilder( + "-XX:-TraceMonitorInflation", "-version"); + analyzeOutputOff(pb); + } +} From 26af4d84c3ac794ef243633992405206b2eda495 Mon Sep 17 00:00:00 2001 From: Joseph Provino Date: Mon, 14 Dec 2015 17:06:06 -0500 Subject: [PATCH 026/146] 8139768: Running with -XX:CMSOldPLABNumRefills=2147483648 causes EXCEPTION_INT_DIVIDE_BY_ZERO on Windows i586 Use double arithmetic to avoid integer overflow Reviewed-by: jwilhelm, tbenson --- hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp b/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp index 933186d34fe..192fdab8e53 100644 --- a/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp +++ b/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp @@ -2517,7 +2517,11 @@ void CFLS_LAB::get_from_global_pool(size_t word_sz, AdaptiveFreeList* // Lacking sufficient experience, CMSOldPLABResizeQuicker is disabled by // default. if (ResizeOldPLAB && CMSOldPLABResizeQuicker) { - size_t multiple = _num_blocks[word_sz]/(CMSOldPLABToleranceFactor*CMSOldPLABNumRefills*n_blks); + // + // On a 32-bit VM, the denominator can become zero because of integer overflow, + // which is why there is a cast to double. + // + size_t multiple = (size_t) (_num_blocks[word_sz]/(((double)CMSOldPLABToleranceFactor)*CMSOldPLABNumRefills*n_blks)); n_blks += CMSOldPLABReactivityFactor*multiple*n_blks; n_blks = MIN2(n_blks, CMSOldPLABMax); } From 9c775566e5dbc1248fb02cd4b3cdf1b45baf9b93 Mon Sep 17 00:00:00 2001 From: Ioi Lam Date: Mon, 7 Dec 2015 09:19:26 -0800 Subject: [PATCH 027/146] 8144853: Print the names of callees in PrintAssembly/PrintInterpreter Reviewed-by: dholmes, vlivanov --- hotspot/src/share/vm/code/nmethod.cpp | 12 ++++++++++++ hotspot/src/share/vm/compiler/disassembler.cpp | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp index 60a864b38e0..5ff6520581b 100644 --- a/hotspot/src/share/vm/code/nmethod.cpp +++ b/hotspot/src/share/vm/code/nmethod.cpp @@ -41,6 +41,7 @@ #include "prims/jvmtiImpl.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/orderAccess.inline.hpp" +#include "runtime/os.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/sweeper.hpp" #include "utilities/resourceHash.hpp" @@ -3050,6 +3051,17 @@ const char* nmethod::reloc_string_for(u_char* begin, u_char* end) { CodeBlob* cb = CodeCache::find_blob(dest); if (cb != NULL) { st.print(" %s", cb->name()); + } else { + ResourceMark rm; + const int buflen = 1024; + char* buf = NEW_RESOURCE_ARRAY(char, buflen); + int offset; + if (os::dll_address_to_function_name(dest, buf, buflen, &offset)) { + st.print(" %s", buf); + if (offset != 0) { + st.print("+%d", offset); + } + } } return st.as_string(); } diff --git a/hotspot/src/share/vm/compiler/disassembler.cpp b/hotspot/src/share/vm/compiler/disassembler.cpp index 1ac15590cd0..4b15e7c6301 100644 --- a/hotspot/src/share/vm/compiler/disassembler.cpp +++ b/hotspot/src/share/vm/compiler/disassembler.cpp @@ -360,6 +360,22 @@ void decode_env::print_address(address adr) { } } + if (_nm == NULL) { + // Don't do this for native methods, as the function name will be printed in + // nmethod::reloc_string_for(). + ResourceMark rm; + const int buflen = 1024; + char* buf = NEW_RESOURCE_ARRAY(char, buflen); + int offset; + if (os::dll_address_to_function_name(adr, buf, buflen, &offset)) { + st->print(PTR_FORMAT " = %s", p2i(adr), buf); + if (offset != 0) { + st->print("+%d", offset); + } + return; + } + } + // Fall through to a simple (hexadecimal) numeral. st->print(PTR_FORMAT, p2i(adr)); } From 08a2e337c77be8952093613528751a9b905a898a Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Sun, 13 Dec 2015 22:51:13 +0100 Subject: [PATCH 028/146] 8145270: Need to eagerly initialize JVMCI compiler under -Xcomp Reviewed-by: twisti --- hotspot/src/share/vm/compiler/compileBroker.cpp | 14 +++++++++++++- hotspot/src/share/vm/compiler/compileBroker.hpp | 2 +- hotspot/src/share/vm/runtime/thread.cpp | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp index e5eac46910c..9881a31435e 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.cpp +++ b/hotspot/src/share/vm/compiler/compileBroker.cpp @@ -56,6 +56,7 @@ #if INCLUDE_JVMCI #include "jvmci/jvmciCompiler.hpp" #include "jvmci/jvmciRuntime.hpp" +#include "jvmci/jvmciJavaClasses.hpp" #include "runtime/vframe.hpp" #endif #ifdef COMPILER2 @@ -498,7 +499,7 @@ CompilerCounters::CompilerCounters() { // CompileBroker::compilation_init // // Initialize the Compilation object -void CompileBroker::compilation_init() { +void CompileBroker::compilation_init(TRAPS) { _last_method_compiled[0] = '\0'; // No need to initialize compilation system if we do not use it. @@ -529,6 +530,17 @@ void CompileBroker::compilation_init() { } else { c1_count = JVMCIHostThreads; } + + if (!UseInterpreter) { + // Force initialization of JVMCI compiler otherwise JVMCI + // compilations will not block until JVMCI is initialized + ResourceMark rm; + TempNewSymbol getCompiler = SymbolTable::new_symbol("getCompiler", CHECK); + TempNewSymbol sig = SymbolTable::new_symbol("()Ljdk/vm/ci/runtime/JVMCICompiler;", CHECK); + Handle jvmciRuntime = JVMCIRuntime::get_HotSpotJVMCIRuntime(CHECK); + JavaValue result(T_OBJECT); + JavaCalls::call_virtual(&result, jvmciRuntime, HotSpotJVMCIRuntime::klass(), getCompiler, sig, CHECK); + } } } #endif // INCLUDE_JVMCI diff --git a/hotspot/src/share/vm/compiler/compileBroker.hpp b/hotspot/src/share/vm/compiler/compileBroker.hpp index 9c0709aa28f..448f1f8897d 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.hpp +++ b/hotspot/src/share/vm/compiler/compileBroker.hpp @@ -276,7 +276,7 @@ public: CompileQueue *q = compile_queue(comp_level); return q != NULL ? q->size() : 0; } - static void compilation_init(); + static void compilation_init(TRAPS); static void init_compiler_thread_log(); static nmethod* compile_method(const methodHandle& method, int osr_bci, diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index db0f5d9812c..f6f00384245 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -3628,7 +3628,7 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) { // initialize compiler(s) #if defined(COMPILER1) || defined(COMPILER2) || defined(SHARK) || INCLUDE_JVMCI - CompileBroker::compilation_init(); + CompileBroker::compilation_init(CHECK_JNI_ERR); #endif // Pre-initialize some JSR292 core classes to avoid deadlock during class loading. From e4d937a557cfc0d7395be218994751d28bcd64ff Mon Sep 17 00:00:00 2001 From: Tom Rodriguez Date: Mon, 14 Dec 2015 13:06:39 -0800 Subject: [PATCH 029/146] 8145338: compiler/jsr292/CallSiteDepContextTest.java fails: assert(dep_implicit_context_arg(dept) == 0) failed: sanity Reviewed-by: twisti --- hotspot/src/share/vm/code/dependencies.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/hotspot/src/share/vm/code/dependencies.cpp b/hotspot/src/share/vm/code/dependencies.cpp index c941f404276..bdb1292a4aa 100644 --- a/hotspot/src/share/vm/code/dependencies.cpp +++ b/hotspot/src/share/vm/code/dependencies.cpp @@ -346,7 +346,6 @@ void Dependencies::assert_common_2(DepType dept, } } } else { - assert(dep_implicit_context_arg(dept) == 0, "sanity"); if (note_dep_seen(dept, x0) && note_dep_seen(dept, x1)) { // look in this bucket for redundant assertions const int stride = 2; From a08d3805f07742bcf22b20bab32134b45cf01b9d Mon Sep 17 00:00:00 2001 From: Jan Civlin Date: Mon, 14 Dec 2015 14:48:30 -0800 Subject: [PATCH 030/146] 8144771: Use AVX3 instructions for string compare Co-authored-by: Michael C Berg Reviewed-by: kvn, thartmann --- hotspot/src/cpu/x86/vm/assembler_x86.cpp | 226 +++++++++++------- hotspot/src/cpu/x86/vm/assembler_x86.hpp | 16 +- hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp | 79 +++++- .../src/cpu/x86/vm/sharedRuntime_x86_64.cpp | 6 +- .../src/cpu/x86/vm/stubGenerator_x86_32.cpp | 4 +- .../src/cpu/x86/vm/stubGenerator_x86_64.cpp | 6 +- 6 files changed, 234 insertions(+), 103 deletions(-) diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.cpp b/hotspot/src/cpu/x86/vm/assembler_x86.cpp index 015a66b7900..e55fd56e78d 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.cpp @@ -2152,33 +2152,64 @@ void Assembler::movddup(XMMRegister dst, XMMRegister src) { emit_int8(0xC0 | encode); } -void Assembler::kmovwl(KRegister dst, Register src) { - NOT_LP64(assert(VM_Version::supports_evex(), "")); +void Assembler::kmovbl(KRegister dst, Register src) { + assert(VM_Version::supports_avx512dq(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); - int encode = kreg_prefix_and_encode(dst, knoreg, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0x92); emit_int8((unsigned char)(0xC0 | encode)); } +void Assembler::kmovbl(Register dst, KRegister src) { + assert(VM_Version::supports_avx512dq(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0x93); + emit_int8((unsigned char)(0xC0 | encode)); +} + +void Assembler::kmovwl(KRegister dst, Register src) { + assert(VM_Version::supports_evex(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0x92); + emit_int8((unsigned char)(0xC0 | encode)); +} + +void Assembler::kmovwl(Register dst, KRegister src) { + assert(VM_Version::supports_evex(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0x93); + emit_int8((unsigned char)(0xC0 | encode)); +} + void Assembler::kmovdl(KRegister dst, Register src) { - NOT_LP64(assert(VM_Version::supports_evex(), "")); - VexSimdPrefix pre = !_legacy_mode_bw ? VEX_SIMD_F2 : VEX_SIMD_NONE; + assert(VM_Version::supports_avx512bw(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); - int encode = kreg_prefix_and_encode(dst, knoreg, src, pre, VEX_OPCODE_0F, &attributes); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0x92); emit_int8((unsigned char)(0xC0 | encode)); } +void Assembler::kmovdl(Register dst, KRegister src) { + assert(VM_Version::supports_avx512bw(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0x93); + emit_int8((unsigned char)(0xC0 | encode)); +} + void Assembler::kmovql(KRegister dst, KRegister src) { - NOT_LP64(assert(VM_Version::supports_evex(), "")); + assert(VM_Version::supports_avx512bw(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); - int encode = kreg_prefix_and_encode(dst, knoreg, src, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0x90); emit_int8((unsigned char)(0xC0 | encode)); } void Assembler::kmovql(KRegister dst, Address src) { - NOT_LP64(assert(VM_Version::supports_evex(), "")); + assert(VM_Version::supports_avx512bw(), ""); InstructionMark im(this); InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); vex_prefix(src, 0, dst->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); @@ -2187,7 +2218,7 @@ void Assembler::kmovql(KRegister dst, Address src) { } void Assembler::kmovql(Address dst, KRegister src) { - NOT_LP64(assert(VM_Version::supports_evex(), "")); + assert(VM_Version::supports_avx512bw(), ""); InstructionMark im(this); InstructionAttr attributes(AVX_128bit, /* vex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); vex_prefix(dst, 0, src->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); @@ -2196,46 +2227,53 @@ void Assembler::kmovql(Address dst, KRegister src) { } void Assembler::kmovql(KRegister dst, Register src) { - NOT_LP64(assert(VM_Version::supports_evex(), "")); - VexSimdPrefix pre = !_legacy_mode_bw ? VEX_SIMD_F2 : VEX_SIMD_NONE; - InstructionAttr attributes(AVX_128bit, /* rex_w */ !_legacy_mode_bw, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); - int encode = kreg_prefix_and_encode(dst, knoreg, src, pre, VEX_OPCODE_0F, &attributes); + assert(VM_Version::supports_avx512bw(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0x92); emit_int8((unsigned char)(0xC0 | encode)); } +void Assembler::kmovql(Register dst, KRegister src) { + assert(VM_Version::supports_avx512bw(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0x93); + emit_int8((unsigned char)(0xC0 | encode)); +} + // This instruction produces ZF or CF flags void Assembler::kortestbl(KRegister src1, KRegister src2) { - NOT_LP64(assert(VM_Version::supports_avx512dq(), "")); + assert(VM_Version::supports_avx512dq(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); - int encode = kreg_prefix_and_encode(src1, knoreg, src2, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + int encode = vex_prefix_and_encode(src1->encoding(), 0, src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0x98); emit_int8((unsigned char)(0xC0 | encode)); } // This instruction produces ZF or CF flags void Assembler::kortestwl(KRegister src1, KRegister src2) { - NOT_LP64(assert(VM_Version::supports_evex(), "")); + assert(VM_Version::supports_evex(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); - int encode = kreg_prefix_and_encode(src1, knoreg, src2, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + int encode = vex_prefix_and_encode(src1->encoding(), 0, src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0x98); emit_int8((unsigned char)(0xC0 | encode)); } // This instruction produces ZF or CF flags void Assembler::kortestdl(KRegister src1, KRegister src2) { - NOT_LP64(assert(VM_Version::supports_avx512bw(), "")); + assert(VM_Version::supports_avx512bw(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); - int encode = kreg_prefix_and_encode(src1, knoreg, src2, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + int encode = vex_prefix_and_encode(src1->encoding(), 0, src2->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0x98); emit_int8((unsigned char)(0xC0 | encode)); } // This instruction produces ZF or CF flags void Assembler::kortestql(KRegister src1, KRegister src2) { - NOT_LP64(assert(VM_Version::supports_avx512bw(), "")); + assert(VM_Version::supports_avx512bw(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); - int encode = kreg_prefix_and_encode(src1, knoreg, src2, VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); + int encode = vex_prefix_and_encode(src1->encoding(), 0, src2->encoding(), VEX_SIMD_NONE, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0x98); emit_int8((unsigned char)(0xC0 | encode)); } @@ -2375,7 +2413,7 @@ void Assembler::vmovdqu(Address dst, XMMRegister src) { // Move Unaligned EVEX enabled Vector (programmable : 8,16,32,64) void Assembler::evmovdqub(XMMRegister dst, XMMRegister src, int vector_len) { assert(VM_Version::supports_evex(), ""); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); emit_int8(0x6F); emit_int8((unsigned char)(0xC0 | encode)); @@ -2395,7 +2433,7 @@ void Assembler::evmovdqub(Address dst, XMMRegister src, int vector_len) { assert(VM_Version::supports_evex(), ""); assert(src != xnoreg, "sanity"); InstructionMark im(this); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); vex_prefix(dst, 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); emit_int8(0x7F); @@ -2404,7 +2442,7 @@ void Assembler::evmovdqub(Address dst, XMMRegister src, int vector_len) { void Assembler::evmovdquw(XMMRegister dst, XMMRegister src, int vector_len) { assert(VM_Version::supports_evex(), ""); - InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); emit_int8(0x6F); emit_int8((unsigned char)(0xC0 | encode)); @@ -2424,7 +2462,7 @@ void Assembler::evmovdquw(Address dst, XMMRegister src, int vector_len) { assert(VM_Version::supports_evex(), ""); assert(src != xnoreg, "sanity"); InstructionMark im(this); - InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); vex_prefix(dst, 0, src->encoding(), VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); emit_int8(0x7F); @@ -3069,7 +3107,7 @@ void Assembler::packuswb(XMMRegister dst, Address src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); InstructionMark im(this); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x67); @@ -3078,7 +3116,7 @@ void Assembler::packuswb(XMMRegister dst, Address src) { void Assembler::packuswb(XMMRegister dst, XMMRegister src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x67); emit_int8((unsigned char)(0xC0 | encode)); @@ -3086,7 +3124,7 @@ void Assembler::packuswb(XMMRegister dst, XMMRegister src) { void Assembler::vpackuswb(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { assert(UseAVX > 0, "some form of AVX must be enabled"); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int nds_enc = nds->is_valid() ? nds->encoding() : 0; int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x67); @@ -3128,7 +3166,7 @@ void Assembler::pcmpestri(XMMRegister dst, XMMRegister src, int imm8) { // In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst void Assembler::pcmpeqb(XMMRegister dst, XMMRegister src) { - NOT_LP64(assert(VM_Version::supports_sse2(), "")); + assert(VM_Version::supports_sse2(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x74); @@ -3148,16 +3186,28 @@ void Assembler::vpcmpeqb(XMMRegister dst, XMMRegister nds, XMMRegister src, int // In this context, kdst is written the mask used to process the equal components void Assembler::evpcmpeqb(KRegister kdst, XMMRegister nds, XMMRegister src, int vector_len) { assert(VM_Version::supports_avx512bw(), ""); - InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); int nds_enc = nds->is_valid() ? nds->encoding() : 0; int encode = vex_prefix_and_encode(kdst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x74); emit_int8((unsigned char)(0xC0 | encode)); } +void Assembler::evpcmpeqb(KRegister kdst, XMMRegister nds, Address src, int vector_len) { + assert(VM_Version::supports_avx512bw(), ""); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); + attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); + int nds_enc = nds->is_valid() ? nds->encoding() : 0; + int dst_enc = kdst->encoding(); + vex_prefix(src, nds_enc, dst_enc, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8(0x74); + emit_operand(as_Register(dst_enc), src); +} + // In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst void Assembler::pcmpeqw(XMMRegister dst, XMMRegister src) { - NOT_LP64(assert(VM_Version::supports_sse2(), "")); + assert(VM_Version::supports_sse2(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x75); @@ -3177,16 +3227,28 @@ void Assembler::vpcmpeqw(XMMRegister dst, XMMRegister nds, XMMRegister src, int // In this context, kdst is written the mask used to process the equal components void Assembler::evpcmpeqw(KRegister kdst, XMMRegister nds, XMMRegister src, int vector_len) { assert(VM_Version::supports_avx512bw(), ""); - InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); int nds_enc = nds->is_valid() ? nds->encoding() : 0; int encode = vex_prefix_and_encode(kdst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x75); emit_int8((unsigned char)(0xC0 | encode)); } +void Assembler::evpcmpeqw(KRegister kdst, XMMRegister nds, Address src, int vector_len) { + assert(VM_Version::supports_avx512bw(), ""); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); + attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); + int nds_enc = nds->is_valid() ? nds->encoding() : 0; + int dst_enc = kdst->encoding(); + vex_prefix(src, nds_enc, dst_enc, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8(0x75); + emit_operand(as_Register(dst_enc), src); +} + // In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst void Assembler::pcmpeqd(XMMRegister dst, XMMRegister src) { - NOT_LP64(assert(VM_Version::supports_sse2(), "")); + assert(VM_Version::supports_sse2(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x76); @@ -3213,9 +3275,21 @@ void Assembler::evpcmpeqd(KRegister kdst, XMMRegister nds, XMMRegister src, int emit_int8((unsigned char)(0xC0 | encode)); } +void Assembler::evpcmpeqd(KRegister kdst, XMMRegister nds, Address src, int vector_len) { + assert(VM_Version::supports_evex(), ""); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_32bit); + int nds_enc = nds->is_valid() ? nds->encoding() : 0; + int dst_enc = kdst->encoding(); + vex_prefix(src, nds_enc, dst_enc, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8(0x76); + emit_operand(as_Register(dst_enc), src); +} + // In this context, the dst vector contains the components that are equal, non equal components are zeroed in dst void Assembler::pcmpeqq(XMMRegister dst, XMMRegister src) { - NOT_LP64(assert(VM_Version::supports_sse4_1(), "")); + assert(VM_Version::supports_sse4_1(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ false, /* uses_vl */ false); int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); emit_int8(0x29); @@ -3328,7 +3402,7 @@ void Assembler::pinsrw(XMMRegister dst, Register src, int imm8) { void Assembler::pmovzxbw(XMMRegister dst, Address src) { assert(VM_Version::supports_sse4_1(), ""); InstructionMark im(this); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ false); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); attributes.set_address_attributes(/* tuple_type */ EVEX_HVM, /* input_size_in_bits */ EVEX_NObit); simd_prefix(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); emit_int8(0x30); @@ -3337,7 +3411,7 @@ void Assembler::pmovzxbw(XMMRegister dst, Address src) { void Assembler::pmovzxbw(XMMRegister dst, XMMRegister src) { assert(VM_Version::supports_sse4_1(), ""); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ false); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); emit_int8(0x30); emit_int8((unsigned char)(0xC0 | encode)); @@ -3347,7 +3421,7 @@ void Assembler::vpmovzxbw(XMMRegister dst, Address src, int vector_len) { assert(VM_Version::supports_avx(), ""); InstructionMark im(this); assert(dst != xnoreg, "sanity"); - InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ false); + InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); attributes.set_address_attributes(/* tuple_type */ EVEX_HVM, /* input_size_in_bits */ EVEX_NObit); vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); emit_int8(0x30); @@ -3452,7 +3526,7 @@ void Assembler::prefix(Prefix p) { void Assembler::pshufb(XMMRegister dst, XMMRegister src) { assert(VM_Version::supports_ssse3(), ""); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ false); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); emit_int8(0x00); emit_int8((unsigned char)(0xC0 | encode)); @@ -3461,7 +3535,7 @@ void Assembler::pshufb(XMMRegister dst, XMMRegister src) { void Assembler::pshufb(XMMRegister dst, Address src) { assert(VM_Version::supports_ssse3(), ""); InstructionMark im(this); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ false); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); emit_int8(0x00); @@ -3495,7 +3569,7 @@ void Assembler::pshufd(XMMRegister dst, Address src, int mode) { void Assembler::pshuflw(XMMRegister dst, XMMRegister src, int mode) { assert(isByte(mode), "invalid value"); NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ false); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); int encode = simd_prefix_and_encode(dst, xnoreg, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); emit_int8(0x70); emit_int8((unsigned char)(0xC0 | encode)); @@ -3507,7 +3581,7 @@ void Assembler::pshuflw(XMMRegister dst, Address src, int mode) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); assert((UseAVX > 0), "SSE mode requires address alignment 16 bytes"); InstructionMark im(this); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ false); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); simd_prefix(dst, xnoreg, src, VEX_SIMD_F2, VEX_OPCODE_0F, &attributes); emit_int8(0x70); @@ -4723,7 +4797,7 @@ void Assembler::vphaddd(XMMRegister dst, XMMRegister nds, XMMRegister src, int v void Assembler::paddb(XMMRegister dst, XMMRegister src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xFC); emit_int8((unsigned char)(0xC0 | encode)); @@ -4731,7 +4805,7 @@ void Assembler::paddb(XMMRegister dst, XMMRegister src) { void Assembler::paddw(XMMRegister dst, XMMRegister src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xFD); emit_int8((unsigned char)(0xC0 | encode)); @@ -4771,7 +4845,7 @@ void Assembler::phaddd(XMMRegister dst, XMMRegister src) { void Assembler::vpaddb(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int nds_enc = nds->is_valid() ? nds->encoding() : 0; int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xFC); @@ -4780,7 +4854,7 @@ void Assembler::vpaddb(XMMRegister dst, XMMRegister nds, XMMRegister src, int ve void Assembler::vpaddw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int nds_enc = nds->is_valid() ? nds->encoding() : 0; int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xFD); @@ -4808,7 +4882,7 @@ void Assembler::vpaddq(XMMRegister dst, XMMRegister nds, XMMRegister src, int ve void Assembler::vpaddb(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); InstructionMark im(this); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); int nds_enc = nds->is_valid() ? nds->encoding() : 0; vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); @@ -4819,7 +4893,7 @@ void Assembler::vpaddb(XMMRegister dst, XMMRegister nds, Address src, int vector void Assembler::vpaddw(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); InstructionMark im(this); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); int nds_enc = nds->is_valid() ? nds->encoding() : 0; vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); @@ -4851,7 +4925,7 @@ void Assembler::vpaddq(XMMRegister dst, XMMRegister nds, Address src, int vector void Assembler::psubb(XMMRegister dst, XMMRegister src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xF8); emit_int8((unsigned char)(0xC0 | encode)); @@ -4859,7 +4933,7 @@ void Assembler::psubb(XMMRegister dst, XMMRegister src) { void Assembler::psubw(XMMRegister dst, XMMRegister src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xF9); emit_int8((unsigned char)(0xC0 | encode)); @@ -4882,7 +4956,7 @@ void Assembler::psubq(XMMRegister dst, XMMRegister src) { void Assembler::vpsubb(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int nds_enc = nds->is_valid() ? nds->encoding() : 0; int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xF8); @@ -4891,7 +4965,7 @@ void Assembler::vpsubb(XMMRegister dst, XMMRegister nds, XMMRegister src, int ve void Assembler::vpsubw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int nds_enc = nds->is_valid() ? nds->encoding() : 0; int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xF9); @@ -4919,7 +4993,7 @@ void Assembler::vpsubq(XMMRegister dst, XMMRegister nds, XMMRegister src, int ve void Assembler::vpsubb(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); InstructionMark im(this); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); int nds_enc = nds->is_valid() ? nds->encoding() : 0; vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); @@ -4930,7 +5004,7 @@ void Assembler::vpsubb(XMMRegister dst, XMMRegister nds, Address src, int vector void Assembler::vpsubw(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); InstructionMark im(this); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); int nds_enc = nds->is_valid() ? nds->encoding() : 0; vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); @@ -4962,7 +5036,7 @@ void Assembler::vpsubq(XMMRegister dst, XMMRegister nds, Address src, int vector void Assembler::pmullw(XMMRegister dst, XMMRegister src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = simd_prefix_and_encode(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xD5); emit_int8((unsigned char)(0xC0 | encode)); @@ -4978,7 +5052,7 @@ void Assembler::pmulld(XMMRegister dst, XMMRegister src) { void Assembler::vpmullw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int nds_enc = nds->is_valid() ? nds->encoding() : 0; int encode = vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xD5); @@ -5006,7 +5080,7 @@ void Assembler::vpmullq(XMMRegister dst, XMMRegister nds, XMMRegister src, int v void Assembler::vpmullw(XMMRegister dst, XMMRegister nds, Address src, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); InstructionMark im(this); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); attributes.set_address_attributes(/* tuple_type */ EVEX_FVM, /* input_size_in_bits */ EVEX_NObit); int nds_enc = nds->is_valid() ? nds->encoding() : 0; vex_prefix(src, nds_enc, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); @@ -5039,7 +5113,7 @@ void Assembler::vpmullq(XMMRegister dst, XMMRegister nds, Address src, int vecto // Shift packed integers left by specified number of bits. void Assembler::psllw(XMMRegister dst, int shift) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); // XMM6 is for /6 encoding: 66 0F 71 /6 ib int encode = simd_prefix_and_encode(xmm6, dst, dst, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x71); @@ -5069,7 +5143,7 @@ void Assembler::psllq(XMMRegister dst, int shift) { void Assembler::psllw(XMMRegister dst, XMMRegister shift) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xF1); emit_int8((unsigned char)(0xC0 | encode)); @@ -5093,7 +5167,7 @@ void Assembler::psllq(XMMRegister dst, XMMRegister shift) { void Assembler::vpsllw(XMMRegister dst, XMMRegister src, int shift, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); // XMM6 is for /6 encoding: 66 0F 71 /6 ib int encode = vex_prefix_and_encode(xmm6->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x71); @@ -5124,7 +5198,7 @@ void Assembler::vpsllq(XMMRegister dst, XMMRegister src, int shift, int vector_l void Assembler::vpsllw(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xF1); emit_int8((unsigned char)(0xC0 | encode)); @@ -5149,7 +5223,7 @@ void Assembler::vpsllq(XMMRegister dst, XMMRegister src, XMMRegister shift, int // Shift packed integers logically right by specified number of bits. void Assembler::psrlw(XMMRegister dst, int shift) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); // XMM2 is for /2 encoding: 66 0F 71 /2 ib int encode = simd_prefix_and_encode(xmm2, dst, dst, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x71); @@ -5181,7 +5255,7 @@ void Assembler::psrlq(XMMRegister dst, int shift) { void Assembler::psrlw(XMMRegister dst, XMMRegister shift) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xD1); emit_int8((unsigned char)(0xC0 | encode)); @@ -5205,7 +5279,7 @@ void Assembler::psrlq(XMMRegister dst, XMMRegister shift) { void Assembler::vpsrlw(XMMRegister dst, XMMRegister src, int shift, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); // XMM2 is for /2 encoding: 66 0F 71 /2 ib int encode = vex_prefix_and_encode(xmm2->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x71); @@ -5235,7 +5309,7 @@ void Assembler::vpsrlq(XMMRegister dst, XMMRegister src, int shift, int vector_l void Assembler::vpsrlw(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xD1); emit_int8((unsigned char)(0xC0 | encode)); @@ -5260,7 +5334,7 @@ void Assembler::vpsrlq(XMMRegister dst, XMMRegister src, XMMRegister shift, int // Shift packed integers arithmetically right by specified number of bits. void Assembler::psraw(XMMRegister dst, int shift) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); // XMM4 is for /4 encoding: 66 0F 71 /4 ib int encode = simd_prefix_and_encode(xmm4, dst, dst, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x71); @@ -5280,7 +5354,7 @@ void Assembler::psrad(XMMRegister dst, int shift) { void Assembler::psraw(XMMRegister dst, XMMRegister shift) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); - InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = simd_prefix_and_encode(dst, dst, shift, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xE1); emit_int8((unsigned char)(0xC0 | encode)); @@ -5296,7 +5370,7 @@ void Assembler::psrad(XMMRegister dst, XMMRegister shift) { void Assembler::vpsraw(XMMRegister dst, XMMRegister src, int shift, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); // XMM4 is for /4 encoding: 66 0F 71 /4 ib int encode = vex_prefix_and_encode(xmm4->encoding(), dst->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8(0x71); @@ -5316,7 +5390,7 @@ void Assembler::vpsrad(XMMRegister dst, XMMRegister src, int shift, int vector_l void Assembler::vpsraw(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len) { assert(UseAVX > 0, "requires some form of AVX"); - InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = vex_prefix_and_encode(dst->encoding(), src->encoding(), shift->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); emit_int8((unsigned char)0xE1); emit_int8((unsigned char)(0xC0 | encode)); @@ -5706,7 +5780,7 @@ void Assembler::vpbroadcastd(XMMRegister dst, XMMRegister src) { // duplicate 2-bytes integer data from src into 16 locations in dest void Assembler::vpbroadcastw(XMMRegister dst, XMMRegister src) { assert(VM_Version::supports_avx2(), ""); - InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ false, /* uses_vl */ true); + InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ true); int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); emit_int8(0x79); emit_int8((unsigned char)(0xC0 | encode)); @@ -6573,18 +6647,6 @@ int Assembler::simd_prefix_and_encode(XMMRegister dst, XMMRegister nds, XMMRegis } } -int Assembler::kreg_prefix_and_encode(KRegister dst, KRegister nds, KRegister src, VexSimdPrefix pre, - VexOpcode opc, InstructionAttr *attributes) { - int nds_enc = nds->is_valid() ? nds->encoding() : 0; - return vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), pre, opc, attributes); -} - -int Assembler::kreg_prefix_and_encode(KRegister dst, KRegister nds, Register src, VexSimdPrefix pre, - VexOpcode opc, InstructionAttr *attributes) { - int nds_enc = nds->is_valid() ? nds->encoding() : 0; - return vex_prefix_and_encode(dst->encoding(), nds_enc, src->encoding(), pre, opc, attributes); -} - void Assembler::cmppd(XMMRegister dst, XMMRegister nds, XMMRegister src, int cop, int vector_len) { assert(VM_Version::supports_avx(), ""); assert(!VM_Version::supports_evex(), ""); diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.hpp b/hotspot/src/cpu/x86/vm/assembler_x86.hpp index a5f493905fc..4b6dcf4a028 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.hpp @@ -655,12 +655,6 @@ private: int simd_prefix_and_encode(XMMRegister dst, XMMRegister nds, XMMRegister src, VexSimdPrefix pre, VexOpcode opc, InstructionAttr *attributes); - int kreg_prefix_and_encode(KRegister dst, KRegister nds, KRegister src, VexSimdPrefix pre, - VexOpcode opc, InstructionAttr *attributes); - - int kreg_prefix_and_encode(KRegister dst, KRegister nds, Register src, VexSimdPrefix pre, - VexOpcode opc, InstructionAttr *attributes); - // Helper functions for groups of instructions void emit_arith_b(int op1, int op2, Register dst, int imm8); @@ -1331,12 +1325,17 @@ private: void movddup(XMMRegister dst, XMMRegister src); + void kmovbl(KRegister dst, Register src); + void kmovbl(Register dst, KRegister src); void kmovwl(KRegister dst, Register src); + void kmovwl(Register dst, KRegister src); void kmovdl(KRegister dst, Register src); + void kmovdl(Register dst, KRegister src); void kmovql(KRegister dst, KRegister src); - void kmovql(KRegister dst, Register src); void kmovql(Address dst, KRegister src); void kmovql(KRegister dst, Address src); + void kmovql(KRegister dst, Register src); + void kmovql(Register dst, KRegister src); void kortestbl(KRegister dst, KRegister src); void kortestwl(KRegister dst, KRegister src); @@ -1521,14 +1520,17 @@ private: void pcmpeqb(XMMRegister dst, XMMRegister src); void vpcmpeqb(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); void evpcmpeqb(KRegister kdst, XMMRegister nds, XMMRegister src, int vector_len); + void evpcmpeqb(KRegister kdst, XMMRegister nds, Address src, int vector_len); void pcmpeqw(XMMRegister dst, XMMRegister src); void vpcmpeqw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); void evpcmpeqw(KRegister kdst, XMMRegister nds, XMMRegister src, int vector_len); + void evpcmpeqw(KRegister kdst, XMMRegister nds, Address src, int vector_len); void pcmpeqd(XMMRegister dst, XMMRegister src); void vpcmpeqd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); void evpcmpeqd(KRegister kdst, XMMRegister nds, XMMRegister src, int vector_len); + void evpcmpeqd(KRegister kdst, XMMRegister nds, Address src, int vector_len); void pcmpeqq(XMMRegister dst, XMMRegister src); void vpcmpeqq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp index 2ccee91a6cd..a916379ea36 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp @@ -7999,9 +7999,15 @@ void MacroAssembler::string_compare(Register str1, Register str2, XMMRegister vec1, int ae) { ShortBranchVerifier sbv(this); Label LENGTH_DIFF_LABEL, POP_LABEL, DONE_LABEL, WHILE_HEAD_LABEL; + Label COMPARE_WIDE_VECTORS_LOOP_FAILED; // used only _LP64 && AVX3 int stride, stride2, adr_stride, adr_stride1, adr_stride2; + int stride2x2 = 0x40; Address::ScaleFactor scale, scale1, scale2; + if (ae != StrIntrinsicNode::LL) { + stride2x2 = 0x20; + } + if (ae == StrIntrinsicNode::LU || ae == StrIntrinsicNode::UL) { shrl(cnt2, 1); } @@ -8011,15 +8017,15 @@ void MacroAssembler::string_compare(Register str1, Register str2, movl(result, cnt1); subl(cnt1, cnt2); push(cnt1); - cmov32(Assembler::lessEqual, cnt2, result); + cmov32(Assembler::lessEqual, cnt2, result); // cnt2 = min(cnt1, cnt2) // Is the minimum length zero? testl(cnt2, cnt2); jcc(Assembler::zero, LENGTH_DIFF_LABEL); if (ae == StrIntrinsicNode::LL) { // Load first bytes - load_unsigned_byte(result, Address(str1, 0)); - load_unsigned_byte(cnt1, Address(str2, 0)); + load_unsigned_byte(result, Address(str1, 0)); // result = str1[0] + load_unsigned_byte(cnt1, Address(str2, 0)); // cnt1 = str2[0] } else if (ae == StrIntrinsicNode::UU) { // Load first characters load_unsigned_short(result, Address(str1, 0)); @@ -8060,7 +8066,10 @@ void MacroAssembler::string_compare(Register str1, Register str2, assert(UseSSE >= 4, "SSE4 must be enabled for SSE4.2 intrinsics to be available"); Label COMPARE_WIDE_VECTORS, VECTOR_NOT_EQUAL, COMPARE_WIDE_TAIL, COMPARE_SMALL_STR; Label COMPARE_WIDE_VECTORS_LOOP, COMPARE_16_CHARS, COMPARE_INDEX_CHAR; + Label COMPARE_WIDE_VECTORS_LOOP_AVX2; Label COMPARE_TAIL_LONG; + Label COMPARE_WIDE_VECTORS_LOOP_AVX3; // used only _LP64 && AVX3 + int pcmpmask = 0x19; if (ae == StrIntrinsicNode::LL) { pcmpmask &= ~0x01; @@ -8123,11 +8132,40 @@ void MacroAssembler::string_compare(Register str1, Register str2, } subl(result, stride2); subl(cnt2, stride2); - jccb(Assembler::zero, COMPARE_WIDE_TAIL); + jcc(Assembler::zero, COMPARE_WIDE_TAIL); negptr(result); // In a loop, compare 16-chars (32-bytes) at once using (vpxor+vptest) bind(COMPARE_WIDE_VECTORS_LOOP); + +#ifdef _LP64 + if (VM_Version::supports_avx512vlbw()) { // trying 64 bytes fast loop + cmpl(cnt2, stride2x2); + jccb(Assembler::below, COMPARE_WIDE_VECTORS_LOOP_AVX2); + testl(cnt2, stride2x2-1); // cnt2 holds the vector count + jccb(Assembler::notZero, COMPARE_WIDE_VECTORS_LOOP_AVX2); // means we cannot subtract by 0x40 + + bind(COMPARE_WIDE_VECTORS_LOOP_AVX3); // the hottest loop + if (ae == StrIntrinsicNode::LL || ae == StrIntrinsicNode::UU) { + evmovdquq(vec1, Address(str1, result, scale), Assembler::AVX_512bit); + evpcmpeqb(k7, vec1, Address(str2, result, scale), Assembler::AVX_512bit); // k7 == 11..11, if operands equal, otherwise k7 has some 0 + } else { + vpmovzxbw(vec1, Address(str1, result, scale1), Assembler::AVX_512bit); + evpcmpeqb(k7, vec1, Address(str2, result, scale2), Assembler::AVX_512bit); // k7 == 11..11, if operands equal, otherwise k7 has some 0 + } + kortestql(k7, k7); + jcc(Assembler::aboveEqual, COMPARE_WIDE_VECTORS_LOOP_FAILED); // miscompare + addptr(result, stride2x2); // update since we already compared at this addr + subl(cnt2, stride2x2); // and sub the size too + jccb(Assembler::notZero, COMPARE_WIDE_VECTORS_LOOP_AVX3); + + vpxor(vec1, vec1); + jmpb(COMPARE_WIDE_TAIL); + }//if (VM_Version::supports_avx512vlbw()) +#endif // _LP64 + + + bind(COMPARE_WIDE_VECTORS_LOOP_AVX2); if (ae == StrIntrinsicNode::LL || ae == StrIntrinsicNode::UU) { vmovdqu(vec1, Address(str1, result, scale)); vpxor(vec1, Address(str2, result, scale)); @@ -8136,7 +8174,7 @@ void MacroAssembler::string_compare(Register str1, Register str2, vpxor(vec1, Address(str2, result, scale2)); } vptest(vec1, vec1); - jccb(Assembler::notZero, VECTOR_NOT_EQUAL); + jcc(Assembler::notZero, VECTOR_NOT_EQUAL); addptr(result, stride2); subl(cnt2, stride2); jccb(Assembler::notZero, COMPARE_WIDE_VECTORS_LOOP); @@ -8151,7 +8189,7 @@ void MacroAssembler::string_compare(Register str1, Register str2, movl(result, stride2); movl(cnt2, result); negptr(result); - jmpb(COMPARE_WIDE_VECTORS_LOOP); + jmp(COMPARE_WIDE_VECTORS_LOOP_AVX2); // Identifies the mismatching (higher or lower)16-bytes in the 32-byte vectors. bind(VECTOR_NOT_EQUAL); @@ -8295,6 +8333,34 @@ void MacroAssembler::string_compare(Register str1, Register str2, } jmpb(DONE_LABEL); +#ifdef _LP64 + if (VM_Version::supports_avx512vlbw()) { + + bind(COMPARE_WIDE_VECTORS_LOOP_FAILED); + + kmovql(cnt1, k7); + notq(cnt1); + bsfq(cnt2, cnt1); + if (ae != StrIntrinsicNode::LL) { + // Divide diff by 2 to get number of chars + sarl(cnt2, 1); + } + addq(result, cnt2); + if (ae == StrIntrinsicNode::LL) { + load_unsigned_byte(cnt1, Address(str2, result)); + load_unsigned_byte(result, Address(str1, result)); + } else if (ae == StrIntrinsicNode::UU) { + load_unsigned_short(cnt1, Address(str2, result, scale)); + load_unsigned_short(result, Address(str1, result, scale)); + } else { + load_unsigned_short(cnt1, Address(str2, result, scale2)); + load_unsigned_byte(result, Address(str1, result, scale1)); + } + subl(result, cnt1); + jmpb(POP_LABEL); + }//if (VM_Version::supports_avx512vlbw()) +#endif // _LP64 + // Discard the stored length difference bind(POP_LABEL); pop(cnt1); @@ -8304,6 +8370,7 @@ void MacroAssembler::string_compare(Register str1, Register str2, if(ae == StrIntrinsicNode::UL) { negl(result); } + } // Search for Non-ASCII character (Negative byte value) in a byte array, diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp index 79b2a0f1db6..2ea8f1a49f0 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp @@ -189,7 +189,7 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_ } // Save full ZMM registes(16..num_xmm_regs) base_addr = XSAVE_AREA_UPPERBANK; - int off = 0; + off = 0; int vector_len = Assembler::AVX_512bit; for (int n = 16; n < num_xmm_regs; n++) { __ evmovdqul(Address(rsp, base_addr+(off++*64)), as_XMMRegister(n), vector_len); @@ -199,7 +199,7 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_ if (VM_Version::supports_evex()) { // Save upper bank of ZMM registers(16..31) for double/float usage int base_addr = XSAVE_AREA_UPPERBANK; - int off = 0; + off = 0; for (int n = 16; n < num_xmm_regs; n++) { __ movsd(Address(rsp, base_addr+(off++*64)), as_XMMRegister(n)); } @@ -325,7 +325,7 @@ void RegisterSaver::restore_live_registers(MacroAssembler* masm, bool restore_ve assert(MaxVectorSize == 64, "only 512bit vectors are supported now"); } #else - assert(!save_vectors, "vectors are generated only by C2"); + assert(!restore_vectors, "vectors are generated only by C2"); #endif // On EVEX enabled targets everything is handled in pop fpu state diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp index 6298be79e33..b55d1bd2e9d 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp @@ -170,7 +170,7 @@ class StubGenerator: public StubCodeGenerator { // provide initial value for required masks if (UseAVX > 2) { __ movl(rbx, 0xffff); - __ kmovdl(k1, rbx); + __ kmovwl(k1, rbx); } // save and initialize %mxcsr @@ -798,7 +798,7 @@ class StubGenerator: public StubCodeGenerator { if (UseAVX > 2) { __ push(rbx); __ movl(rbx, 0xffff); - __ kmovdl(k1, rbx); + __ kmovwl(k1, rbx); __ pop(rbx); } // Copy 64-byte chunks diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp index c704975870f..f86c6b88786 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp @@ -266,7 +266,7 @@ class StubGenerator: public StubCodeGenerator { __ movptr(r15_save, r15); if (UseAVX > 2) { __ movl(rbx, 0xffff); - __ kmovql(k1, rbx); + __ kmovwl(k1, rbx); } #ifdef _WIN64 int last_reg = 15; @@ -1350,7 +1350,7 @@ class StubGenerator: public StubCodeGenerator { Label L_end; if (UseAVX > 2) { __ movl(to, 0xffff); - __ kmovql(k1, to); + __ kmovwl(k1, to); } // Copy 64-bytes per iteration __ BIND(L_loop); @@ -1434,7 +1434,7 @@ class StubGenerator: public StubCodeGenerator { Label L_end; if (UseAVX > 2) { __ movl(to, 0xffff); - __ kmovql(k1, to); + __ kmovwl(k1, to); } // Copy 64-bytes per iteration __ BIND(L_loop); From ef1c3dc4ed614bcf7c8e9d6bb1d57015fc392ff7 Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Mon, 7 Dec 2015 18:24:24 +0100 Subject: [PATCH 031/146] 8144850: C1: operator delete needs an implementation Reviewed-by: kvn --- hotspot/src/share/vm/c1/c1_LIRGenerator.hpp | 4 ++-- hotspot/src/share/vm/c1/c1_RangeCheckElimination.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp index 47dd33df54e..9438d77288c 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp @@ -157,8 +157,8 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure { private: void* operator new(size_t size) throw(); void* operator new[](size_t size) throw(); - void operator delete(void* p); - void operator delete[](void* p); + void operator delete(void* p) { ShouldNotReachHere(); } + void operator delete[](void* p) { ShouldNotReachHere(); } Compilation* _compilation; ciMethod* _method; // method that we are compiling diff --git a/hotspot/src/share/vm/c1/c1_RangeCheckElimination.hpp b/hotspot/src/share/vm/c1/c1_RangeCheckElimination.hpp index 608f39a9196..0552125b8dc 100644 --- a/hotspot/src/share/vm/c1/c1_RangeCheckElimination.hpp +++ b/hotspot/src/share/vm/c1/c1_RangeCheckElimination.hpp @@ -50,8 +50,8 @@ private: private: void* operator new(size_t size) throw(); void* operator new[](size_t size) throw(); - void operator delete(void* p); - void operator delete[](void* p); + void operator delete(void* p) { ShouldNotReachHere(); } + void operator delete[](void* p) { ShouldNotReachHere(); } IR *_ir; boolArray _used; From 555dd24642f5c4069d8782bcd95fd434b135cc18 Mon Sep 17 00:00:00 2001 From: Pavel Punegov Date: Wed, 9 Dec 2015 00:33:30 +0300 Subject: [PATCH 032/146] 8140667: CompilerControl: tests incorrectly set states for excluded methods Fix exclude command generation Reviewed-by: kvn --- .../mixed/RandomValidCommandsTest.java | 1 - .../scenario/AbstractCommandBuilder.java | 128 ++++++++++++++---- .../compilercontrol/share/scenario/State.java | 4 + 3 files changed, 103 insertions(+), 30 deletions(-) diff --git a/hotspot/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java b/hotspot/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java index 508963836e3..951789991f7 100644 --- a/hotspot/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java +++ b/hotspot/test/compiler/compilercontrol/mixed/RandomValidCommandsTest.java @@ -24,7 +24,6 @@ /* * @test * @bug 8137167 - * @ignore 8140667 * @summary Randomly generates valid commands with random types * @library /testlibrary /../../test/lib /compiler/testlibrary ../share / * @build RandomValidCommandsTest pool.sub.* pool.subpack.* sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java b/hotspot/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java index 6a5b6342f47..0d78cadd8e0 100644 --- a/hotspot/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java +++ b/hotspot/test/compiler/compilercontrol/share/scenario/AbstractCommandBuilder.java @@ -33,6 +33,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.concurrent.Callable; /** @@ -48,38 +49,12 @@ public abstract class AbstractCommandBuilder @Override public void add(CompileCommand command) { compileCommands.add(command); + CommandStateBuilder.getInstance().add(command); } @Override public Map getStates() { - Map states = new HashMap<>(); - for (CompileCommand compileCommand : compileCommands) { - if (compileCommand.isValid()) { - CompileCommand cc = new CompileCommand(compileCommand.command, - compileCommand.methodDescriptor, - /* CompileCommand option and file doesn't support - compiler setting */ - null, - compileCommand.type); - MethodDescriptor md = cc.methodDescriptor; - for (Pair> pair: METHODS) { - Executable exec = pair.first; - State state = states.getOrDefault(exec, new State()); - MethodDescriptor execDesc = new MethodDescriptor(exec); - // if executable matches regex then apply the state - if (execDesc.getCanonicalString().matches(md.getRegexp())) { - state.apply(cc); - } else { - if (cc.command == Command.COMPILEONLY) { - state.setC1Compilable(false); - state.setC2Compilable(false); - } - } - states.put(exec, state); - } - } - } - return states; + return CommandStateBuilder.getInstance().getStates(); } @Override @@ -89,7 +64,102 @@ public abstract class AbstractCommandBuilder @Override public boolean isValid() { - // CompileCommand ignores invalid items + // -XX:CompileCommand(File) ignores invalid items return true; } + + /* + * This is an internal class used to build states for commands given from + * options and a file. As all commands are added into a single set in + * CompilerOracle, we need a class that builds states in the same manner + */ + private static class CommandStateBuilder { + private static final CommandStateBuilder INSTANCE + = new CommandStateBuilder(); + private final List optionCommands = new ArrayList<>(); + private final List fileCommands = new ArrayList<>(); + + private CommandStateBuilder() { } + + public static CommandStateBuilder getInstance() { + return INSTANCE; + } + + public void add(CompileCommand command) { + switch (command.type) { + case OPTION: + optionCommands.add(command); + break; + case FILE: + fileCommands.add(command); + break; + default: + throw new Error("TESTBUG: wrong type: " + command.type); + } + } + + public Map getStates() { + List commandList = new ArrayList<>(); + commandList.addAll(optionCommands); + commandList.addAll(fileCommands); + Map states = new HashMap<>(); + for (Pair> pair : METHODS) { + Executable exec = pair.first; + State state = getState(commandList, states, exec); + states.put(exec, state); + } + return states; + } + + private State getState(List commandList, + Map states, Executable exec) { + State state = states.getOrDefault(exec, new State()); + MethodDescriptor execDesc = new MethodDescriptor(exec); + for (CompileCommand compileCommand : commandList) { + if (compileCommand.isValid()) { + // Create a copy without compiler set + CompileCommand cc = new CompileCommand( + compileCommand.command, + compileCommand.methodDescriptor, + /* CompileCommand option and file doesn't support + compiler setting */ + null, + compileCommand.type); + MethodDescriptor md = cc.methodDescriptor; + // if executable matches regex then apply the state + if (execDesc.getCanonicalString().matches(md.getRegexp())) { + if (cc.command == Command.COMPILEONLY + && !state.isCompilable()) { + /* if the method was already excluded it will not + be compilable again */ + } else { + state.apply(cc); + } + } + } + } + + /* + * Set compilation states for methods that don't match + * any compileonly command. Such methods should be excluded + * from compilation + */ + for (CompileCommand compileCommand : commandList) { + if (compileCommand.isValid() + && (compileCommand.command == Command.COMPILEONLY)) { + MethodDescriptor md = compileCommand.methodDescriptor; + if (!execDesc.getCanonicalString().matches(md.getRegexp()) + && (state.getCompilableOptional( + // no matter C1, C2 or both + Scenario.Compiler.C2).isPresent())) { + /* compileonly excludes only methods that haven't been + already set to be compilable or excluded */ + state.setC1Compilable(false); + state.setC2Compilable(false); + } + } + } + return state; + } + } } diff --git a/hotspot/test/compiler/compilercontrol/share/scenario/State.java b/hotspot/test/compiler/compilercontrol/share/scenario/State.java index b9a81984b69..82a46e7dc69 100644 --- a/hotspot/test/compiler/compilercontrol/share/scenario/State.java +++ b/hotspot/test/compiler/compilercontrol/share/scenario/State.java @@ -135,6 +135,10 @@ public class State { + "\nprint_inline " + printInline; } + public Optional getCompilableOptional(Scenario.Compiler compiler) { + return compile[compiler.ordinal()]; + } + public boolean isC1Compilable() { return compile[Scenario.Compiler.C1.ordinal()].orElse(true); } From a1bb5b8456cbfedbf39e56382005c120912fd36a Mon Sep 17 00:00:00 2001 From: Pavel Punegov Date: Wed, 9 Dec 2015 00:30:32 +0300 Subject: [PATCH 033/146] 8144933: CompilerControl: commandfile/ExcludeTest has incorrect jtreg run innotation Fix incorrect full test name Reviewed-by: kvn --- .../test/compiler/compilercontrol/commandfile/ExcludeTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/test/compiler/compilercontrol/commandfile/ExcludeTest.java b/hotspot/test/compiler/compilercontrol/commandfile/ExcludeTest.java index b4843a7d930..0e5dc7948e0 100644 --- a/hotspot/test/compiler/compilercontrol/commandfile/ExcludeTest.java +++ b/hotspot/test/compiler/compilercontrol/commandfile/ExcludeTest.java @@ -30,7 +30,7 @@ * compiler.testlibrary.CompilerUtils compiler.compilercontrol.share.actions.* * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm compiler.compilercontrol.commands.ExcludeTest + * @run main/othervm compiler.compilercontrol.commandfile.ExcludeTest */ package compiler.compilercontrol.commandfile; From 1f2a9c1407f43ad254bc467d24c17fbd7985d88c Mon Sep 17 00:00:00 2001 From: Jamsheed Mohammed Date: Wed, 9 Dec 2015 11:06:39 +0100 Subject: [PATCH 034/146] 6808665: Use486InstrsOnly aborts 32-bit VM The code supporting -XX:+/-Use486InstrsOnly was removed. Reviewed-by: dholmes, thartmann, vlivanov --- hotspot/src/cpu/x86/vm/globals_x86.hpp | 3 --- hotspot/src/cpu/x86/vm/vm_version_x86.cpp | 26 +++++++++++------------ 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/hotspot/src/cpu/x86/vm/globals_x86.hpp b/hotspot/src/cpu/x86/vm/globals_x86.hpp index 43c4cca5b2a..4c57e1b9a9f 100644 --- a/hotspot/src/cpu/x86/vm/globals_x86.hpp +++ b/hotspot/src/cpu/x86/vm/globals_x86.hpp @@ -175,9 +175,6 @@ define_pd_global(bool, PreserveFramePointer, false); "Use RTM Xend instead of Xabort when lock busy") \ \ /* assembler */ \ - product(bool, Use486InstrsOnly, false, \ - "Use 80486 Compliant instruction subset") \ - \ product(bool, UseCountLeadingZerosInstruction, false, \ "Use count leading zeros instruction") \ \ diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp index eed88e81342..b13974f1e37 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp @@ -473,23 +473,21 @@ void VM_Version::get_processor_features() { // i486 internal cache is both I&D and has a 16-byte line size _L1_data_cache_line_size = 16; - if (!Use486InstrsOnly) { - // Get raw processor info + // Get raw processor info - get_cpu_info_stub(&_cpuid_info); + get_cpu_info_stub(&_cpuid_info); - assert_is_initialized(); - _cpu = extended_cpu_family(); - _model = extended_cpu_model(); - _stepping = cpu_stepping(); + assert_is_initialized(); + _cpu = extended_cpu_family(); + _model = extended_cpu_model(); + _stepping = cpu_stepping(); - if (cpu_family() > 4) { // it supports CPUID - _cpuFeatures = feature_flags(); - // Logical processors are only available on P4s and above, - // and only if hyperthreading is available. - _logical_processors_per_package = logical_processor_count(); - _L1_data_cache_line_size = L1_line_size(); - } + if (cpu_family() > 4) { // it supports CPUID + _cpuFeatures = feature_flags(); + // Logical processors are only available on P4s and above, + // and only if hyperthreading is available. + _logical_processors_per_package = logical_processor_count(); + _L1_data_cache_line_size = L1_line_size(); } _supports_cx8 = supports_cmpxchg8(); From 4d4c7ad974ca451cedf0b3c3f31efcacc98234b6 Mon Sep 17 00:00:00 2001 From: Paul Sandoz Date: Wed, 9 Dec 2015 14:54:40 +0100 Subject: [PATCH 035/146] 8143628: Fork sun.misc.Unsafe and jdk.internal.misc.Unsafe native method tables Reviewed-by: shade, dholmes, alanb, chegar, mchung, roland --- hotspot/src/share/vm/prims/nativeLookup.cpp | 7 +- hotspot/src/share/vm/prims/unsafe.cpp | 90 ++++++- ...dkInternalMiscUnsafeAccessTestBoolean.java | 135 ++++++++++ .../JdkInternalMiscUnsafeAccessTestByte.java | 172 ++++++++++++ .../JdkInternalMiscUnsafeAccessTestChar.java | 190 ++++++++++++++ ...JdkInternalMiscUnsafeAccessTestDouble.java | 172 ++++++++++++ .../JdkInternalMiscUnsafeAccessTestFloat.java | 172 ++++++++++++ .../JdkInternalMiscUnsafeAccessTestInt.java | 229 ++++++++++++++++ .../JdkInternalMiscUnsafeAccessTestLong.java | 229 ++++++++++++++++ ...JdkInternalMiscUnsafeAccessTestObject.java | 165 ++++++++++++ .../JdkInternalMiscUnsafeAccessTestShort.java | 190 ++++++++++++++ .../SunMiscUnsafeAccessTestBoolean.java | 135 ++++++++++ .../unsafe/SunMiscUnsafeAccessTestByte.java | 172 ++++++++++++ .../unsafe/SunMiscUnsafeAccessTestChar.java | 172 ++++++++++++ .../unsafe/SunMiscUnsafeAccessTestDouble.java | 172 ++++++++++++ .../unsafe/SunMiscUnsafeAccessTestFloat.java | 172 ++++++++++++ .../unsafe/SunMiscUnsafeAccessTestInt.java | 211 +++++++++++++++ .../unsafe/SunMiscUnsafeAccessTestLong.java | 211 +++++++++++++++ .../unsafe/SunMiscUnsafeAccessTestObject.java | 165 ++++++++++++ .../unsafe/SunMiscUnsafeAccessTestShort.java | 172 ++++++++++++ .../unsafe/X-UnsafeAccessTest.java.template | 247 ++++++++++++++++++ .../unsafe/generate-unsafe-access-tests.sh | 119 +++++++++ 22 files changed, 3690 insertions(+), 9 deletions(-) create mode 100644 hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestBoolean.java create mode 100644 hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestByte.java create mode 100644 hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestChar.java create mode 100644 hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestDouble.java create mode 100644 hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestFloat.java create mode 100644 hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestInt.java create mode 100644 hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestLong.java create mode 100644 hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestObject.java create mode 100644 hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestShort.java create mode 100644 hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestBoolean.java create mode 100644 hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestByte.java create mode 100644 hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestChar.java create mode 100644 hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestDouble.java create mode 100644 hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestFloat.java create mode 100644 hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestInt.java create mode 100644 hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestLong.java create mode 100644 hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestObject.java create mode 100644 hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestShort.java create mode 100644 hotspot/test/compiler/unsafe/X-UnsafeAccessTest.java.template create mode 100644 hotspot/test/compiler/unsafe/generate-unsafe-access-tests.sh diff --git a/hotspot/src/share/vm/prims/nativeLookup.cpp b/hotspot/src/share/vm/prims/nativeLookup.cpp index fecef0a5055..5f693b46684 100644 --- a/hotspot/src/share/vm/prims/nativeLookup.cpp +++ b/hotspot/src/share/vm/prims/nativeLookup.cpp @@ -107,7 +107,8 @@ char* NativeLookup::long_jni_name(const methodHandle& method) { } extern "C" { - void JNICALL JVM_RegisterUnsafeMethods(JNIEnv *env, jclass unsafecls); + void JNICALL JVM_RegisterJDKInternalMiscUnsafeMethods(JNIEnv *env, jclass unsafecls); + void JNICALL JVM_RegisterSunMiscUnsafeMethods(JNIEnv *env, jclass unsafecls); void JNICALL JVM_RegisterMethodHandleMethods(JNIEnv *env, jclass unsafecls); void JNICALL JVM_RegisterPerfMethods(JNIEnv *env, jclass perfclass); void JNICALL JVM_RegisterWhiteBoxMethods(JNIEnv *env, jclass wbclass); @@ -121,8 +122,8 @@ extern "C" { #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &f) static JNINativeMethod lookup_special_native_methods[] = { - { CC"Java_jdk_internal_misc_Unsafe_registerNatives", NULL, FN_PTR(JVM_RegisterUnsafeMethods) }, - { CC"Java_sun_misc_Unsafe_registerNatives", NULL, FN_PTR(JVM_RegisterUnsafeMethods) }, + { CC"Java_jdk_internal_misc_Unsafe_registerNatives", NULL, FN_PTR(JVM_RegisterJDKInternalMiscUnsafeMethods) }, + { CC"Java_sun_misc_Unsafe_registerNatives", NULL, FN_PTR(JVM_RegisterSunMiscUnsafeMethods) }, { CC"Java_java_lang_invoke_MethodHandleNatives_registerNatives", NULL, FN_PTR(JVM_RegisterMethodHandleMethods) }, { CC"Java_sun_misc_Perf_registerNatives", NULL, FN_PTR(JVM_RegisterPerfMethods) }, { CC"Java_sun_hotspot_WhiteBox_registerNatives", NULL, FN_PTR(JVM_RegisterWhiteBoxMethods) }, diff --git a/hotspot/src/share/vm/prims/unsafe.cpp b/hotspot/src/share/vm/prims/unsafe.cpp index d2d1f0bb866..9d74cf1cf45 100644 --- a/hotspot/src/share/vm/prims/unsafe.cpp +++ b/hotspot/src/share/vm/prims/unsafe.cpp @@ -1227,8 +1227,76 @@ UNSAFE_END {CC "put" #Byte, CC "(" ADR#B ")V", FN_PTR(Unsafe_SetNative##Byte)} +static JNINativeMethod sun_misc_Unsafe_methods[] = { + {CC "getObject", CC "(" OBJ "J)" OBJ "", FN_PTR(Unsafe_GetObject)}, + {CC "putObject", CC "(" OBJ "J" OBJ ")V", FN_PTR(Unsafe_SetObject)}, + {CC "getObjectVolatile",CC "(" OBJ "J)" OBJ "", FN_PTR(Unsafe_GetObjectVolatile)}, + {CC "putObjectVolatile",CC "(" OBJ "J" OBJ ")V", FN_PTR(Unsafe_SetObjectVolatile)}, -static JNINativeMethod methods[] = { + {CC "getUncompressedObject", CC "(" ADR ")" OBJ, FN_PTR(Unsafe_GetUncompressedObject)}, + {CC "getJavaMirror", CC "(" ADR ")" CLS, FN_PTR(Unsafe_GetJavaMirror)}, + {CC "getKlassPointer", CC "(" OBJ ")" ADR, FN_PTR(Unsafe_GetKlassPointer)}, + + DECLARE_GETPUTOOP(Boolean, Z), + DECLARE_GETPUTOOP(Byte, B), + DECLARE_GETPUTOOP(Short, S), + DECLARE_GETPUTOOP(Char, C), + DECLARE_GETPUTOOP(Int, I), + DECLARE_GETPUTOOP(Long, J), + DECLARE_GETPUTOOP(Float, F), + DECLARE_GETPUTOOP(Double, D), + + DECLARE_GETPUTNATIVE(Byte, B), + DECLARE_GETPUTNATIVE(Short, S), + DECLARE_GETPUTNATIVE(Char, C), + DECLARE_GETPUTNATIVE(Int, I), + DECLARE_GETPUTNATIVE(Long, J), + DECLARE_GETPUTNATIVE(Float, F), + DECLARE_GETPUTNATIVE(Double, D), + + {CC "getAddress", CC "(" ADR ")" ADR, FN_PTR(Unsafe_GetNativeAddress)}, + {CC "putAddress", CC "(" ADR "" ADR ")V", FN_PTR(Unsafe_SetNativeAddress)}, + + {CC "allocateMemory", CC "(J)" ADR, FN_PTR(Unsafe_AllocateMemory)}, + {CC "reallocateMemory", CC "(" ADR "J)" ADR, FN_PTR(Unsafe_ReallocateMemory)}, + {CC "freeMemory", CC "(" ADR ")V", FN_PTR(Unsafe_FreeMemory)}, + + {CC "objectFieldOffset", CC "(" FLD ")J", FN_PTR(Unsafe_ObjectFieldOffset)}, + {CC "staticFieldOffset", CC "(" FLD ")J", FN_PTR(Unsafe_StaticFieldOffset)}, + {CC "staticFieldBase", CC "(" FLD ")" OBJ, FN_PTR(Unsafe_StaticFieldBaseFromField)}, + {CC "ensureClassInitialized",CC "(" CLS ")V", FN_PTR(Unsafe_EnsureClassInitialized)}, + {CC "arrayBaseOffset", CC "(" CLS ")I", FN_PTR(Unsafe_ArrayBaseOffset)}, + {CC "arrayIndexScale", CC "(" CLS ")I", FN_PTR(Unsafe_ArrayIndexScale)}, + {CC "addressSize", CC "()I", FN_PTR(Unsafe_AddressSize)}, + {CC "pageSize", CC "()I", FN_PTR(Unsafe_PageSize)}, + + {CC "defineClass", CC "(" DC_Args ")" CLS, FN_PTR(Unsafe_DefineClass)}, + {CC "allocateInstance", CC "(" CLS ")" OBJ, FN_PTR(Unsafe_AllocateInstance)}, + {CC "throwException", CC "(" THR ")V", FN_PTR(Unsafe_ThrowException)}, + {CC "compareAndSwapObject", CC "(" OBJ "J" OBJ "" OBJ ")Z", FN_PTR(Unsafe_CompareAndSwapObject)}, + {CC "compareAndSwapInt", CC "(" OBJ "J""I""I"")Z", FN_PTR(Unsafe_CompareAndSwapInt)}, + {CC "compareAndSwapLong", CC "(" OBJ "J""J""J"")Z", FN_PTR(Unsafe_CompareAndSwapLong)}, + {CC "putOrderedObject", CC "(" OBJ "J" OBJ ")V", FN_PTR(Unsafe_SetOrderedObject)}, + {CC "putOrderedInt", CC "(" OBJ "JI)V", FN_PTR(Unsafe_SetOrderedInt)}, + {CC "putOrderedLong", CC "(" OBJ "JJ)V", FN_PTR(Unsafe_SetOrderedLong)}, + {CC "park", CC "(ZJ)V", FN_PTR(Unsafe_Park)}, + {CC "unpark", CC "(" OBJ ")V", FN_PTR(Unsafe_Unpark)}, + + {CC "getLoadAverage", CC "([DI)I", FN_PTR(Unsafe_Loadavg)}, + + {CC "copyMemory", CC "(" OBJ "J" OBJ "JJ)V", FN_PTR(Unsafe_CopyMemory)}, + {CC "setMemory", CC "(" OBJ "JJB)V", FN_PTR(Unsafe_SetMemory)}, + + {CC "defineAnonymousClass", CC "(" DAC_Args ")" CLS, FN_PTR(Unsafe_DefineAnonymousClass)}, + + {CC "shouldBeInitialized",CC "(" CLS ")Z", FN_PTR(Unsafe_ShouldBeInitialized)}, + + {CC "loadFence", CC "()V", FN_PTR(Unsafe_LoadFence)}, + {CC "storeFence", CC "()V", FN_PTR(Unsafe_StoreFence)}, + {CC "fullFence", CC "()V", FN_PTR(Unsafe_FullFence)}, +}; + +static JNINativeMethod jdk_internal_misc_Unsafe_methods[] = { {CC "getObject", CC "(" OBJ "J)" OBJ "", FN_PTR(Unsafe_GetObject)}, {CC "putObject", CC "(" OBJ "J" OBJ ")V", FN_PTR(Unsafe_SetObject)}, {CC "getObjectVolatile",CC "(" OBJ "J)" OBJ "", FN_PTR(Unsafe_GetObjectVolatile)}, @@ -1316,17 +1384,27 @@ static JNINativeMethod methods[] = { #undef DECLARE_GETPUTNATIVE -// This one function is exported, used by NativeLookup. +// These two functions are exported, used by NativeLookup. // The Unsafe_xxx functions above are called only from the interpreter. // The optimizer looks at names and signatures to recognize // individual functions. -JVM_ENTRY(void, JVM_RegisterUnsafeMethods(JNIEnv *env, jclass unsafeclass)) - UnsafeWrapper("JVM_RegisterUnsafeMethods"); +JVM_ENTRY(void, JVM_RegisterSunMiscUnsafeMethods(JNIEnv *env, jclass unsafeclass)) + UnsafeWrapper("JVM_RegisterSunMiscUnsafeMethods"); { ThreadToNativeFromVM ttnfv(thread); - int ok = env->RegisterNatives(unsafeclass, methods, sizeof(methods)/sizeof(JNINativeMethod)); - guarantee(ok == 0, "register unsafe natives"); + int ok = env->RegisterNatives(unsafeclass, sun_misc_Unsafe_methods, sizeof(sun_misc_Unsafe_methods)/sizeof(JNINativeMethod)); + guarantee(ok == 0, "register sun.misc.Unsafe natives"); + } +JVM_END + +JVM_ENTRY(void, JVM_RegisterJDKInternalMiscUnsafeMethods(JNIEnv *env, jclass unsafeclass)) + UnsafeWrapper("JVM_RegisterJDKInternalMiscUnsafeMethods"); + { + ThreadToNativeFromVM ttnfv(thread); + + int ok = env->RegisterNatives(unsafeclass, jdk_internal_misc_Unsafe_methods, sizeof(jdk_internal_misc_Unsafe_methods)/sizeof(JNINativeMethod)); + guarantee(ok == 0, "register jdk.internal.misc.Unsafe natives"); } JVM_END diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestBoolean.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestBoolean.java new file mode 100644 index 00000000000..1f19d4c14da --- /dev/null +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestBoolean.java @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8143628 + * @summary Test unsafe access for boolean + * @modules java.base/jdk.internal.misc + * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestBoolean + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestBoolean + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestBoolean + * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestBoolean + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class JdkInternalMiscUnsafeAccessTestBoolean { + static final int ITERS = Integer.getInteger("iters", 1); + + static final jdk.internal.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = jdk.internal.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (jdk.internal.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = JdkInternalMiscUnsafeAccessTestBoolean.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = JdkInternalMiscUnsafeAccessTestBoolean.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(boolean[].class); + int ascale = UNSAFE.arrayIndexScale(boolean[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static boolean static_v; + + boolean v; + + @Test + public void testFieldInstance() { + JdkInternalMiscUnsafeAccessTestBoolean t = new JdkInternalMiscUnsafeAccessTestBoolean(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + boolean[] array = new boolean[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putBoolean(base, offset, true); + boolean x = UNSAFE.getBoolean(base, offset); + assertEquals(x, true, "set boolean value"); + } + + // Volatile + { + UNSAFE.putBooleanVolatile(base, offset, false); + boolean x = UNSAFE.getBooleanVolatile(base, offset); + assertEquals(x, false, "putVolatile boolean value"); + } + + + + + } + +} diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestByte.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestByte.java new file mode 100644 index 00000000000..a3ffa6fb8ab --- /dev/null +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestByte.java @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8143628 + * @summary Test unsafe access for byte + * @modules java.base/jdk.internal.misc + * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestByte + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestByte + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestByte + * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestByte + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class JdkInternalMiscUnsafeAccessTestByte { + static final int ITERS = Integer.getInteger("iters", 1); + + static final jdk.internal.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = jdk.internal.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (jdk.internal.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = JdkInternalMiscUnsafeAccessTestByte.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = JdkInternalMiscUnsafeAccessTestByte.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(byte[].class); + int ascale = UNSAFE.arrayIndexScale(byte[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static byte static_v; + + byte v; + + @Test + public void testFieldInstance() { + JdkInternalMiscUnsafeAccessTestByte t = new JdkInternalMiscUnsafeAccessTestByte(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + byte[] array = new byte[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putByte(base, offset, (byte)1); + byte x = UNSAFE.getByte(base, offset); + assertEquals(x, (byte)1, "set byte value"); + } + + // Volatile + { + UNSAFE.putByteVolatile(base, offset, (byte)2); + byte x = UNSAFE.getByteVolatile(base, offset); + assertEquals(x, (byte)2, "putVolatile byte value"); + } + + + + + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putByte(address, (byte)1); + byte x = UNSAFE.getByte(address); + assertEquals(x, (byte)1, "set byte value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestChar.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestChar.java new file mode 100644 index 00000000000..b148aee5c8a --- /dev/null +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestChar.java @@ -0,0 +1,190 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8143628 + * @summary Test unsafe access for char + * @modules java.base/jdk.internal.misc + * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestChar + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestChar + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestChar + * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestChar + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class JdkInternalMiscUnsafeAccessTestChar { + static final int ITERS = Integer.getInteger("iters", 1); + + static final jdk.internal.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = jdk.internal.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (jdk.internal.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = JdkInternalMiscUnsafeAccessTestChar.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = JdkInternalMiscUnsafeAccessTestChar.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(char[].class); + int ascale = UNSAFE.arrayIndexScale(char[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static char static_v; + + char v; + + @Test + public void testFieldInstance() { + JdkInternalMiscUnsafeAccessTestChar t = new JdkInternalMiscUnsafeAccessTestChar(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + char[] array = new char[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putChar(base, offset, 'a'); + char x = UNSAFE.getChar(base, offset); + assertEquals(x, 'a', "set char value"); + } + + // Volatile + { + UNSAFE.putCharVolatile(base, offset, 'b'); + char x = UNSAFE.getCharVolatile(base, offset); + assertEquals(x, 'b', "putVolatile char value"); + } + + + // Unaligned + { + UNSAFE.putCharUnaligned(base, offset, 'b'); + char x = UNSAFE.getCharUnaligned(base, offset); + assertEquals(x, 'b', "putUnaligned char value"); + } + + { + UNSAFE.putCharUnaligned(base, offset, 'a', true); + char x = UNSAFE.getCharUnaligned(base, offset, true); + assertEquals(x, 'a', "putUnaligned big endian char value"); + } + + { + UNSAFE.putCharUnaligned(base, offset, 'b', false); + char x = UNSAFE.getCharUnaligned(base, offset, false); + assertEquals(x, 'b', "putUnaligned little endian char value"); + } + + + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putChar(address, 'a'); + char x = UNSAFE.getChar(address); + assertEquals(x, 'a', "set char value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestDouble.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestDouble.java new file mode 100644 index 00000000000..3ea637178ac --- /dev/null +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestDouble.java @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8143628 + * @summary Test unsafe access for double + * @modules java.base/jdk.internal.misc + * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestDouble + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestDouble + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestDouble + * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestDouble + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class JdkInternalMiscUnsafeAccessTestDouble { + static final int ITERS = Integer.getInteger("iters", 1); + + static final jdk.internal.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = jdk.internal.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (jdk.internal.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = JdkInternalMiscUnsafeAccessTestDouble.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = JdkInternalMiscUnsafeAccessTestDouble.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(double[].class); + int ascale = UNSAFE.arrayIndexScale(double[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static double static_v; + + double v; + + @Test + public void testFieldInstance() { + JdkInternalMiscUnsafeAccessTestDouble t = new JdkInternalMiscUnsafeAccessTestDouble(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + double[] array = new double[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putDouble(base, offset, 1.0d); + double x = UNSAFE.getDouble(base, offset); + assertEquals(x, 1.0d, "set double value"); + } + + // Volatile + { + UNSAFE.putDoubleVolatile(base, offset, 2.0d); + double x = UNSAFE.getDoubleVolatile(base, offset); + assertEquals(x, 2.0d, "putVolatile double value"); + } + + + + + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putDouble(address, 1.0d); + double x = UNSAFE.getDouble(address); + assertEquals(x, 1.0d, "set double value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestFloat.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestFloat.java new file mode 100644 index 00000000000..a2e313620fb --- /dev/null +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestFloat.java @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8143628 + * @summary Test unsafe access for float + * @modules java.base/jdk.internal.misc + * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestFloat + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestFloat + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestFloat + * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestFloat + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class JdkInternalMiscUnsafeAccessTestFloat { + static final int ITERS = Integer.getInteger("iters", 1); + + static final jdk.internal.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = jdk.internal.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (jdk.internal.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = JdkInternalMiscUnsafeAccessTestFloat.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = JdkInternalMiscUnsafeAccessTestFloat.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(float[].class); + int ascale = UNSAFE.arrayIndexScale(float[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static float static_v; + + float v; + + @Test + public void testFieldInstance() { + JdkInternalMiscUnsafeAccessTestFloat t = new JdkInternalMiscUnsafeAccessTestFloat(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + float[] array = new float[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putFloat(base, offset, 1.0f); + float x = UNSAFE.getFloat(base, offset); + assertEquals(x, 1.0f, "set float value"); + } + + // Volatile + { + UNSAFE.putFloatVolatile(base, offset, 2.0f); + float x = UNSAFE.getFloatVolatile(base, offset); + assertEquals(x, 2.0f, "putVolatile float value"); + } + + + + + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putFloat(address, 1.0f); + float x = UNSAFE.getFloat(address); + assertEquals(x, 1.0f, "set float value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestInt.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestInt.java new file mode 100644 index 00000000000..1ea024f1320 --- /dev/null +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestInt.java @@ -0,0 +1,229 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8143628 + * @summary Test unsafe access for int + * @modules java.base/jdk.internal.misc + * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestInt + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestInt + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestInt + * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestInt + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class JdkInternalMiscUnsafeAccessTestInt { + static final int ITERS = Integer.getInteger("iters", 1); + + static final jdk.internal.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = jdk.internal.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (jdk.internal.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = JdkInternalMiscUnsafeAccessTestInt.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = JdkInternalMiscUnsafeAccessTestInt.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(int[].class); + int ascale = UNSAFE.arrayIndexScale(int[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static int static_v; + + int v; + + @Test + public void testFieldInstance() { + JdkInternalMiscUnsafeAccessTestInt t = new JdkInternalMiscUnsafeAccessTestInt(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + int[] array = new int[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putInt(base, offset, 1); + int x = UNSAFE.getInt(base, offset); + assertEquals(x, 1, "set int value"); + } + + // Volatile + { + UNSAFE.putIntVolatile(base, offset, 2); + int x = UNSAFE.getIntVolatile(base, offset); + assertEquals(x, 2, "putVolatile int value"); + } + + // Lazy + { + UNSAFE.putOrderedInt(base, offset, 1); + int x = UNSAFE.getIntVolatile(base, offset); + assertEquals(x, 1, "putRelease int value"); + } + + // Unaligned + { + UNSAFE.putIntUnaligned(base, offset, 2); + int x = UNSAFE.getIntUnaligned(base, offset); + assertEquals(x, 2, "putUnaligned int value"); + } + + { + UNSAFE.putIntUnaligned(base, offset, 1, true); + int x = UNSAFE.getIntUnaligned(base, offset, true); + assertEquals(x, 1, "putUnaligned big endian int value"); + } + + { + UNSAFE.putIntUnaligned(base, offset, 2, false); + int x = UNSAFE.getIntUnaligned(base, offset, false); + assertEquals(x, 2, "putUnaligned little endian int value"); + } + + UNSAFE.putInt(base, offset, 1); + + // Compare + { + boolean r = UNSAFE.compareAndSwapInt(base, offset, 1, 2); + assertEquals(r, true, "success compareAndSwap int"); + int x = UNSAFE.getInt(base, offset); + assertEquals(x, 2, "success compareAndSwap int value"); + } + + { + boolean r = UNSAFE.compareAndSwapInt(base, offset, 1, 3); + assertEquals(r, false, "failing compareAndSwap int"); + int x = UNSAFE.getInt(base, offset); + assertEquals(x, 2, "failing compareAndSwap int value"); + } + + // Compare set and get + { + int o = UNSAFE.getAndSetInt(base, offset, 1); + assertEquals(o, 2, "getAndSet int"); + int x = UNSAFE.getInt(base, offset); + assertEquals(x, 1, "getAndSet int value"); + } + + UNSAFE.putInt(base, offset, 1); + + // get and add, add and get + { + int o = UNSAFE.getAndAddInt(base, offset, 2); + assertEquals(o, 1, "getAndAdd int"); + int x = UNSAFE.getInt(base, offset); + assertEquals(x, 1 + 2, "weakCompareAndSwapRelease int"); + } + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putInt(address, 1); + int x = UNSAFE.getInt(address); + assertEquals(x, 1, "set int value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestLong.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestLong.java new file mode 100644 index 00000000000..0c5262019b1 --- /dev/null +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestLong.java @@ -0,0 +1,229 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8143628 + * @summary Test unsafe access for long + * @modules java.base/jdk.internal.misc + * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestLong + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestLong + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestLong + * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestLong + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class JdkInternalMiscUnsafeAccessTestLong { + static final int ITERS = Integer.getInteger("iters", 1); + + static final jdk.internal.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = jdk.internal.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (jdk.internal.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = JdkInternalMiscUnsafeAccessTestLong.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = JdkInternalMiscUnsafeAccessTestLong.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(long[].class); + int ascale = UNSAFE.arrayIndexScale(long[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static long static_v; + + long v; + + @Test + public void testFieldInstance() { + JdkInternalMiscUnsafeAccessTestLong t = new JdkInternalMiscUnsafeAccessTestLong(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + long[] array = new long[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putLong(base, offset, 1L); + long x = UNSAFE.getLong(base, offset); + assertEquals(x, 1L, "set long value"); + } + + // Volatile + { + UNSAFE.putLongVolatile(base, offset, 2L); + long x = UNSAFE.getLongVolatile(base, offset); + assertEquals(x, 2L, "putVolatile long value"); + } + + // Lazy + { + UNSAFE.putOrderedLong(base, offset, 1L); + long x = UNSAFE.getLongVolatile(base, offset); + assertEquals(x, 1L, "putRelease long value"); + } + + // Unaligned + { + UNSAFE.putLongUnaligned(base, offset, 2L); + long x = UNSAFE.getLongUnaligned(base, offset); + assertEquals(x, 2L, "putUnaligned long value"); + } + + { + UNSAFE.putLongUnaligned(base, offset, 1L, true); + long x = UNSAFE.getLongUnaligned(base, offset, true); + assertEquals(x, 1L, "putUnaligned big endian long value"); + } + + { + UNSAFE.putLongUnaligned(base, offset, 2L, false); + long x = UNSAFE.getLongUnaligned(base, offset, false); + assertEquals(x, 2L, "putUnaligned little endian long value"); + } + + UNSAFE.putLong(base, offset, 1L); + + // Compare + { + boolean r = UNSAFE.compareAndSwapLong(base, offset, 1L, 2L); + assertEquals(r, true, "success compareAndSwap long"); + long x = UNSAFE.getLong(base, offset); + assertEquals(x, 2L, "success compareAndSwap long value"); + } + + { + boolean r = UNSAFE.compareAndSwapLong(base, offset, 1L, 3L); + assertEquals(r, false, "failing compareAndSwap long"); + long x = UNSAFE.getLong(base, offset); + assertEquals(x, 2L, "failing compareAndSwap long value"); + } + + // Compare set and get + { + long o = UNSAFE.getAndSetLong(base, offset, 1L); + assertEquals(o, 2L, "getAndSet long"); + long x = UNSAFE.getLong(base, offset); + assertEquals(x, 1L, "getAndSet long value"); + } + + UNSAFE.putLong(base, offset, 1L); + + // get and add, add and get + { + long o = UNSAFE.getAndAddLong(base, offset, 2L); + assertEquals(o, 1L, "getAndAdd long"); + long x = UNSAFE.getLong(base, offset); + assertEquals(x, 1L + 2L, "weakCompareAndSwapRelease long"); + } + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putLong(address, 1L); + long x = UNSAFE.getLong(address); + assertEquals(x, 1L, "set long value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestObject.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestObject.java new file mode 100644 index 00000000000..c23cffd02ad --- /dev/null +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestObject.java @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8143628 + * @summary Test unsafe access for Object + * @modules java.base/jdk.internal.misc + * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestObject + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestObject + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestObject + * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestObject + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class JdkInternalMiscUnsafeAccessTestObject { + static final int ITERS = Integer.getInteger("iters", 1); + + static final jdk.internal.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = jdk.internal.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (jdk.internal.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = JdkInternalMiscUnsafeAccessTestObject.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = JdkInternalMiscUnsafeAccessTestObject.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(Object[].class); + int ascale = UNSAFE.arrayIndexScale(Object[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static Object static_v; + + Object v; + + @Test + public void testFieldInstance() { + JdkInternalMiscUnsafeAccessTestObject t = new JdkInternalMiscUnsafeAccessTestObject(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + Object[] array = new Object[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putObject(base, offset, "foo"); + Object x = UNSAFE.getObject(base, offset); + assertEquals(x, "foo", "set Object value"); + } + + // Volatile + { + UNSAFE.putObjectVolatile(base, offset, "bar"); + Object x = UNSAFE.getObjectVolatile(base, offset); + assertEquals(x, "bar", "putVolatile Object value"); + } + + // Lazy + { + UNSAFE.putOrderedObject(base, offset, "foo"); + Object x = UNSAFE.getObjectVolatile(base, offset); + assertEquals(x, "foo", "putRelease Object value"); + } + + + UNSAFE.putObject(base, offset, "foo"); + + // Compare + { + boolean r = UNSAFE.compareAndSwapObject(base, offset, "foo", "bar"); + assertEquals(r, true, "success compareAndSwap Object"); + Object x = UNSAFE.getObject(base, offset); + assertEquals(x, "bar", "success compareAndSwap Object value"); + } + + { + boolean r = UNSAFE.compareAndSwapObject(base, offset, "foo", "baz"); + assertEquals(r, false, "failing compareAndSwap Object"); + Object x = UNSAFE.getObject(base, offset); + assertEquals(x, "bar", "failing compareAndSwap Object value"); + } + + // Compare set and get + { + Object o = UNSAFE.getAndSetObject(base, offset, "foo"); + assertEquals(o, "bar", "getAndSet Object"); + Object x = UNSAFE.getObject(base, offset); + assertEquals(x, "foo", "getAndSet Object value"); + } + + } + +} diff --git a/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestShort.java b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestShort.java new file mode 100644 index 00000000000..40a20789769 --- /dev/null +++ b/hotspot/test/compiler/unsafe/JdkInternalMiscUnsafeAccessTestShort.java @@ -0,0 +1,190 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8143628 + * @summary Test unsafe access for short + * @modules java.base/jdk.internal.misc + * @run testng/othervm -Diters=100 -Xint JdkInternalMiscUnsafeAccessTestShort + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 JdkInternalMiscUnsafeAccessTestShort + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation JdkInternalMiscUnsafeAccessTestShort + * @run testng/othervm -Diters=20000 JdkInternalMiscUnsafeAccessTestShort + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class JdkInternalMiscUnsafeAccessTestShort { + static final int ITERS = Integer.getInteger("iters", 1); + + static final jdk.internal.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = jdk.internal.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (jdk.internal.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = JdkInternalMiscUnsafeAccessTestShort.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = JdkInternalMiscUnsafeAccessTestShort.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(short[].class); + int ascale = UNSAFE.arrayIndexScale(short[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static short static_v; + + short v; + + @Test + public void testFieldInstance() { + JdkInternalMiscUnsafeAccessTestShort t = new JdkInternalMiscUnsafeAccessTestShort(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + short[] array = new short[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putShort(base, offset, (short)1); + short x = UNSAFE.getShort(base, offset); + assertEquals(x, (short)1, "set short value"); + } + + // Volatile + { + UNSAFE.putShortVolatile(base, offset, (short)2); + short x = UNSAFE.getShortVolatile(base, offset); + assertEquals(x, (short)2, "putVolatile short value"); + } + + + // Unaligned + { + UNSAFE.putShortUnaligned(base, offset, (short)2); + short x = UNSAFE.getShortUnaligned(base, offset); + assertEquals(x, (short)2, "putUnaligned short value"); + } + + { + UNSAFE.putShortUnaligned(base, offset, (short)1, true); + short x = UNSAFE.getShortUnaligned(base, offset, true); + assertEquals(x, (short)1, "putUnaligned big endian short value"); + } + + { + UNSAFE.putShortUnaligned(base, offset, (short)2, false); + short x = UNSAFE.getShortUnaligned(base, offset, false); + assertEquals(x, (short)2, "putUnaligned little endian short value"); + } + + + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putShort(address, (short)1); + short x = UNSAFE.getShort(address); + assertEquals(x, (short)1, "set short value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestBoolean.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestBoolean.java new file mode 100644 index 00000000000..976691c6735 --- /dev/null +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestBoolean.java @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8143628 + * @summary Test unsafe access for boolean + * @modules java.base/sun.misc + * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestBoolean + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestBoolean + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestBoolean + * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestBoolean + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class SunMiscUnsafeAccessTestBoolean { + static final int ITERS = Integer.getInteger("iters", 1); + + static final sun.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = sun.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (sun.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = SunMiscUnsafeAccessTestBoolean.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = SunMiscUnsafeAccessTestBoolean.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(boolean[].class); + int ascale = UNSAFE.arrayIndexScale(boolean[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static boolean static_v; + + boolean v; + + @Test + public void testFieldInstance() { + SunMiscUnsafeAccessTestBoolean t = new SunMiscUnsafeAccessTestBoolean(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + boolean[] array = new boolean[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putBoolean(base, offset, true); + boolean x = UNSAFE.getBoolean(base, offset); + assertEquals(x, true, "set boolean value"); + } + + // Volatile + { + UNSAFE.putBooleanVolatile(base, offset, false); + boolean x = UNSAFE.getBooleanVolatile(base, offset); + assertEquals(x, false, "putVolatile boolean value"); + } + + + + + } + +} diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestByte.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestByte.java new file mode 100644 index 00000000000..bdcab491316 --- /dev/null +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestByte.java @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8143628 + * @summary Test unsafe access for byte + * @modules java.base/sun.misc + * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestByte + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestByte + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestByte + * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestByte + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class SunMiscUnsafeAccessTestByte { + static final int ITERS = Integer.getInteger("iters", 1); + + static final sun.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = sun.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (sun.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = SunMiscUnsafeAccessTestByte.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = SunMiscUnsafeAccessTestByte.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(byte[].class); + int ascale = UNSAFE.arrayIndexScale(byte[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static byte static_v; + + byte v; + + @Test + public void testFieldInstance() { + SunMiscUnsafeAccessTestByte t = new SunMiscUnsafeAccessTestByte(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + byte[] array = new byte[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putByte(base, offset, (byte)1); + byte x = UNSAFE.getByte(base, offset); + assertEquals(x, (byte)1, "set byte value"); + } + + // Volatile + { + UNSAFE.putByteVolatile(base, offset, (byte)2); + byte x = UNSAFE.getByteVolatile(base, offset); + assertEquals(x, (byte)2, "putVolatile byte value"); + } + + + + + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putByte(address, (byte)1); + byte x = UNSAFE.getByte(address); + assertEquals(x, (byte)1, "set byte value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestChar.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestChar.java new file mode 100644 index 00000000000..d7f56e31648 --- /dev/null +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestChar.java @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8143628 + * @summary Test unsafe access for char + * @modules java.base/sun.misc + * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestChar + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestChar + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestChar + * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestChar + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class SunMiscUnsafeAccessTestChar { + static final int ITERS = Integer.getInteger("iters", 1); + + static final sun.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = sun.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (sun.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = SunMiscUnsafeAccessTestChar.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = SunMiscUnsafeAccessTestChar.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(char[].class); + int ascale = UNSAFE.arrayIndexScale(char[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static char static_v; + + char v; + + @Test + public void testFieldInstance() { + SunMiscUnsafeAccessTestChar t = new SunMiscUnsafeAccessTestChar(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + char[] array = new char[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putChar(base, offset, 'a'); + char x = UNSAFE.getChar(base, offset); + assertEquals(x, 'a', "set char value"); + } + + // Volatile + { + UNSAFE.putCharVolatile(base, offset, 'b'); + char x = UNSAFE.getCharVolatile(base, offset); + assertEquals(x, 'b', "putVolatile char value"); + } + + + + + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putChar(address, 'a'); + char x = UNSAFE.getChar(address); + assertEquals(x, 'a', "set char value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestDouble.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestDouble.java new file mode 100644 index 00000000000..e9c5624afe6 --- /dev/null +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestDouble.java @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8143628 + * @summary Test unsafe access for double + * @modules java.base/sun.misc + * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestDouble + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestDouble + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestDouble + * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestDouble + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class SunMiscUnsafeAccessTestDouble { + static final int ITERS = Integer.getInteger("iters", 1); + + static final sun.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = sun.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (sun.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = SunMiscUnsafeAccessTestDouble.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = SunMiscUnsafeAccessTestDouble.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(double[].class); + int ascale = UNSAFE.arrayIndexScale(double[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static double static_v; + + double v; + + @Test + public void testFieldInstance() { + SunMiscUnsafeAccessTestDouble t = new SunMiscUnsafeAccessTestDouble(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + double[] array = new double[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putDouble(base, offset, 1.0d); + double x = UNSAFE.getDouble(base, offset); + assertEquals(x, 1.0d, "set double value"); + } + + // Volatile + { + UNSAFE.putDoubleVolatile(base, offset, 2.0d); + double x = UNSAFE.getDoubleVolatile(base, offset); + assertEquals(x, 2.0d, "putVolatile double value"); + } + + + + + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putDouble(address, 1.0d); + double x = UNSAFE.getDouble(address); + assertEquals(x, 1.0d, "set double value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestFloat.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestFloat.java new file mode 100644 index 00000000000..993c63339d8 --- /dev/null +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestFloat.java @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8143628 + * @summary Test unsafe access for float + * @modules java.base/sun.misc + * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestFloat + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestFloat + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestFloat + * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestFloat + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class SunMiscUnsafeAccessTestFloat { + static final int ITERS = Integer.getInteger("iters", 1); + + static final sun.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = sun.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (sun.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = SunMiscUnsafeAccessTestFloat.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = SunMiscUnsafeAccessTestFloat.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(float[].class); + int ascale = UNSAFE.arrayIndexScale(float[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static float static_v; + + float v; + + @Test + public void testFieldInstance() { + SunMiscUnsafeAccessTestFloat t = new SunMiscUnsafeAccessTestFloat(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + float[] array = new float[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putFloat(base, offset, 1.0f); + float x = UNSAFE.getFloat(base, offset); + assertEquals(x, 1.0f, "set float value"); + } + + // Volatile + { + UNSAFE.putFloatVolatile(base, offset, 2.0f); + float x = UNSAFE.getFloatVolatile(base, offset); + assertEquals(x, 2.0f, "putVolatile float value"); + } + + + + + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putFloat(address, 1.0f); + float x = UNSAFE.getFloat(address); + assertEquals(x, 1.0f, "set float value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestInt.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestInt.java new file mode 100644 index 00000000000..8924cc168cd --- /dev/null +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestInt.java @@ -0,0 +1,211 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8143628 + * @summary Test unsafe access for int + * @modules java.base/sun.misc + * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestInt + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestInt + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestInt + * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestInt + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class SunMiscUnsafeAccessTestInt { + static final int ITERS = Integer.getInteger("iters", 1); + + static final sun.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = sun.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (sun.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = SunMiscUnsafeAccessTestInt.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = SunMiscUnsafeAccessTestInt.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(int[].class); + int ascale = UNSAFE.arrayIndexScale(int[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static int static_v; + + int v; + + @Test + public void testFieldInstance() { + SunMiscUnsafeAccessTestInt t = new SunMiscUnsafeAccessTestInt(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + int[] array = new int[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putInt(base, offset, 1); + int x = UNSAFE.getInt(base, offset); + assertEquals(x, 1, "set int value"); + } + + // Volatile + { + UNSAFE.putIntVolatile(base, offset, 2); + int x = UNSAFE.getIntVolatile(base, offset); + assertEquals(x, 2, "putVolatile int value"); + } + + // Lazy + { + UNSAFE.putOrderedInt(base, offset, 1); + int x = UNSAFE.getIntVolatile(base, offset); + assertEquals(x, 1, "putRelease int value"); + } + + + UNSAFE.putInt(base, offset, 1); + + // Compare + { + boolean r = UNSAFE.compareAndSwapInt(base, offset, 1, 2); + assertEquals(r, true, "success compareAndSwap int"); + int x = UNSAFE.getInt(base, offset); + assertEquals(x, 2, "success compareAndSwap int value"); + } + + { + boolean r = UNSAFE.compareAndSwapInt(base, offset, 1, 3); + assertEquals(r, false, "failing compareAndSwap int"); + int x = UNSAFE.getInt(base, offset); + assertEquals(x, 2, "failing compareAndSwap int value"); + } + + // Compare set and get + { + int o = UNSAFE.getAndSetInt(base, offset, 1); + assertEquals(o, 2, "getAndSet int"); + int x = UNSAFE.getInt(base, offset); + assertEquals(x, 1, "getAndSet int value"); + } + + UNSAFE.putInt(base, offset, 1); + + // get and add, add and get + { + int o = UNSAFE.getAndAddInt(base, offset, 2); + assertEquals(o, 1, "getAndAdd int"); + int x = UNSAFE.getInt(base, offset); + assertEquals(x, 1 + 2, "weakCompareAndSwapRelease int"); + } + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putInt(address, 1); + int x = UNSAFE.getInt(address); + assertEquals(x, 1, "set int value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestLong.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestLong.java new file mode 100644 index 00000000000..5999073a425 --- /dev/null +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestLong.java @@ -0,0 +1,211 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8143628 + * @summary Test unsafe access for long + * @modules java.base/sun.misc + * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestLong + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestLong + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestLong + * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestLong + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class SunMiscUnsafeAccessTestLong { + static final int ITERS = Integer.getInteger("iters", 1); + + static final sun.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = sun.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (sun.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = SunMiscUnsafeAccessTestLong.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = SunMiscUnsafeAccessTestLong.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(long[].class); + int ascale = UNSAFE.arrayIndexScale(long[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static long static_v; + + long v; + + @Test + public void testFieldInstance() { + SunMiscUnsafeAccessTestLong t = new SunMiscUnsafeAccessTestLong(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + long[] array = new long[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putLong(base, offset, 1L); + long x = UNSAFE.getLong(base, offset); + assertEquals(x, 1L, "set long value"); + } + + // Volatile + { + UNSAFE.putLongVolatile(base, offset, 2L); + long x = UNSAFE.getLongVolatile(base, offset); + assertEquals(x, 2L, "putVolatile long value"); + } + + // Lazy + { + UNSAFE.putOrderedLong(base, offset, 1L); + long x = UNSAFE.getLongVolatile(base, offset); + assertEquals(x, 1L, "putRelease long value"); + } + + + UNSAFE.putLong(base, offset, 1L); + + // Compare + { + boolean r = UNSAFE.compareAndSwapLong(base, offset, 1L, 2L); + assertEquals(r, true, "success compareAndSwap long"); + long x = UNSAFE.getLong(base, offset); + assertEquals(x, 2L, "success compareAndSwap long value"); + } + + { + boolean r = UNSAFE.compareAndSwapLong(base, offset, 1L, 3L); + assertEquals(r, false, "failing compareAndSwap long"); + long x = UNSAFE.getLong(base, offset); + assertEquals(x, 2L, "failing compareAndSwap long value"); + } + + // Compare set and get + { + long o = UNSAFE.getAndSetLong(base, offset, 1L); + assertEquals(o, 2L, "getAndSet long"); + long x = UNSAFE.getLong(base, offset); + assertEquals(x, 1L, "getAndSet long value"); + } + + UNSAFE.putLong(base, offset, 1L); + + // get and add, add and get + { + long o = UNSAFE.getAndAddLong(base, offset, 2L); + assertEquals(o, 1L, "getAndAdd long"); + long x = UNSAFE.getLong(base, offset); + assertEquals(x, 1L + 2L, "weakCompareAndSwapRelease long"); + } + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putLong(address, 1L); + long x = UNSAFE.getLong(address); + assertEquals(x, 1L, "set long value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestObject.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestObject.java new file mode 100644 index 00000000000..75fb599340b --- /dev/null +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestObject.java @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8143628 + * @summary Test unsafe access for Object + * @modules java.base/sun.misc + * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestObject + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestObject + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestObject + * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestObject + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class SunMiscUnsafeAccessTestObject { + static final int ITERS = Integer.getInteger("iters", 1); + + static final sun.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = sun.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (sun.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = SunMiscUnsafeAccessTestObject.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = SunMiscUnsafeAccessTestObject.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(Object[].class); + int ascale = UNSAFE.arrayIndexScale(Object[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static Object static_v; + + Object v; + + @Test + public void testFieldInstance() { + SunMiscUnsafeAccessTestObject t = new SunMiscUnsafeAccessTestObject(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + Object[] array = new Object[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putObject(base, offset, "foo"); + Object x = UNSAFE.getObject(base, offset); + assertEquals(x, "foo", "set Object value"); + } + + // Volatile + { + UNSAFE.putObjectVolatile(base, offset, "bar"); + Object x = UNSAFE.getObjectVolatile(base, offset); + assertEquals(x, "bar", "putVolatile Object value"); + } + + // Lazy + { + UNSAFE.putOrderedObject(base, offset, "foo"); + Object x = UNSAFE.getObjectVolatile(base, offset); + assertEquals(x, "foo", "putRelease Object value"); + } + + + UNSAFE.putObject(base, offset, "foo"); + + // Compare + { + boolean r = UNSAFE.compareAndSwapObject(base, offset, "foo", "bar"); + assertEquals(r, true, "success compareAndSwap Object"); + Object x = UNSAFE.getObject(base, offset); + assertEquals(x, "bar", "success compareAndSwap Object value"); + } + + { + boolean r = UNSAFE.compareAndSwapObject(base, offset, "foo", "baz"); + assertEquals(r, false, "failing compareAndSwap Object"); + Object x = UNSAFE.getObject(base, offset); + assertEquals(x, "bar", "failing compareAndSwap Object value"); + } + + // Compare set and get + { + Object o = UNSAFE.getAndSetObject(base, offset, "foo"); + assertEquals(o, "bar", "getAndSet Object"); + Object x = UNSAFE.getObject(base, offset); + assertEquals(x, "foo", "getAndSet Object value"); + } + + } + +} diff --git a/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestShort.java b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestShort.java new file mode 100644 index 00000000000..ef4311483a6 --- /dev/null +++ b/hotspot/test/compiler/unsafe/SunMiscUnsafeAccessTestShort.java @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8143628 + * @summary Test unsafe access for short + * @modules java.base/sun.misc + * @run testng/othervm -Diters=100 -Xint SunMiscUnsafeAccessTestShort + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 SunMiscUnsafeAccessTestShort + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation SunMiscUnsafeAccessTestShort + * @run testng/othervm -Diters=20000 SunMiscUnsafeAccessTestShort + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class SunMiscUnsafeAccessTestShort { + static final int ITERS = Integer.getInteger("iters", 1); + + static final sun.misc.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = sun.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (sun.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = SunMiscUnsafeAccessTestShort.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = SunMiscUnsafeAccessTestShort.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset(short[].class); + int ascale = UNSAFE.arrayIndexScale(short[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static short static_v; + + short v; + + @Test + public void testFieldInstance() { + SunMiscUnsafeAccessTestShort t = new SunMiscUnsafeAccessTestShort(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + short[] array = new short[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.putShort(base, offset, (short)1); + short x = UNSAFE.getShort(base, offset); + assertEquals(x, (short)1, "set short value"); + } + + // Volatile + { + UNSAFE.putShortVolatile(base, offset, (short)2); + short x = UNSAFE.getShortVolatile(base, offset); + assertEquals(x, (short)2, "putVolatile short value"); + } + + + + + } + + static void testAccess(long address) { + // Plain + { + UNSAFE.putShort(address, (short)1); + short x = UNSAFE.getShort(address); + assertEquals(x, (short)1, "set short value"); + } + } +} diff --git a/hotspot/test/compiler/unsafe/X-UnsafeAccessTest.java.template b/hotspot/test/compiler/unsafe/X-UnsafeAccessTest.java.template new file mode 100644 index 00000000000..fcc74e325b0 --- /dev/null +++ b/hotspot/test/compiler/unsafe/X-UnsafeAccessTest.java.template @@ -0,0 +1,247 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8143628 + * @summary Test unsafe access for $type$ + * @modules java.base/$package$ + * @run testng/othervm -Diters=100 -Xint $Qualifier$UnsafeAccessTest$Type$ + * @run testng/othervm -Diters=20000 -XX:TieredStopAtLevel=1 $Qualifier$UnsafeAccessTest$Type$ + * @run testng/othervm -Diters=20000 -XX:-TieredCompilation $Qualifier$UnsafeAccessTest$Type$ + * @run testng/othervm -Diters=20000 $Qualifier$UnsafeAccessTest$Type$ + */ + +import org.testng.annotations.Test; + +import java.lang.reflect.Field; + +import static org.testng.Assert.*; + +public class $Qualifier$UnsafeAccessTest$Type$ { + static final int ITERS = Integer.getInteger("iters", 1); + + static final $package$.Unsafe UNSAFE; + + static final long V_OFFSET; + + static final Object STATIC_V_BASE; + + static final long STATIC_V_OFFSET; + + static int ARRAY_OFFSET; + + static int ARRAY_SHIFT; + + static { + try { + Field f = $package$.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = ($package$.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + + try { + Field staticVField = $Qualifier$UnsafeAccessTest$Type$.class.getDeclaredField("static_v"); + STATIC_V_BASE = UNSAFE.staticFieldBase(staticVField); + STATIC_V_OFFSET = UNSAFE.staticFieldOffset(staticVField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + try { + Field vField = $Qualifier$UnsafeAccessTest$Type$.class.getDeclaredField("v"); + V_OFFSET = UNSAFE.objectFieldOffset(vField); + } catch (Exception e) { + throw new RuntimeException(e); + } + + ARRAY_OFFSET = UNSAFE.arrayBaseOffset($type$[].class); + int ascale = UNSAFE.arrayIndexScale($type$[].class); + ARRAY_SHIFT = 31 - Integer.numberOfLeadingZeros(ascale); + } + + static $type$ static_v; + + $type$ v; + + @Test + public void testFieldInstance() { + $Qualifier$UnsafeAccessTest$Type$ t = new $Qualifier$UnsafeAccessTest$Type$(); + for (int c = 0; c < ITERS; c++) { + testAccess(t, V_OFFSET); + } + } + + @Test + public void testFieldStatic() { + for (int c = 0; c < ITERS; c++) { + testAccess(STATIC_V_BASE, STATIC_V_OFFSET); + } + } + + @Test + public void testArray() { + $type$[] array = new $type$[10]; + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < array.length; i++) { + testAccess(array, (((long) i) << ARRAY_SHIFT) + ARRAY_OFFSET); + } + } + } + +#if[!Object] +#if[!boolean] + @Test + public void testArrayOffHeap() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess(null, (((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } + + @Test + public void testArrayOffHeapDirect() { + int size = 10; + long address = UNSAFE.allocateMemory(size << ARRAY_SHIFT); + try { + for (int c = 0; c < ITERS; c++) { + for (int i = 0; i < size; i++) { + testAccess((((long) i) << ARRAY_SHIFT) + address); + } + } + } finally { + UNSAFE.freeMemory(address); + } + } +#end[!boolean] +#end[!Object] + + static void testAccess(Object base, long offset) { + // Plain + { + UNSAFE.put$Type$(base, offset, $value1$); + $type$ x = UNSAFE.get$Type$(base, offset); + assertEquals(x, $value1$, "set $type$ value"); + } + + // Volatile + { + UNSAFE.put$Type$Volatile(base, offset, $value2$); + $type$ x = UNSAFE.get$Type$Volatile(base, offset); + assertEquals(x, $value2$, "putVolatile $type$ value"); + } + +#if[Ordered] + // Lazy + { + UNSAFE.putOrdered$Type$(base, offset, $value1$); + $type$ x = UNSAFE.get$Type$Volatile(base, offset); + assertEquals(x, $value1$, "putRelease $type$ value"); + } +#end[Ordered] + +#if[JdkInternalMisc] +#if[Unaligned] + // Unaligned + { + UNSAFE.put$Type$Unaligned(base, offset, $value2$); + $type$ x = UNSAFE.get$Type$Unaligned(base, offset); + assertEquals(x, $value2$, "putUnaligned $type$ value"); + } + + { + UNSAFE.put$Type$Unaligned(base, offset, $value1$, true); + $type$ x = UNSAFE.get$Type$Unaligned(base, offset, true); + assertEquals(x, $value1$, "putUnaligned big endian $type$ value"); + } + + { + UNSAFE.put$Type$Unaligned(base, offset, $value2$, false); + $type$ x = UNSAFE.get$Type$Unaligned(base, offset, false); + assertEquals(x, $value2$, "putUnaligned little endian $type$ value"); + } +#end[Unaligned] +#end[JdkInternalMisc] + +#if[CAS] + UNSAFE.put$Type$(base, offset, $value1$); + + // Compare + { + boolean r = UNSAFE.compareAndSwap$Type$(base, offset, $value1$, $value2$); + assertEquals(r, true, "success compareAndSwap $type$"); + $type$ x = UNSAFE.get$Type$(base, offset); + assertEquals(x, $value2$, "success compareAndSwap $type$ value"); + } + + { + boolean r = UNSAFE.compareAndSwap$Type$(base, offset, $value1$, $value3$); + assertEquals(r, false, "failing compareAndSwap $type$"); + $type$ x = UNSAFE.get$Type$(base, offset); + assertEquals(x, $value2$, "failing compareAndSwap $type$ value"); + } + + // Compare set and get + { + $type$ o = UNSAFE.getAndSet$Type$(base, offset, $value1$); + assertEquals(o, $value2$, "getAndSet $type$"); + $type$ x = UNSAFE.get$Type$(base, offset); + assertEquals(x, $value1$, "getAndSet $type$ value"); + } +#end[CAS] + +#if[AtomicAdd] + UNSAFE.put$Type$(base, offset, $value1$); + + // get and add, add and get + { + $type$ o = UNSAFE.getAndAdd$Type$(base, offset, $value2$); + assertEquals(o, $value1$, "getAndAdd $type$"); + $type$ x = UNSAFE.get$Type$(base, offset); + assertEquals(x, $value1$ + $value2$, "weakCompareAndSwapRelease $type$"); + } +#end[AtomicAdd] + } + +#if[!Object] +#if[!boolean] + static void testAccess(long address) { + // Plain + { + UNSAFE.put$Type$(address, $value1$); + $type$ x = UNSAFE.get$Type$(address); + assertEquals(x, $value1$, "set $type$ value"); + } + } +#end[!boolean] +#end[!Object] +} \ No newline at end of file diff --git a/hotspot/test/compiler/unsafe/generate-unsafe-access-tests.sh b/hotspot/test/compiler/unsafe/generate-unsafe-access-tests.sh new file mode 100644 index 00000000000..fc4f7f47ee1 --- /dev/null +++ b/hotspot/test/compiler/unsafe/generate-unsafe-access-tests.sh @@ -0,0 +1,119 @@ +#!/bin/bash + +# +# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +javac -d . ../../../../jdk/make/src/classes/build/tools/spp/Spp.java + +SPP=build.tools.spp.Spp + +# Generates unsafe access tests for objects and all primitive types +# $1 = package name to Unsafe, sun.misc | jdk.internal.misc +# $2 = test class qualifier name, SunMisc | JdkInternalMisc +function generate { + package=$1 + Qualifier=$2 + + for type in boolean byte short char int long float double Object + do + Type="$(tr '[:lower:]' '[:upper:]' <<< ${type:0:1})${type:1}" + args="-K$type -Dtype=$type -DType=$Type" + + case $type in + Object|int|long) + args="$args -KCAS -KOrdered" + ;; + esac + + case $type in + int|long) + args="$args -KAtomicAdd" + ;; + esac + + case $type in + short|char|int|long) + args="$args -KUnaligned" + ;; + esac + + case $type in + boolean) + value1=true + value2=false + value3=false + ;; + byte) + value1=(byte)1 + value2=(byte)2 + value3=(byte)3 + ;; + short) + value1=(short)1 + value2=(short)2 + value3=(short)3 + ;; + char) + value1=\'a\' + value2=\'b\' + value3=\'c\' + ;; + int) + value1=1 + value2=2 + value3=3 + ;; + long) + value1=1L + value2=2L + value3=3L + ;; + float) + value1=1.0f + value2=2.0f + value3=3.0f + ;; + double) + value1=1.0d + value2=2.0d + value3=3.0d + ;; + Object) + value1=\"foo\" + value2=\"bar\" + value3=\"baz\" + ;; + esac + + args="$args -Dvalue1=$value1 -Dvalue2=$value2 -Dvalue3=$value3" + + echo $args + java $SPP -nel -K$Qualifier -Dpackage=$package -DQualifier=$Qualifier \ + $args < X-UnsafeAccessTest.java.template > ${Qualifier}UnsafeAccessTest${Type}.java + done +} + +generate sun.misc SunMisc +generate jdk.internal.misc JdkInternalMisc + +rm -fr build \ No newline at end of file From bbc34efe2612f099073d5b0eb119a2f253cc2c47 Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Wed, 9 Dec 2015 22:57:52 +0100 Subject: [PATCH 036/146] 8144944: JVMCI compiler initialization can happen on different thread than JVMCI initialization Reviewed-by: twisti --- .../src/jdk/vm/ci/inittimer/InitTimer.java | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.inittimer/src/jdk/vm/ci/inittimer/InitTimer.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.inittimer/src/jdk/vm/ci/inittimer/InitTimer.java index 608285e7e92..921b537bfb1 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.inittimer/src/jdk/vm/ci/inittimer/InitTimer.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.inittimer/src/jdk/vm/ci/inittimer/InitTimer.java @@ -22,6 +22,8 @@ */ package jdk.vm.ci.inittimer; +import java.util.concurrent.atomic.AtomicInteger; + /** * A facility for timing a step in the runtime initialization sequence. This is independent from all * other JVMCI code so as to not perturb the initialization sequence. It is enabled by setting the @@ -32,18 +34,26 @@ public final class InitTimer implements AutoCloseable { final long start; private InitTimer(String name) { + int n = nesting.getAndIncrement(); + if (n == 0) { + initializingThread = Thread.currentThread(); + System.out.println("INITIALIZING THREAD: " + initializingThread); + } else { + assert Thread.currentThread() == initializingThread : Thread.currentThread() + " != " + initializingThread; + } this.name = name; this.start = System.currentTimeMillis(); - System.out.println("START: " + SPACES.substring(0, timerDepth * 2) + name); - assert Thread.currentThread() == initializingThread : Thread.currentThread() + " != " + initializingThread; - timerDepth++; + System.out.println("START: " + SPACES.substring(0, n * 2) + name); } @SuppressFBWarnings(value = "ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD", justification = "only the initializing thread accesses this field") public void close() { final long end = System.currentTimeMillis(); - timerDepth--; - System.out.println(" DONE: " + SPACES.substring(0, timerDepth * 2) + name + " [" + (end - start) + " ms]"); + int n = nesting.decrementAndGet(); + System.out.println(" DONE: " + SPACES.substring(0, n * 2) + name + " [" + (end - start) + " ms]"); + if (n == 0) { + initializingThread = null; + } } public static InitTimer timer(String name) { @@ -59,19 +69,11 @@ public final class InitTimer implements AutoCloseable { */ private static final boolean ENABLED = Boolean.getBoolean("jvmci.inittimer") || Boolean.getBoolean("jvmci.runtime.TimeInit"); - public static int timerDepth = 0; + public static final AtomicInteger nesting = ENABLED ? new AtomicInteger() : null; public static final String SPACES = " "; /** - * Used to assert the invariant that all initialization happens on the same thread. + * Used to assert the invariant that all related initialization happens on the same thread. */ - public static final Thread initializingThread; - static { - if (ENABLED) { - initializingThread = Thread.currentThread(); - System.out.println("INITIALIZING THREAD: " + initializingThread); - } else { - initializingThread = null; - } - } + public static Thread initializingThread; } From 7b54819d3ee2fc6f34b22fcedd7956923685845a Mon Sep 17 00:00:00 2001 From: Nils Eliasson Date: Wed, 9 Dec 2015 13:41:04 +0100 Subject: [PATCH 037/146] 8144601: Premature assert in directive inline parsing Break after first fail Reviewed-by: roland --- hotspot/src/share/vm/compiler/directivesParser.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hotspot/src/share/vm/compiler/directivesParser.cpp b/hotspot/src/share/vm/compiler/directivesParser.cpp index e916b536dd2..7c2b15404ac 100644 --- a/hotspot/src/share/vm/compiler/directivesParser.cpp +++ b/hotspot/src/share/vm/compiler/directivesParser.cpp @@ -379,11 +379,12 @@ bool DirectivesParser::set_option(JSON_TYPE t, JSON_VAL* v) { const char* error_msg = NULL; if (current_directiveset == NULL) { - if (!current_directive->_c1_store->parse_and_add_inline(s, error_msg)) { - assert (error_msg != NULL, "Must have valid error message"); - error(VALUE_ERROR, "Method pattern error: %s", error_msg); - } - if (!current_directive->_c2_store->parse_and_add_inline(s, error_msg)) { + if (current_directive->_c1_store->parse_and_add_inline(s, error_msg)) { + if (!current_directive->_c2_store->parse_and_add_inline(s, error_msg)) { + assert (error_msg != NULL, "Must have valid error message"); + error(VALUE_ERROR, "Method pattern error: %s", error_msg); + } + } else { assert (error_msg != NULL, "Must have valid error message"); error(VALUE_ERROR, "Method pattern error: %s", error_msg); } From afeb87ddd8adffe47d5ce5b0a18d9122329bfbbc Mon Sep 17 00:00:00 2001 From: Vladimir Ivanov Date: Thu, 10 Dec 2015 14:51:53 +0300 Subject: [PATCH 038/146] 8144935: C2: safepoint is pruned from a non-counted loop Reviewed-by: roland --- hotspot/src/share/vm/opto/loopnode.cpp | 19 ++++++++++++++++--- hotspot/src/share/vm/opto/node.cpp | 11 +++++++++++ hotspot/src/share/vm/opto/node.hpp | 1 + 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/hotspot/src/share/vm/opto/loopnode.cpp b/hotspot/src/share/vm/opto/loopnode.cpp index db0b3c83c84..ac82a605303 100644 --- a/hotspot/src/share/vm/opto/loopnode.cpp +++ b/hotspot/src/share/vm/opto/loopnode.cpp @@ -1818,10 +1818,9 @@ void PhaseIdealLoop::replace_parallel_iv(IdealLoopTree *loop) { } void IdealLoopTree::remove_safepoints(PhaseIdealLoop* phase, bool keep_one) { - // Look for a safepoint on the idom-path. Node* keep = NULL; if (keep_one) { - // Keep one if possible + // Look for a safepoint on the idom-path. for (Node* i = tail(); i != _head; i = phase->idom(i)) { if (i->Opcode() == Op_SafePoint && phase->get_loop(i) == this) { keep = i; @@ -1830,9 +1829,14 @@ void IdealLoopTree::remove_safepoints(PhaseIdealLoop* phase, bool keep_one) { } } + // Don't remove any safepoints if it is requested to keep a single safepoint and + // no safepoint was found on idom-path. It is not safe to remove any safepoint + // in this case since there's no safepoint dominating all paths in the loop body. + bool prune = !keep_one || keep != NULL; + // Delete other safepoints in this loop. Node_List* sfpts = _safepts; - if (sfpts != NULL) { + if (prune && sfpts != NULL) { assert(keep == NULL || keep->Opcode() == Op_SafePoint, "not safepoint"); for (uint i = 0; i < sfpts->size(); i++) { Node* n = sfpts->at(i); @@ -1925,6 +1929,15 @@ void IdealLoopTree::dump_head( ) const { if (cl->is_main_loop()) tty->print(" main"); if (cl->is_post_loop()) tty->print(" post"); } + if (_has_call) tty->print(" has_call"); + if (_has_sfpt) tty->print(" has_sfpt"); + if (_rce_candidate) tty->print(" rce"); + if (_safepts != NULL && _safepts->size() > 0) { + tty->print(" sfpts={"); _safepts->dump_simple(); tty->print(" }"); + } + if (_required_safept != NULL && _required_safept->size() > 0) { + tty->print(" req={"); _required_safept->dump_simple(); tty->print(" }"); + } tty->cr(); } diff --git a/hotspot/src/share/vm/opto/node.cpp b/hotspot/src/share/vm/opto/node.cpp index dc91ef3e471..ac093690bc5 100644 --- a/hotspot/src/share/vm/opto/node.cpp +++ b/hotspot/src/share/vm/opto/node.cpp @@ -2365,6 +2365,17 @@ void Node_List::dump() const { #endif } +void Node_List::dump_simple() const { +#ifndef PRODUCT + for( uint i = 0; i < _cnt; i++ ) + if( _nodes[i] ) { + tty->print(" %d", _nodes[i]->_idx); + } else { + tty->print(" NULL"); + } +#endif +} + //============================================================================= //------------------------------remove----------------------------------------- void Unique_Node_List::remove( Node *n ) { diff --git a/hotspot/src/share/vm/opto/node.hpp b/hotspot/src/share/vm/opto/node.hpp index 0d29b85b45a..d737f537868 100644 --- a/hotspot/src/share/vm/opto/node.hpp +++ b/hotspot/src/share/vm/opto/node.hpp @@ -1442,6 +1442,7 @@ public: void clear() { _cnt = 0; Node_Array::clear(); } // retain storage uint size() const { return _cnt; } void dump() const; + void dump_simple() const; }; //------------------------------Unique_Node_List------------------------------- From e56a7de478a319879d8a9cb3dd2a90799580491d Mon Sep 17 00:00:00 2001 From: Vladimir Ivanov Date: Thu, 10 Dec 2015 14:51:54 +0300 Subject: [PATCH 039/146] 8145026: compiler/jsr292/NonInlinedCall/RedefineTest.java fails with: java.lang.NullPointerException in ClassFileInstaller.main Reviewed-by: roland --- hotspot/test/compiler/jsr292/NonInlinedCall/Agent.java | 1 - hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java | 6 ++---- hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java | 6 ++---- .../test/compiler/jsr292/NonInlinedCall/RedefineTest.java | 6 ++---- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/Agent.java b/hotspot/test/compiler/jsr292/NonInlinedCall/Agent.java index 415f0b6b903..70665d5f604 100644 --- a/hotspot/test/compiler/jsr292/NonInlinedCall/Agent.java +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/Agent.java @@ -22,7 +22,6 @@ */ import java.io.File; import java.io.PrintStream; -import java.lang.instrument.Instrumentation; import java.util.Arrays; public class Agent { diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java index 8be925b00d6..49ce05490fd 100644 --- a/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/GCTest.java @@ -24,8 +24,8 @@ /* * @test * @bug 8072008 - * @library /testlibrary /../../test/lib - * @build GCTest NonInlinedReinvoker + * @library /testlibrary /test/lib + * @compile GCTest.java NonInlinedReinvoker.java * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * java.lang.invoke.GCTest @@ -40,10 +40,8 @@ package java.lang.invoke; import sun.hotspot.WhiteBox; - import jdk.internal.vm.annotation.DontInline; import jdk.internal.vm.annotation.Stable; - import java.lang.ref.*; import static jdk.test.lib.Asserts.*; diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java index 8ab6031b575..72a521d480d 100644 --- a/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java @@ -24,8 +24,8 @@ /* * @test * @bug 8072008 - * @library /testlibrary /../../test/lib - * @build InvokeTest NonInlinedReinvoker + * @library /testlibrary /test/lib + * @compile InvokeTest.java NonInlinedReinvoker.java * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * java.lang.invoke.InvokeTest @@ -43,9 +43,7 @@ package java.lang.invoke; import sun.hotspot.WhiteBox; - import jdk.internal.vm.annotation.DontInline; - import static jdk.test.lib.Asserts.*; public class InvokeTest { diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java index 2da0f4bd70b..884295cf77e 100644 --- a/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/RedefineTest.java @@ -24,8 +24,8 @@ /* * @test * @bug 8072008 - * @library /testlibrary /../../test/lib - * @build RedefineTest Agent + * @library /testlibrary /test/lib + * @compile -XDignore.symbol.file RedefineTest.java Agent.java * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * java.lang.invoke.RedefineTest @@ -42,10 +42,8 @@ package java.lang.invoke; import sun.hotspot.WhiteBox; import sun.misc.Unsafe; - import jdk.internal.org.objectweb.asm.*; import jdk.internal.vm.annotation.DontInline; - import java.lang.instrument.ClassDefinition; import java.lang.instrument.Instrumentation; From 1a4c3a752dfa45eb6f09922077cb99941dced229 Mon Sep 17 00:00:00 2001 From: Vladimir Ivanov Date: Fri, 11 Dec 2015 15:03:11 +0300 Subject: [PATCH 040/146] 8145137: Incorrect call signature can be used in nmethod::preserve_callee_argument_oops Reviewed-by: roland, jrose --- hotspot/src/share/vm/code/nmethod.cpp | 21 ++++++++++++++++++- hotspot/src/share/vm/code/nmethod.hpp | 1 + .../src/share/vm/runtime/sharedRuntime.cpp | 5 +---- .../jsr292/NonInlinedCall/InvokeTest.java | 16 +++++++------- 4 files changed, 30 insertions(+), 13 deletions(-) diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp index 18625bcbbe3..a2f256a680d 100644 --- a/hotspot/src/share/vm/code/nmethod.cpp +++ b/hotspot/src/share/vm/code/nmethod.cpp @@ -2332,11 +2332,22 @@ bool nmethod::detect_scavenge_root_oops() { void nmethod::preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) { #ifndef SHARK if (method() != NULL && !method()->is_native()) { - SimpleScopeDesc ssd(this, fr.pc()); + address pc = fr.pc(); + SimpleScopeDesc ssd(this, pc); Bytecode_invoke call(ssd.method(), ssd.bci()); bool has_receiver = call.has_receiver(); bool has_appendix = call.has_appendix(); Symbol* signature = call.signature(); + + // The method attached by JIT-compilers should be used, if present. + // Bytecode can be inaccurate in such case. + Method* callee = attached_method_before_pc(pc); + if (callee != NULL) { + has_receiver = !(callee->access_flags().is_static()); + has_appendix = false; + signature = callee->signature(); + } + fr.oops_compiled_arguments_do(signature, has_receiver, has_appendix, reg_map, f); } #endif // !SHARK @@ -3526,3 +3537,11 @@ Method* nmethod::attached_method(address call_instr) { return NULL; // not found } +Method* nmethod::attached_method_before_pc(address pc) { + if (NativeCall::is_call_before(pc)) { + NativeCall* ncall = nativeCall_before(pc); + return attached_method(ncall->instruction_address()); + } + return NULL; // not a call +} + diff --git a/hotspot/src/share/vm/code/nmethod.hpp b/hotspot/src/share/vm/code/nmethod.hpp index 5f9b1aa320f..2305f51bc24 100644 --- a/hotspot/src/share/vm/code/nmethod.hpp +++ b/hotspot/src/share/vm/code/nmethod.hpp @@ -512,6 +512,7 @@ class nmethod : public CodeBlob { void copy_values(GrowableArray* metadata); Method* attached_method(address call_pc); + Method* attached_method_before_pc(address pc); // Relocation support private: diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp index a79ae71fbc6..02c8dc656d5 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp @@ -1078,10 +1078,7 @@ methodHandle SharedRuntime::extract_attached_method(vframeStream& vfst) { address pc = vfst.frame_pc(); { // Get call instruction under lock because another thread may be busy patching it. MutexLockerEx ml_patch(Patching_lock, Mutex::_no_safepoint_check_flag); - if (NativeCall::is_call_before(pc)) { - NativeCall* ncall = nativeCall_before(pc); - return caller_nm->attached_method(ncall->instruction_address()); - } + return caller_nm->attached_method_before_pc(pc); } return NULL; } diff --git a/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java b/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java index 72a521d480d..02bdef91a10 100644 --- a/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java +++ b/hotspot/test/compiler/jsr292/NonInlinedCall/InvokeTest.java @@ -74,23 +74,23 @@ public class InvokeTest { } static class T implements I { - @DontInline public Class f1() { if (doDeopt) WB.deoptimize(); return T.class; } - @DontInline public static Class f2() { if (doDeopt) WB.deoptimize(); return T.class; } - @DontInline private Class f4() { if (doDeopt) WB.deoptimize(); return T.class; } + @DontInline public Class f1() { if (doDeopt) WB.deoptimizeAll(); return T.class; } + @DontInline public static Class f2() { if (doDeopt) WB.deoptimizeAll(); return T.class; } + @DontInline private Class f4() { if (doDeopt) WB.deoptimizeAll(); return T.class; } } static class P1 extends T { - @DontInline public Class f1() { if (doDeopt) WB.deoptimize(); return P1.class; } - @DontInline public Class f3() { if (doDeopt) WB.deoptimize(); return P1.class; } + @DontInline public Class f1() { if (doDeopt) WB.deoptimizeAll(); return P1.class; } + @DontInline public Class f3() { if (doDeopt) WB.deoptimizeAll(); return P1.class; } } static class P2 extends T { - @DontInline public Class f1() { if (doDeopt) WB.deoptimize(); return P2.class; } - @DontInline public Class f3() { if (doDeopt) WB.deoptimize(); return P2.class; } + @DontInline public Class f1() { if (doDeopt) WB.deoptimizeAll(); return P2.class; } + @DontInline public Class f3() { if (doDeopt) WB.deoptimizeAll(); return P2.class; } } static interface I { - @DontInline default Class f3() { if (doDeopt) WB.deoptimize(); return I.class; } + @DontInline default Class f3() { if (doDeopt) WB.deoptimizeAll(); return I.class; } } @DontInline From 2b4403dc8837df2edb09a294c6cd0f902a6dba7c Mon Sep 17 00:00:00 2001 From: Goetz Lindenmaier Date: Mon, 14 Dec 2015 10:22:19 +0100 Subject: [PATCH 041/146] 8145300: ppc64: fix port of "8072008: Emit direct call instead of linkTo* for recursive indy/MH.invoke* calls" Reviewed-by: simonis --- hotspot/src/cpu/ppc/vm/ppc.ad | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/src/cpu/ppc/vm/ppc.ad b/hotspot/src/cpu/ppc/vm/ppc.ad index 781b4038229..682474c05a3 100644 --- a/hotspot/src/cpu/ppc/vm/ppc.ad +++ b/hotspot/src/cpu/ppc/vm/ppc.ad @@ -3486,6 +3486,7 @@ encode %{ call->_jvmadj = _jvmadj; call->_in_rms = _in_rms; call->_nesting = _nesting; + call->_override_symbolic_info = _override_symbolic_info; // New call needs all inputs of old call. // Req... From c2221a88e819436b7c973942367eb7eeabc354e7 Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Mon, 14 Dec 2015 15:53:48 +0000 Subject: [PATCH 042/146] 8145320: Create unsafe_arraycopy and generic_arraycopy for AArch64 Reviewed-by: kvn --- .../cpu/aarch64/vm/stubGenerator_aarch64.cpp | 364 +++++++++++++++++- 1 file changed, 355 insertions(+), 9 deletions(-) diff --git a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp index 2eb119125f2..30b42c0634c 100644 --- a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp @@ -958,8 +958,8 @@ class StubGenerator: public StubCodeGenerator { const Register t0 = r3, t1 = r4; if (is_backwards) { - __ lea(s, Address(s, count, Address::uxtw(exact_log2(-step)))); - __ lea(d, Address(d, count, Address::uxtw(exact_log2(-step)))); + __ lea(s, Address(s, count, Address::lsl(exact_log2(-step)))); + __ lea(d, Address(d, count, Address::lsl(exact_log2(-step)))); } Label done, tail; @@ -1051,10 +1051,10 @@ class StubGenerator: public StubCodeGenerator { __ cmp(rscratch2, count); __ br(Assembler::HS, end); if (size == (size_t)wordSize) { - __ ldr(temp, Address(a, rscratch2, Address::uxtw(exact_log2(size)))); + __ ldr(temp, Address(a, rscratch2, Address::lsl(exact_log2(size)))); __ verify_oop(temp); } else { - __ ldrw(r16, Address(a, rscratch2, Address::uxtw(exact_log2(size)))); + __ ldrw(r16, Address(a, rscratch2, Address::lsl(exact_log2(size)))); __ decode_heap_oop(temp); // calls verify_oop } __ add(rscratch2, rscratch2, size); @@ -1087,12 +1087,14 @@ class StubGenerator: public StubCodeGenerator { __ align(CodeEntryAlignment); StubCodeMark mark(this, "StubRoutines", name); address start = __ pc(); + __ enter(); + if (entry != NULL) { *entry = __ pc(); // caller can pass a 64-bit byte count here (from Unsafe.copyMemory) BLOCK_COMMENT("Entry:"); } - __ enter(); + if (is_oop) { __ push(RegSet::of(d, count), sp); // no registers are destroyed by this call @@ -1104,10 +1106,11 @@ class StubGenerator: public StubCodeGenerator { if (VerifyOops) verify_oop_array(size, d, count, r16); __ sub(count, count, 1); // make an inclusive end pointer - __ lea(count, Address(d, count, Address::uxtw(exact_log2(size)))); + __ lea(count, Address(d, count, Address::lsl(exact_log2(size)))); gen_write_ref_array_post_barrier(d, count, rscratch1); } __ leave(); + __ mov(r0, zr); // return 0 __ ret(lr); #ifdef BUILTIN_SIM { @@ -1140,11 +1143,16 @@ class StubGenerator: public StubCodeGenerator { StubCodeMark mark(this, "StubRoutines", name); address start = __ pc(); + __ enter(); + if (entry != NULL) { + *entry = __ pc(); + // caller can pass a 64-bit byte count here (from Unsafe.copyMemory) + BLOCK_COMMENT("Entry:"); + } __ cmp(d, s); __ br(Assembler::LS, nooverlap_target); - __ enter(); if (is_oop) { __ push(RegSet::of(d, count), sp); // no registers are destroyed by this call @@ -1160,6 +1168,7 @@ class StubGenerator: public StubCodeGenerator { gen_write_ref_array_post_barrier(d, count, rscratch1); } __ leave(); + __ mov(r0, zr); // return 0 __ ret(lr); #ifdef BUILTIN_SIM { @@ -1559,7 +1568,29 @@ class StubGenerator: public StubCodeGenerator { Register dst_pos, // destination position (c_rarg3) Register length, Register temp, - Label& L_failed) { Unimplemented(); } + Label& L_failed) { + BLOCK_COMMENT("arraycopy_range_checks:"); + + assert_different_registers(rscratch1, temp); + + // if (src_pos + length > arrayOop(src)->length()) FAIL; + __ ldrw(rscratch1, Address(src, arrayOopDesc::length_offset_in_bytes())); + __ addw(temp, length, src_pos); + __ cmpw(temp, rscratch1); + __ br(Assembler::HI, L_failed); + + // if (dst_pos + length > arrayOop(dst)->length()) FAIL; + __ ldrw(rscratch1, Address(dst, arrayOopDesc::length_offset_in_bytes())); + __ addw(temp, length, dst_pos); + __ cmpw(temp, rscratch1); + __ br(Assembler::HI, L_failed); + + // Have to clean up high 32 bits of 'src_pos' and 'dst_pos'. + __ movw(src_pos, src_pos); + __ movw(dst_pos, dst_pos); + + BLOCK_COMMENT("arraycopy_range_checks done"); + } // These stubs get called from some dumb test routine. // I'll write them properly when they're called from @@ -1569,6 +1600,309 @@ class StubGenerator: public StubCodeGenerator { } + // + // Generate 'unsafe' array copy stub + // Though just as safe as the other stubs, it takes an unscaled + // size_t argument instead of an element count. + // + // Input: + // c_rarg0 - source array address + // c_rarg1 - destination array address + // c_rarg2 - byte count, treated as ssize_t, can be zero + // + // Examines the alignment of the operands and dispatches + // to a long, int, short, or byte copy loop. + // + address generate_unsafe_copy(const char *name, + address byte_copy_entry) { +#ifdef PRODUCT + return StubRoutines::_jbyte_arraycopy; +#else + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", name); + address start = __ pc(); + __ enter(); // required for proper stackwalking of RuntimeStub frame + // bump this on entry, not on exit: + __ lea(rscratch2, ExternalAddress((address)&SharedRuntime::_unsafe_array_copy_ctr)); + __ incrementw(Address(rscratch2)); + __ b(RuntimeAddress(byte_copy_entry)); + return start; +#endif + } + + // + // Generate generic array copy stubs + // + // Input: + // c_rarg0 - src oop + // c_rarg1 - src_pos (32-bits) + // c_rarg2 - dst oop + // c_rarg3 - dst_pos (32-bits) + // c_rarg4 - element count (32-bits) + // + // Output: + // r0 == 0 - success + // r0 == -1^K - failure, where K is partial transfer count + // + address generate_generic_copy(const char *name, + address byte_copy_entry, address short_copy_entry, + address int_copy_entry, address oop_copy_entry, + address long_copy_entry, address checkcast_copy_entry) { + + Label L_failed, L_failed_0, L_objArray; + Label L_copy_bytes, L_copy_shorts, L_copy_ints, L_copy_longs; + + // Input registers + const Register src = c_rarg0; // source array oop + const Register src_pos = c_rarg1; // source position + const Register dst = c_rarg2; // destination array oop + const Register dst_pos = c_rarg3; // destination position + const Register length = c_rarg4; + + StubCodeMark mark(this, "StubRoutines", name); + + __ align(CodeEntryAlignment); + address start = __ pc(); + + __ enter(); // required for proper stackwalking of RuntimeStub frame + + // bump this on entry, not on exit: + inc_counter_np(SharedRuntime::_generic_array_copy_ctr); + + //----------------------------------------------------------------------- + // Assembler stub will be used for this call to arraycopy + // if the following conditions are met: + // + // (1) src and dst must not be null. + // (2) src_pos must not be negative. + // (3) dst_pos must not be negative. + // (4) length must not be negative. + // (5) src klass and dst klass should be the same and not NULL. + // (6) src and dst should be arrays. + // (7) src_pos + length must not exceed length of src. + // (8) dst_pos + length must not exceed length of dst. + // + + // if (src == NULL) return -1; + __ cbz(src, L_failed); + + // if (src_pos < 0) return -1; + __ tbnz(src_pos, 31, L_failed); // i.e. sign bit set + + // if (dst == NULL) return -1; + __ cbz(dst, L_failed); + + // if (dst_pos < 0) return -1; + __ tbnz(dst_pos, 31, L_failed); // i.e. sign bit set + + // registers used as temp + const Register scratch_length = r16; // elements count to copy + const Register scratch_src_klass = r17; // array klass + const Register lh = r18; // layout helper + + // if (length < 0) return -1; + __ movw(scratch_length, length); // length (elements count, 32-bits value) + __ tbnz(scratch_length, 31, L_failed); // i.e. sign bit set + + __ load_klass(scratch_src_klass, src); +#ifdef ASSERT + // assert(src->klass() != NULL); + { + BLOCK_COMMENT("assert klasses not null {"); + Label L1, L2; + __ cbnz(scratch_src_klass, L2); // it is broken if klass is NULL + __ bind(L1); + __ stop("broken null klass"); + __ bind(L2); + __ load_klass(rscratch1, dst); + __ cbz(rscratch1, L1); // this would be broken also + BLOCK_COMMENT("} assert klasses not null done"); + } +#endif + + // Load layout helper (32-bits) + // + // |array_tag| | header_size | element_type | |log2_element_size| + // 32 30 24 16 8 2 0 + // + // array_tag: typeArray = 0x3, objArray = 0x2, non-array = 0x0 + // + + const int lh_offset = in_bytes(Klass::layout_helper_offset()); + + // Handle objArrays completely differently... + const jint objArray_lh = Klass::array_layout_helper(T_OBJECT); + __ ldrw(lh, Address(scratch_src_klass, lh_offset)); + __ movw(rscratch1, objArray_lh); + __ eorw(rscratch2, lh, rscratch1); + __ cbzw(rscratch2, L_objArray); + + // if (src->klass() != dst->klass()) return -1; + __ load_klass(rscratch2, dst); + __ eor(rscratch2, rscratch2, scratch_src_klass); + __ cbnz(rscratch2, L_failed); + + // if (!src->is_Array()) return -1; + __ tbz(lh, 31, L_failed); // i.e. (lh >= 0) + + // At this point, it is known to be a typeArray (array_tag 0x3). +#ifdef ASSERT + { + BLOCK_COMMENT("assert primitive array {"); + Label L; + __ movw(rscratch2, Klass::_lh_array_tag_type_value << Klass::_lh_array_tag_shift); + __ cmpw(lh, rscratch2); + __ br(Assembler::GE, L); + __ stop("must be a primitive array"); + __ bind(L); + BLOCK_COMMENT("} assert primitive array done"); + } +#endif + + arraycopy_range_checks(src, src_pos, dst, dst_pos, scratch_length, + rscratch2, L_failed); + + // TypeArrayKlass + // + // src_addr = (src + array_header_in_bytes()) + (src_pos << log2elemsize); + // dst_addr = (dst + array_header_in_bytes()) + (dst_pos << log2elemsize); + // + + const Register rscratch1_offset = rscratch1; // array offset + const Register r18_elsize = lh; // element size + + __ ubfx(rscratch1_offset, lh, Klass::_lh_header_size_shift, + exact_log2(Klass::_lh_header_size_mask+1)); // array_offset + __ add(src, src, rscratch1_offset); // src array offset + __ add(dst, dst, rscratch1_offset); // dst array offset + BLOCK_COMMENT("choose copy loop based on element size"); + + // next registers should be set before the jump to corresponding stub + const Register from = c_rarg0; // source array address + const Register to = c_rarg1; // destination array address + const Register count = c_rarg2; // elements count + + // 'from', 'to', 'count' registers should be set in such order + // since they are the same as 'src', 'src_pos', 'dst'. + + assert(Klass::_lh_log2_element_size_shift == 0, "fix this code"); + + // The possible values of elsize are 0-3, i.e. exact_log2(element + // size in bytes). We do a simple bitwise binary search. + __ BIND(L_copy_bytes); + __ tbnz(r18_elsize, 1, L_copy_ints); + __ tbnz(r18_elsize, 0, L_copy_shorts); + __ lea(from, Address(src, src_pos));// src_addr + __ lea(to, Address(dst, dst_pos));// dst_addr + __ movw(count, scratch_length); // length + __ b(RuntimeAddress(byte_copy_entry)); + + __ BIND(L_copy_shorts); + __ lea(from, Address(src, src_pos, Address::lsl(1)));// src_addr + __ lea(to, Address(dst, dst_pos, Address::lsl(1)));// dst_addr + __ movw(count, scratch_length); // length + __ b(RuntimeAddress(short_copy_entry)); + + __ BIND(L_copy_ints); + __ tbnz(r18_elsize, 0, L_copy_longs); + __ lea(from, Address(src, src_pos, Address::lsl(2)));// src_addr + __ lea(to, Address(dst, dst_pos, Address::lsl(2)));// dst_addr + __ movw(count, scratch_length); // length + __ b(RuntimeAddress(int_copy_entry)); + + __ BIND(L_copy_longs); +#ifdef ASSERT + { + BLOCK_COMMENT("assert long copy {"); + Label L; + __ andw(lh, lh, Klass::_lh_log2_element_size_mask); // lh -> r18_elsize + __ cmpw(r18_elsize, LogBytesPerLong); + __ br(Assembler::EQ, L); + __ stop("must be long copy, but elsize is wrong"); + __ bind(L); + BLOCK_COMMENT("} assert long copy done"); + } +#endif + __ lea(from, Address(src, src_pos, Address::lsl(3)));// src_addr + __ lea(to, Address(dst, dst_pos, Address::lsl(3)));// dst_addr + __ movw(count, scratch_length); // length + __ b(RuntimeAddress(long_copy_entry)); + + // ObjArrayKlass + __ BIND(L_objArray); + // live at this point: scratch_src_klass, scratch_length, src[_pos], dst[_pos] + + Label L_plain_copy, L_checkcast_copy; + // test array classes for subtyping + __ load_klass(r18, dst); + __ cmp(scratch_src_klass, r18); // usual case is exact equality + __ br(Assembler::NE, L_checkcast_copy); + + // Identically typed arrays can be copied without element-wise checks. + arraycopy_range_checks(src, src_pos, dst, dst_pos, scratch_length, + rscratch2, L_failed); + + __ lea(from, Address(src, src_pos, Address::lsl(3))); + __ add(from, from, arrayOopDesc::base_offset_in_bytes(T_OBJECT)); + __ lea(to, Address(dst, dst_pos, Address::lsl(3))); + __ add(to, to, arrayOopDesc::base_offset_in_bytes(T_OBJECT)); + __ movw(count, scratch_length); // length + __ BIND(L_plain_copy); + __ b(RuntimeAddress(oop_copy_entry)); + + __ BIND(L_checkcast_copy); + // live at this point: scratch_src_klass, scratch_length, r18 (dst_klass) + { + // Before looking at dst.length, make sure dst is also an objArray. + __ ldrw(rscratch1, Address(r18, lh_offset)); + __ movw(rscratch2, objArray_lh); + __ eorw(rscratch1, rscratch1, rscratch2); + __ cbnzw(rscratch1, L_failed); + + // It is safe to examine both src.length and dst.length. + arraycopy_range_checks(src, src_pos, dst, dst_pos, scratch_length, + r18, L_failed); + + const Register rscratch2_dst_klass = rscratch2; + __ load_klass(rscratch2_dst_klass, dst); // reload + + // Marshal the base address arguments now, freeing registers. + __ lea(from, Address(src, src_pos, Address::lsl(3))); + __ add(from, from, arrayOopDesc::base_offset_in_bytes(T_OBJECT)); + __ lea(to, Address(dst, dst_pos, Address::lsl(3))); + __ add(to, to, arrayOopDesc::base_offset_in_bytes(T_OBJECT)); + __ movw(count, length); // length (reloaded) + Register sco_temp = c_rarg3; // this register is free now + assert_different_registers(from, to, count, sco_temp, + rscratch2_dst_klass, scratch_src_klass); + // assert_clean_int(count, sco_temp); + + // Generate the type check. + const int sco_offset = in_bytes(Klass::super_check_offset_offset()); + __ ldrw(sco_temp, Address(rscratch2_dst_klass, sco_offset)); + // assert_clean_int(sco_temp, r18); + generate_type_check(scratch_src_klass, sco_temp, rscratch2_dst_klass, L_plain_copy); + + // Fetch destination element klass from the ObjArrayKlass header. + int ek_offset = in_bytes(ObjArrayKlass::element_klass_offset()); + __ ldr(rscratch2_dst_klass, Address(rscratch2_dst_klass, ek_offset)); + __ ldrw(sco_temp, Address(rscratch2_dst_klass, sco_offset)); + + // the checkcast_copy loop needs two extra arguments: + assert(c_rarg3 == sco_temp, "#3 already in place"); + // Set up arguments for checkcast_copy_entry. + __ mov(c_rarg4, rscratch2_dst_klass); // dst.klass.element_klass + __ b(RuntimeAddress(checkcast_copy_entry)); + } + + __ BIND(L_failed); + __ mov(r0, -1); + __ leave(); // required for proper stackwalking of RuntimeStub frame + __ ret(lr); + + return start; + } + void generate_arraycopy_stubs() { address entry; address entry_jbyte_arraycopy; @@ -1655,6 +1989,18 @@ class StubGenerator: public StubCodeGenerator { StubRoutines::_checkcast_arraycopy = generate_checkcast_copy("checkcast_arraycopy", &entry_checkcast_arraycopy); StubRoutines::_checkcast_arraycopy_uninit = generate_checkcast_copy("checkcast_arraycopy_uninit", NULL, /*dest_uninitialized*/true); + + StubRoutines::_unsafe_arraycopy = generate_unsafe_copy("unsafe_arraycopy", + entry_jbyte_arraycopy); + + StubRoutines::_generic_arraycopy = generate_generic_copy("generic_arraycopy", + entry_jbyte_arraycopy, + entry_jshort_arraycopy, + entry_jint_arraycopy, + entry_oop_arraycopy, + entry_jlong_arraycopy, + entry_checkcast_arraycopy); + } void generate_math_stubs() { Unimplemented(); } @@ -1973,7 +2319,7 @@ class StubGenerator: public StubCodeGenerator { // c_rarg4 - input length // // Output: - // rax - input length + // r0 - input length // address generate_cipherBlockChaining_decryptAESCrypt() { assert(UseAES, "need AES instructions and misaligned SSE support"); From c095394bced5c3a8155c651fa28df81709815a28 Mon Sep 17 00:00:00 2001 From: Ed Nevill Date: Tue, 8 Dec 2015 14:26:17 +0000 Subject: [PATCH 043/146] 8144498: aarch64: large code cache generates SEGV Fix pd_call_destination to use is_call_at rather than is_call Reviewed-by: aph, adinn --- hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp index 3ab4f0b7b2c..42d2977b1b5 100644 --- a/hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp @@ -59,7 +59,7 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) { address Relocation::pd_call_destination(address orig_addr) { assert(is_call(), "should be a call here"); - if (is_call()) { + if (NativeCall::is_call_at(addr())) { address trampoline = nativeCall_at(addr())->get_trampoline(); if (trampoline) { return nativeCallTrampolineStub_at(trampoline)->destination(); From 238c184b1161cb916ee2a3caf56eab6c2e56f2b4 Mon Sep 17 00:00:00 2001 From: Yasumasa Suenaga Date: Wed, 9 Dec 2015 23:17:21 +0900 Subject: [PATCH 044/146] 8144965: Show oop pointer in call frame at HSDB Reviewed-by: jbachorik --- .../sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java index 342a96d6e36..37b730693f0 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java @@ -1921,6 +1921,15 @@ public class HTMLGenerator implements /* imports */ ClassConstants { buf.link(genPCHref(addressToLong(pc)), pc.toString()); } + if (!method.isStatic() && !method.isNative()) { + OopHandle oopHandle = vf.getLocals().oopHandleAt(0); + + if (oopHandle != null) { + buf.append(", oop = "); + buf.append(oopHandle.toString()); + } + } + if (vf.isCompiledFrame()) { buf.append(" (Compiled"); } From 30603c6599334c888670ad8e84263e99fac14221 Mon Sep 17 00:00:00 2001 From: Yasumasa Suenaga Date: Wed, 9 Dec 2015 21:24:57 +0900 Subject: [PATCH 045/146] 8144332: HSDB could not terminate when close button is pushed Reviewed-by: jbachorik --- .../share/classes/sun/jvm/hotspot/HSDB.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java index bac6fb7f548..901ac689e4c 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java @@ -125,10 +125,14 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener { } } - // close this tool without calling System.exit - protected void closeUI() { - workerThread.shutdown(); - frame.dispose(); + private class CloseUI extends WindowAdapter { + + @Override + public void windowClosing(WindowEvent e) { + workerThread.shutdown(); + frame.dispose(); + } + } public void run() { @@ -144,7 +148,8 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener { frame = new JFrame("HSDB - HotSpot Debugger"); frame.setSize(800, 600); - frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); + frame.addWindowListener(new CloseUI()); JMenuBar menuBar = new JMenuBar(); @@ -207,7 +212,8 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener { item = createMenuItem("Exit", new ActionListener() { public void actionPerformed(ActionEvent e) { - closeUI(); + workerThread.shutdown(); + frame.dispose(); } }); item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.ALT_MASK)); From bf5db7225437e03f0c0ec4e74468ea9538e32992 Mon Sep 17 00:00:00 2001 From: Christian Thalinger Date: Mon, 14 Dec 2015 17:02:02 -1000 Subject: [PATCH 046/146] 8134994: use separate VMStructs databases for SA and JVMCI Reviewed-by: kbarrett --- hotspot/src/cpu/x86/vm/vm_version_x86.hpp | 1 + .../hotspot/HotSpotResolvedJavaFieldImpl.java | 2 +- .../HotSpotResolvedObjectTypeImpl.java | 3 +- .../jdk/vm/ci/hotspot/HotSpotVMConfig.java | 322 +++---- .../ci/hotspotvmconfig/HotSpotVMManual.java | 44 - .../src/share/vm/classfile/javaClasses.hpp | 1 + hotspot/src/share/vm/classfile/vmSymbols.hpp | 1 + hotspot/src/share/vm/code/codeBlob.hpp | 2 + hotspot/src/share/vm/code/codeCache.hpp | 1 + hotspot/src/share/vm/code/nmethod.hpp | 1 + hotspot/src/share/vm/compiler/compileTask.hpp | 1 + hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp | 21 - .../src/share/vm/gc/shared/collectedHeap.hpp | 1 + .../vm/gc/shared/threadLocalAllocBuffer.hpp | 1 + .../src/share/vm/jvmci/jvmciCodeInstaller.hpp | 2 +- .../src/share/vm/jvmci/jvmciCompilerToVM.cpp | 203 +++-- .../src/share/vm/jvmci/jvmciCompilerToVM.hpp | 57 +- hotspot/src/share/vm/jvmci/jvmciEnv.hpp | 1 + hotspot/src/share/vm/jvmci/jvmciRuntime.cpp | 4 - .../src/share/vm/jvmci/vmStructs_jvmci.cpp | 849 ++++++++++++++++++ .../src/share/vm/jvmci/vmStructs_jvmci.hpp | 131 +-- hotspot/src/share/vm/oops/constMethod.hpp | 2 +- hotspot/src/share/vm/oops/constantPool.hpp | 1 + hotspot/src/share/vm/oops/instanceKlass.hpp | 1 + hotspot/src/share/vm/oops/klass.hpp | 1 + hotspot/src/share/vm/oops/klassVtable.hpp | 1 + hotspot/src/share/vm/oops/method.hpp | 1 + hotspot/src/share/vm/oops/methodCounters.hpp | 1 + hotspot/src/share/vm/oops/methodData.hpp | 9 + hotspot/src/share/vm/oops/objArrayKlass.hpp | 1 + hotspot/src/share/vm/oops/oop.hpp | 1 + hotspot/src/share/vm/runtime/basicLock.hpp | 1 + .../src/share/vm/runtime/deoptimization.hpp | 1 + .../src/share/vm/runtime/javaFrameAnchor.hpp | 1 + hotspot/src/share/vm/runtime/os.hpp | 1 + hotspot/src/share/vm/runtime/osThread.hpp | 1 + hotspot/src/share/vm/runtime/thread.hpp | 2 + hotspot/src/share/vm/runtime/vmStructs.cpp | 218 +---- hotspot/src/share/vm/runtime/vmStructs.hpp | 147 +++ hotspot/src/share/vm/utilities/array.hpp | 1 + hotspot/src/share/vm/utilities/exceptions.hpp | 1 + 41 files changed, 1367 insertions(+), 675 deletions(-) delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspotvmconfig/src/jdk/vm/ci/hotspotvmconfig/HotSpotVMManual.java create mode 100644 hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.hpp b/hotspot/src/cpu/x86/vm/vm_version_x86.hpp index 784e8475da9..624f138d5be 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86.hpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.hpp @@ -30,6 +30,7 @@ class VM_Version : public Abstract_VM_Version { friend class VMStructs; + friend class JVMCIVMStructs; public: // cpuid result register layouts. These are all unions of a uint32_t // (in case anyone wants access to the register as a whole) and a bitfield. diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java index cd89be3e563..d565dfe4d39 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java @@ -190,7 +190,7 @@ class HotSpotResolvedJavaFieldImpl implements HotSpotResolvedJavaField, HotSpotP @Override public boolean isSynthetic() { - return (config().syntheticFlag & modifiers) != 0; + return (config().jvmAccSynthetic & modifiers) != 0; } /** diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java index 4ef227ec823..65d92b1d8fd 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java @@ -324,8 +324,7 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem @Override public boolean hasFinalizer() { - HotSpotVMConfig config = config(); - return (getAccessFlags() & config.klassHasFinalizerFlag) != 0; + return (getAccessFlags() & config().jvmAccHasFinalizer) != 0; } @Override diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java index 2709c0807ac..228bff3a9a7 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java @@ -37,7 +37,6 @@ import jdk.vm.ci.hotspotvmconfig.HotSpotVMConstant; import jdk.vm.ci.hotspotvmconfig.HotSpotVMData; import jdk.vm.ci.hotspotvmconfig.HotSpotVMField; import jdk.vm.ci.hotspotvmconfig.HotSpotVMFlag; -import jdk.vm.ci.hotspotvmconfig.HotSpotVMManual; import jdk.vm.ci.hotspotvmconfig.HotSpotVMType; import sun.misc.Unsafe; @@ -68,11 +67,11 @@ public class HotSpotVMConfig { assert gHotSpotVMData != 0; // Make FindBugs happy. - gHotSpotVMStructs = 0; - gHotSpotVMTypes = 0; - gHotSpotVMIntConstants = 0; - gHotSpotVMLongConstants = 0; - gHotSpotVMAddresses = 0; + jvmciHotSpotVMStructs = 0; + jvmciHotSpotVMTypes = 0; + jvmciHotSpotVMIntConstants = 0; + jvmciHotSpotVMLongConstants = 0; + jvmciHotSpotVMAddresses = 0; // Initialize the gHotSpotVM fields. for (Field f : HotSpotVMConfig.class.getDeclaredFields()) { @@ -89,41 +88,17 @@ public class HotSpotVMConfig { } // Quick sanity check. - assert gHotSpotVMStructs != 0; - assert gHotSpotVMTypes != 0; - assert gHotSpotVMIntConstants != 0; - assert gHotSpotVMLongConstants != 0; - assert gHotSpotVMAddresses != 0; + assert jvmciHotSpotVMStructs != 0; + assert jvmciHotSpotVMTypes != 0; + assert jvmciHotSpotVMIntConstants != 0; + assert jvmciHotSpotVMLongConstants != 0; + assert jvmciHotSpotVMAddresses != 0; initialize(); oopEncoding = new CompressEncoding(narrowOopBase, narrowOopShift, logMinObjAlignment()); klassEncoding = new CompressEncoding(narrowKlassBase, narrowKlassShift, logKlassAlignment); - final long barrierSetAddress = UNSAFE.getAddress(universeCollectedHeap + collectedHeapBarrierSetOffset); - final int kind = UNSAFE.getInt(barrierSetAddress + barrierSetFakeRttiOffset + fakeRttiConcreteTagOffset); - if ((kind == barrierSetCardTableModRef) || (kind == barrierSetCardTableForRS) || (kind == barrierSetCardTableExtension) || (kind == barrierSetG1SATBCT) || (kind == barrierSetG1SATBCTLogging)) { - final long base = UNSAFE.getAddress(barrierSetAddress + cardTableModRefBSByteMapBaseOffset); - assert base != 0 : "unexpected byte_map_base: " + base; - cardtableStartAddress = base; - cardtableShift = cardTableModRefBSCardShift; - } else if (kind == barrierSetModRef) { - // No post barriers - cardtableStartAddress = 0; - cardtableShift = 0; - } else { - cardtableStartAddress = -1; - cardtableShift = -1; - } - - // Now handle all HotSpotVMManual fields. - inlineCacheMissStub = inlineCacheMissBlob + UNSAFE.getInt(inlineCacheMissBlob + codeBlobCodeOffsetOffset); - handleWrongMethodStub = wrongMethodBlob + UNSAFE.getInt(wrongMethodBlob + codeBlobCodeOffsetOffset); - handleDeoptStub = deoptBlob + UNSAFE.getInt(deoptBlob + codeBlobCodeOffsetOffset) + UNSAFE.getInt(deoptBlob + deoptimizationBlobUnpackOffsetOffset); - uncommonTrapStub = deoptBlob + UNSAFE.getInt(deoptBlob + codeBlobCodeOffsetOffset) + UNSAFE.getInt(deoptBlob + deoptimizationBlobUncommonTrapOffsetOffset); - - tlabAlignmentReserve = roundUp(threadLocalAllocBufferEndReserve(), minObjAlignment()); - assert check(); assert HotSpotVMConfigVerifier.check(); } @@ -139,28 +114,28 @@ public class HotSpotVMConfig { private void initialize() { // Fill the VM fields hash map. HashMap vmFields = new HashMap<>(); - for (VMFields.Field e : new VMFields(gHotSpotVMStructs)) { + for (VMFields.Field e : new VMFields(jvmciHotSpotVMStructs)) { vmFields.put(e.getName(), e); } // Fill the VM types hash map. HashMap vmTypes = new HashMap<>(); - for (VMTypes.Type e : new VMTypes(gHotSpotVMTypes)) { + for (VMTypes.Type e : new VMTypes(jvmciHotSpotVMTypes)) { vmTypes.put(e.getTypeName(), e); } // Fill the VM constants hash map. HashMap vmConstants = new HashMap<>(); - for (AbstractConstant e : new VMIntConstants(gHotSpotVMIntConstants)) { + for (AbstractConstant e : new VMIntConstants(jvmciHotSpotVMIntConstants)) { vmConstants.put(e.getName(), e); } - for (AbstractConstant e : new VMAddresses(gHotSpotVMLongConstants)) { + for (AbstractConstant e : new VMLongConstants(jvmciHotSpotVMLongConstants)) { vmConstants.put(e.getName(), e); } // Fill the VM addresses hash map. HashMap vmAddresses = new HashMap<>(); - for (VMAddresses.Address e : new VMAddresses(gHotSpotVMAddresses)) { + for (VMAddresses.Address e : new VMAddresses(jvmciHotSpotVMAddresses)) { vmAddresses.put(e.getName(), e); } @@ -213,6 +188,7 @@ public class HotSpotVMConfig { if (entry == null) { throw new JVMCIError(f.getName() + ": expected VM type not found: " + name); } + switch (annotation.get()) { case SIZE: setField(f, entry.getSize()); @@ -371,14 +347,14 @@ public class HotSpotVMConfig { /** * VMStructEntry (see {@code vmStructs.hpp}). */ - @HotSpotVMData(index = 0) @Stable private long gHotSpotVMStructs; - @HotSpotVMData(index = 1) @Stable private long gHotSpotVMStructEntryTypeNameOffset; - @HotSpotVMData(index = 2) @Stable private long gHotSpotVMStructEntryFieldNameOffset; - @HotSpotVMData(index = 3) @Stable private long gHotSpotVMStructEntryTypeStringOffset; - @HotSpotVMData(index = 4) @Stable private long gHotSpotVMStructEntryIsStaticOffset; - @HotSpotVMData(index = 5) @Stable private long gHotSpotVMStructEntryOffsetOffset; - @HotSpotVMData(index = 6) @Stable private long gHotSpotVMStructEntryAddressOffset; - @HotSpotVMData(index = 7) @Stable private long gHotSpotVMStructEntryArrayStride; + @HotSpotVMData(index = 0) @Stable private long jvmciHotSpotVMStructs; + @HotSpotVMData(index = 1) @Stable private long jvmciHotSpotVMStructEntryTypeNameOffset; + @HotSpotVMData(index = 2) @Stable private long jvmciHotSpotVMStructEntryFieldNameOffset; + @HotSpotVMData(index = 3) @Stable private long jvmciHotSpotVMStructEntryTypeStringOffset; + @HotSpotVMData(index = 4) @Stable private long jvmciHotSpotVMStructEntryIsStaticOffset; + @HotSpotVMData(index = 5) @Stable private long jvmciHotSpotVMStructEntryOffsetOffset; + @HotSpotVMData(index = 6) @Stable private long jvmciHotSpotVMStructEntryAddressOffset; + @HotSpotVMData(index = 7) @Stable private long jvmciHotSpotVMStructEntryArrayStride; final class VMFields implements Iterable { @@ -394,7 +370,7 @@ public class HotSpotVMConfig { private int index = 0; private Field current() { - return new Field(address + gHotSpotVMStructEntryArrayStride * index); + return new Field(address + jvmciHotSpotVMStructEntryArrayStride * index); } /** @@ -422,30 +398,30 @@ public class HotSpotVMConfig { } public String getTypeName() { - long typeNameAddress = UNSAFE.getAddress(entryAddress + gHotSpotVMStructEntryTypeNameOffset); + long typeNameAddress = UNSAFE.getAddress(entryAddress + jvmciHotSpotVMStructEntryTypeNameOffset); return readCString(UNSAFE, typeNameAddress); } public String getFieldName() { - long fieldNameAddress = UNSAFE.getAddress(entryAddress + gHotSpotVMStructEntryFieldNameOffset); + long fieldNameAddress = UNSAFE.getAddress(entryAddress + jvmciHotSpotVMStructEntryFieldNameOffset); return readCString(UNSAFE, fieldNameAddress); } public String getTypeString() { - long typeStringAddress = UNSAFE.getAddress(entryAddress + gHotSpotVMStructEntryTypeStringOffset); + long typeStringAddress = UNSAFE.getAddress(entryAddress + jvmciHotSpotVMStructEntryTypeStringOffset); return readCString(UNSAFE, typeStringAddress); } public boolean isStatic() { - return UNSAFE.getInt(entryAddress + gHotSpotVMStructEntryIsStaticOffset) != 0; + return UNSAFE.getInt(entryAddress + jvmciHotSpotVMStructEntryIsStaticOffset) != 0; } public long getOffset() { - return UNSAFE.getLong(entryAddress + gHotSpotVMStructEntryOffsetOffset); + return UNSAFE.getLong(entryAddress + jvmciHotSpotVMStructEntryOffsetOffset); } public long getAddress() { - return UNSAFE.getAddress(entryAddress + gHotSpotVMStructEntryAddressOffset); + return UNSAFE.getAddress(entryAddress + jvmciHotSpotVMStructEntryAddressOffset); } public String getName() { @@ -466,6 +442,7 @@ public class HotSpotVMConfig { case "address": case "intptr_t": case "uintptr_t": + case "size_t": return UNSAFE.getAddress(getAddress()); default: // All foo* types are addresses. @@ -487,14 +464,14 @@ public class HotSpotVMConfig { /** * VMTypeEntry (see vmStructs.hpp). */ - @HotSpotVMData(index = 8) @Stable private long gHotSpotVMTypes; - @HotSpotVMData(index = 9) @Stable private long gHotSpotVMTypeEntryTypeNameOffset; - @HotSpotVMData(index = 10) @Stable private long gHotSpotVMTypeEntrySuperclassNameOffset; - @HotSpotVMData(index = 11) @Stable private long gHotSpotVMTypeEntryIsOopTypeOffset; - @HotSpotVMData(index = 12) @Stable private long gHotSpotVMTypeEntryIsIntegerTypeOffset; - @HotSpotVMData(index = 13) @Stable private long gHotSpotVMTypeEntryIsUnsignedOffset; - @HotSpotVMData(index = 14) @Stable private long gHotSpotVMTypeEntrySizeOffset; - @HotSpotVMData(index = 15) @Stable private long gHotSpotVMTypeEntryArrayStride; + @HotSpotVMData(index = 8) @Stable private long jvmciHotSpotVMTypes; + @HotSpotVMData(index = 9) @Stable private long jvmciHotSpotVMTypeEntryTypeNameOffset; + @HotSpotVMData(index = 10) @Stable private long jvmciHotSpotVMTypeEntrySuperclassNameOffset; + @HotSpotVMData(index = 11) @Stable private long jvmciHotSpotVMTypeEntryIsOopTypeOffset; + @HotSpotVMData(index = 12) @Stable private long jvmciHotSpotVMTypeEntryIsIntegerTypeOffset; + @HotSpotVMData(index = 13) @Stable private long jvmciHotSpotVMTypeEntryIsUnsignedOffset; + @HotSpotVMData(index = 14) @Stable private long jvmciHotSpotVMTypeEntrySizeOffset; + @HotSpotVMData(index = 15) @Stable private long jvmciHotSpotVMTypeEntryArrayStride; final class VMTypes implements Iterable { @@ -510,7 +487,7 @@ public class HotSpotVMConfig { private int index = 0; private Type current() { - return new Type(address + gHotSpotVMTypeEntryArrayStride * index); + return new Type(address + jvmciHotSpotVMTypeEntryArrayStride * index); } /** @@ -538,29 +515,29 @@ public class HotSpotVMConfig { } public String getTypeName() { - long typeNameAddress = UNSAFE.getAddress(entryAddress + gHotSpotVMTypeEntryTypeNameOffset); + long typeNameAddress = UNSAFE.getAddress(entryAddress + jvmciHotSpotVMTypeEntryTypeNameOffset); return readCString(UNSAFE, typeNameAddress); } public String getSuperclassName() { - long superclassNameAddress = UNSAFE.getAddress(entryAddress + gHotSpotVMTypeEntrySuperclassNameOffset); + long superclassNameAddress = UNSAFE.getAddress(entryAddress + jvmciHotSpotVMTypeEntrySuperclassNameOffset); return readCString(UNSAFE, superclassNameAddress); } public boolean isOopType() { - return UNSAFE.getInt(entryAddress + gHotSpotVMTypeEntryIsOopTypeOffset) != 0; + return UNSAFE.getInt(entryAddress + jvmciHotSpotVMTypeEntryIsOopTypeOffset) != 0; } public boolean isIntegerType() { - return UNSAFE.getInt(entryAddress + gHotSpotVMTypeEntryIsIntegerTypeOffset) != 0; + return UNSAFE.getInt(entryAddress + jvmciHotSpotVMTypeEntryIsIntegerTypeOffset) != 0; } public boolean isUnsigned() { - return UNSAFE.getInt(entryAddress + gHotSpotVMTypeEntryIsUnsignedOffset) != 0; + return UNSAFE.getInt(entryAddress + jvmciHotSpotVMTypeEntryIsUnsignedOffset) != 0; } public long getSize() { - return UNSAFE.getLong(entryAddress + gHotSpotVMTypeEntrySizeOffset); + return UNSAFE.getLong(entryAddress + jvmciHotSpotVMTypeEntrySizeOffset); } @Override @@ -594,10 +571,10 @@ public class HotSpotVMConfig { /** * VMIntConstantEntry (see vmStructs.hpp). */ - @HotSpotVMData(index = 16) @Stable private long gHotSpotVMIntConstants; - @HotSpotVMData(index = 17) @Stable private long gHotSpotVMIntConstantEntryNameOffset; - @HotSpotVMData(index = 18) @Stable private long gHotSpotVMIntConstantEntryValueOffset; - @HotSpotVMData(index = 19) @Stable private long gHotSpotVMIntConstantEntryArrayStride; + @HotSpotVMData(index = 16) @Stable private long jvmciHotSpotVMIntConstants; + @HotSpotVMData(index = 17) @Stable private long jvmciHotSpotVMIntConstantEntryNameOffset; + @HotSpotVMData(index = 18) @Stable private long jvmciHotSpotVMIntConstantEntryValueOffset; + @HotSpotVMData(index = 19) @Stable private long jvmciHotSpotVMIntConstantEntryArrayStride; final class VMIntConstants implements Iterable { @@ -613,7 +590,7 @@ public class HotSpotVMConfig { private int index = 0; private Constant current() { - return new Constant(address + gHotSpotVMIntConstantEntryArrayStride * index); + return new Constant(address + jvmciHotSpotVMIntConstantEntryArrayStride * index); } /** @@ -635,7 +612,7 @@ public class HotSpotVMConfig { final class Constant extends AbstractConstant { Constant(long address) { - super(address, gHotSpotVMIntConstantEntryNameOffset, gHotSpotVMIntConstantEntryValueOffset); + super(address, jvmciHotSpotVMIntConstantEntryNameOffset, jvmciHotSpotVMIntConstantEntryValueOffset); } @Override @@ -653,10 +630,10 @@ public class HotSpotVMConfig { /** * VMLongConstantEntry (see vmStructs.hpp). */ - @HotSpotVMData(index = 20) @Stable private long gHotSpotVMLongConstants; - @HotSpotVMData(index = 21) @Stable private long gHotSpotVMLongConstantEntryNameOffset; - @HotSpotVMData(index = 22) @Stable private long gHotSpotVMLongConstantEntryValueOffset; - @HotSpotVMData(index = 23) @Stable private long gHotSpotVMLongConstantEntryArrayStride; + @HotSpotVMData(index = 20) @Stable private long jvmciHotSpotVMLongConstants; + @HotSpotVMData(index = 21) @Stable private long jvmciHotSpotVMLongConstantEntryNameOffset; + @HotSpotVMData(index = 22) @Stable private long jvmciHotSpotVMLongConstantEntryValueOffset; + @HotSpotVMData(index = 23) @Stable private long jvmciHotSpotVMLongConstantEntryArrayStride; final class VMLongConstants implements Iterable { @@ -672,7 +649,7 @@ public class HotSpotVMConfig { private int index = 0; private Constant currentEntry() { - return new Constant(address + gHotSpotVMLongConstantEntryArrayStride * index); + return new Constant(address + jvmciHotSpotVMLongConstantEntryArrayStride * index); } /** @@ -694,7 +671,7 @@ public class HotSpotVMConfig { final class Constant extends AbstractConstant { Constant(long address) { - super(address, gHotSpotVMLongConstantEntryNameOffset, gHotSpotVMLongConstantEntryValueOffset); + super(address, jvmciHotSpotVMLongConstantEntryNameOffset, jvmciHotSpotVMLongConstantEntryValueOffset); } @Override @@ -712,10 +689,10 @@ public class HotSpotVMConfig { /** * VMAddressEntry (see vmStructs.hpp). */ - @HotSpotVMData(index = 24) @Stable private long gHotSpotVMAddresses; - @HotSpotVMData(index = 25) @Stable private long gHotSpotVMAddressEntryNameOffset; - @HotSpotVMData(index = 26) @Stable private long gHotSpotVMAddressEntryValueOffset; - @HotSpotVMData(index = 27) @Stable private long gHotSpotVMAddressEntryArrayStride; + @HotSpotVMData(index = 24) @Stable private long jvmciHotSpotVMAddresses; + @HotSpotVMData(index = 25) @Stable private long jvmciHotSpotVMAddressEntryNameOffset; + @HotSpotVMData(index = 26) @Stable private long jvmciHotSpotVMAddressEntryValueOffset; + @HotSpotVMData(index = 27) @Stable private long jvmciHotSpotVMAddressEntryArrayStride; final class VMAddresses implements Iterable { @@ -731,7 +708,7 @@ public class HotSpotVMConfig { private int index = 0; private Address currentEntry() { - return new Address(address + gHotSpotVMAddressEntryArrayStride * index); + return new Address(address + jvmciHotSpotVMAddressEntryArrayStride * index); } /** @@ -753,7 +730,7 @@ public class HotSpotVMConfig { final class Address extends AbstractConstant { Address(long address) { - super(address, gHotSpotVMAddressEntryNameOffset, gHotSpotVMAddressEntryValueOffset); + super(address, jvmciHotSpotVMAddressEntryNameOffset, jvmciHotSpotVMAddressEntryValueOffset); } @Override @@ -896,7 +873,7 @@ public class HotSpotVMConfig { @HotSpotVMFlag(name = "FlightRecorder", optional = true) @Stable public boolean flightRecorder; - @HotSpotVMField(name = "Universe::_collectedHeap", type = "CollectedHeap*", get = HotSpotVMField.Type.VALUE) @Stable private long universeCollectedHeap; + @HotSpotVMField(name = "CompilerToVM::Data::Universe_collectedHeap", type = "CollectedHeap*", get = HotSpotVMField.Type.VALUE) @Stable private long universeCollectedHeap; @HotSpotVMField(name = "CollectedHeap::_total_collections", type = "unsigned int", get = HotSpotVMField.Type.OFFSET) @Stable private int collectedHeapTotalCollectionsOffset; public long gcTotalCollectionsAddress() { @@ -909,8 +886,8 @@ public class HotSpotVMConfig { @HotSpotVMFlag(name = "UseCompressedOops") @Stable public boolean useCompressedOops; @HotSpotVMFlag(name = "UseCompressedClassPointers") @Stable public boolean useCompressedClassPointers; - @HotSpotVMField(name = "Universe::_narrow_oop._base", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long narrowOopBase; - @HotSpotVMField(name = "Universe::_narrow_oop._shift", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int narrowOopShift; + @HotSpotVMField(name = "CompilerToVM::Data::Universe_narrow_oop_base", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long narrowOopBase; + @HotSpotVMField(name = "CompilerToVM::Data::Universe_narrow_oop_shift", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int narrowOopShift; @HotSpotVMFlag(name = "ObjectAlignmentInBytes") @Stable public int objectAlignment; public final int minObjAlignment() { @@ -922,16 +899,14 @@ public class HotSpotVMConfig { } @HotSpotVMType(name = "narrowKlass", get = HotSpotVMType.Type.SIZE) @Stable public int narrowKlassSize; - @HotSpotVMField(name = "Universe::_narrow_klass._base", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long narrowKlassBase; - @HotSpotVMField(name = "Universe::_narrow_klass._shift", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int narrowKlassShift; + @HotSpotVMField(name = "CompilerToVM::Data::Universe_narrow_klass_base", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long narrowKlassBase; + @HotSpotVMField(name = "CompilerToVM::Data::Universe_narrow_klass_shift", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int narrowKlassShift; @HotSpotVMConstant(name = "LogKlassAlignmentInBytes") @Stable public int logKlassAlignment; // CPU capabilities @HotSpotVMFlag(name = "UseSSE") @Stable public int useSSE; @HotSpotVMFlag(name = "UseAVX", archs = {"amd64"}) @Stable public int useAVX; - @HotSpotVMField(name = "Abstract_VM_Version::_reserve_for_allocation_prefetch", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int abstractVmVersionReserveForAllocationPrefetch; - // X86 specific values @HotSpotVMField(name = "VM_Version::_cpuFeatures", type = "uint64_t", get = HotSpotVMField.Type.VALUE, archs = {"amd64"}) @Stable public long x86CPUFeatures; @HotSpotVMConstant(name = "VM_Version::CPU_CX8", archs = {"amd64"}) @Stable public long cpuCX8; @@ -1054,7 +1029,8 @@ public class HotSpotVMConfig { @HotSpotVMField(name = "InstanceKlass::_init_state", type = "u1", get = HotSpotVMField.Type.OFFSET) @Stable public int instanceKlassInitStateOffset; @HotSpotVMField(name = "InstanceKlass::_constants", type = "ConstantPool*", get = HotSpotVMField.Type.OFFSET) @Stable public int instanceKlassConstantsOffset; @HotSpotVMField(name = "InstanceKlass::_fields", type = "Array*", get = HotSpotVMField.Type.OFFSET) @Stable public int instanceKlassFieldsOffset; - @HotSpotVMField(name = "InstanceKlass::_vtable_len", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int instanceKlassVtableLengthOffset; + @HotSpotVMField(name = "CompilerToVM::Data::InstanceKlass_vtable_start_offset", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int instanceKlassVtableStartOffset; + @HotSpotVMField(name = "CompilerToVM::Data::InstanceKlass_vtable_length_offset", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int instanceKlassVtableLengthOffset; @HotSpotVMConstant(name = "InstanceKlass::linked") @Stable public int instanceKlassStateLinked; @HotSpotVMConstant(name = "InstanceKlass::fully_initialized") @Stable public int instanceKlassStateFullyInitialized; @@ -1063,12 +1039,7 @@ public class HotSpotVMConfig { * See {@code InstanceKlass::vtable_start_offset()}. */ public final int instanceKlassVtableStartOffset() { - return roundUp(instanceKlassSize, heapWordSize); - } - - // TODO use CodeUtil method once it's moved from NumUtil - private static int roundUp(int number, int mod) { - return ((number + mod - 1) / mod) * mod; + return instanceKlassVtableStartOffset * heapWordSize; } @HotSpotVMType(name = "arrayOopDesc", get = HotSpotVMType.Type.SIZE) @Stable public int arrayOopDescSize; @@ -1100,11 +1071,22 @@ public class HotSpotVMConfig { @HotSpotVMConstant(name = "FIELDINFO_TAG_SIZE") @Stable public int fieldInfoTagSize; + @HotSpotVMConstant(name = "JVM_ACC_MONITOR_MATCH") @Stable public int jvmAccMonitorMatch; + @HotSpotVMConstant(name = "JVM_ACC_HAS_MONITOR_BYTECODES") @Stable public int jvmAccHasMonitorBytecodes; + @HotSpotVMConstant(name = "JVM_ACC_HAS_FINALIZER") @Stable public int jvmAccHasFinalizer; @HotSpotVMConstant(name = "JVM_ACC_FIELD_INTERNAL") @Stable public int jvmAccFieldInternal; @HotSpotVMConstant(name = "JVM_ACC_FIELD_STABLE") @Stable public int jvmAccFieldStable; @HotSpotVMConstant(name = "JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE") @Stable public int jvmAccFieldHasGenericSignature; @HotSpotVMConstant(name = "JVM_ACC_WRITTEN_FLAGS") @Stable public int jvmAccWrittenFlags; + // Modifier.SYNTHETIC is not public so we get it via vmStructs. + @HotSpotVMConstant(name = "JVM_ACC_SYNTHETIC") @Stable public int jvmAccSynthetic; + + /** + * @see HotSpotResolvedObjectTypeImpl#createField + */ + @HotSpotVMConstant(name = "JVM_RECOGNIZED_FIELD_MODIFIERS") @Stable public int recognizedFieldModifiers; + @HotSpotVMField(name = "Thread::_tlab", type = "ThreadLocalAllocBuffer", get = HotSpotVMField.Type.OFFSET) @Stable public int threadTlabOffset; @HotSpotVMField(name = "JavaThread::_anchor", type = "JavaFrameAnchor", get = HotSpotVMField.Type.OFFSET) @Stable public int javaThreadAnchorOffset; @@ -1202,16 +1184,17 @@ public class HotSpotVMConfig { @HotSpotVMField(name = "OSThread::_interrupted", type = "jint", get = HotSpotVMField.Type.OFFSET) @Stable public int osThreadInterruptedOffset; - @HotSpotVMConstant(name = "markOopDesc::unlocked_value") @Stable public int unlockedMask; + @HotSpotVMConstant(name = "markOopDesc::hash_shift") @Stable public long markOopDescHashShift; + @HotSpotVMConstant(name = "markOopDesc::biased_lock_mask_in_place") @Stable public int biasedLockMaskInPlace; @HotSpotVMConstant(name = "markOopDesc::age_mask_in_place") @Stable public int ageMaskInPlace; @HotSpotVMConstant(name = "markOopDesc::epoch_mask_in_place") @Stable public int epochMaskInPlace; - - @HotSpotVMConstant(name = "markOopDesc::hash_shift") @Stable public long markOopDescHashShift; @HotSpotVMConstant(name = "markOopDesc::hash_mask") @Stable public long markOopDescHashMask; @HotSpotVMConstant(name = "markOopDesc::hash_mask_in_place") @Stable public long markOopDescHashMaskInPlace; + @HotSpotVMConstant(name = "markOopDesc::unlocked_value") @Stable public int unlockedMask; @HotSpotVMConstant(name = "markOopDesc::biased_lock_pattern") @Stable public int biasedLockPattern; + @HotSpotVMConstant(name = "markOopDesc::no_hash_in_place") @Stable public int markWordNoHashInPlace; @HotSpotVMConstant(name = "markOopDesc::no_lock_in_place") @Stable public int markWordNoLockInPlace; @@ -1247,6 +1230,11 @@ public class HotSpotVMConfig { @HotSpotVMField(name = "Method::_flags", type = "u1", get = HotSpotVMField.Type.OFFSET) @Stable public int methodFlagsOffset; @HotSpotVMField(name = "Method::_vtable_index", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int methodVtableIndexOffset; + @HotSpotVMField(name = "Method::_method_counters", type = "MethodCounters*", get = HotSpotVMField.Type.OFFSET) @Stable public int methodCountersOffset; + @HotSpotVMField(name = "Method::_method_data", type = "MethodData*", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataOffset; + @HotSpotVMField(name = "Method::_from_compiled_entry", type = "address", get = HotSpotVMField.Type.OFFSET) @Stable public int methodCompiledEntryOffset; + @HotSpotVMField(name = "Method::_code", type = "nmethod*", get = HotSpotVMField.Type.OFFSET) @Stable public int methodCodeOffset; + @HotSpotVMConstant(name = "Method::_jfr_towrite") @Stable public int methodFlagsJfrTowrite; @HotSpotVMConstant(name = "Method::_caller_sensitive") @Stable public int methodFlagsCallerSensitive; @HotSpotVMConstant(name = "Method::_force_inline") @Stable public int methodFlagsForceInline; @@ -1255,16 +1243,29 @@ public class HotSpotVMConfig { @HotSpotVMConstant(name = "Method::nonvirtual_vtable_index") @Stable public int nonvirtualVtableIndex; @HotSpotVMConstant(name = "Method::invalid_vtable_index") @Stable public int invalidVtableIndex; + @HotSpotVMField(name = "MethodCounters::_invocation_counter", type = "InvocationCounter", get = HotSpotVMField.Type.OFFSET) @Stable public int invocationCounterOffset; + @HotSpotVMField(name = "MethodCounters::_backedge_counter", type = "InvocationCounter", get = HotSpotVMField.Type.OFFSET) @Stable public int backedgeCounterOffset; + @HotSpotVMConstant(name = "InvocationCounter::count_increment") @Stable public int invocationCounterIncrement; + @HotSpotVMConstant(name = "InvocationCounter::count_shift") @Stable public int invocationCounterShift; + + @HotSpotVMField(name = "MethodData::_size", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataSize; + @HotSpotVMField(name = "MethodData::_data_size", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataDataSize; + @HotSpotVMField(name = "MethodData::_data[0]", type = "intptr_t", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataOopDataOffset; + @HotSpotVMField(name = "MethodData::_trap_hist._array[0]", type = "u1", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataOopTrapHistoryOffset; + @HotSpotVMField(name = "MethodData::_jvmci_ir_size", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataIRSizeOffset; + + @HotSpotVMField(name = "nmethod::_verified_entry_point", type = "address", get = HotSpotVMField.Type.OFFSET) @Stable public int nmethodEntryOffset; + @HotSpotVMField(name = "nmethod::_comp_level", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int nmethodCompLevelOffset; + + @HotSpotVMConstant(name = "CompLevel_full_optimization") @Stable public int compilationLevelFullOptimization; + @HotSpotVMConstant(name = "InvocationEntryBci") @Stable public int invocationEntryBci; @HotSpotVMField(name = "JVMCIEnv::_task", type = "CompileTask*", get = HotSpotVMField.Type.OFFSET) @Stable public int jvmciEnvTaskOffset; @HotSpotVMField(name = "JVMCIEnv::_jvmti_can_hotswap_or_post_breakpoint", type = "bool", get = HotSpotVMField.Type.OFFSET) @Stable public int jvmciEnvJvmtiCanHotswapOrPostBreakpointOffset; @HotSpotVMField(name = "CompileTask::_num_inlined_bytecodes", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int compileTaskNumInlinedBytecodesOffset; - /** - * See {@code Method::extra_stack_entries()}. - */ - @HotSpotVMConstant(name = "Method::extra_stack_entries_for_jsr292") @Stable public int extraStackEntries; + @HotSpotVMField(name = "CompilerToVM::Data::Method_extra_stack_entries", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int extraStackEntries; @HotSpotVMField(name = "ConstMethod::_constants", type = "ConstantPool*", get = HotSpotVMField.Type.OFFSET) @Stable public int constMethodConstantsOffset; @HotSpotVMField(name = "ConstMethod::_flags", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int constMethodFlagsOffset; @@ -1325,72 +1326,39 @@ public class HotSpotVMConfig { @HotSpotVMConstant(name = "HeapWordSize") @Stable public int heapWordSize; @HotSpotVMType(name = "Symbol*", get = HotSpotVMType.Type.SIZE) @Stable public int symbolPointerSize; - @HotSpotVMField(name = "Symbol::_length", type = "unsigned short", get = HotSpotVMField.Type.OFFSET) @Stable public int symbolLengthOffset; - @HotSpotVMField(name = "Symbol::_body[0]", type = "jbyte", get = HotSpotVMField.Type.OFFSET) @Stable public int symbolBodyOffset; @HotSpotVMField(name = "vmSymbols::_symbols[0]", type = "Symbol*", get = HotSpotVMField.Type.ADDRESS) @Stable public long vmSymbolsSymbols; @HotSpotVMConstant(name = "vmSymbols::FIRST_SID") @Stable public int vmSymbolsFirstSID; @HotSpotVMConstant(name = "vmSymbols::SID_LIMIT") @Stable public int vmSymbolsSIDLimit; - @HotSpotVMConstant(name = "JVM_ACC_HAS_FINALIZER") @Stable public int klassHasFinalizerFlag; - - // Modifier.SYNTHETIC is not public so we get it via vmStructs. - @HotSpotVMConstant(name = "JVM_ACC_SYNTHETIC") @Stable public int syntheticFlag; - - /** - * @see HotSpotResolvedObjectTypeImpl#createField - */ - @HotSpotVMConstant(name = "JVM_RECOGNIZED_FIELD_MODIFIERS") @Stable public int recognizedFieldModifiers; - /** * Bit pattern that represents a non-oop. Neither the high bits nor the low bits of this value * are allowed to look like (respectively) the high or low bits of a real oop. */ - @HotSpotVMField(name = "Universe::_non_oop_bits", type = "intptr_t", get = HotSpotVMField.Type.VALUE) @Stable public long nonOopBits; + @HotSpotVMField(name = "CompilerToVM::Data::Universe_non_oop_bits", type = "void*", get = HotSpotVMField.Type.VALUE) @Stable public long nonOopBits; @HotSpotVMField(name = "StubRoutines::_verify_oop_count", type = "jint", get = HotSpotVMField.Type.ADDRESS) @Stable public long verifyOopCounterAddress; - @HotSpotVMField(name = "Universe::_verify_oop_mask", type = "uintptr_t", get = HotSpotVMField.Type.VALUE) @Stable public long verifyOopMask; - @HotSpotVMField(name = "Universe::_verify_oop_bits", type = "uintptr_t", get = HotSpotVMField.Type.VALUE) @Stable public long verifyOopBits; - @HotSpotVMField(name = "Universe::_base_vtable_size", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int universeBaseVtableSize; + @HotSpotVMField(name = "CompilerToVM::Data::Universe_verify_oop_mask", type = "uintptr_t", get = HotSpotVMField.Type.VALUE) @Stable public long verifyOopMask; + @HotSpotVMField(name = "CompilerToVM::Data::Universe_verify_oop_bits", type = "uintptr_t", get = HotSpotVMField.Type.VALUE) @Stable public long verifyOopBits; + @HotSpotVMField(name = "CompilerToVM::Data::Universe_base_vtable_size", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int universeBaseVtableSize; public final int baseVtableLength() { return universeBaseVtableSize / vtableEntrySize; } - @HotSpotVMField(name = "CollectedHeap::_barrier_set", type = "BarrierSet*", get = HotSpotVMField.Type.OFFSET) @Stable public int collectedHeapBarrierSetOffset; - @HotSpotVMField(name = "HeapRegion::LogOfHRGrainBytes", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int logOfHRGrainBytes; - @HotSpotVMField(name = "BarrierSet::_fake_rtti", type = "BarrierSet::FakeRtti", get = HotSpotVMField.Type.OFFSET) @Stable private int barrierSetFakeRttiOffset; - @HotSpotVMConstant(name = "BarrierSet::CardTableModRef") @Stable public int barrierSetCardTableModRef; - @HotSpotVMConstant(name = "BarrierSet::CardTableForRS") @Stable public int barrierSetCardTableForRS; - @HotSpotVMConstant(name = "BarrierSet::CardTableExtension") @Stable public int barrierSetCardTableExtension; - @HotSpotVMConstant(name = "BarrierSet::G1SATBCT") @Stable public int barrierSetG1SATBCT; - @HotSpotVMConstant(name = "BarrierSet::G1SATBCTLogging") @Stable public int barrierSetG1SATBCTLogging; - @HotSpotVMConstant(name = "BarrierSet::ModRef") @Stable public int barrierSetModRef; - - @HotSpotVMField(name = "BarrierSet::FakeRtti::_concrete_tag", type = "BarrierSet::Name", get = HotSpotVMField.Type.OFFSET) @Stable private int fakeRttiConcreteTagOffset; - - @HotSpotVMField(name = "CardTableModRefBS::byte_map_base", type = "jbyte*", get = HotSpotVMField.Type.OFFSET) @Stable private int cardTableModRefBSByteMapBaseOffset; - @HotSpotVMConstant(name = "CardTableModRefBS::card_shift") @Stable public int cardTableModRefBSCardShift; - @HotSpotVMConstant(name = "CardTableModRefBS::dirty_card") @Stable public byte dirtyCardValue; @HotSpotVMConstant(name = "G1SATBCardTableModRefBS::g1_young_gen") @Stable public byte g1YoungCardValue; - private final long cardtableStartAddress; - private final int cardtableShift; + @HotSpotVMField(name = "CompilerToVM::Data::cardtable_start_address", type = "jbyte*", get = HotSpotVMField.Type.VALUE) @Stable private long cardtableStartAddress; + @HotSpotVMField(name = "CompilerToVM::Data::cardtable_shift", type = "int", get = HotSpotVMField.Type.VALUE) @Stable private int cardtableShift; public long cardtableStartAddress() { - if (cardtableStartAddress == -1) { - throw JVMCIError.shouldNotReachHere(); - } return cardtableStartAddress; } public int cardtableShift() { - if (cardtableShift == -1) { - throw JVMCIError.shouldNotReachHere(); - } return cardtableShift; } @@ -1421,34 +1389,12 @@ public class HotSpotVMConfig { @HotSpotVMField(name = "java_lang_Class::_klass_offset", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int klassOffset; @HotSpotVMField(name = "java_lang_Class::_array_klass_offset", type = "int", get = HotSpotVMField.Type.VALUE) @Stable public int arrayKlassOffset; - @HotSpotVMField(name = "Method::_method_counters", type = "MethodCounters*", get = HotSpotVMField.Type.OFFSET) @Stable public int methodCountersOffset; - @HotSpotVMField(name = "Method::_method_data", type = "MethodData*", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataOffset; - @HotSpotVMField(name = "Method::_from_compiled_entry", type = "address", get = HotSpotVMField.Type.OFFSET) @Stable public int methodCompiledEntryOffset; - @HotSpotVMField(name = "Method::_code", type = "nmethod*", get = HotSpotVMField.Type.OFFSET) @Stable public int methodCodeOffset; - - @HotSpotVMField(name = "MethodCounters::_invocation_counter", type = "InvocationCounter", get = HotSpotVMField.Type.OFFSET) @Stable public int invocationCounterOffset; - @HotSpotVMField(name = "MethodCounters::_backedge_counter", type = "InvocationCounter", get = HotSpotVMField.Type.OFFSET) @Stable public int backedgeCounterOffset; - @HotSpotVMConstant(name = "InvocationCounter::count_increment") @Stable public int invocationCounterIncrement; - @HotSpotVMConstant(name = "InvocationCounter::count_shift") @Stable public int invocationCounterShift; - - @HotSpotVMField(name = "MethodData::_size", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataSize; - @HotSpotVMField(name = "MethodData::_data_size", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataDataSize; - @HotSpotVMField(name = "MethodData::_data[0]", type = "intptr_t", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataOopDataOffset; - @HotSpotVMField(name = "MethodData::_trap_hist._array[0]", type = "u1", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataOopTrapHistoryOffset; - @HotSpotVMField(name = "MethodData::_jvmci_ir_size", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int methodDataIRSizeOffset; - - @HotSpotVMField(name = "nmethod::_verified_entry_point", type = "address", get = HotSpotVMField.Type.OFFSET) @Stable public int nmethodEntryOffset; - @HotSpotVMField(name = "nmethod::_comp_level", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int nmethodCompLevelOffset; - - @HotSpotVMConstant(name = "CompLevel_full_optimization") @Stable public int compilationLevelFullOptimization; - @HotSpotVMType(name = "BasicLock", get = HotSpotVMType.Type.SIZE) @Stable public int basicLockSize; @HotSpotVMField(name = "BasicLock::_displaced_header", type = "markOop", get = HotSpotVMField.Type.OFFSET) @Stable public int basicLockDisplacedHeaderOffset; @HotSpotVMField(name = "Thread::_allocated_bytes", type = "jlong", get = HotSpotVMField.Type.OFFSET) @Stable public int threadAllocatedBytesOffset; @HotSpotVMFlag(name = "TLABWasteIncrement") @Stable public int tlabRefillWasteIncrement; - @HotSpotVMManual(name = "ThreadLocalAllocBuffer::alignment_reserve()") @Stable public int tlabAlignmentReserve; @HotSpotVMField(name = "ThreadLocalAllocBuffer::_start", type = "HeapWord*", get = HotSpotVMField.Type.OFFSET) @Stable private int threadLocalAllocBufferStartOffset; @HotSpotVMField(name = "ThreadLocalAllocBuffer::_end", type = "HeapWord*", get = HotSpotVMField.Type.OFFSET) @Stable private int threadLocalAllocBufferEndOffset; @@ -1496,22 +1442,14 @@ public class HotSpotVMConfig { return threadTlabOffset + threadLocalAllocBufferPfTopOffset; } - /** - * See: {@code ThreadLocalAllocBuffer::end_reserve()}. - */ - public final int threadLocalAllocBufferEndReserve() { - final int typeSizeInBytes = roundUp(arrayOopDescLengthOffset() + Integer.BYTES, heapWordSize); - // T_INT arrays need not be 8 byte aligned. - final int reserveSize = typeSizeInBytes / heapWordSize; - return Integer.max(reserveSize, abstractVmVersionReserveForAllocationPrefetch); - } + @HotSpotVMField(name = "CompilerToVM::Data::ThreadLocalAllocBuffer_alignment_reserve", type = "size_t", get = HotSpotVMField.Type.VALUE) @Stable public int tlabAlignmentReserve; @HotSpotVMFlag(name = "TLABStats") @Stable public boolean tlabStats; // FIXME This is only temporary until the GC code is changed. - @HotSpotVMField(name = "CompilerToVM::_supports_inline_contig_alloc", type = "bool", get = HotSpotVMField.Type.VALUE) @Stable public boolean inlineContiguousAllocationSupported; - @HotSpotVMField(name = "CompilerToVM::_heap_end_addr", type = "HeapWord**", get = HotSpotVMField.Type.VALUE) @Stable public long heapEndAddress; - @HotSpotVMField(name = "CompilerToVM::_heap_top_addr", type = "HeapWord**", get = HotSpotVMField.Type.VALUE) @Stable public long heapTopAddress; + @HotSpotVMField(name = "CompilerToVM::Data::_supports_inline_contig_alloc", type = "bool", get = HotSpotVMField.Type.VALUE) @Stable public boolean inlineContiguousAllocationSupported; + @HotSpotVMField(name = "CompilerToVM::Data::_heap_end_addr", type = "HeapWord**", get = HotSpotVMField.Type.VALUE) @Stable public long heapEndAddress; + @HotSpotVMField(name = "CompilerToVM::Data::_heap_top_addr", type = "HeapWord**", get = HotSpotVMField.Type.VALUE) @Stable public long heapTopAddress; /** * The DataLayout header size is the same as the cell size. @@ -1542,19 +1480,11 @@ public class HotSpotVMConfig { @HotSpotVMFlag(name = "TypeProfileWidth") @Stable public int typeProfileWidth; @HotSpotVMFlag(name = "MethodProfileWidth") @Stable public int methodProfileWidth; - @HotSpotVMField(name = "CodeBlob::_code_offset", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable private int codeBlobCodeOffsetOffset; - @HotSpotVMField(name = "DeoptimizationBlob::_unpack_offset", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable private int deoptimizationBlobUnpackOffsetOffset; - @HotSpotVMField(name = "DeoptimizationBlob::_uncommon_trap_offset", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable private int deoptimizationBlobUncommonTrapOffsetOffset; + @HotSpotVMField(name = "CompilerToVM::Data::SharedRuntime_ic_miss_stub", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long inlineCacheMissStub; + @HotSpotVMField(name = "CompilerToVM::Data::SharedRuntime_handle_wrong_method_stub", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long handleWrongMethodStub; - @HotSpotVMField(name = "SharedRuntime::_ic_miss_blob", type = "RuntimeStub*", get = HotSpotVMField.Type.VALUE) @Stable private long inlineCacheMissBlob; - @HotSpotVMField(name = "SharedRuntime::_wrong_method_blob", type = "RuntimeStub*", get = HotSpotVMField.Type.VALUE) @Stable private long wrongMethodBlob; - @HotSpotVMField(name = "SharedRuntime::_deopt_blob", type = "DeoptimizationBlob*", get = HotSpotVMField.Type.VALUE) @Stable private long deoptBlob; - - @HotSpotVMManual(name = "SharedRuntime::get_ic_miss_stub()") public final long inlineCacheMissStub; - @HotSpotVMManual(name = "SharedRuntime::get_handle_wrong_method_stub()") public final long handleWrongMethodStub; - - @HotSpotVMManual(name = "SharedRuntime::deopt_blob()->unpack()") public final long handleDeoptStub; - @HotSpotVMManual(name = "SharedRuntime::deopt_blob()->uncommon_trap()") public final long uncommonTrapStub; + @HotSpotVMField(name = "CompilerToVM::Data::SharedRuntime_deopt_blob_unpack", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long handleDeoptStub; + @HotSpotVMField(name = "CompilerToVM::Data::SharedRuntime_deopt_blob_uncommon_trap", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long uncommonTrapStub; @HotSpotVMField(name = "CodeCache::_low_bound", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long codeCacheLowBound; @HotSpotVMField(name = "CodeCache::_high_bound", type = "address", get = HotSpotVMField.Type.VALUE) @Stable public long codeCacheHighBound; @@ -1717,9 +1647,6 @@ public class HotSpotVMConfig { return "unknown"; } - @HotSpotVMConstant(name = "CompilerToVM::KLASS_TAG") @Stable public int compilerToVMKlassTag; - @HotSpotVMConstant(name = "CompilerToVM::SYMBOL_TAG") @Stable public int compilerToVMSymbolTag; - // Checkstyle: stop @HotSpotVMConstant(name = "CodeInstaller::VERIFIED_ENTRY") @Stable public int MARKID_VERIFIED_ENTRY; @HotSpotVMConstant(name = "CodeInstaller::UNVERIFIED_ENTRY") @Stable public int MARKID_UNVERIFIED_ENTRY; @@ -1756,7 +1683,6 @@ public class HotSpotVMConfig { @HotSpotVMConstant(name = "ArrayData::array_len_off_set") @Stable public int arrayDataArrayLenOffset; @HotSpotVMConstant(name = "ArrayData::array_start_off_set") @Stable public int arrayDataArrayStartOffset; @HotSpotVMConstant(name = "MultiBranchData::per_case_cell_count") @Stable public int multiBranchDataPerCaseCellCount; - // Checkstyle: resume private boolean check() { diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspotvmconfig/src/jdk/vm/ci/hotspotvmconfig/HotSpotVMManual.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspotvmconfig/src/jdk/vm/ci/hotspotvmconfig/HotSpotVMManual.java deleted file mode 100644 index 91ddf950879..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspotvmconfig/src/jdk/vm/ci/hotspotvmconfig/HotSpotVMManual.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.vm.ci.hotspotvmconfig; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Annotates a field in HotSpotVMConfig which is not read from the VM but is calculated manually. - */ -@Target(ElementType.FIELD) -@Retention(RetentionPolicy.RUNTIME) -public @interface HotSpotVMManual { - - /** - * Returns the name associated with that field. - * - * @return name associated with field - */ - String name(); - -} diff --git a/hotspot/src/share/vm/classfile/javaClasses.hpp b/hotspot/src/share/vm/classfile/javaClasses.hpp index 192d11ccede..1aa88b399db 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.hpp +++ b/hotspot/src/share/vm/classfile/javaClasses.hpp @@ -240,6 +240,7 @@ class java_lang_String : AllStatic { class java_lang_Class : AllStatic { friend class VMStructs; + friend class JVMCIVMStructs; private: // The fake offsets are added by the class loader when java.lang.Class is loaded diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp index 6fff569a762..805bb45162c 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp @@ -1328,6 +1328,7 @@ class vmSymbols: AllStatic { friend class vmIntrinsics; friend class VMStructs; + friend class JVMCIVMStructs; public: // enum for figuring positions and size of array holding Symbol*s enum SID { diff --git a/hotspot/src/share/vm/code/codeBlob.hpp b/hotspot/src/share/vm/code/codeBlob.hpp index cf846940b60..a4a4cab7c8b 100644 --- a/hotspot/src/share/vm/code/codeBlob.hpp +++ b/hotspot/src/share/vm/code/codeBlob.hpp @@ -64,6 +64,7 @@ class DeoptimizationBlob; class CodeBlob VALUE_OBJ_CLASS_SPEC { friend class VMStructs; + friend class JVMCIVMStructs; friend class CodeCacheDumper; private: @@ -374,6 +375,7 @@ class SingletonBlob: public CodeBlob { class DeoptimizationBlob: public SingletonBlob { friend class VMStructs; + friend class JVMCIVMStructs; private: int _unpack_offset; int _unpack_with_exception; diff --git a/hotspot/src/share/vm/code/codeCache.hpp b/hotspot/src/share/vm/code/codeCache.hpp index 88594bd80a7..a3da713c9e5 100644 --- a/hotspot/src/share/vm/code/codeCache.hpp +++ b/hotspot/src/share/vm/code/codeCache.hpp @@ -76,6 +76,7 @@ class DepChange; class CodeCache : AllStatic { friend class VMStructs; + friend class JVMCIVMStructs; friend class NMethodIterator; friend class WhiteBox; friend class CodeCacheLoader; diff --git a/hotspot/src/share/vm/code/nmethod.hpp b/hotspot/src/share/vm/code/nmethod.hpp index 2305f51bc24..f38ed2edb36 100644 --- a/hotspot/src/share/vm/code/nmethod.hpp +++ b/hotspot/src/share/vm/code/nmethod.hpp @@ -113,6 +113,7 @@ class xmlStream; class nmethod : public CodeBlob { friend class VMStructs; + friend class JVMCIVMStructs; friend class NMethodSweeper; friend class CodeCache; // scavengable oops private: diff --git a/hotspot/src/share/vm/compiler/compileTask.hpp b/hotspot/src/share/vm/compiler/compileTask.hpp index 1ec57bd00ab..17f77b34dee 100644 --- a/hotspot/src/share/vm/compiler/compileTask.hpp +++ b/hotspot/src/share/vm/compiler/compileTask.hpp @@ -38,6 +38,7 @@ class CompileTask : public CHeapObj { friend class VMStructs; + friend class JVMCIVMStructs; private: static CompileTask* _task_free_list; diff --git a/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp b/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp index 1fad2b64637..b790d40a78c 100644 --- a/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp +++ b/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp @@ -70,27 +70,6 @@ #define VM_INT_CONSTANTS_G1(declare_constant, declare_constant_with_value) \ - \ - JVMCI_ONLY( \ - declare_constant_with_value( \ - "dirtyCardQueueBufferOffset", \ - in_bytes(DirtyCardQueue::byte_offset_of_buf())) \ - declare_constant_with_value( \ - "dirtyCardQueueIndexOffset", \ - in_bytes(DirtyCardQueue::byte_offset_of_index())) \ - ) /* JVMCI_ONLY */ \ - \ - JVMCI_ONLY( \ - declare_constant_with_value( \ - "satbMarkQueueBufferOffset", \ - in_bytes(SATBMarkQueue::byte_offset_of_buf())) \ - declare_constant_with_value( \ - "satbMarkQueueIndexOffset", \ - in_bytes(SATBMarkQueue::byte_offset_of_index())) \ - declare_constant_with_value( \ - "satbMarkQueueActiveOffset", \ - in_bytes(SATBMarkQueue::byte_offset_of_active())) \ - ) /* JVMCI_ONLY */ \ #define VM_TYPES_G1(declare_type, declare_toplevel_type) \ diff --git a/hotspot/src/share/vm/gc/shared/collectedHeap.hpp b/hotspot/src/share/vm/gc/shared/collectedHeap.hpp index d12941b14fe..02de82c7b83 100644 --- a/hotspot/src/share/vm/gc/shared/collectedHeap.hpp +++ b/hotspot/src/share/vm/gc/shared/collectedHeap.hpp @@ -81,6 +81,7 @@ class GCHeapLog : public EventLogBase { // class CollectedHeap : public CHeapObj { friend class VMStructs; + friend class JVMCIVMStructs; friend class IsGCActiveMark; // Block structured external access to _is_gc_active private: diff --git a/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.hpp b/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.hpp index 60e05dcab26..eca56006510 100644 --- a/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.hpp +++ b/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.hpp @@ -39,6 +39,7 @@ class GlobalTLABStats; // used to make it available for such multiplexing. class ThreadLocalAllocBuffer: public CHeapObj { friend class VMStructs; + friend class JVMCIVMStructs; private: HeapWord* _start; // address of TLAB HeapWord* _top; // address after last allocation diff --git a/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.hpp b/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.hpp index 394d263f668..1157759d0ed 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.hpp +++ b/hotspot/src/share/vm/jvmci/jvmciCodeInstaller.hpp @@ -89,7 +89,7 @@ private: * This class handles the conversion from a InstalledCode to a CodeBlob or an nmethod. */ class CodeInstaller : public StackObj { - friend class VMStructs; + friend class JVMCIVMStructs; private: enum MarkId { VERIFIED_ENTRY = 1, diff --git a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp index 694513cc4a7..2205ff479fd 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp @@ -43,6 +43,7 @@ #include "jvmci/jvmciEnv.hpp" #include "jvmci/jvmciJavaClasses.hpp" #include "jvmci/jvmciCodeInstaller.hpp" +#include "jvmci/vmStructs_jvmci.hpp" #include "gc/g1/heapRegion.hpp" #include "runtime/javaCalls.hpp" #include "runtime/deoptimization.hpp" @@ -85,88 +86,160 @@ oop CompilerToVM::get_jvmci_type(KlassHandle klass, TRAPS) { } extern "C" { -extern VMStructEntry* gHotSpotVMStructs; -extern uint64_t gHotSpotVMStructEntryTypeNameOffset; -extern uint64_t gHotSpotVMStructEntryFieldNameOffset; -extern uint64_t gHotSpotVMStructEntryTypeStringOffset; -extern uint64_t gHotSpotVMStructEntryIsStaticOffset; -extern uint64_t gHotSpotVMStructEntryOffsetOffset; -extern uint64_t gHotSpotVMStructEntryAddressOffset; -extern uint64_t gHotSpotVMStructEntryArrayStride; +extern VMStructEntry* jvmciHotSpotVMStructs; +extern uint64_t jvmciHotSpotVMStructEntryTypeNameOffset; +extern uint64_t jvmciHotSpotVMStructEntryFieldNameOffset; +extern uint64_t jvmciHotSpotVMStructEntryTypeStringOffset; +extern uint64_t jvmciHotSpotVMStructEntryIsStaticOffset; +extern uint64_t jvmciHotSpotVMStructEntryOffsetOffset; +extern uint64_t jvmciHotSpotVMStructEntryAddressOffset; +extern uint64_t jvmciHotSpotVMStructEntryArrayStride; -extern VMTypeEntry* gHotSpotVMTypes; -extern uint64_t gHotSpotVMTypeEntryTypeNameOffset; -extern uint64_t gHotSpotVMTypeEntrySuperclassNameOffset; -extern uint64_t gHotSpotVMTypeEntryIsOopTypeOffset; -extern uint64_t gHotSpotVMTypeEntryIsIntegerTypeOffset; -extern uint64_t gHotSpotVMTypeEntryIsUnsignedOffset; -extern uint64_t gHotSpotVMTypeEntrySizeOffset; -extern uint64_t gHotSpotVMTypeEntryArrayStride; +extern VMTypeEntry* jvmciHotSpotVMTypes; +extern uint64_t jvmciHotSpotVMTypeEntryTypeNameOffset; +extern uint64_t jvmciHotSpotVMTypeEntrySuperclassNameOffset; +extern uint64_t jvmciHotSpotVMTypeEntryIsOopTypeOffset; +extern uint64_t jvmciHotSpotVMTypeEntryIsIntegerTypeOffset; +extern uint64_t jvmciHotSpotVMTypeEntryIsUnsignedOffset; +extern uint64_t jvmciHotSpotVMTypeEntrySizeOffset; +extern uint64_t jvmciHotSpotVMTypeEntryArrayStride; -extern VMIntConstantEntry* gHotSpotVMIntConstants; -extern uint64_t gHotSpotVMIntConstantEntryNameOffset; -extern uint64_t gHotSpotVMIntConstantEntryValueOffset; -extern uint64_t gHotSpotVMIntConstantEntryArrayStride; +extern VMIntConstantEntry* jvmciHotSpotVMIntConstants; +extern uint64_t jvmciHotSpotVMIntConstantEntryNameOffset; +extern uint64_t jvmciHotSpotVMIntConstantEntryValueOffset; +extern uint64_t jvmciHotSpotVMIntConstantEntryArrayStride; -extern VMLongConstantEntry* gHotSpotVMLongConstants; -extern uint64_t gHotSpotVMLongConstantEntryNameOffset; -extern uint64_t gHotSpotVMLongConstantEntryValueOffset; -extern uint64_t gHotSpotVMLongConstantEntryArrayStride; +extern VMLongConstantEntry* jvmciHotSpotVMLongConstants; +extern uint64_t jvmciHotSpotVMLongConstantEntryNameOffset; +extern uint64_t jvmciHotSpotVMLongConstantEntryValueOffset; +extern uint64_t jvmciHotSpotVMLongConstantEntryArrayStride; -extern VMAddressEntry* gHotSpotVMAddresses; -extern uint64_t gHotSpotVMAddressEntryNameOffset; -extern uint64_t gHotSpotVMAddressEntryValueOffset; -extern uint64_t gHotSpotVMAddressEntryArrayStride; +extern VMAddressEntry* jvmciHotSpotVMAddresses; +extern uint64_t jvmciHotSpotVMAddressEntryNameOffset; +extern uint64_t jvmciHotSpotVMAddressEntryValueOffset; +extern uint64_t jvmciHotSpotVMAddressEntryArrayStride; } -// FIXME This is only temporary until the GC code is changed. -bool CompilerToVM::_supports_inline_contig_alloc; -HeapWord** CompilerToVM::_heap_end_addr; -HeapWord** CompilerToVM::_heap_top_addr; +int CompilerToVM::Data::InstanceKlass_vtable_start_offset; +int CompilerToVM::Data::InstanceKlass_vtable_length_offset; + +int CompilerToVM::Data::Method_extra_stack_entries; + +address CompilerToVM::Data::SharedRuntime_ic_miss_stub; +address CompilerToVM::Data::SharedRuntime_handle_wrong_method_stub; +address CompilerToVM::Data::SharedRuntime_deopt_blob_unpack; +address CompilerToVM::Data::SharedRuntime_deopt_blob_uncommon_trap; + +size_t CompilerToVM::Data::ThreadLocalAllocBuffer_alignment_reserve; + +CollectedHeap* CompilerToVM::Data::Universe_collectedHeap; +int CompilerToVM::Data::Universe_base_vtable_size; +address CompilerToVM::Data::Universe_narrow_oop_base; +int CompilerToVM::Data::Universe_narrow_oop_shift; +address CompilerToVM::Data::Universe_narrow_klass_base; +int CompilerToVM::Data::Universe_narrow_klass_shift; +void* CompilerToVM::Data::Universe_non_oop_bits; +uintptr_t CompilerToVM::Data::Universe_verify_oop_mask; +uintptr_t CompilerToVM::Data::Universe_verify_oop_bits; + +bool CompilerToVM::Data::_supports_inline_contig_alloc; +HeapWord** CompilerToVM::Data::_heap_end_addr; +HeapWord** CompilerToVM::Data::_heap_top_addr; + +jbyte* CompilerToVM::Data::cardtable_start_address; +int CompilerToVM::Data::cardtable_shift; + +void CompilerToVM::Data::initialize() { + InstanceKlass_vtable_start_offset = InstanceKlass::vtable_start_offset(); + InstanceKlass_vtable_length_offset = InstanceKlass::vtable_length_offset() * HeapWordSize; + + Method_extra_stack_entries = Method::extra_stack_entries(); + + SharedRuntime_ic_miss_stub = SharedRuntime::get_ic_miss_stub(); + SharedRuntime_handle_wrong_method_stub = SharedRuntime::get_handle_wrong_method_stub(); + SharedRuntime_deopt_blob_unpack = SharedRuntime::deopt_blob()->unpack(); + SharedRuntime_deopt_blob_uncommon_trap = SharedRuntime::deopt_blob()->uncommon_trap(); + + ThreadLocalAllocBuffer_alignment_reserve = ThreadLocalAllocBuffer::alignment_reserve(); + + Universe_collectedHeap = Universe::heap(); + Universe_base_vtable_size = Universe::base_vtable_size(); + Universe_narrow_oop_base = Universe::narrow_oop_base(); + Universe_narrow_oop_shift = Universe::narrow_oop_shift(); + Universe_narrow_klass_base = Universe::narrow_klass_base(); + Universe_narrow_klass_shift = Universe::narrow_klass_shift(); + Universe_non_oop_bits = Universe::non_oop_word(); + Universe_verify_oop_mask = Universe::verify_oop_mask(); + Universe_verify_oop_bits = Universe::verify_oop_bits(); + + _supports_inline_contig_alloc = Universe::heap()->supports_inline_contig_alloc(); + _heap_end_addr = _supports_inline_contig_alloc ? Universe::heap()->end_addr() : (HeapWord**) -1; + _heap_top_addr = _supports_inline_contig_alloc ? Universe::heap()->top_addr() : (HeapWord**) -1; + + BarrierSet* bs = Universe::heap()->barrier_set(); + switch (bs->kind()) { + case BarrierSet::CardTableModRef: + case BarrierSet::CardTableForRS: + case BarrierSet::CardTableExtension: + case BarrierSet::G1SATBCT: + case BarrierSet::G1SATBCTLogging: { + jbyte* base = barrier_set_cast(bs)->byte_map_base; + assert(base != 0, "unexpected byte_map_base"); + cardtable_start_address = base; + cardtable_shift = CardTableModRefBS::card_shift; + break; + } + case BarrierSet::ModRef: + cardtable_start_address = 0; + cardtable_shift = 0; + // No post barriers + break; + default: + ShouldNotReachHere(); + break; + } +} /** - * We put all gHotSpotVM values in an array so we can read them easily from Java. + * We put all jvmciHotSpotVM values in an array so we can read them easily from Java. */ static uintptr_t ciHotSpotVMData[28]; C2V_VMENTRY(jlong, initializeConfiguration, (JNIEnv *env, jobject)) - ciHotSpotVMData[0] = (uintptr_t) gHotSpotVMStructs; - ciHotSpotVMData[1] = gHotSpotVMStructEntryTypeNameOffset; - ciHotSpotVMData[2] = gHotSpotVMStructEntryFieldNameOffset; - ciHotSpotVMData[3] = gHotSpotVMStructEntryTypeStringOffset; - ciHotSpotVMData[4] = gHotSpotVMStructEntryIsStaticOffset; - ciHotSpotVMData[5] = gHotSpotVMStructEntryOffsetOffset; - ciHotSpotVMData[6] = gHotSpotVMStructEntryAddressOffset; - ciHotSpotVMData[7] = gHotSpotVMStructEntryArrayStride; + ciHotSpotVMData[0] = (uintptr_t) jvmciHotSpotVMStructs; + ciHotSpotVMData[1] = jvmciHotSpotVMStructEntryTypeNameOffset; + ciHotSpotVMData[2] = jvmciHotSpotVMStructEntryFieldNameOffset; + ciHotSpotVMData[3] = jvmciHotSpotVMStructEntryTypeStringOffset; + ciHotSpotVMData[4] = jvmciHotSpotVMStructEntryIsStaticOffset; + ciHotSpotVMData[5] = jvmciHotSpotVMStructEntryOffsetOffset; + ciHotSpotVMData[6] = jvmciHotSpotVMStructEntryAddressOffset; + ciHotSpotVMData[7] = jvmciHotSpotVMStructEntryArrayStride; - ciHotSpotVMData[8] = (uintptr_t) gHotSpotVMTypes; - ciHotSpotVMData[9] = gHotSpotVMTypeEntryTypeNameOffset; - ciHotSpotVMData[10] = gHotSpotVMTypeEntrySuperclassNameOffset; - ciHotSpotVMData[11] = gHotSpotVMTypeEntryIsOopTypeOffset; - ciHotSpotVMData[12] = gHotSpotVMTypeEntryIsIntegerTypeOffset; - ciHotSpotVMData[13] = gHotSpotVMTypeEntryIsUnsignedOffset; - ciHotSpotVMData[14] = gHotSpotVMTypeEntrySizeOffset; - ciHotSpotVMData[15] = gHotSpotVMTypeEntryArrayStride; + ciHotSpotVMData[8] = (uintptr_t) jvmciHotSpotVMTypes; + ciHotSpotVMData[9] = jvmciHotSpotVMTypeEntryTypeNameOffset; + ciHotSpotVMData[10] = jvmciHotSpotVMTypeEntrySuperclassNameOffset; + ciHotSpotVMData[11] = jvmciHotSpotVMTypeEntryIsOopTypeOffset; + ciHotSpotVMData[12] = jvmciHotSpotVMTypeEntryIsIntegerTypeOffset; + ciHotSpotVMData[13] = jvmciHotSpotVMTypeEntryIsUnsignedOffset; + ciHotSpotVMData[14] = jvmciHotSpotVMTypeEntrySizeOffset; + ciHotSpotVMData[15] = jvmciHotSpotVMTypeEntryArrayStride; - ciHotSpotVMData[16] = (uintptr_t) gHotSpotVMIntConstants; - ciHotSpotVMData[17] = gHotSpotVMIntConstantEntryNameOffset; - ciHotSpotVMData[18] = gHotSpotVMIntConstantEntryValueOffset; - ciHotSpotVMData[19] = gHotSpotVMIntConstantEntryArrayStride; + ciHotSpotVMData[16] = (uintptr_t) jvmciHotSpotVMIntConstants; + ciHotSpotVMData[17] = jvmciHotSpotVMIntConstantEntryNameOffset; + ciHotSpotVMData[18] = jvmciHotSpotVMIntConstantEntryValueOffset; + ciHotSpotVMData[19] = jvmciHotSpotVMIntConstantEntryArrayStride; - ciHotSpotVMData[20] = (uintptr_t) gHotSpotVMLongConstants; - ciHotSpotVMData[21] = gHotSpotVMLongConstantEntryNameOffset; - ciHotSpotVMData[22] = gHotSpotVMLongConstantEntryValueOffset; - ciHotSpotVMData[23] = gHotSpotVMLongConstantEntryArrayStride; + ciHotSpotVMData[20] = (uintptr_t) jvmciHotSpotVMLongConstants; + ciHotSpotVMData[21] = jvmciHotSpotVMLongConstantEntryNameOffset; + ciHotSpotVMData[22] = jvmciHotSpotVMLongConstantEntryValueOffset; + ciHotSpotVMData[23] = jvmciHotSpotVMLongConstantEntryArrayStride; - ciHotSpotVMData[24] = (uintptr_t) gHotSpotVMAddresses; - ciHotSpotVMData[25] = gHotSpotVMAddressEntryNameOffset; - ciHotSpotVMData[26] = gHotSpotVMAddressEntryValueOffset; - ciHotSpotVMData[27] = gHotSpotVMAddressEntryArrayStride; + ciHotSpotVMData[24] = (uintptr_t) jvmciHotSpotVMAddresses; + ciHotSpotVMData[25] = jvmciHotSpotVMAddressEntryNameOffset; + ciHotSpotVMData[26] = jvmciHotSpotVMAddressEntryValueOffset; + ciHotSpotVMData[27] = jvmciHotSpotVMAddressEntryArrayStride; - // FIXME This is only temporary until the GC code is changed. - CompilerToVM::_supports_inline_contig_alloc = Universe::heap()->supports_inline_contig_alloc(); - CompilerToVM::_heap_end_addr = CompilerToVM::_supports_inline_contig_alloc ? Universe::heap()->end_addr() : (HeapWord**) -1; - CompilerToVM::_heap_top_addr = CompilerToVM::_supports_inline_contig_alloc ? Universe::heap()->top_addr() : (HeapWord**) -1; + CompilerToVM::Data::initialize(); return (jlong) (address) &ciHotSpotVMData; C2V_END diff --git a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp index 35f17689f1e..1947324556b 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp +++ b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp @@ -29,28 +29,45 @@ #include "jvmci/jvmciJavaClasses.hpp" class CompilerToVM { -public: - /** - * Tag bits used by lookupKlassInPool to distinguish the types in Java. - */ - enum Tags { - KLASS_TAG = 0x0, - SYMBOL_TAG = 0x1 + public: + class Data { + friend class JVMCIVMStructs; + + private: + static int InstanceKlass_vtable_start_offset; + static int InstanceKlass_vtable_length_offset; + + static int Method_extra_stack_entries; + + static address SharedRuntime_ic_miss_stub; + static address SharedRuntime_handle_wrong_method_stub; + static address SharedRuntime_deopt_blob_unpack; + static address SharedRuntime_deopt_blob_uncommon_trap; + + static size_t ThreadLocalAllocBuffer_alignment_reserve; + + static CollectedHeap* Universe_collectedHeap; + static int Universe_base_vtable_size; + static address Universe_narrow_oop_base; + static int Universe_narrow_oop_shift; + static address Universe_narrow_klass_base; + static int Universe_narrow_klass_shift; + static uintptr_t Universe_verify_oop_mask; + static uintptr_t Universe_verify_oop_bits; + static void* Universe_non_oop_bits; + + static bool _supports_inline_contig_alloc; + static HeapWord** _heap_end_addr; + static HeapWord** _heap_top_addr; + + static jbyte* cardtable_start_address; + static int cardtable_shift; + + public: + static void initialize(); }; - // FIXME This is only temporary until the GC code is changed. - static bool _supports_inline_contig_alloc; - static HeapWord** _heap_end_addr; - static HeapWord** _heap_top_addr; - - static intptr_t tag_pointer(Klass* klass) { - return ((intptr_t) klass) | KLASS_TAG; - } - - static intptr_t tag_pointer(Symbol* symbol) { - return ((intptr_t) symbol) | SYMBOL_TAG; - } - + public: static JNINativeMethod methods[]; static int methods_count(); diff --git a/hotspot/src/share/vm/jvmci/jvmciEnv.hpp b/hotspot/src/share/vm/jvmci/jvmciEnv.hpp index 173729259fe..2bc95d3308c 100644 --- a/hotspot/src/share/vm/jvmci/jvmciEnv.hpp +++ b/hotspot/src/share/vm/jvmci/jvmciEnv.hpp @@ -53,6 +53,7 @@ class CompileTask; class JVMCIEnv : StackObj { CI_PACKAGE_ACCESS_TO + friend class JVMCIVMStructs; friend class CompileBroker; friend class Dependencies; // for get_object, during logging diff --git a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp index afcbdf27f82..893a576699f 100644 --- a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp @@ -813,10 +813,6 @@ JVM_ENTRY(void, JVM_RegisterJVMCINatives(JNIEnv *env, jclass c2vmClass)) { ThreadToNativeFromVM trans(thread); - - // Ensure _non_oop_bits is initialized - Universe::non_oop_word(); - env->RegisterNatives(c2vmClass, CompilerToVM::methods, CompilerToVM::methods_count()); } JVM_END diff --git a/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp b/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp new file mode 100644 index 00000000000..fdd816a1929 --- /dev/null +++ b/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp @@ -0,0 +1,849 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "code/codeBlob.hpp" +#include "compiler/abstractCompiler.hpp" +#include "compiler/compileBroker.hpp" +#include "jvmci/jvmciCodeInstaller.hpp" +#include "jvmci/jvmciCompilerToVM.hpp" +#include "jvmci/jvmciEnv.hpp" +#include "jvmci/jvmciRuntime.hpp" +#include "jvmci/vmStructs_jvmci.hpp" +#include "oops/oop.hpp" +#include "oops/objArrayKlass.hpp" +#include "runtime/globals.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/thread.hpp" +#include "runtime/vm_version.hpp" + +#if INCLUDE_ALL_GCS +#include "gc/g1/g1SATBCardTableModRefBS.hpp" +#include "gc/g1/heapRegion.hpp" +#endif + + +#define VM_STRUCTS(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field) \ + static_field(CompilerToVM::Data, InstanceKlass_vtable_start_offset, int) \ + static_field(CompilerToVM::Data, InstanceKlass_vtable_length_offset, int) \ + \ + static_field(CompilerToVM::Data, Method_extra_stack_entries, int) \ + \ + static_field(CompilerToVM::Data, SharedRuntime_ic_miss_stub, address) \ + static_field(CompilerToVM::Data, SharedRuntime_handle_wrong_method_stub, address) \ + static_field(CompilerToVM::Data, SharedRuntime_deopt_blob_unpack, address) \ + static_field(CompilerToVM::Data, SharedRuntime_deopt_blob_uncommon_trap, address) \ + \ + static_field(CompilerToVM::Data, ThreadLocalAllocBuffer_alignment_reserve, size_t) \ + \ + static_field(CompilerToVM::Data, Universe_collectedHeap, CollectedHeap*) \ + static_field(CompilerToVM::Data, Universe_base_vtable_size, int) \ + static_field(CompilerToVM::Data, Universe_narrow_oop_base, address) \ + static_field(CompilerToVM::Data, Universe_narrow_oop_shift, int) \ + static_field(CompilerToVM::Data, Universe_narrow_klass_base, address) \ + static_field(CompilerToVM::Data, Universe_narrow_klass_shift, int) \ + static_field(CompilerToVM::Data, Universe_non_oop_bits, void*) \ + static_field(CompilerToVM::Data, Universe_verify_oop_mask, uintptr_t) \ + static_field(CompilerToVM::Data, Universe_verify_oop_bits, uintptr_t) \ + \ + static_field(CompilerToVM::Data, _supports_inline_contig_alloc, bool) \ + static_field(CompilerToVM::Data, _heap_end_addr, HeapWord**) \ + static_field(CompilerToVM::Data, _heap_top_addr, HeapWord**) \ + \ + static_field(CompilerToVM::Data, cardtable_start_address, jbyte*) \ + static_field(CompilerToVM::Data, cardtable_shift, int) \ + \ + nonstatic_field(Array, _length, int) \ + unchecked_nonstatic_field(Array, _data, sizeof(u1)) \ + unchecked_nonstatic_field(Array, _data, sizeof(u2)) \ + nonstatic_field(Array, _length, int) \ + nonstatic_field(Array, _data[0], Klass*) \ + \ + volatile_nonstatic_field(BasicLock, _displaced_header, markOop) \ + \ + static_field(CodeCache, _low_bound, address) \ + static_field(CodeCache, _high_bound, address) \ + \ + nonstatic_field(CollectedHeap, _total_collections, unsigned int) \ + \ + nonstatic_field(CompileTask, _num_inlined_bytecodes, int) \ + \ + nonstatic_field(ConstantPool, _tags, Array*) \ + nonstatic_field(ConstantPool, _pool_holder, InstanceKlass*) \ + nonstatic_field(ConstantPool, _length, int) \ + \ + nonstatic_field(ConstMethod, _constants, ConstantPool*) \ + nonstatic_field(ConstMethod, _flags, u2) \ + nonstatic_field(ConstMethod, _code_size, u2) \ + nonstatic_field(ConstMethod, _name_index, u2) \ + nonstatic_field(ConstMethod, _signature_index, u2) \ + nonstatic_field(ConstMethod, _max_stack, u2) \ + nonstatic_field(ConstMethod, _max_locals, u2) \ + \ + nonstatic_field(DataLayout, _header._struct._tag, u1) \ + nonstatic_field(DataLayout, _header._struct._flags, u1) \ + nonstatic_field(DataLayout, _header._struct._bci, u2) \ + nonstatic_field(DataLayout, _cells[0], intptr_t) \ + \ + nonstatic_field(Deoptimization::UnrollBlock, _size_of_deoptimized_frame, int) \ + nonstatic_field(Deoptimization::UnrollBlock, _caller_adjustment, int) \ + nonstatic_field(Deoptimization::UnrollBlock, _number_of_frames, int) \ + nonstatic_field(Deoptimization::UnrollBlock, _total_frame_sizes, int) \ + nonstatic_field(Deoptimization::UnrollBlock, _frame_sizes, intptr_t*) \ + nonstatic_field(Deoptimization::UnrollBlock, _frame_pcs, address*) \ + nonstatic_field(Deoptimization::UnrollBlock, _initial_info, intptr_t) \ + nonstatic_field(Deoptimization::UnrollBlock, _unpack_kind, int) \ + \ + nonstatic_field(ExceptionTableElement, start_pc, u2) \ + nonstatic_field(ExceptionTableElement, end_pc, u2) \ + nonstatic_field(ExceptionTableElement, handler_pc, u2) \ + nonstatic_field(ExceptionTableElement, catch_type_index, u2) \ + \ + nonstatic_field(Flag, _type, const char*) \ + nonstatic_field(Flag, _name, const char*) \ + unchecked_nonstatic_field(Flag, _addr, sizeof(void*)) \ + nonstatic_field(Flag, _flags, Flag::Flags) \ + static_field(Flag, flags, Flag*) \ + \ + nonstatic_field(InstanceKlass, _fields, Array*) \ + nonstatic_field(InstanceKlass, _constants, ConstantPool*) \ + nonstatic_field(InstanceKlass, _source_file_name_index, u2) \ + nonstatic_field(InstanceKlass, _init_state, u1) \ + \ + volatile_nonstatic_field(JavaFrameAnchor, _last_Java_sp, intptr_t*) \ + volatile_nonstatic_field(JavaFrameAnchor, _last_Java_pc, address) \ + \ + nonstatic_field(JavaThread, _threadObj, oop) \ + nonstatic_field(JavaThread, _anchor, JavaFrameAnchor) \ + nonstatic_field(JavaThread, _vm_result, oop) \ + volatile_nonstatic_field(JavaThread, _exception_oop, oop) \ + volatile_nonstatic_field(JavaThread, _exception_pc, address) \ + volatile_nonstatic_field(JavaThread, _is_method_handle_return, int) \ + nonstatic_field(JavaThread, _osthread, OSThread*) \ + nonstatic_field(JavaThread, _satb_mark_queue, SATBMarkQueue) \ + nonstatic_field(JavaThread, _dirty_card_queue, DirtyCardQueue) \ + nonstatic_field(JavaThread, _pending_deoptimization, int) \ + nonstatic_field(JavaThread, _pending_failed_speculation, oop) \ + nonstatic_field(JavaThread, _pending_transfer_to_interpreter, bool) \ + nonstatic_field(JavaThread, _jvmci_counters, jlong*) \ + \ + static_field(java_lang_Class, _klass_offset, int) \ + static_field(java_lang_Class, _array_klass_offset, int) \ + \ + nonstatic_field(JVMCIEnv, _task, CompileTask*) \ + nonstatic_field(JVMCIEnv, _jvmti_can_hotswap_or_post_breakpoint, bool) \ + \ + nonstatic_field(Klass, _secondary_super_cache, Klass*) \ + nonstatic_field(Klass, _secondary_supers, Array*) \ + nonstatic_field(Klass, _super, Klass*) \ + nonstatic_field(Klass, _super_check_offset, juint) \ + nonstatic_field(Klass, _subklass, Klass*) \ + nonstatic_field(Klass, _layout_helper, jint) \ + nonstatic_field(Klass, _prototype_header, markOop) \ + nonstatic_field(Klass, _next_sibling, Klass*) \ + nonstatic_field(Klass, _java_mirror, oop) \ + nonstatic_field(Klass, _modifier_flags, jint) \ + nonstatic_field(Klass, _access_flags, AccessFlags) \ + \ + nonstatic_field(LocalVariableTableElement, start_bci, u2) \ + nonstatic_field(LocalVariableTableElement, length, u2) \ + nonstatic_field(LocalVariableTableElement, name_cp_index, u2) \ + nonstatic_field(LocalVariableTableElement, descriptor_cp_index, u2) \ + nonstatic_field(LocalVariableTableElement, signature_cp_index, u2) \ + nonstatic_field(LocalVariableTableElement, slot, u2) \ + \ + nonstatic_field(Method, _constMethod, ConstMethod*) \ + nonstatic_field(Method, _method_data, MethodData*) \ + nonstatic_field(Method, _method_counters, MethodCounters*) \ + nonstatic_field(Method, _access_flags, AccessFlags) \ + nonstatic_field(Method, _vtable_index, int) \ + nonstatic_field(Method, _intrinsic_id, u2) \ + nonstatic_field(Method, _flags, u1) \ + volatile_nonstatic_field(Method, _code, nmethod*) \ + volatile_nonstatic_field(Method, _from_compiled_entry, address) \ + \ + nonstatic_field(MethodCounters, _invocation_counter, InvocationCounter) \ + nonstatic_field(MethodCounters, _backedge_counter, InvocationCounter) \ + \ + nonstatic_field(MethodData, _size, int) \ + nonstatic_field(MethodData, _data_size, int) \ + nonstatic_field(MethodData, _data[0], intptr_t) \ + nonstatic_field(MethodData, _trap_hist._array[0], u1) \ + nonstatic_field(MethodData, _jvmci_ir_size, int) \ + \ + nonstatic_field(nmethod, _verified_entry_point, address) \ + nonstatic_field(nmethod, _comp_level, int) \ + \ + nonstatic_field(ObjArrayKlass, _element_klass, Klass*) \ + \ + volatile_nonstatic_field(oopDesc, _mark, markOop) \ + volatile_nonstatic_field(oopDesc, _metadata._klass, Klass*) \ + \ + static_field(os, _polling_page, address) \ + \ + volatile_nonstatic_field(OSThread, _interrupted, jint) \ + \ + static_field(StubRoutines, _verify_oop_count, jint) \ + \ + static_field(StubRoutines, _jbyte_arraycopy, address) \ + static_field(StubRoutines, _jshort_arraycopy, address) \ + static_field(StubRoutines, _jint_arraycopy, address) \ + static_field(StubRoutines, _jlong_arraycopy, address) \ + static_field(StubRoutines, _oop_arraycopy, address) \ + static_field(StubRoutines, _oop_arraycopy_uninit, address) \ + static_field(StubRoutines, _jbyte_disjoint_arraycopy, address) \ + static_field(StubRoutines, _jshort_disjoint_arraycopy, address) \ + static_field(StubRoutines, _jint_disjoint_arraycopy, address) \ + static_field(StubRoutines, _jlong_disjoint_arraycopy, address) \ + static_field(StubRoutines, _oop_disjoint_arraycopy, address) \ + static_field(StubRoutines, _oop_disjoint_arraycopy_uninit, address) \ + static_field(StubRoutines, _arrayof_jbyte_arraycopy, address) \ + static_field(StubRoutines, _arrayof_jshort_arraycopy, address) \ + static_field(StubRoutines, _arrayof_jint_arraycopy, address) \ + static_field(StubRoutines, _arrayof_jlong_arraycopy, address) \ + static_field(StubRoutines, _arrayof_oop_arraycopy, address) \ + static_field(StubRoutines, _arrayof_oop_arraycopy_uninit, address) \ + static_field(StubRoutines, _arrayof_jbyte_disjoint_arraycopy, address) \ + static_field(StubRoutines, _arrayof_jshort_disjoint_arraycopy, address) \ + static_field(StubRoutines, _arrayof_jint_disjoint_arraycopy, address) \ + static_field(StubRoutines, _arrayof_jlong_disjoint_arraycopy, address) \ + static_field(StubRoutines, _arrayof_oop_disjoint_arraycopy, address) \ + static_field(StubRoutines, _arrayof_oop_disjoint_arraycopy_uninit, address) \ + static_field(StubRoutines, _checkcast_arraycopy, address) \ + static_field(StubRoutines, _checkcast_arraycopy_uninit, address) \ + static_field(StubRoutines, _unsafe_arraycopy, address) \ + static_field(StubRoutines, _generic_arraycopy, address) \ + \ + static_field(StubRoutines, _aescrypt_encryptBlock, address) \ + static_field(StubRoutines, _aescrypt_decryptBlock, address) \ + static_field(StubRoutines, _cipherBlockChaining_encryptAESCrypt, address) \ + static_field(StubRoutines, _cipherBlockChaining_decryptAESCrypt, address) \ + static_field(StubRoutines, _updateBytesCRC32, address) \ + static_field(StubRoutines, _crc_table_adr, address) \ + \ + nonstatic_field(Thread, _tlab, ThreadLocalAllocBuffer) \ + nonstatic_field(Thread, _allocated_bytes, jlong) \ + \ + nonstatic_field(ThreadLocalAllocBuffer, _start, HeapWord*) \ + nonstatic_field(ThreadLocalAllocBuffer, _top, HeapWord*) \ + nonstatic_field(ThreadLocalAllocBuffer, _end, HeapWord*) \ + nonstatic_field(ThreadLocalAllocBuffer, _pf_top, HeapWord*) \ + nonstatic_field(ThreadLocalAllocBuffer, _desired_size, size_t) \ + nonstatic_field(ThreadLocalAllocBuffer, _refill_waste_limit, size_t) \ + nonstatic_field(ThreadLocalAllocBuffer, _number_of_refills, unsigned) \ + nonstatic_field(ThreadLocalAllocBuffer, _fast_refill_waste, unsigned) \ + nonstatic_field(ThreadLocalAllocBuffer, _slow_allocations, unsigned) \ + \ + nonstatic_field(ThreadShadow, _pending_exception, oop) \ + \ + static_field(vmSymbols, _symbols[0], Symbol*) \ + \ + nonstatic_field(vtableEntry, _method, Method*) \ + +#define VM_TYPES(declare_type, declare_toplevel_type, declare_integer_type, declare_unsigned_integer_type) \ + declare_integer_type(bool) \ + declare_unsigned_integer_type(size_t) \ + declare_integer_type(intx) \ + declare_unsigned_integer_type(uintx) \ + \ + declare_toplevel_type(BasicLock) \ + declare_toplevel_type(CompilerToVM) \ + declare_toplevel_type(ExceptionTableElement) \ + declare_toplevel_type(Flag) \ + declare_toplevel_type(Flag*) \ + declare_toplevel_type(JVMCIEnv) \ + declare_toplevel_type(LocalVariableTableElement) \ + declare_toplevel_type(narrowKlass) \ + declare_toplevel_type(Symbol*) \ + declare_toplevel_type(vtableEntry) \ + \ + declare_toplevel_type(oopDesc) \ + declare_type(arrayOopDesc, oopDesc) \ + \ + declare_toplevel_type(MetaspaceObj) \ + declare_type(Metadata, MetaspaceObj) \ + declare_type(Klass, Metadata) \ + declare_type(InstanceKlass, Klass) \ + declare_type(ConstantPool, Metadata) \ + +#define VM_INT_CONSTANTS(declare_constant, declare_constant_with_value, declare_preprocessor_constant) \ + declare_preprocessor_constant("ASSERT", DEBUG_ONLY(1) NOT_DEBUG(0)) \ + declare_preprocessor_constant("FIELDINFO_TAG_SIZE", FIELDINFO_TAG_SIZE) \ + declare_preprocessor_constant("STACK_BIAS", STACK_BIAS) \ + \ + declare_constant(CompLevel_full_optimization) \ + declare_constant(HeapWordSize) \ + declare_constant(InvocationEntryBci) \ + declare_constant(LogKlassAlignmentInBytes) \ + \ + declare_constant(JVM_ACC_WRITTEN_FLAGS) \ + declare_constant(JVM_ACC_MONITOR_MATCH) \ + declare_constant(JVM_ACC_HAS_MONITOR_BYTECODES) \ + declare_constant(JVM_ACC_HAS_FINALIZER) \ + declare_constant(JVM_ACC_FIELD_INTERNAL) \ + declare_constant(JVM_ACC_FIELD_STABLE) \ + declare_constant(JVM_ACC_FIELD_HAS_GENERIC_SIGNATURE) \ + declare_preprocessor_constant("JVM_ACC_SYNTHETIC", JVM_ACC_SYNTHETIC) \ + declare_preprocessor_constant("JVM_RECOGNIZED_FIELD_MODIFIERS", JVM_RECOGNIZED_FIELD_MODIFIERS) \ + \ + declare_constant(JVM_CONSTANT_Utf8) \ + declare_constant(JVM_CONSTANT_Unicode) \ + declare_constant(JVM_CONSTANT_Integer) \ + declare_constant(JVM_CONSTANT_Float) \ + declare_constant(JVM_CONSTANT_Long) \ + declare_constant(JVM_CONSTANT_Double) \ + declare_constant(JVM_CONSTANT_Class) \ + declare_constant(JVM_CONSTANT_String) \ + declare_constant(JVM_CONSTANT_Fieldref) \ + declare_constant(JVM_CONSTANT_Methodref) \ + declare_constant(JVM_CONSTANT_InterfaceMethodref) \ + declare_constant(JVM_CONSTANT_NameAndType) \ + declare_constant(JVM_CONSTANT_MethodHandle) \ + declare_constant(JVM_CONSTANT_MethodType) \ + declare_constant(JVM_CONSTANT_InvokeDynamic) \ + declare_constant(JVM_CONSTANT_ExternalMax) \ + \ + declare_constant(JVM_CONSTANT_Invalid) \ + declare_constant(JVM_CONSTANT_InternalMin) \ + declare_constant(JVM_CONSTANT_UnresolvedClass) \ + declare_constant(JVM_CONSTANT_ClassIndex) \ + declare_constant(JVM_CONSTANT_StringIndex) \ + declare_constant(JVM_CONSTANT_UnresolvedClassInError) \ + declare_constant(JVM_CONSTANT_MethodHandleInError) \ + declare_constant(JVM_CONSTANT_MethodTypeInError) \ + declare_constant(JVM_CONSTANT_InternalMax) \ + \ + declare_constant(ArrayData::array_len_off_set) \ + declare_constant(ArrayData::array_start_off_set) \ + \ + declare_constant(BitData::exception_seen_flag) \ + declare_constant(BitData::null_seen_flag) \ + declare_constant(BranchData::not_taken_off_set) \ + \ + declare_constant_with_value("CardTableModRefBS::dirty_card", CardTableModRefBS::dirty_card_val()) \ + \ + declare_constant(CodeInstaller::VERIFIED_ENTRY) \ + declare_constant(CodeInstaller::UNVERIFIED_ENTRY) \ + declare_constant(CodeInstaller::OSR_ENTRY) \ + declare_constant(CodeInstaller::EXCEPTION_HANDLER_ENTRY) \ + declare_constant(CodeInstaller::DEOPT_HANDLER_ENTRY) \ + declare_constant(CodeInstaller::INVOKEINTERFACE) \ + declare_constant(CodeInstaller::INVOKEVIRTUAL) \ + declare_constant(CodeInstaller::INVOKESTATIC) \ + declare_constant(CodeInstaller::INVOKESPECIAL) \ + declare_constant(CodeInstaller::INLINE_INVOKE) \ + declare_constant(CodeInstaller::POLL_NEAR) \ + declare_constant(CodeInstaller::POLL_RETURN_NEAR) \ + declare_constant(CodeInstaller::POLL_FAR) \ + declare_constant(CodeInstaller::POLL_RETURN_FAR) \ + declare_constant(CodeInstaller::CARD_TABLE_SHIFT) \ + declare_constant(CodeInstaller::CARD_TABLE_ADDRESS) \ + declare_constant(CodeInstaller::HEAP_TOP_ADDRESS) \ + declare_constant(CodeInstaller::HEAP_END_ADDRESS) \ + declare_constant(CodeInstaller::NARROW_KLASS_BASE_ADDRESS) \ + declare_constant(CodeInstaller::CRC_TABLE_ADDRESS) \ + declare_constant(CodeInstaller::INVOKE_INVALID) \ + \ + declare_constant(ConstantPool::CPCACHE_INDEX_TAG) \ + \ + declare_constant(ConstMethod::_has_linenumber_table) \ + declare_constant(ConstMethod::_has_localvariable_table) \ + declare_constant(ConstMethod::_has_exception_table) \ + \ + declare_constant(CounterData::count_off) \ + \ + declare_constant(DataLayout::cell_size) \ + declare_constant(DataLayout::no_tag) \ + declare_constant(DataLayout::bit_data_tag) \ + declare_constant(DataLayout::counter_data_tag) \ + declare_constant(DataLayout::jump_data_tag) \ + declare_constant(DataLayout::receiver_type_data_tag) \ + declare_constant(DataLayout::virtual_call_data_tag) \ + declare_constant(DataLayout::ret_data_tag) \ + declare_constant(DataLayout::branch_data_tag) \ + declare_constant(DataLayout::multi_branch_data_tag) \ + declare_constant(DataLayout::arg_info_data_tag) \ + declare_constant(DataLayout::call_type_data_tag) \ + declare_constant(DataLayout::virtual_call_type_data_tag) \ + declare_constant(DataLayout::parameters_type_data_tag) \ + declare_constant(DataLayout::speculative_trap_data_tag) \ + \ + declare_constant(Deoptimization::Unpack_deopt) \ + declare_constant(Deoptimization::Unpack_exception) \ + declare_constant(Deoptimization::Unpack_uncommon_trap) \ + declare_constant(Deoptimization::Unpack_reexecute) \ + \ + declare_constant(Deoptimization::_action_bits) \ + declare_constant(Deoptimization::_reason_bits) \ + declare_constant(Deoptimization::_debug_id_bits) \ + declare_constant(Deoptimization::_action_shift) \ + declare_constant(Deoptimization::_reason_shift) \ + declare_constant(Deoptimization::_debug_id_shift) \ + \ + declare_constant(Deoptimization::Action_none) \ + declare_constant(Deoptimization::Action_maybe_recompile) \ + declare_constant(Deoptimization::Action_reinterpret) \ + declare_constant(Deoptimization::Action_make_not_entrant) \ + declare_constant(Deoptimization::Action_make_not_compilable) \ + \ + declare_constant(Deoptimization::Reason_none) \ + declare_constant(Deoptimization::Reason_null_check) \ + declare_constant(Deoptimization::Reason_range_check) \ + declare_constant(Deoptimization::Reason_class_check) \ + declare_constant(Deoptimization::Reason_array_check) \ + declare_constant(Deoptimization::Reason_unreached0) \ + declare_constant(Deoptimization::Reason_constraint) \ + declare_constant(Deoptimization::Reason_div0_check) \ + declare_constant(Deoptimization::Reason_loop_limit_check) \ + declare_constant(Deoptimization::Reason_type_checked_inlining) \ + declare_constant(Deoptimization::Reason_optimized_type_check) \ + declare_constant(Deoptimization::Reason_aliasing) \ + declare_constant(Deoptimization::Reason_transfer_to_interpreter) \ + declare_constant(Deoptimization::Reason_not_compiled_exception_handler) \ + declare_constant(Deoptimization::Reason_unresolved) \ + declare_constant(Deoptimization::Reason_jsr_mismatch) \ + declare_constant(Deoptimization::Reason_LIMIT) \ + \ + declare_constant_with_value("dirtyCardQueueBufferOffset", in_bytes(DirtyCardQueue::byte_offset_of_buf())) \ + declare_constant_with_value("dirtyCardQueueIndexOffset", in_bytes(DirtyCardQueue::byte_offset_of_index())) \ + \ + declare_constant(FieldInfo::access_flags_offset) \ + declare_constant(FieldInfo::name_index_offset) \ + declare_constant(FieldInfo::signature_index_offset) \ + declare_constant(FieldInfo::initval_index_offset) \ + declare_constant(FieldInfo::low_packed_offset) \ + declare_constant(FieldInfo::high_packed_offset) \ + declare_constant(FieldInfo::field_slots) \ + \ + declare_constant(InstanceKlass::linked) \ + declare_constant(InstanceKlass::fully_initialized) \ + \ + declare_constant(JumpData::taken_off_set) \ + declare_constant(JumpData::displacement_off_set) \ + \ + declare_constant(JVMCIEnv::ok) \ + declare_constant(JVMCIEnv::dependencies_failed) \ + declare_constant(JVMCIEnv::dependencies_invalid) \ + declare_constant(JVMCIEnv::cache_full) \ + declare_constant(JVMCIEnv::code_too_large) \ + \ + declare_constant(Klass::_lh_neutral_value) \ + declare_constant(Klass::_lh_instance_slow_path_bit) \ + declare_constant(Klass::_lh_log2_element_size_shift) \ + declare_constant(Klass::_lh_log2_element_size_mask) \ + declare_constant(Klass::_lh_element_type_shift) \ + declare_constant(Klass::_lh_element_type_mask) \ + declare_constant(Klass::_lh_header_size_shift) \ + declare_constant(Klass::_lh_header_size_mask) \ + declare_constant(Klass::_lh_array_tag_shift) \ + declare_constant(Klass::_lh_array_tag_type_value) \ + declare_constant(Klass::_lh_array_tag_obj_value) \ + \ + declare_constant(markOopDesc::no_hash) \ + \ + declare_constant(Method::_jfr_towrite) \ + declare_constant(Method::_caller_sensitive) \ + declare_constant(Method::_force_inline) \ + declare_constant(Method::_dont_inline) \ + declare_constant(Method::_hidden) \ + \ + declare_constant(Method::nonvirtual_vtable_index) \ + declare_constant(Method::invalid_vtable_index) \ + \ + declare_constant(MultiBranchData::per_case_cell_count) \ + \ + declare_constant(ReceiverTypeData::nonprofiled_count_off_set) \ + declare_constant(ReceiverTypeData::receiver_type_row_cell_count) \ + declare_constant(ReceiverTypeData::receiver0_offset) \ + declare_constant(ReceiverTypeData::count0_offset) \ + \ + declare_constant_with_value("satbMarkQueueBufferOffset", in_bytes(SATBMarkQueue::byte_offset_of_buf())) \ + declare_constant_with_value("satbMarkQueueIndexOffset", in_bytes(SATBMarkQueue::byte_offset_of_index())) \ + declare_constant_with_value("satbMarkQueueActiveOffset", in_bytes(SATBMarkQueue::byte_offset_of_active())) \ + \ + declare_constant(vmIntrinsics::_invokeBasic) \ + declare_constant(vmIntrinsics::_linkToVirtual) \ + declare_constant(vmIntrinsics::_linkToStatic) \ + declare_constant(vmIntrinsics::_linkToSpecial) \ + declare_constant(vmIntrinsics::_linkToInterface) \ + \ + declare_constant(vmSymbols::FIRST_SID) \ + declare_constant(vmSymbols::SID_LIMIT) \ + +#define VM_LONG_CONSTANTS(declare_constant, declare_preprocessor_constant) \ + declare_constant(InvocationCounter::count_increment) \ + declare_constant(InvocationCounter::count_shift) \ + \ + declare_constant(markOopDesc::hash_shift) \ + \ + declare_constant(markOopDesc::biased_lock_mask_in_place) \ + declare_constant(markOopDesc::age_mask_in_place) \ + declare_constant(markOopDesc::epoch_mask_in_place) \ + declare_constant(markOopDesc::hash_mask) \ + declare_constant(markOopDesc::hash_mask_in_place) \ + \ + declare_constant(markOopDesc::unlocked_value) \ + declare_constant(markOopDesc::biased_lock_pattern) \ + \ + declare_constant(markOopDesc::no_hash_in_place) \ + declare_constant(markOopDesc::no_lock_in_place) \ + +#define VM_ADDRESSES(declare_address, declare_preprocessor_address, declare_function) \ + declare_function(SharedRuntime::register_finalizer) \ + declare_function(SharedRuntime::exception_handler_for_return_address) \ + declare_function(SharedRuntime::OSR_migration_end) \ + declare_function(SharedRuntime::dsin) \ + declare_function(SharedRuntime::dcos) \ + declare_function(SharedRuntime::dtan) \ + declare_function(SharedRuntime::dexp) \ + declare_function(SharedRuntime::dlog) \ + declare_function(SharedRuntime::dlog10) \ + declare_function(SharedRuntime::dpow) \ + \ + declare_function(os::dll_load) \ + declare_function(os::dll_lookup) \ + declare_function(os::javaTimeMillis) \ + declare_function(os::javaTimeNanos) \ + \ + declare_function(Deoptimization::fetch_unroll_info) \ + COMPILER2_PRESENT(declare_function(Deoptimization::uncommon_trap)) \ + declare_function(Deoptimization::unpack_frames) \ + \ + declare_function(JVMCIRuntime::new_instance) \ + declare_function(JVMCIRuntime::new_array) \ + declare_function(JVMCIRuntime::new_multi_array) \ + declare_function(JVMCIRuntime::dynamic_new_array) \ + declare_function(JVMCIRuntime::dynamic_new_instance) \ + \ + declare_function(JVMCIRuntime::thread_is_interrupted) \ + declare_function(JVMCIRuntime::vm_message) \ + declare_function(JVMCIRuntime::identity_hash_code) \ + declare_function(JVMCIRuntime::exception_handler_for_pc) \ + declare_function(JVMCIRuntime::monitorenter) \ + declare_function(JVMCIRuntime::monitorexit) \ + declare_function(JVMCIRuntime::create_null_exception) \ + declare_function(JVMCIRuntime::create_out_of_bounds_exception) \ + declare_function(JVMCIRuntime::log_primitive) \ + declare_function(JVMCIRuntime::log_object) \ + declare_function(JVMCIRuntime::log_printf) \ + declare_function(JVMCIRuntime::vm_error) \ + declare_function(JVMCIRuntime::load_and_clear_exception) \ + declare_function(JVMCIRuntime::write_barrier_pre) \ + declare_function(JVMCIRuntime::write_barrier_post) \ + declare_function(JVMCIRuntime::validate_object) \ + \ + declare_function(JVMCIRuntime::test_deoptimize_call_int) + + +#if INCLUDE_ALL_GCS + +#define VM_STRUCTS_G1(nonstatic_field, static_field) \ + static_field(HeapRegion, LogOfHRGrainBytes, int) + +#define VM_INT_CONSTANTS_G1(declare_constant, declare_constant_with_value, declare_preprocessor_constant) \ + declare_constant_with_value("G1SATBCardTableModRefBS::g1_young_gen", G1SATBCardTableModRefBS::g1_young_card_val()) + +#endif // INCLUDE_ALL_GCS + + +#ifdef TARGET_OS_FAMILY_linux + +#define VM_ADDRESSES_OS(declare_address, declare_preprocessor_address, declare_function) \ + declare_preprocessor_address("RTLD_DEFAULT", RTLD_DEFAULT) + +#endif // TARGET_OS_FAMILY_linux + + +#ifdef TARGET_OS_FAMILY_bsd + +#define VM_ADDRESSES_OS(declare_address, declare_preprocessor_address, declare_function) \ + declare_preprocessor_address("RTLD_DEFAULT", RTLD_DEFAULT) + +#endif // TARGET_OS_FAMILY_bsd + + +#ifdef TARGET_ARCH_x86 + +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \ + volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) \ + static_field(VM_Version, _cpuFeatures, uint64_t) + +#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) \ + declare_toplevel_type(VM_Version) + +#define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \ + LP64_ONLY(declare_constant(frame::arg_reg_save_area_bytes)) \ + declare_constant(frame::interpreter_frame_sender_sp_offset) \ + declare_constant(frame::interpreter_frame_last_sp_offset) \ + declare_constant(VM_Version::CPU_CX8) \ + declare_constant(VM_Version::CPU_CMOV) \ + declare_constant(VM_Version::CPU_FXSR) \ + declare_constant(VM_Version::CPU_HT) \ + declare_constant(VM_Version::CPU_MMX) \ + declare_constant(VM_Version::CPU_3DNOW_PREFETCH) \ + declare_constant(VM_Version::CPU_SSE) \ + declare_constant(VM_Version::CPU_SSE2) \ + declare_constant(VM_Version::CPU_SSE3) \ + declare_constant(VM_Version::CPU_SSSE3) \ + declare_constant(VM_Version::CPU_SSE4A) \ + declare_constant(VM_Version::CPU_SSE4_1) \ + declare_constant(VM_Version::CPU_SSE4_2) \ + declare_constant(VM_Version::CPU_POPCNT) \ + declare_constant(VM_Version::CPU_LZCNT) \ + declare_constant(VM_Version::CPU_TSC) \ + declare_constant(VM_Version::CPU_TSCINV) \ + declare_constant(VM_Version::CPU_AVX) \ + declare_constant(VM_Version::CPU_AVX2) \ + declare_constant(VM_Version::CPU_AES) \ + declare_constant(VM_Version::CPU_ERMS) \ + declare_constant(VM_Version::CPU_CLMUL) \ + declare_constant(VM_Version::CPU_BMI1) \ + declare_constant(VM_Version::CPU_BMI2) \ + declare_constant(VM_Version::CPU_RTM) \ + declare_constant(VM_Version::CPU_ADX) \ + declare_constant(VM_Version::CPU_AVX512F) \ + declare_constant(VM_Version::CPU_AVX512DQ) \ + declare_constant(VM_Version::CPU_AVX512PF) \ + declare_constant(VM_Version::CPU_AVX512ER) \ + declare_constant(VM_Version::CPU_AVX512CD) \ + declare_constant(VM_Version::CPU_AVX512BW) + +#define VM_LONG_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \ + declare_preprocessor_constant("VM_Version::CPU_AVX512VL", CPU_AVX512VL) + +#endif // TARGET_ARCH_x86 + + +/* + * Dummy defines for architectures that don't use these. + */ +#ifndef VM_STRUCTS_CPU +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) +#endif + +#ifndef VM_TYPES_CPU +#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) +#endif + +#ifndef VM_INT_CONSTANTS_CPU +#define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) +#endif + +#ifndef VM_LONG_CONSTANTS_CPU +#define VM_LONG_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) +#endif + +#ifndef VM_STRUCTS_OS +#define VM_STRUCTS_OS(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) +#endif + +#ifndef VM_TYPES_OS +#define VM_TYPES_OS(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) +#endif + +#ifndef VM_INT_CONSTANTS_OS +#define VM_INT_CONSTANTS_OS(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) +#endif + +#ifndef VM_LONG_CONSTANTS_OS +#define VM_LONG_CONSTANTS_OS(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) +#endif + +#ifndef VM_ADDRESSES_OS +#define VM_ADDRESSES_OS(declare_address, declare_preprocessor_address, declare_function) +#endif + + +// whole purpose of this function is to work around bug c++/27724 in gcc 4.1.1 +// with optimization turned on it doesn't affect produced code +static inline uint64_t cast_uint64_t(size_t x) +{ + return x; +} + +#define ASSIGN_CONST_TO_64BIT_VAR(var, expr) \ + JNIEXPORT uint64_t var = cast_uint64_t(expr); + +#define ASSIGN_OFFSET_TO_64BIT_VAR(var, type, field) \ + ASSIGN_CONST_TO_64BIT_VAR(var, offset_of(type, field)) + +#define ASSIGN_STRIDE_TO_64BIT_VAR(var, array) \ + ASSIGN_CONST_TO_64BIT_VAR(var, (char*)&array[1] - (char*)&array[0]) + +// +// Instantiation of VMStructEntries, VMTypeEntries and VMIntConstantEntries +// + +// These initializers are allowed to access private fields in classes +// as long as class VMStructs is a friend +VMStructEntry JVMCIVMStructs::localHotSpotVMStructs[] = { + VM_STRUCTS(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_STATIC_VM_STRUCT_ENTRY, + GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_NONSTATIC_VM_STRUCT_ENTRY) + + VM_STRUCTS_OS(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_STATIC_VM_STRUCT_ENTRY, + GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_C1_UNCHECKED_STATIC_VM_STRUCT_ENTRY, + GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY) + + VM_STRUCTS_CPU(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_STATIC_VM_STRUCT_ENTRY, + GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_NONPRODUCT_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_C2_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_C1_UNCHECKED_STATIC_VM_STRUCT_ENTRY, + GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY) + +#if INCLUDE_ALL_GCS + VM_STRUCTS_G1(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, + GENERATE_STATIC_VM_STRUCT_ENTRY) +#endif + + GENERATE_VM_STRUCT_LAST_ENTRY() +}; + +VMTypeEntry JVMCIVMStructs::localHotSpotVMTypes[] = { + VM_TYPES(GENERATE_VM_TYPE_ENTRY, + GENERATE_TOPLEVEL_VM_TYPE_ENTRY, + GENERATE_INTEGER_VM_TYPE_ENTRY, + GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY) + + VM_TYPES_OS(GENERATE_VM_TYPE_ENTRY, + GENERATE_TOPLEVEL_VM_TYPE_ENTRY, + GENERATE_OOP_VM_TYPE_ENTRY, + GENERATE_INTEGER_VM_TYPE_ENTRY, + GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY, + GENERATE_C1_TOPLEVEL_VM_TYPE_ENTRY, + GENERATE_C2_VM_TYPE_ENTRY, + GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY) + + VM_TYPES_CPU(GENERATE_VM_TYPE_ENTRY, + GENERATE_TOPLEVEL_VM_TYPE_ENTRY, + GENERATE_OOP_VM_TYPE_ENTRY, + GENERATE_INTEGER_VM_TYPE_ENTRY, + GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY, + GENERATE_C1_TOPLEVEL_VM_TYPE_ENTRY, + GENERATE_C2_VM_TYPE_ENTRY, + GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY) + + GENERATE_VM_TYPE_LAST_ENTRY() +}; + +VMIntConstantEntry JVMCIVMStructs::localHotSpotVMIntConstants[] = { + VM_INT_CONSTANTS(GENERATE_VM_INT_CONSTANT_ENTRY, + GENERATE_VM_INT_CONSTANT_WITH_VALUE_ENTRY, + GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY) + + VM_INT_CONSTANTS_OS(GENERATE_VM_INT_CONSTANT_ENTRY, + GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY, + GENERATE_C1_VM_INT_CONSTANT_ENTRY, + GENERATE_C2_VM_INT_CONSTANT_ENTRY, + GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY) + + VM_INT_CONSTANTS_CPU(GENERATE_VM_INT_CONSTANT_ENTRY, + GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY, + GENERATE_C1_VM_INT_CONSTANT_ENTRY, + GENERATE_C2_VM_INT_CONSTANT_ENTRY, + GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY) + +#if INCLUDE_ALL_GCS + VM_INT_CONSTANTS_G1(GENERATE_VM_INT_CONSTANT_ENTRY, + GENERATE_VM_INT_CONSTANT_WITH_VALUE_ENTRY, + GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY) +#endif + + GENERATE_VM_INT_CONSTANT_LAST_ENTRY() +}; + +VMLongConstantEntry JVMCIVMStructs::localHotSpotVMLongConstants[] = { + VM_LONG_CONSTANTS(GENERATE_VM_LONG_CONSTANT_ENTRY, + GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY) + + VM_LONG_CONSTANTS_OS(GENERATE_VM_LONG_CONSTANT_ENTRY, + GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY, + GENERATE_C1_VM_LONG_CONSTANT_ENTRY, + GENERATE_C2_VM_LONG_CONSTANT_ENTRY, + GENERATE_C2_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY) + + VM_LONG_CONSTANTS_CPU(GENERATE_VM_LONG_CONSTANT_ENTRY, + GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY, + GENERATE_C1_VM_LONG_CONSTANT_ENTRY, + GENERATE_C2_VM_LONG_CONSTANT_ENTRY, + GENERATE_C2_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY) + + GENERATE_VM_LONG_CONSTANT_LAST_ENTRY() +}; + +VMAddressEntry JVMCIVMStructs::localHotSpotVMAddresses[] = { + VM_ADDRESSES(GENERATE_VM_ADDRESS_ENTRY, + GENERATE_PREPROCESSOR_VM_ADDRESS_ENTRY, + GENERATE_VM_FUNCTION_ENTRY) + + VM_ADDRESSES_OS(GENERATE_VM_ADDRESS_ENTRY, + GENERATE_PREPROCESSOR_VM_ADDRESS_ENTRY, + GENERATE_VM_FUNCTION_ENTRY) + + GENERATE_VM_ADDRESS_LAST_ENTRY() +}; + +extern "C" { +JNIEXPORT VMStructEntry* jvmciHotSpotVMStructs = JVMCIVMStructs::localHotSpotVMStructs; +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMStructEntryTypeNameOffset, VMStructEntry, typeName); +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMStructEntryFieldNameOffset, VMStructEntry, fieldName); +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMStructEntryTypeStringOffset, VMStructEntry, typeString); +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMStructEntryIsStaticOffset, VMStructEntry, isStatic); +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMStructEntryOffsetOffset, VMStructEntry, offset); +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMStructEntryAddressOffset, VMStructEntry, address); +ASSIGN_STRIDE_TO_64BIT_VAR(jvmciHotSpotVMStructEntryArrayStride, jvmciHotSpotVMStructs); + +JNIEXPORT VMTypeEntry* jvmciHotSpotVMTypes = JVMCIVMStructs::localHotSpotVMTypes; +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMTypeEntryTypeNameOffset, VMTypeEntry, typeName); +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMTypeEntrySuperclassNameOffset, VMTypeEntry, superclassName); +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMTypeEntryIsOopTypeOffset, VMTypeEntry, isOopType); +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMTypeEntryIsIntegerTypeOffset, VMTypeEntry, isIntegerType); +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMTypeEntryIsUnsignedOffset, VMTypeEntry, isUnsigned); +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMTypeEntrySizeOffset, VMTypeEntry, size); +ASSIGN_STRIDE_TO_64BIT_VAR(jvmciHotSpotVMTypeEntryArrayStride, jvmciHotSpotVMTypes); + +JNIEXPORT VMIntConstantEntry* jvmciHotSpotVMIntConstants = JVMCIVMStructs::localHotSpotVMIntConstants; +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMIntConstantEntryNameOffset, VMIntConstantEntry, name); +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMIntConstantEntryValueOffset, VMIntConstantEntry, value); +ASSIGN_STRIDE_TO_64BIT_VAR(jvmciHotSpotVMIntConstantEntryArrayStride, jvmciHotSpotVMIntConstants); + +JNIEXPORT VMLongConstantEntry* jvmciHotSpotVMLongConstants = JVMCIVMStructs::localHotSpotVMLongConstants; +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMLongConstantEntryNameOffset, VMLongConstantEntry, name); +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMLongConstantEntryValueOffset, VMLongConstantEntry, value); +ASSIGN_STRIDE_TO_64BIT_VAR(jvmciHotSpotVMLongConstantEntryArrayStride, jvmciHotSpotVMLongConstants); + +JNIEXPORT VMAddressEntry* jvmciHotSpotVMAddresses = JVMCIVMStructs::localHotSpotVMAddresses; +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMAddressEntryNameOffset, VMAddressEntry, name); +ASSIGN_OFFSET_TO_64BIT_VAR(jvmciHotSpotVMAddressEntryValueOffset, VMAddressEntry, value); +ASSIGN_STRIDE_TO_64BIT_VAR(jvmciHotSpotVMAddressEntryArrayStride, jvmciHotSpotVMAddresses); +} diff --git a/hotspot/src/share/vm/jvmci/vmStructs_jvmci.hpp b/hotspot/src/share/vm/jvmci/vmStructs_jvmci.hpp index a58a6ef74c7..36bfe7289c9 100644 --- a/hotspot/src/share/vm/jvmci/vmStructs_jvmci.hpp +++ b/hotspot/src/share/vm/jvmci/vmStructs_jvmci.hpp @@ -25,113 +25,36 @@ #ifndef SHARE_VM_JVMCI_VMSTRUCTS_JVMCI_HPP #define SHARE_VM_JVMCI_VMSTRUCTS_JVMCI_HPP -#include "compiler/abstractCompiler.hpp" -#include "jvmci/jvmciCodeInstaller.hpp" -#include "jvmci/jvmciCompilerToVM.hpp" -#include "jvmci/jvmciEnv.hpp" -#include "jvmci/jvmciRuntime.hpp" +#include "runtime/vmStructs.hpp" -#define VM_STRUCTS_JVMCI(nonstatic_field, static_field) \ - nonstatic_field(JavaThread, _pending_deoptimization, int) \ - nonstatic_field(JavaThread, _pending_failed_speculation, oop) \ - nonstatic_field(JavaThread, _pending_transfer_to_interpreter, bool) \ - nonstatic_field(JavaThread, _jvmci_counters, jlong*) \ - nonstatic_field(MethodData, _jvmci_ir_size, int) \ - nonstatic_field(JVMCIEnv, _task, CompileTask*) \ - nonstatic_field(JVMCIEnv, _jvmti_can_hotswap_or_post_breakpoint, bool) \ - nonstatic_field(DeoptimizationBlob, _uncommon_trap_offset, int) \ - \ - static_field(CompilerToVM, _supports_inline_contig_alloc, bool) \ - static_field(CompilerToVM, _heap_end_addr, HeapWord**) \ - static_field(CompilerToVM, _heap_top_addr, HeapWord**) +class JVMCIVMStructs { +public: + /** + * The last entry has a NULL fieldName. + */ + static VMStructEntry localHotSpotVMStructs[]; -#define VM_TYPES_JVMCI(declare_type, declare_toplevel_type) \ - declare_toplevel_type(CompilerToVM) \ - declare_toplevel_type(JVMCIEnv) \ + /** + * The last entry has a NULL typeName. + */ + static VMTypeEntry localHotSpotVMTypes[]; -#define VM_INT_CONSTANTS_JVMCI(declare_constant, declare_preprocessor_constant) \ - declare_constant(Deoptimization::Reason_unreached0) \ - declare_constant(Deoptimization::Reason_type_checked_inlining) \ - declare_constant(Deoptimization::Reason_optimized_type_check) \ - declare_constant(Deoptimization::Reason_aliasing) \ - declare_constant(Deoptimization::Reason_transfer_to_interpreter) \ - declare_constant(Deoptimization::Reason_not_compiled_exception_handler) \ - declare_constant(Deoptimization::Reason_unresolved) \ - declare_constant(Deoptimization::Reason_jsr_mismatch) \ - declare_constant(JVMCIEnv::ok) \ - declare_constant(JVMCIEnv::dependencies_failed) \ - declare_constant(JVMCIEnv::dependencies_invalid) \ - declare_constant(JVMCIEnv::cache_full) \ - declare_constant(JVMCIEnv::code_too_large) \ - \ - declare_preprocessor_constant("JVM_ACC_SYNTHETIC", JVM_ACC_SYNTHETIC) \ - declare_preprocessor_constant("JVM_RECOGNIZED_FIELD_MODIFIERS", JVM_RECOGNIZED_FIELD_MODIFIERS) \ - \ - declare_constant(CompilerToVM::KLASS_TAG) \ - declare_constant(CompilerToVM::SYMBOL_TAG) \ - \ - declare_constant(BitData::exception_seen_flag) \ - declare_constant(BitData::null_seen_flag) \ - declare_constant(CounterData::count_off) \ - declare_constant(JumpData::taken_off_set) \ - declare_constant(JumpData::displacement_off_set) \ - declare_constant(ReceiverTypeData::nonprofiled_count_off_set) \ - declare_constant(ReceiverTypeData::receiver_type_row_cell_count) \ - declare_constant(ReceiverTypeData::receiver0_offset) \ - declare_constant(ReceiverTypeData::count0_offset) \ - declare_constant(BranchData::not_taken_off_set) \ - declare_constant(ArrayData::array_len_off_set) \ - declare_constant(ArrayData::array_start_off_set) \ - declare_constant(MultiBranchData::per_case_cell_count) \ - \ - declare_constant(CodeInstaller::VERIFIED_ENTRY) \ - declare_constant(CodeInstaller::UNVERIFIED_ENTRY) \ - declare_constant(CodeInstaller::OSR_ENTRY) \ - declare_constant(CodeInstaller::EXCEPTION_HANDLER_ENTRY) \ - declare_constant(CodeInstaller::DEOPT_HANDLER_ENTRY) \ - declare_constant(CodeInstaller::INVOKEINTERFACE) \ - declare_constant(CodeInstaller::INVOKEVIRTUAL) \ - declare_constant(CodeInstaller::INVOKESTATIC) \ - declare_constant(CodeInstaller::INVOKESPECIAL) \ - declare_constant(CodeInstaller::INLINE_INVOKE) \ - declare_constant(CodeInstaller::POLL_NEAR) \ - declare_constant(CodeInstaller::POLL_RETURN_NEAR) \ - declare_constant(CodeInstaller::POLL_FAR) \ - declare_constant(CodeInstaller::POLL_RETURN_FAR) \ - declare_constant(CodeInstaller::CARD_TABLE_SHIFT) \ - declare_constant(CodeInstaller::CARD_TABLE_ADDRESS) \ - declare_constant(CodeInstaller::HEAP_TOP_ADDRESS) \ - declare_constant(CodeInstaller::HEAP_END_ADDRESS) \ - declare_constant(CodeInstaller::NARROW_KLASS_BASE_ADDRESS) \ - declare_constant(CodeInstaller::CRC_TABLE_ADDRESS) \ - declare_constant(CodeInstaller::INVOKE_INVALID) \ - \ - declare_constant(Method::invalid_vtable_index) \ + /** + * Table of integer constants. + * The last entry has a NULL typeName. + */ + static VMIntConstantEntry localHotSpotVMIntConstants[]; -#define VM_ADDRESSES_JVMCI(declare_address, declare_preprocessor_address, declare_function) \ - declare_function(JVMCIRuntime::new_instance) \ - declare_function(JVMCIRuntime::new_array) \ - declare_function(JVMCIRuntime::new_multi_array) \ - declare_function(JVMCIRuntime::dynamic_new_array) \ - declare_function(JVMCIRuntime::dynamic_new_instance) \ - \ - declare_function(JVMCIRuntime::thread_is_interrupted) \ - declare_function(JVMCIRuntime::vm_message) \ - declare_function(JVMCIRuntime::identity_hash_code) \ - declare_function(JVMCIRuntime::exception_handler_for_pc) \ - declare_function(JVMCIRuntime::monitorenter) \ - declare_function(JVMCIRuntime::monitorexit) \ - declare_function(JVMCIRuntime::create_null_exception) \ - declare_function(JVMCIRuntime::create_out_of_bounds_exception) \ - declare_function(JVMCIRuntime::log_primitive) \ - declare_function(JVMCIRuntime::log_object) \ - declare_function(JVMCIRuntime::log_printf) \ - declare_function(JVMCIRuntime::vm_error) \ - declare_function(JVMCIRuntime::load_and_clear_exception) \ - declare_function(JVMCIRuntime::write_barrier_pre) \ - declare_function(JVMCIRuntime::write_barrier_post) \ - declare_function(JVMCIRuntime::validate_object) \ - \ - declare_function(JVMCIRuntime::test_deoptimize_call_int) + /** + * Table of long constants. + * The last entry has a NULL typeName. + */ + static VMLongConstantEntry localHotSpotVMLongConstants[]; + + /** + * Table of addresses. + */ + static VMAddressEntry localHotSpotVMAddresses[]; +}; #endif // SHARE_VM_JVMCI_VMSTRUCTS_JVMCI_HPP diff --git a/hotspot/src/share/vm/oops/constMethod.hpp b/hotspot/src/share/vm/oops/constMethod.hpp index b5360571cdb..5bd135ebf17 100644 --- a/hotspot/src/share/vm/oops/constMethod.hpp +++ b/hotspot/src/share/vm/oops/constMethod.hpp @@ -166,9 +166,9 @@ class InlineTableSizes : StackObj { #undef INLINE_TABLE_PARAM #undef INLINE_TABLE_DECLARE - class ConstMethod : public MetaspaceObj { friend class VMStructs; + friend class JVMCIVMStructs; public: typedef enum { NORMAL, OVERPASS } MethodType; diff --git a/hotspot/src/share/vm/oops/constantPool.hpp b/hotspot/src/share/vm/oops/constantPool.hpp index 99d77253be9..bbb099b22cb 100644 --- a/hotspot/src/share/vm/oops/constantPool.hpp +++ b/hotspot/src/share/vm/oops/constantPool.hpp @@ -74,6 +74,7 @@ class KlassSizeStats; class ConstantPool : public Metadata { friend class VMStructs; + friend class JVMCIVMStructs; friend class BytecodeInterpreter; // Directly extracts a klass in the pool for fast instanceof/checkcast friend class Universe; // For null constructor private: diff --git a/hotspot/src/share/vm/oops/instanceKlass.hpp b/hotspot/src/share/vm/oops/instanceKlass.hpp index ca5262346a1..0d2dac711e4 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.hpp +++ b/hotspot/src/share/vm/oops/instanceKlass.hpp @@ -108,6 +108,7 @@ struct JvmtiCachedClassFileData; class InstanceKlass: public Klass { friend class VMStructs; + friend class JVMCIVMStructs; friend class ClassFileParser; friend class CompileReplay; diff --git a/hotspot/src/share/vm/oops/klass.hpp b/hotspot/src/share/vm/oops/klass.hpp index a7ddf019063..bfad79f5bb5 100644 --- a/hotspot/src/share/vm/oops/klass.hpp +++ b/hotspot/src/share/vm/oops/klass.hpp @@ -60,6 +60,7 @@ class fieldDescriptor; class Klass : public Metadata { friend class VMStructs; + friend class JVMCIVMStructs; protected: // note: put frequently-used fields together at start of klass structure // for better cache behavior (may not make much of a difference but sure won't hurt) diff --git a/hotspot/src/share/vm/oops/klassVtable.hpp b/hotspot/src/share/vm/oops/klassVtable.hpp index e4b4c9f5141..78a7bb39b1a 100644 --- a/hotspot/src/share/vm/oops/klassVtable.hpp +++ b/hotspot/src/share/vm/oops/klassVtable.hpp @@ -155,6 +155,7 @@ class klassVtable : public ResourceObj { // from_interpreter_entry_point -> i2cadapter class vtableEntry VALUE_OBJ_CLASS_SPEC { friend class VMStructs; + friend class JVMCIVMStructs; public: // size in words diff --git a/hotspot/src/share/vm/oops/method.hpp b/hotspot/src/share/vm/oops/method.hpp index 2b7bd268f5c..861b407c6cf 100644 --- a/hotspot/src/share/vm/oops/method.hpp +++ b/hotspot/src/share/vm/oops/method.hpp @@ -61,6 +61,7 @@ class KlassSizeStats; class Method : public Metadata { friend class VMStructs; + friend class JVMCIVMStructs; private: ConstMethod* _constMethod; // Method read-only data. MethodData* _method_data; diff --git a/hotspot/src/share/vm/oops/methodCounters.hpp b/hotspot/src/share/vm/oops/methodCounters.hpp index 039271b1c10..b52bff3104a 100644 --- a/hotspot/src/share/vm/oops/methodCounters.hpp +++ b/hotspot/src/share/vm/oops/methodCounters.hpp @@ -32,6 +32,7 @@ class MethodCounters: public MetaspaceObj { friend class VMStructs; + friend class JVMCIVMStructs; private: int _interpreter_invocation_count; // Count of times invoked (reused as prev_event_count in tiered) u2 _interpreter_throwout_count; // Count of times method was exited via exception while interpreting diff --git a/hotspot/src/share/vm/oops/methodData.hpp b/hotspot/src/share/vm/oops/methodData.hpp index 14afeccea57..c8d3d8fc247 100644 --- a/hotspot/src/share/vm/oops/methodData.hpp +++ b/hotspot/src/share/vm/oops/methodData.hpp @@ -73,6 +73,7 @@ class ProfileData; // Overlay for generic profiling data. class DataLayout VALUE_OBJ_CLASS_SPEC { friend class VMStructs; + friend class JVMCIVMStructs; private: // Every data layout begins with a header. This header @@ -536,6 +537,7 @@ public: // A BitData holds a flag or two in its header. class BitData : public ProfileData { friend class VMStructs; + friend class JVMCIVMStructs; protected: enum { // null_seen: @@ -605,6 +607,7 @@ public: // A CounterData corresponds to a simple counter. class CounterData : public BitData { friend class VMStructs; + friend class JVMCIVMStructs; protected: enum { count_off, @@ -670,6 +673,7 @@ public: // the corresponding target bci. class JumpData : public ProfileData { friend class VMStructs; + friend class JVMCIVMStructs; protected: enum { taken_off_set, @@ -1177,6 +1181,7 @@ public: // which are used to store a type profile for the receiver of the check. class ReceiverTypeData : public CounterData { friend class VMStructs; + friend class JVMCIVMStructs; protected: enum { #if INCLUDE_JVMCI @@ -1683,6 +1688,7 @@ public: // for the taken case. class BranchData : public JumpData { friend class VMStructs; + friend class JVMCIVMStructs; protected: enum { not_taken_off_set = jump_cell_count, @@ -1760,6 +1766,7 @@ public: // and an array start. class ArrayData : public ProfileData { friend class VMStructs; + friend class JVMCIVMStructs; protected: friend class DataLayout; @@ -1838,6 +1845,7 @@ public: // case was taken and specify the data displacment for each branch target. class MultiBranchData : public ArrayData { friend class VMStructs; + friend class JVMCIVMStructs; protected: enum { default_count_off_set, @@ -2137,6 +2145,7 @@ class CleanExtraDataClosure; class MethodData : public Metadata { friend class VMStructs; + friend class JVMCIVMStructs; CC_INTERP_ONLY(friend class BytecodeInterpreter;) private: friend class ProfileData; diff --git a/hotspot/src/share/vm/oops/objArrayKlass.hpp b/hotspot/src/share/vm/oops/objArrayKlass.hpp index d888fb7228a..560f266bc63 100644 --- a/hotspot/src/share/vm/oops/objArrayKlass.hpp +++ b/hotspot/src/share/vm/oops/objArrayKlass.hpp @@ -33,6 +33,7 @@ class ObjArrayKlass : public ArrayKlass { friend class VMStructs; + friend class JVMCIVMStructs; private: Klass* _element_klass; // The klass of the elements of this array type Klass* _bottom_klass; // The one-dimensional type (InstanceKlass or TypeArrayKlass) diff --git a/hotspot/src/share/vm/oops/oop.hpp b/hotspot/src/share/vm/oops/oop.hpp index b096f3f45c5..b7fa4c2de6e 100644 --- a/hotspot/src/share/vm/oops/oop.hpp +++ b/hotspot/src/share/vm/oops/oop.hpp @@ -58,6 +58,7 @@ class ParCompactionManager; class oopDesc { friend class VMStructs; + friend class JVMCIVMStructs; private: volatile markOop _mark; union _metadata { diff --git a/hotspot/src/share/vm/runtime/basicLock.hpp b/hotspot/src/share/vm/runtime/basicLock.hpp index 309e07c0bd0..cc4e37eed52 100644 --- a/hotspot/src/share/vm/runtime/basicLock.hpp +++ b/hotspot/src/share/vm/runtime/basicLock.hpp @@ -31,6 +31,7 @@ class BasicLock VALUE_OBJ_CLASS_SPEC { friend class VMStructs; + friend class JVMCIVMStructs; private: volatile markOop _displaced_header; public: diff --git a/hotspot/src/share/vm/runtime/deoptimization.hpp b/hotspot/src/share/vm/runtime/deoptimization.hpp index 7e63ab6bd38..82bb20af4e9 100644 --- a/hotspot/src/share/vm/runtime/deoptimization.hpp +++ b/hotspot/src/share/vm/runtime/deoptimization.hpp @@ -168,6 +168,7 @@ JVMCI_ONLY(public:) // This is only a CheapObj to ease debugging after a deopt failure class UnrollBlock : public CHeapObj { friend class VMStructs; + friend class JVMCIVMStructs; private: int _size_of_deoptimized_frame; // Size, in bytes, of current deoptimized frame int _caller_adjustment; // Adjustment, in bytes, to caller's SP by initial interpreted frame diff --git a/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp b/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp index fa3c279e001..efb4d415aa4 100644 --- a/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp +++ b/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp @@ -48,6 +48,7 @@ friend class StubGenerator; friend class JavaThread; friend class frame; friend class VMStructs; +friend class JVMCIVMStructs; friend class BytecodeInterpreter; friend class JavaCallWrapper; diff --git a/hotspot/src/share/vm/runtime/os.hpp b/hotspot/src/share/vm/runtime/os.hpp index 0e104226501..f4995159bcb 100644 --- a/hotspot/src/share/vm/runtime/os.hpp +++ b/hotspot/src/share/vm/runtime/os.hpp @@ -102,6 +102,7 @@ class MallocTracker; class os: AllStatic { friend class VMStructs; + friend class JVMCIVMStructs; friend class MallocTracker; public: enum { page_sizes_max = 9 }; // Size of _page_sizes array (8 plus a sentinel) diff --git a/hotspot/src/share/vm/runtime/osThread.hpp b/hotspot/src/share/vm/runtime/osThread.hpp index 02f3c0203fd..29912bd5187 100644 --- a/hotspot/src/share/vm/runtime/osThread.hpp +++ b/hotspot/src/share/vm/runtime/osThread.hpp @@ -60,6 +60,7 @@ enum ThreadState { class OSThread: public CHeapObj { friend class VMStructs; + friend class JVMCIVMStructs; private: OSThreadStartFunc _start_proc; // Thread start routine void* _start_parm; // Thread start routine parameter diff --git a/hotspot/src/share/vm/runtime/thread.hpp b/hotspot/src/share/vm/runtime/thread.hpp index 27c81f00346..de23fe565bd 100644 --- a/hotspot/src/share/vm/runtime/thread.hpp +++ b/hotspot/src/share/vm/runtime/thread.hpp @@ -101,6 +101,7 @@ class WorkerThread; class Thread: public ThreadShadow { friend class VMStructs; + friend class JVMCIVMStructs; private: // Exception handling // (Note: _pending_exception and friends are in ThreadShadow) @@ -775,6 +776,7 @@ typedef void (*ThreadFunction)(JavaThread*, TRAPS); class JavaThread: public Thread { friend class VMStructs; + friend class JVMCIVMStructs; friend class WhiteBox; private: JavaThread* _next; // The next thread in the Threads list diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index d3e1b44de02..edeb34ed0f6 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -2844,104 +2844,6 @@ typedef CompactHashtable SymbolCompactHashTable; //-------------------------------------------------------------------------------- -// VM_ADDRESSES -// - -#define VM_ADDRESSES(declare_address, declare_preprocessor_address, declare_function) \ - \ - declare_function(SharedRuntime::register_finalizer) \ - declare_function(SharedRuntime::exception_handler_for_return_address) \ - declare_function(SharedRuntime::OSR_migration_end) \ - declare_function(SharedRuntime::dsin) \ - declare_function(SharedRuntime::dcos) \ - declare_function(SharedRuntime::dtan) \ - declare_function(SharedRuntime::dexp) \ - declare_function(SharedRuntime::dlog) \ - declare_function(SharedRuntime::dlog10) \ - declare_function(SharedRuntime::dpow) \ - \ - declare_function(os::dll_load) \ - declare_function(os::dll_lookup) \ - declare_function(os::javaTimeMillis) \ - declare_function(os::javaTimeNanos) \ - \ - declare_function(Deoptimization::fetch_unroll_info) \ - COMPILER2_PRESENT(declare_function(Deoptimization::uncommon_trap)) \ - declare_function(Deoptimization::unpack_frames) - -//-------------------------------------------------------------------------------- -// Macros operating on the above lists -//-------------------------------------------------------------------------------- - -// This utility macro quotes the passed string -#define QUOTE(x) #x - -//-------------------------------------------------------------------------------- -// VMStructEntry macros -// - -// This macro generates a VMStructEntry line for a nonstatic field -#define GENERATE_NONSTATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ - { QUOTE(typeName), QUOTE(fieldName), QUOTE(type), 0, offset_of(typeName, fieldName), NULL }, - -// This macro generates a VMStructEntry line for a static field -#define GENERATE_STATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ - { QUOTE(typeName), QUOTE(fieldName), QUOTE(type), 1, 0, &typeName::fieldName }, - -// This macro generates a VMStructEntry line for a static pointer volatile field, -// e.g.: "static ObjectMonitor * volatile gBlockList;" -#define GENERATE_STATIC_PTR_VOLATILE_VM_STRUCT_ENTRY(typeName, fieldName, type) \ - { QUOTE(typeName), QUOTE(fieldName), QUOTE(type), 1, 0, (void *)&typeName::fieldName }, - -// This macro generates a VMStructEntry line for an unchecked -// nonstatic field, in which the size of the type is also specified. -// The type string is given as NULL, indicating an "opaque" type. -#define GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY(typeName, fieldName, size) \ - { QUOTE(typeName), QUOTE(fieldName), NULL, 0, offset_of(typeName, fieldName), NULL }, - -// This macro generates a VMStructEntry line for an unchecked -// static field, in which the size of the type is also specified. -// The type string is given as NULL, indicating an "opaque" type. -#define GENERATE_UNCHECKED_STATIC_VM_STRUCT_ENTRY(typeName, fieldName, size) \ - { QUOTE(typeName), QUOTE(fieldName), NULL, 1, 0, (void*) &typeName::fieldName }, - -// This macro generates the sentinel value indicating the end of the list -#define GENERATE_VM_STRUCT_LAST_ENTRY() \ - { NULL, NULL, NULL, 0, 0, NULL } - -// This macro checks the type of a VMStructEntry by comparing pointer types -#define CHECK_NONSTATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ - {typeName *dummyObj = NULL; type* dummy = &dummyObj->fieldName; \ - assert(offset_of(typeName, fieldName) < sizeof(typeName), "Illegal nonstatic struct entry, field offset too large"); } - -// This macro checks the type of a volatile VMStructEntry by comparing pointer types -#define CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ - {typedef type dummyvtype; typeName *dummyObj = NULL; volatile dummyvtype* dummy = &dummyObj->fieldName; } - -// This macro checks the type of a static VMStructEntry by comparing pointer types -#define CHECK_STATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ - {type* dummy = &typeName::fieldName; } - -// This macro checks the type of a static pointer volatile VMStructEntry by comparing pointer types, -// e.g.: "static ObjectMonitor * volatile gBlockList;" -#define CHECK_STATIC_PTR_VOLATILE_VM_STRUCT_ENTRY(typeName, fieldName, type) \ - {type volatile * dummy = &typeName::fieldName; } - -// This macro ensures the type of a field and its containing type are -// present in the type table. The assertion string is shorter than -// preferable because (incredibly) of a bug in Solstice NFS client -// which seems to prevent very long lines from compiling. This assertion -// means that an entry in VMStructs::localHotSpotVMStructs[] was not -// found in VMStructs::localHotSpotVMTypes[]. -#define ENSURE_FIELD_TYPE_PRESENT(typeName, fieldName, type) \ - { assert(findType(QUOTE(typeName)) != 0, "type \"" QUOTE(typeName) "\" not found in type table"); \ - assert(findType(QUOTE(type)) != 0, "type \"" QUOTE(type) "\" not found in type table"); } - -// This is a no-op macro for unchecked fields -#define CHECK_NO_OP(a, b, c) - -// -// Build-specific macros: // // Generate and check a nonstatic field in non-product builds @@ -2997,35 +2899,7 @@ typedef CompactHashtable SymbolCompactHashTable; #endif /* COMPILER2 */ //-------------------------------------------------------------------------------- -// VMTypeEntry macros -// - -#define GENERATE_VM_TYPE_ENTRY(type, superclass) \ - { QUOTE(type), QUOTE(superclass), 0, 0, 0, sizeof(type) }, - -#define GENERATE_TOPLEVEL_VM_TYPE_ENTRY(type) \ - { QUOTE(type), NULL, 0, 0, 0, sizeof(type) }, - -#define GENERATE_OOP_VM_TYPE_ENTRY(type) \ - { QUOTE(type), NULL, 1, 0, 0, sizeof(type) }, - -#define GENERATE_INTEGER_VM_TYPE_ENTRY(type) \ - { QUOTE(type), NULL, 0, 1, 0, sizeof(type) }, - -#define GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY(type) \ - { QUOTE(type), NULL, 0, 1, 1, sizeof(type) }, - -#define GENERATE_VM_TYPE_LAST_ENTRY() \ - { NULL, NULL, 0, 0, 0, 0 } - -#define CHECK_VM_TYPE_ENTRY(type, superclass) \ - { type* dummyObj = NULL; superclass* dummySuperObj = dummyObj; } - -#define CHECK_VM_TYPE_NO_OP(a) -#define CHECK_SINGLE_ARG_VM_TYPE_NO_OP(a) - -// -// Build-specific macros: +// VMTypeEntry build-specific macros // #ifdef COMPILER1 @@ -3050,23 +2924,9 @@ typedef CompactHashtable SymbolCompactHashTable; //-------------------------------------------------------------------------------- -// VMIntConstantEntry macros +// VMIntConstantEntry build-specific macros // -#define GENERATE_VM_INT_CONSTANT_ENTRY(name) \ - { QUOTE(name), (int32_t) name }, - -#define GENERATE_VM_INT_CONSTANT_WITH_VALUE_ENTRY(name, value) \ - { (name), (int32_t)(value) }, - -#define GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY(name, value) \ - { name, (int32_t) value }, - -// This macro generates the sentinel value indicating the end of the list -#define GENERATE_VM_INT_CONSTANT_LAST_ENTRY() \ - { NULL, 0 } - - // Generate an int constant for a C1 build #ifdef COMPILER1 # define GENERATE_C1_VM_INT_CONSTANT_ENTRY(name) GENERATE_VM_INT_CONSTANT_ENTRY(name) @@ -3083,20 +2943,11 @@ typedef CompactHashtable SymbolCompactHashTable; # define GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY(name, value) #endif /* COMPILER1 */ + //-------------------------------------------------------------------------------- -// VMLongConstantEntry macros +// VMLongConstantEntry build-specific macros // -#define GENERATE_VM_LONG_CONSTANT_ENTRY(name) \ - { QUOTE(name), name }, - -#define GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY(name, value) \ - { name, value }, - -// This macro generates the sentinel value indicating the end of the list -#define GENERATE_VM_LONG_CONSTANT_LAST_ENTRY() \ - { NULL, 0 } - // Generate a long constant for a C1 build #ifdef COMPILER1 # define GENERATE_C1_VM_LONG_CONSTANT_ENTRY(name) GENERATE_VM_LONG_CONSTANT_ENTRY(name) @@ -3113,22 +2964,6 @@ typedef CompactHashtable SymbolCompactHashTable; # define GENERATE_C2_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY(name, value) #endif /* COMPILER1 */ -//-------------------------------------------------------------------------------- -// VMAddressEntry macros -// - -#define GENERATE_VM_ADDRESS_ENTRY(name) \ - { QUOTE(name), (void*) (name) }, - -#define GENERATE_PREPROCESSOR_VM_ADDRESS_ENTRY(name, value) \ - { name, (void*) (value) }, - -#define GENERATE_VM_FUNCTION_ENTRY(name) \ - { QUOTE(name), CAST_FROM_FN_PTR(void*, &(name)) }, - -// This macro generates the sentinel value indicating the end of the list -#define GENERATE_VM_ADDRESS_LAST_ENTRY() \ - { NULL, NULL } // // Instantiation of VMStructEntries, VMTypeEntries and VMIntConstantEntries @@ -3149,11 +2984,6 @@ VMStructEntry VMStructs::localHotSpotVMStructs[] = { GENERATE_C1_UNCHECKED_STATIC_VM_STRUCT_ENTRY, GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY) -#if INCLUDE_JVMCI - VM_STRUCTS_JVMCI(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, - GENERATE_STATIC_VM_STRUCT_ENTRY) -#endif - #if INCLUDE_ALL_GCS VM_STRUCTS_PARALLELGC(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, GENERATE_STATIC_VM_STRUCT_ENTRY) @@ -3215,11 +3045,6 @@ VMTypeEntry VMStructs::localHotSpotVMTypes[] = { GENERATE_C2_VM_TYPE_ENTRY, GENERATE_C2_TOPLEVEL_VM_TYPE_ENTRY) -#if INCLUDE_JVMCI - VM_TYPES_JVMCI(GENERATE_VM_TYPE_ENTRY, - GENERATE_TOPLEVEL_VM_TYPE_ENTRY) -#endif - #if INCLUDE_ALL_GCS VM_TYPES_PARALLELGC(GENERATE_VM_TYPE_ENTRY, GENERATE_TOPLEVEL_VM_TYPE_ENTRY) @@ -3279,12 +3104,6 @@ VMIntConstantEntry VMStructs::localHotSpotVMIntConstants[] = { GENERATE_C2_VM_INT_CONSTANT_ENTRY, GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY) -#if INCLUDE_JVMCI - VM_INT_CONSTANTS_JVMCI(GENERATE_VM_INT_CONSTANT_ENTRY, - GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY) - -#endif - #if INCLUDE_ALL_GCS VM_INT_CONSTANTS_CMS(GENERATE_VM_INT_CONSTANT_ENTRY) @@ -3348,25 +3167,6 @@ VMLongConstantEntry VMStructs::localHotSpotVMLongConstants[] = { GENERATE_VM_LONG_CONSTANT_LAST_ENTRY() }; -VMAddressEntry VMStructs::localHotSpotVMAddresses[] = { - - VM_ADDRESSES(GENERATE_VM_ADDRESS_ENTRY, - GENERATE_PREPROCESSOR_VM_ADDRESS_ENTRY, - GENERATE_VM_FUNCTION_ENTRY) - - VM_ADDRESSES_OS(GENERATE_VM_ADDRESS_ENTRY, - GENERATE_PREPROCESSOR_VM_ADDRESS_ENTRY, - GENERATE_VM_FUNCTION_ENTRY) - -#if INCLUDE_JVMCI - VM_ADDRESSES_JVMCI(GENERATE_VM_ADDRESS_ENTRY, - GENERATE_PREPROCESSOR_VM_ADDRESS_ENTRY, - GENERATE_VM_FUNCTION_ENTRY) -#endif - - GENERATE_VM_ADDRESS_LAST_ENTRY() -}; - // This is used both to check the types of referenced fields and, in // debug builds, to ensure that all of the field types are present. void @@ -3575,11 +3375,6 @@ JNIEXPORT VMLongConstantEntry* gHotSpotVMLongConstants = VMStructs::localHotSpot JNIEXPORT uint64_t gHotSpotVMLongConstantEntryNameOffset = offset_of(VMLongConstantEntry, name); JNIEXPORT uint64_t gHotSpotVMLongConstantEntryValueOffset = offset_of(VMLongConstantEntry, value); JNIEXPORT uint64_t gHotSpotVMLongConstantEntryArrayStride = STRIDE(gHotSpotVMLongConstants); - -JNIEXPORT VMAddressEntry* gHotSpotVMAddresses = VMStructs::localHotSpotVMAddresses; -JNIEXPORT uint64_t gHotSpotVMAddressEntryNameOffset = offset_of(VMAddressEntry, name); -JNIEXPORT uint64_t gHotSpotVMAddressEntryValueOffset = offset_of(VMAddressEntry, value); -JNIEXPORT uint64_t gHotSpotVMAddressEntryArrayStride = STRIDE(gHotSpotVMAddresses); } #ifdef ASSERT @@ -3687,11 +3482,6 @@ void VMStructs::test() { &long_last_entry, sizeof(VMLongConstantEntry)) == 0, "Incorrect last entry in localHotSpotVMLongConstants"); - static VMAddressEntry address_last_entry = GENERATE_VM_ADDRESS_LAST_ENTRY(); - assert(memcmp(&localHotSpotVMAddresses[sizeof(localHotSpotVMAddresses) / sizeof(VMAddressEntry) - 1], - &address_last_entry, - sizeof(VMAddressEntry)) == 0, "Incorrect last entry in localHotSpotVMAddresses"); - // Check for duplicate entries in type array for (int i = 0; localHotSpotVMTypes[i].typeName != NULL; i++) { diff --git a/hotspot/src/share/vm/runtime/vmStructs.hpp b/hotspot/src/share/vm/runtime/vmStructs.hpp index 369ff9e9426..4f9f31dcd3e 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.hpp +++ b/hotspot/src/share/vm/runtime/vmStructs.hpp @@ -143,4 +143,151 @@ private: static int findType(const char* typeName); }; +// This utility macro quotes the passed string +#define QUOTE(x) #x + +//-------------------------------------------------------------------------------- +// VMStructEntry macros +// + +// This macro generates a VMStructEntry line for a nonstatic field +#define GENERATE_NONSTATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ + { QUOTE(typeName), QUOTE(fieldName), QUOTE(type), 0, offset_of(typeName, fieldName), NULL }, + +// This macro generates a VMStructEntry line for a static field +#define GENERATE_STATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ + { QUOTE(typeName), QUOTE(fieldName), QUOTE(type), 1, 0, &typeName::fieldName }, + +// This macro generates a VMStructEntry line for a static pointer volatile field, +// e.g.: "static ObjectMonitor * volatile gBlockList;" +#define GENERATE_STATIC_PTR_VOLATILE_VM_STRUCT_ENTRY(typeName, fieldName, type) \ + { QUOTE(typeName), QUOTE(fieldName), QUOTE(type), 1, 0, (void *)&typeName::fieldName }, + +// This macro generates a VMStructEntry line for an unchecked +// nonstatic field, in which the size of the type is also specified. +// The type string is given as NULL, indicating an "opaque" type. +#define GENERATE_UNCHECKED_NONSTATIC_VM_STRUCT_ENTRY(typeName, fieldName, size) \ + { QUOTE(typeName), QUOTE(fieldName), NULL, 0, offset_of(typeName, fieldName), NULL }, + +// This macro generates a VMStructEntry line for an unchecked +// static field, in which the size of the type is also specified. +// The type string is given as NULL, indicating an "opaque" type. +#define GENERATE_UNCHECKED_STATIC_VM_STRUCT_ENTRY(typeName, fieldName, size) \ + { QUOTE(typeName), QUOTE(fieldName), NULL, 1, 0, (void*) &typeName::fieldName }, + +// This macro generates the sentinel value indicating the end of the list +#define GENERATE_VM_STRUCT_LAST_ENTRY() \ + { NULL, NULL, NULL, 0, 0, NULL } + +// This macro checks the type of a VMStructEntry by comparing pointer types +#define CHECK_NONSTATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ + {typeName *dummyObj = NULL; type* dummy = &dummyObj->fieldName; \ + assert(offset_of(typeName, fieldName) < sizeof(typeName), "Illegal nonstatic struct entry, field offset too large"); } + +// This macro checks the type of a volatile VMStructEntry by comparing pointer types +#define CHECK_VOLATILE_NONSTATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ + {typedef type dummyvtype; typeName *dummyObj = NULL; volatile dummyvtype* dummy = &dummyObj->fieldName; } + +// This macro checks the type of a static VMStructEntry by comparing pointer types +#define CHECK_STATIC_VM_STRUCT_ENTRY(typeName, fieldName, type) \ + {type* dummy = &typeName::fieldName; } + +// This macro checks the type of a static pointer volatile VMStructEntry by comparing pointer types, +// e.g.: "static ObjectMonitor * volatile gBlockList;" +#define CHECK_STATIC_PTR_VOLATILE_VM_STRUCT_ENTRY(typeName, fieldName, type) \ + {type volatile * dummy = &typeName::fieldName; } + +// This macro ensures the type of a field and its containing type are +// present in the type table. The assertion string is shorter than +// preferable because (incredibly) of a bug in Solstice NFS client +// which seems to prevent very long lines from compiling. This assertion +// means that an entry in VMStructs::localHotSpotVMStructs[] was not +// found in VMStructs::localHotSpotVMTypes[]. +#define ENSURE_FIELD_TYPE_PRESENT(typeName, fieldName, type) \ + { assert(findType(QUOTE(typeName)) != 0, "type \"" QUOTE(typeName) "\" not found in type table"); \ + assert(findType(QUOTE(type)) != 0, "type \"" QUOTE(type) "\" not found in type table"); } + +// This is a no-op macro for unchecked fields +#define CHECK_NO_OP(a, b, c) + + +//-------------------------------------------------------------------------------- +// VMTypeEntry macros +// + +#define GENERATE_VM_TYPE_ENTRY(type, superclass) \ + { QUOTE(type), QUOTE(superclass), 0, 0, 0, sizeof(type) }, + +#define GENERATE_TOPLEVEL_VM_TYPE_ENTRY(type) \ + { QUOTE(type), NULL, 0, 0, 0, sizeof(type) }, + +#define GENERATE_OOP_VM_TYPE_ENTRY(type) \ + { QUOTE(type), NULL, 1, 0, 0, sizeof(type) }, + +#define GENERATE_INTEGER_VM_TYPE_ENTRY(type) \ + { QUOTE(type), NULL, 0, 1, 0, sizeof(type) }, + +#define GENERATE_UNSIGNED_INTEGER_VM_TYPE_ENTRY(type) \ + { QUOTE(type), NULL, 0, 1, 1, sizeof(type) }, + +#define GENERATE_VM_TYPE_LAST_ENTRY() \ + { NULL, NULL, 0, 0, 0, 0 } + +#define CHECK_VM_TYPE_ENTRY(type, superclass) \ + { type* dummyObj = NULL; superclass* dummySuperObj = dummyObj; } + +#define CHECK_VM_TYPE_NO_OP(a) +#define CHECK_SINGLE_ARG_VM_TYPE_NO_OP(a) + + +//-------------------------------------------------------------------------------- +// VMIntConstantEntry macros +// + +#define GENERATE_VM_INT_CONSTANT_ENTRY(name) \ + { QUOTE(name), (int32_t) name }, + +#define GENERATE_VM_INT_CONSTANT_WITH_VALUE_ENTRY(name, value) \ + { (name), (int32_t)(value) }, + +#define GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY(name, value) \ + { name, (int32_t) value }, + +// This macro generates the sentinel value indicating the end of the list +#define GENERATE_VM_INT_CONSTANT_LAST_ENTRY() \ + { NULL, 0 } + + +//-------------------------------------------------------------------------------- +// VMLongConstantEntry macros +// + +#define GENERATE_VM_LONG_CONSTANT_ENTRY(name) \ + { QUOTE(name), name }, + +#define GENERATE_PREPROCESSOR_VM_LONG_CONSTANT_ENTRY(name, value) \ + { name, value }, + +// This macro generates the sentinel value indicating the end of the list +#define GENERATE_VM_LONG_CONSTANT_LAST_ENTRY() \ + { NULL, 0 } + + +//-------------------------------------------------------------------------------- +// VMAddressEntry macros +// + +#define GENERATE_VM_ADDRESS_ENTRY(name) \ + { QUOTE(name), (void*) (name) }, + +#define GENERATE_PREPROCESSOR_VM_ADDRESS_ENTRY(name, value) \ + { name, (void*) (value) }, + +#define GENERATE_VM_FUNCTION_ENTRY(name) \ + { QUOTE(name), CAST_FROM_FN_PTR(void*, &(name)) }, + +// This macro generates the sentinel value indicating the end of the list +#define GENERATE_VM_ADDRESS_LAST_ENTRY() \ + { NULL, NULL } + #endif // SHARE_VM_RUNTIME_VMSTRUCTS_HPP diff --git a/hotspot/src/share/vm/utilities/array.hpp b/hotspot/src/share/vm/utilities/array.hpp index 8df72304ef0..f759fe1c03f 100644 --- a/hotspot/src/share/vm/utilities/array.hpp +++ b/hotspot/src/share/vm/utilities/array.hpp @@ -304,6 +304,7 @@ template class Array: public MetaspaceObj { friend class MetadataFactory; friend class VMStructs; + friend class JVMCIVMStructs; friend class MethodHandleCompiler; // special case friend class WhiteBox; protected: diff --git a/hotspot/src/share/vm/utilities/exceptions.hpp b/hotspot/src/share/vm/utilities/exceptions.hpp index 02d9110ef74..5983f5e32f9 100644 --- a/hotspot/src/share/vm/utilities/exceptions.hpp +++ b/hotspot/src/share/vm/utilities/exceptions.hpp @@ -59,6 +59,7 @@ class JavaCallArguments; class ThreadShadow: public CHeapObj { friend class VMStructs; + friend class JVMCIVMStructs; protected: oop _pending_exception; // Thread has gc actions. From 1a135175c4a0c511c8dda22b4243c33e30d7062d Mon Sep 17 00:00:00 2001 From: Alexander Vorobyev Date: Tue, 15 Dec 2015 17:31:18 +0300 Subject: [PATCH 047/146] 8079667: port vm/compiler/AESIntrinsics/CheckIntrinsics into jtreg Reviewed-by: kvn --- .../compiler/cpuflags/AESIntrinsicsBase.java | 65 +++++ .../TestAESIntrinsicsOnSupportedConfig.java | 254 ++++++++++++++++++ .../TestAESIntrinsicsOnUnsupportedConfig.java | 112 ++++++++ .../predicate/AESSupportPredicate.java | 37 +++ .../test/lib/cli/CommandLineOptionTest.java | 48 +++- 5 files changed, 511 insertions(+), 5 deletions(-) create mode 100644 hotspot/test/compiler/cpuflags/AESIntrinsicsBase.java create mode 100644 hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java create mode 100644 hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java create mode 100644 hotspot/test/compiler/cpuflags/predicate/AESSupportPredicate.java diff --git a/hotspot/test/compiler/cpuflags/AESIntrinsicsBase.java b/hotspot/test/compiler/cpuflags/AESIntrinsicsBase.java new file mode 100644 index 00000000000..8e8deda71bd --- /dev/null +++ b/hotspot/test/compiler/cpuflags/AESIntrinsicsBase.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +import jdk.test.lib.cli.CommandLineOptionTest; +import predicate.AESSupportPredicate; + +import java.util.Arrays; +import java.util.function.BooleanSupplier; + +public abstract class AESIntrinsicsBase extends CommandLineOptionTest { + public static final BooleanSupplier AES_SUPPORTED_PREDICATE + = new AESSupportPredicate(); + public static final String CIPHER_INTRINSIC = "com\\.sun\\.crypto\\" + + ".provider\\.CipherBlockChaining::" + + "(implEncrypt|implDecrypt) \\([0-9]+ bytes\\)\\s+\\(intrinsic[,\\)]"; + public static final String AES_INTRINSIC = "com\\.sun\\.crypto\\" + + ".provider\\.AESCrypt::(implEncryptBlock|implDecryptBlock) \\([0-9]+ " + + "bytes\\)\\s+\\(intrinsic[,\\)]"; + public static final String USE_AES = "UseAES"; + public static final String USE_AES_INTRINSICS = "UseAESIntrinsics"; + public static final String USE_SSE = "UseSSE"; + public static final String USE_VIS = "UseVIS"; + public static final String[] TEST_AES_CMD + = {"-XX:+IgnoreUnrecognizedVMOptions", "-XX:+PrintFlagsFinal", + "-Xbatch","-XX:+UnlockDiagnosticVMOptions", + "-XX:+PrintIntrinsics", "-DcheckOutput=true", "-Dmode=CBC", + "TestAESMain"}; + + protected AESIntrinsicsBase(BooleanSupplier predicate) { + super(predicate); + } + + /** + * Prepares command for TestAESMain execution. + * @param args flags that must be added to command + * @return command for TestAESMain execution + */ + public static String[] prepareArguments(String... args) { + String[] command = Arrays.copyOf(args, TEST_AES_CMD.length + + args.length); + System.arraycopy(TEST_AES_CMD, 0, command, args.length, + TEST_AES_CMD.length); + return command; + } +} diff --git a/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java b/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java new file mode 100644 index 00000000000..4d655dee023 --- /dev/null +++ b/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java @@ -0,0 +1,254 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.Platform; +import jdk.test.lib.ProcessTools; + +/* + * @test + * @library /testlibrary /../../test/lib /compiler/whitebox + * /compiler/testlibrary /compiler/codegen/7184394 + * @modules java.base/sun.misc + * java.management + * @build TestAESIntrinsicsOnSupportedConfig TestAESMain + * @run main ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -Xbatch + * TestAESIntrinsicsOnSupportedConfig + */ +public class TestAESIntrinsicsOnSupportedConfig extends AESIntrinsicsBase { + + /** + * Constructs new TestAESIntrinsicsOnSupportedConfig that will be executed + * only if AESSupportPredicate returns true + */ + private TestAESIntrinsicsOnSupportedConfig() { + super(AESIntrinsicsBase.AES_SUPPORTED_PREDICATE); + } + + @Override + protected void runTestCases() throws Throwable { + testUseAES(); + testUseAESUseSSE2(); + testUseAESUseVIS2(); + testNoUseAES(); + testNoUseAESUseSSE2(); + testNoUseAESUseVIS2(); + testNoUseAESIntrinsic(); + } + + /** + * Test checks following situation:
+ * UseAES flag is set to true, TestAESMain is executed
+ * Expected result: UseAESIntrinsics flag is set to true
+ * If vm type is server then output should contain intrinsics usage
+ * + * @throws Throwable + */ + private void testUseAES() throws Throwable { + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + prepareArguments(prepareBooleanFlag(AESIntrinsicsBase + .USE_AES, true))); + final String errorMessage = "Case testUseAES failed"; + if (Platform.isServer()) { + verifyOutput(new String[]{AESIntrinsicsBase.CIPHER_INTRINSIC, + AESIntrinsicsBase.AES_INTRINSIC}, null, errorMessage, + outputAnalyzer); + } else { + verifyOutput(null, new String[]{AESIntrinsicsBase.CIPHER_INTRINSIC, + AESIntrinsicsBase.AES_INTRINSIC}, errorMessage, + outputAnalyzer); + } + verifyOptionValue(AESIntrinsicsBase.USE_AES, "true", errorMessage, + outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES_INTRINSICS, "true", + errorMessage, outputAnalyzer); + } + + /** + * Test checks following situation:
+ * UseAES flag is set to true, UseSSE flag is set to 2, + * Platform should support UseSSE (x86 or x64)
+ * TestAESMain is executed
+ * Expected result: UseAESIntrinsics flag is set to false
+ * Output shouldn't contain intrinsics usage
+ * + * @throws Throwable + */ + private void testUseAESUseSSE2() throws Throwable { + if (Platform.isX86() || Platform.isX64()) { + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + prepareArguments(prepareBooleanFlag(AESIntrinsicsBase + .USE_AES_INTRINSICS, true), + prepareNumericFlag(AESIntrinsicsBase.USE_SSE, 2))); + final String errorMessage = "Case testUseAESUseSSE2 failed"; + verifyOutput(null, new String[]{AESIntrinsicsBase.CIPHER_INTRINSIC, + AESIntrinsicsBase.AES_INTRINSIC}, + errorMessage, outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES, "true", errorMessage, + outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES_INTRINSICS, "false", + errorMessage, outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_SSE, "2", errorMessage, + outputAnalyzer); + } + } + + /** + * Test checks following situation:
+ * UseAES flag is set to false, UseSSE flag is set to 2, + * Platform should support UseSSE (x86 or x64)
+ * TestAESMain is executed
+ * Expected result: UseAESIntrinsics flag is set to false
+ * Output shouldn't contain intrinsics usage
+ * + * @throws Throwable + */ + private void testNoUseAESUseSSE2() throws Throwable { + if (Platform.isX86() || Platform.isX64()) { + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + prepareArguments(prepareBooleanFlag(AESIntrinsicsBase + .USE_AES, false), + prepareNumericFlag(AESIntrinsicsBase.USE_SSE, 2))); + final String errorMessage = "Case testNoUseAESUseSSE2 failed"; + verifyOutput(null, new String[]{AESIntrinsicsBase.CIPHER_INTRINSIC, + AESIntrinsicsBase.AES_INTRINSIC}, + errorMessage, outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES, "false", errorMessage, + outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES_INTRINSICS, "false", + errorMessage, outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_SSE, "2", errorMessage, + outputAnalyzer); + } + } + + /** + * Test checks following situation:
+ * UseAES flag is set to true, UseVIS flag is set to 2, + * Platform should support UseVIS (sparc)
+ * TestAESMain is executed
+ * Expected result: UseAESIntrinsics flag is set to false
+ * Output shouldn't contain intrinsics usage
+ * + * @throws Throwable + */ + private void testUseAESUseVIS2() throws Throwable { + if (Platform.isSparc()) { + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + prepareArguments(prepareBooleanFlag(AESIntrinsicsBase + .USE_AES_INTRINSICS, true), + prepareNumericFlag(AESIntrinsicsBase.USE_VIS, 2))); + final String errorMessage = "Case testUseAESUseVIS2 failed"; + verifyOutput(null, new String[]{AESIntrinsicsBase.CIPHER_INTRINSIC, + AESIntrinsicsBase.AES_INTRINSIC}, + errorMessage, outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES, "true", errorMessage, + outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES_INTRINSICS, "false", + errorMessage, outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_VIS, "2", errorMessage, + outputAnalyzer); + } + } + + + /** + * Test checks following situation:
+ * UseAES flag is set to false, UseVIS flag is set to 2, + * Platform should support UseVIS (sparc)
+ * TestAESMain is executed
+ * Expected result: UseAESIntrinsics flag is set to false
+ * Output shouldn't contain intrinsics usage
+ * + * @throws Throwable + */ + private void testNoUseAESUseVIS2() throws Throwable { + if (Platform.isSparc()) { + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + prepareArguments(prepareBooleanFlag(AESIntrinsicsBase + .USE_AES, false), + prepareNumericFlag(AESIntrinsicsBase.USE_VIS, 2))); + final String errorMessage = "Case testNoUseAESUseVIS2 failed"; + verifyOutput(null, new String[]{AESIntrinsicsBase.CIPHER_INTRINSIC, + AESIntrinsicsBase.AES_INTRINSIC}, + errorMessage, outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES, "false", errorMessage, + outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES_INTRINSICS, "false", + errorMessage, outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_VIS, "2", errorMessage, + outputAnalyzer); + } + } + + /** + * Test checks following situation:
+ * UseAES flag is set to false, TestAESMain is executed
+ * Expected result: UseAESIntrinsics flag is set to false
+ * Output shouldn't contain intrinsics usage
+ * + * @throws Throwable + */ + private void testNoUseAES() throws Throwable { + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + prepareArguments(prepareBooleanFlag(AESIntrinsicsBase + .USE_AES, false))); + final String errorMessage = "Case testNoUseAES failed"; + verifyOutput(null, new String[]{AESIntrinsicsBase.CIPHER_INTRINSIC, + AESIntrinsicsBase.AES_INTRINSIC}, + errorMessage, outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES, "false", errorMessage, + outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES_INTRINSICS, "false", + errorMessage, outputAnalyzer); + } + + /** + * Test checks following situation:
+ * UseAESIntrinsics flag is set to false, TestAESMain is executed
+ * Expected result: UseAES flag is set to true
+ * Output shouldn't contain intrinsics usage
+ * + * @throws Throwable + */ + private void testNoUseAESIntrinsic() throws Throwable { + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + prepareArguments(prepareBooleanFlag(AESIntrinsicsBase + .USE_AES_INTRINSICS, false))); + final String errorMessage = "Case testNoUseAESIntrinsic failed"; + verifyOutput(null, new String[]{AESIntrinsicsBase.CIPHER_INTRINSIC, + AESIntrinsicsBase.AES_INTRINSIC}, errorMessage, + outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES, "true", errorMessage, + outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES_INTRINSICS, "false", + errorMessage, outputAnalyzer); + } + + public static void main(String args[]) throws Throwable { + new TestAESIntrinsicsOnSupportedConfig().test(); + } +} diff --git a/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java b/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java new file mode 100644 index 00000000000..fa5e3aaf46e --- /dev/null +++ b/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnUnsupportedConfig.java @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +import jdk.test.lib.cli.predicate.NotPredicate; +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; + +/* + * @test + * @library /testlibrary /../../test/lib /compiler/whitebox + * /compiler/testlibrary /compiler/codegen/7184394 + * @modules java.base/sun.misc + * java.management + * @build TestAESIntrinsicsOnUnsupportedConfig TestAESMain + * @run main ClassFileInstaller + * sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -Xbatch TestAESIntrinsicsOnUnsupportedConfig + */ +public class TestAESIntrinsicsOnUnsupportedConfig extends AESIntrinsicsBase { + + private static final String INTRINSICS_NOT_AVAILABLE_MSG = "warning: AES " + + "intrinsics are not available on this CPU"; + private static final String AES_NOT_AVAILABLE_MSG = "warning: AES " + + "instructions are not available on this CPU"; + + /** + * Constructs new TestAESIntrinsicsOnUnsupportedConfig that will be + * executed only if AESSupportPredicate returns false + */ + private TestAESIntrinsicsOnUnsupportedConfig() { + super(new NotPredicate(AESIntrinsicsBase.AES_SUPPORTED_PREDICATE)); + } + + @Override + protected void runTestCases() throws Throwable { + testUseAES(); + testUseAESIntrinsics(); + } + + /** + * Test checks following situation:
+ * UseAESIntrinsics flag is set to true, TestAESMain is executed
+ * Expected result: UseAESIntrinsics flag is set to false
+ * UseAES flag is set to false
+ * Output shouldn't contain intrinsics usage
+ * Output should contain message about intrinsics unavailability + * @throws Throwable + */ + private void testUseAESIntrinsics() throws Throwable { + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + AESIntrinsicsBase.prepareArguments(prepareBooleanFlag( + AESIntrinsicsBase.USE_AES_INTRINSICS, true))); + final String errorMessage = "Case testUseAESIntrinsics failed"; + verifyOutput(new String[] {INTRINSICS_NOT_AVAILABLE_MSG}, + new String[] {AESIntrinsicsBase.CIPHER_INTRINSIC, + AESIntrinsicsBase.AES_INTRINSIC}, + errorMessage, outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES_INTRINSICS, "false", + errorMessage, outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES, "false", errorMessage, + outputAnalyzer); + } + + /** + * Test checks following situation:
+ * UseAESIntrinsics flag is set to true, TestAESMain is executed
+ * Expected result: UseAES flag is set to false
+ * UseAES flag is set to false
+ * Output shouldn't contain intrinsics usage
+ * Output should contain message about AES unavailability
+ * @throws Throwable + */ + private void testUseAES() throws Throwable { + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( + AESIntrinsicsBase.prepareArguments(prepareBooleanFlag + (AESIntrinsicsBase.USE_AES, true))); + final String errorMessage = "Case testUseAES failed"; + verifyOutput(new String[] {AES_NOT_AVAILABLE_MSG}, + new String[] {AESIntrinsicsBase.CIPHER_INTRINSIC, + AESIntrinsicsBase.AES_INTRINSIC}, errorMessage, outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES_INTRINSICS, "false", + errorMessage, outputAnalyzer); + verifyOptionValue(AESIntrinsicsBase.USE_AES, "false", errorMessage, + outputAnalyzer); + } + + public static void main(String args[]) throws Throwable { + new TestAESIntrinsicsOnUnsupportedConfig().test(); + } +} diff --git a/hotspot/test/compiler/cpuflags/predicate/AESSupportPredicate.java b/hotspot/test/compiler/cpuflags/predicate/AESSupportPredicate.java new file mode 100644 index 00000000000..7b4f78b8d13 --- /dev/null +++ b/hotspot/test/compiler/cpuflags/predicate/AESSupportPredicate.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ +package predicate; + +import sun.hotspot.cpuinfo.CPUInfo; +import java.util.function.BooleanSupplier; + +public class AESSupportPredicate implements BooleanSupplier { + + private static final String AES = "aes"; + + @Override + public boolean getAsBoolean() { + return CPUInfo.getFeatures().contains(AES); + } +} diff --git a/hotspot/test/testlibrary/jdk/test/lib/cli/CommandLineOptionTest.java b/hotspot/test/testlibrary/jdk/test/lib/cli/CommandLineOptionTest.java index 031d58a4b54..e1bb112ceb3 100644 --- a/hotspot/test/testlibrary/jdk/test/lib/cli/CommandLineOptionTest.java +++ b/hotspot/test/testlibrary/jdk/test/lib/cli/CommandLineOptionTest.java @@ -121,7 +121,27 @@ public abstract class CommandLineOptionTest { throw new AssertionError(errorMessage, e); } + verifyOutput(expectedMessages, unexpectedMessages, + wrongWarningMessage, outputAnalyzer); + } + /** + * Verifies that JVM startup behavior matches our expectations. + * + * @param expectedMessages an array of patterns that should occur in JVM + * output. If {@code null} then + * JVM output could be empty. + * @param unexpectedMessages an array of patterns that should not occur + * in JVM output. If {@code null} then + * JVM output could be empty. + * @param wrongWarningMessage message that will be shown if messages are + * not as expected. + * @param outputAnalyzer OutputAnalyzer instance + * @throws AssertionError if verification fails. + */ + public static void verifyOutput(String[] expectedMessages, + String[] unexpectedMessages, String wrongWarningMessage, + OutputAnalyzer outputAnalyzer) { if (expectedMessages != null) { for (String expectedMessage : expectedMessages) { try { @@ -199,7 +219,7 @@ public abstract class CommandLineOptionTest { public static void verifyOptionValue(String optionName, String expectedValue, String optionErrorString, String... additionalVMOpts) throws Throwable { - verifyOptionValue(optionName, expectedValue, optionErrorString, + verifyOptionValue(optionName, expectedValue, optionErrorString, true, additionalVMOpts); } @@ -247,12 +267,30 @@ public abstract class CommandLineOptionTest { optionName); throw new AssertionError(errorMessage, e); } + verifyOptionValue(optionName, expectedValue, optionErrorString, + outputAnalyzer); + } + + /** + * Verifies that value of specified JVM option is the same as + * expected value. + * + * @param optionName a name of tested option. + * @param expectedValue expected value of tested option. + * @param optionErrorString message will be shown if option value is not + * as expected. + * @param outputAnalyzer OutputAnalyzer instance + * @throws AssertionError if verification fails + */ + public static void verifyOptionValue(String optionName, + String expectedValue, String optionErrorString, + OutputAnalyzer outputAnalyzer) { try { - outputAnalyzer.shouldMatch(String.format( - CommandLineOptionTest.PRINT_FLAGS_FINAL_FORMAT, - optionName, expectedValue)); + outputAnalyzer.shouldMatch(String.format( + CommandLineOptionTest.PRINT_FLAGS_FINAL_FORMAT, + optionName, expectedValue)); } catch (RuntimeException e) { - String errorMessage = String.format( + String errorMessage = String.format( "Option '%s' is expected to have '%s' value%n%s", optionName, expectedValue, optionErrorString); From dd5481cbbc702b33b4cff08a2cc2cb7e18fccea6 Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Tue, 15 Dec 2015 19:18:05 +0000 Subject: [PATCH 048/146] 8145438: Guarantee failures since 8144028: Use AArch64 bit-test instructions in C2 Implement short and long versions of bit test instructions. Reviewed-by: kvn --- hotspot/src/cpu/aarch64/vm/aarch64.ad | 122 ++++++++++++++---- .../aarch64/vm/c1_MacroAssembler_aarch64.hpp | 1 + .../cpu/aarch64/vm/interp_masm_aarch64.cpp | 5 +- .../cpu/aarch64/vm/macroAssembler_aarch64.hpp | 26 ++++ hotspot/src/share/vm/adlc/formssel.cpp | 3 +- 5 files changed, 127 insertions(+), 30 deletions(-) diff --git a/hotspot/src/cpu/aarch64/vm/aarch64.ad b/hotspot/src/cpu/aarch64/vm/aarch64.ad index b6a1a242038..f19eb0e71c7 100644 --- a/hotspot/src/cpu/aarch64/vm/aarch64.ad +++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad @@ -3484,10 +3484,14 @@ int Matcher::regnum_to_fpu_offset(int regnum) return 0; } -bool Matcher::is_short_branch_offset(int rule, int br_size, int offset) -{ - Unimplemented(); - return false; +// Is this branch offset short enough that a short branch can be used? +// +// NOTE: If the platform does not provide any short branch variants, then +// this method should return false for offset 0. +bool Matcher::is_short_branch_offset(int rule, int br_size, int offset) { + // The passed offset is relative to address of the branch. + + return (-32768 <= offset && offset < 32768); } const bool Matcher::isSimpleConstant64(jlong value) { @@ -13845,7 +13849,8 @@ instruct cmpP_narrowOop_imm0_branch(cmpOp cmp, iRegN oop, immP0 zero, label labl // Test bit and Branch -instruct cmpL_branch_sign(cmpOp cmp, iRegL op1, immL0 op2, label labl, rFlagsReg cr) %{ +// Patterns for short (< 32KiB) variants +instruct cmpL_branch_sign(cmpOp cmp, iRegL op1, immL0 op2, label labl) %{ match(If cmp (CmpL op1 op2)); predicate(n->in(1)->as_Bool()->_test._test == BoolTest::lt || n->in(1)->as_Bool()->_test._test == BoolTest::ge); @@ -13855,16 +13860,15 @@ instruct cmpL_branch_sign(cmpOp cmp, iRegL op1, immL0 op2, label labl, rFlagsReg format %{ "cb$cmp $op1, $labl # long" %} ins_encode %{ Label* L = $labl$$label; - Assembler::Condition cond = (Assembler::Condition)$cmp$$cmpcode; - if (cond == Assembler::LT) - __ tbnz($op1$$Register, 63, *L); - else - __ tbz($op1$$Register, 63, *L); + Assembler::Condition cond = + ((Assembler::Condition)$cmp$$cmpcode == Assembler::LT) ? Assembler::NE : Assembler::EQ; + __ tbr(cond, $op1$$Register, 63, *L); %} ins_pipe(pipe_cmp_branch); + ins_short_branch(1); %} -instruct cmpI_branch_sign(cmpOp cmp, iRegIorL2I op1, immI0 op2, label labl, rFlagsReg cr) %{ +instruct cmpI_branch_sign(cmpOp cmp, iRegIorL2I op1, immI0 op2, label labl) %{ match(If cmp (CmpI op1 op2)); predicate(n->in(1)->as_Bool()->_test._test == BoolTest::lt || n->in(1)->as_Bool()->_test._test == BoolTest::ge); @@ -13874,16 +13878,15 @@ instruct cmpI_branch_sign(cmpOp cmp, iRegIorL2I op1, immI0 op2, label labl, rFla format %{ "cb$cmp $op1, $labl # int" %} ins_encode %{ Label* L = $labl$$label; - Assembler::Condition cond = (Assembler::Condition)$cmp$$cmpcode; - if (cond == Assembler::LT) - __ tbnz($op1$$Register, 31, *L); - else - __ tbz($op1$$Register, 31, *L); + Assembler::Condition cond = + ((Assembler::Condition)$cmp$$cmpcode == Assembler::LT) ? Assembler::NE : Assembler::EQ; + __ tbr(cond, $op1$$Register, 31, *L); %} ins_pipe(pipe_cmp_branch); + ins_short_branch(1); %} -instruct cmpL_branch_bit(cmpOp cmp, iRegL op1, immL op2, immL0 op3, label labl, rFlagsReg cr) %{ +instruct cmpL_branch_bit(cmpOp cmp, iRegL op1, immL op2, immL0 op3, label labl) %{ match(If cmp (CmpL (AndL op1 op2) op3)); predicate((n->in(1)->as_Bool()->_test._test == BoolTest::ne || n->in(1)->as_Bool()->_test._test == BoolTest::eq) @@ -13896,15 +13899,13 @@ instruct cmpL_branch_bit(cmpOp cmp, iRegL op1, immL op2, immL0 op3, label labl, Label* L = $labl$$label; Assembler::Condition cond = (Assembler::Condition)$cmp$$cmpcode; int bit = exact_log2($op2$$constant); - if (cond == Assembler::EQ) - __ tbz($op1$$Register, bit, *L); - else - __ tbnz($op1$$Register, bit, *L); + __ tbr(cond, $op1$$Register, bit, *L); %} ins_pipe(pipe_cmp_branch); + ins_short_branch(1); %} -instruct cmpI_branch_bit(cmpOp cmp, iRegIorL2I op1, immI op2, immI0 op3, label labl, rFlagsReg cr) %{ +instruct cmpI_branch_bit(cmpOp cmp, iRegIorL2I op1, immI op2, immI0 op3, label labl) %{ match(If cmp (CmpI (AndI op1 op2) op3)); predicate((n->in(1)->as_Bool()->_test._test == BoolTest::ne || n->in(1)->as_Bool()->_test._test == BoolTest::eq) @@ -13917,10 +13918,79 @@ instruct cmpI_branch_bit(cmpOp cmp, iRegIorL2I op1, immI op2, immI0 op3, label l Label* L = $labl$$label; Assembler::Condition cond = (Assembler::Condition)$cmp$$cmpcode; int bit = exact_log2($op2$$constant); - if (cond == Assembler::EQ) - __ tbz($op1$$Register, bit, *L); - else - __ tbnz($op1$$Register, bit, *L); + __ tbr(cond, $op1$$Register, bit, *L); + %} + ins_pipe(pipe_cmp_branch); + ins_short_branch(1); +%} + +// And far variants +instruct far_cmpL_branch_sign(cmpOp cmp, iRegL op1, immL0 op2, label labl) %{ + match(If cmp (CmpL op1 op2)); + predicate(n->in(1)->as_Bool()->_test._test == BoolTest::lt + || n->in(1)->as_Bool()->_test._test == BoolTest::ge); + effect(USE labl); + + ins_cost(BRANCH_COST); + format %{ "cb$cmp $op1, $labl # long" %} + ins_encode %{ + Label* L = $labl$$label; + Assembler::Condition cond = + ((Assembler::Condition)$cmp$$cmpcode == Assembler::LT) ? Assembler::NE : Assembler::EQ; + __ tbr(cond, $op1$$Register, 63, *L, /*far*/true); + %} + ins_pipe(pipe_cmp_branch); +%} + +instruct far_cmpI_branch_sign(cmpOp cmp, iRegIorL2I op1, immI0 op2, label labl) %{ + match(If cmp (CmpI op1 op2)); + predicate(n->in(1)->as_Bool()->_test._test == BoolTest::lt + || n->in(1)->as_Bool()->_test._test == BoolTest::ge); + effect(USE labl); + + ins_cost(BRANCH_COST); + format %{ "cb$cmp $op1, $labl # int" %} + ins_encode %{ + Label* L = $labl$$label; + Assembler::Condition cond = + ((Assembler::Condition)$cmp$$cmpcode == Assembler::LT) ? Assembler::NE : Assembler::EQ; + __ tbr(cond, $op1$$Register, 31, *L, /*far*/true); + %} + ins_pipe(pipe_cmp_branch); +%} + +instruct far_cmpL_branch_bit(cmpOp cmp, iRegL op1, immL op2, immL0 op3, label labl) %{ + match(If cmp (CmpL (AndL op1 op2) op3)); + predicate((n->in(1)->as_Bool()->_test._test == BoolTest::ne + || n->in(1)->as_Bool()->_test._test == BoolTest::eq) + && is_power_of_2(n->in(2)->in(1)->in(2)->get_long())); + effect(USE labl); + + ins_cost(BRANCH_COST); + format %{ "tb$cmp $op1, $op2, $labl" %} + ins_encode %{ + Label* L = $labl$$label; + Assembler::Condition cond = (Assembler::Condition)$cmp$$cmpcode; + int bit = exact_log2($op2$$constant); + __ tbr(cond, $op1$$Register, bit, *L, /*far*/true); + %} + ins_pipe(pipe_cmp_branch); +%} + +instruct far_cmpI_branch_bit(cmpOp cmp, iRegIorL2I op1, immI op2, immI0 op3, label labl) %{ + match(If cmp (CmpI (AndI op1 op2) op3)); + predicate((n->in(1)->as_Bool()->_test._test == BoolTest::ne + || n->in(1)->as_Bool()->_test._test == BoolTest::eq) + && is_power_of_2(n->in(2)->in(1)->in(2)->get_int())); + effect(USE labl); + + ins_cost(BRANCH_COST); + format %{ "tb$cmp $op1, $op2, $labl" %} + ins_encode %{ + Label* L = $labl$$label; + Assembler::Condition cond = (Assembler::Condition)$cmp$$cmpcode; + int bit = exact_log2($op2$$constant); + __ tbr(cond, $op1$$Register, bit, *L, /*far*/true); %} ins_pipe(pipe_cmp_branch); %} diff --git a/hotspot/src/cpu/aarch64/vm/c1_MacroAssembler_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/c1_MacroAssembler_aarch64.hpp index fe41973b106..24389643ca0 100644 --- a/hotspot/src/cpu/aarch64/vm/c1_MacroAssembler_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/c1_MacroAssembler_aarch64.hpp @@ -27,6 +27,7 @@ #define CPU_AARCH64_VM_C1_MACROASSEMBLER_AARCH64_HPP using MacroAssembler::build_frame; +using MacroAssembler::null_check; // C1_MacroAssembler contains high-level macros for C1 diff --git a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp index d463f059978..73f35a6bb44 100644 --- a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp @@ -1354,9 +1354,8 @@ void InterpreterMacroAssembler::notify_method_entry() { // the code to check if the event should be sent. if (JvmtiExport::can_post_interpreter_events()) { Label L; - ldr(r3, Address(rthread, JavaThread::interp_only_mode_offset())); - tst(r3, ~0); - br(Assembler::EQ, L); + ldrw(r3, Address(rthread, JavaThread::interp_only_mode_offset())); + cbzw(r3, L); call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_method_entry)); bind(L); diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp index 54c608fada0..ade0ba0eb97 100644 --- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp @@ -487,6 +487,32 @@ public: orr(Vd, T, Vn, Vn); } +public: + + // Generalized Test Bit And Branch, including a "far" variety which + // spans more than 32KiB. + void tbr(Condition cond, Register Rt, int bitpos, Label &dest, bool far = false) { + assert(cond == EQ || cond == NE, "must be"); + + if (far) + cond = ~cond; + + void (Assembler::* branch)(Register Rt, int bitpos, Label &L); + if (cond == Assembler::EQ) + branch = &Assembler::tbz; + else + branch = &Assembler::tbnz; + + if (far) { + Label L; + (this->*branch)(Rt, bitpos, L); + b(dest); + bind(L); + } else { + (this->*branch)(Rt, bitpos, dest); + } + } + // macro instructions for accessing and updating floating point // status register // diff --git a/hotspot/src/share/vm/adlc/formssel.cpp b/hotspot/src/share/vm/adlc/formssel.cpp index 82ba5f9e2d7..90c965bfa88 100644 --- a/hotspot/src/share/vm/adlc/formssel.cpp +++ b/hotspot/src/share/vm/adlc/formssel.cpp @@ -1246,7 +1246,8 @@ bool InstructForm::check_branch_variant(ArchDesc &AD, InstructForm *short_branch !is_short_branch() && // Don't match another short branch variant reduce_result() != NULL && strcmp(reduce_result(), short_branch->reduce_result()) == 0 && - _matrule->equivalent(AD.globalNames(), short_branch->_matrule)) { + _matrule->equivalent(AD.globalNames(), short_branch->_matrule) && + equivalent_predicates(this, short_branch)) { // The instructions are equivalent. // Now verify that both instructions have the same parameters and From edb2af6a6d955e466cf66dcfcf51bb6b7bdcde9c Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Wed, 16 Dec 2015 11:35:59 +0000 Subject: [PATCH 049/146] 8144582: AArch64 does not generate correct branch profile data Reviewed-by: kvn --- hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp index fb339033869..c2da6264f6c 100644 --- a/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp @@ -392,7 +392,7 @@ void InterpreterGenerator::generate_counter_incr( __ br(Assembler::LT, *profile_method_continue); // if no method data exists, go to profile_method - __ test_method_data_pointer(r0, *profile_method); + __ test_method_data_pointer(rscratch2, *profile_method); } { From 07512e7aece900b81032c429abff38e580137bce Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Wed, 16 Dec 2015 13:21:19 +0000 Subject: [PATCH 050/146] 8145553: Fix warnings in AArch64 directory Reviewed-by: kvn --- .../src/cpu/aarch64/vm/assembler_aarch64.hpp | 8 +--- .../aarch64/vm/c1_LIRAssembler_aarch64.cpp | 40 +++++++++++++------ .../aarch64/vm/c1_LIRGenerator_aarch64.cpp | 1 + .../cpu/aarch64/vm/interpreter_aarch64.cpp | 1 + .../aarch64/vm/jniFastGetField_aarch64.cpp | 2 + 5 files changed, 33 insertions(+), 19 deletions(-) diff --git a/hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp index 76fdf876f90..ca617716562 100644 --- a/hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/assembler_aarch64.hpp @@ -135,15 +135,10 @@ REGISTER_DECLARATION(Register, rlocals, r24); // bytecode pointer REGISTER_DECLARATION(Register, rbcp, r22); // Dispatch table base -REGISTER_DECLARATION(Register, rdispatch, r21); +REGISTER_DECLARATION(Register, rdispatch, r21); // Java stack pointer REGISTER_DECLARATION(Register, esp, r20); -// TODO : x86 uses rbp to save SP in method handle code -// we may need to do the same with fp -// JSR 292 fixed register usages: -//REGISTER_DECLARATION(Register, r_mh_SP_save, r29); - #define assert_cond(ARG1) assert(ARG1, #ARG1) namespace asm_util { @@ -551,6 +546,7 @@ class Address VALUE_OBJ_CLASS_SPEC { size = 0; break; default: ShouldNotReachHere(); + size = 0; // unreachable } } else { size = i->get(31, 31); diff --git a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp index 119d113aac5..210b29e1e75 100644 --- a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp @@ -173,6 +173,7 @@ static jlong as_long(LIR_Opr data) { break; default: ShouldNotReachHere(); + result = 0; // unreachable } return result; } @@ -720,6 +721,7 @@ void LIR_Assembler::const2mem(LIR_Opr src, LIR_Opr dest, BasicType type, CodeEmi break; default: ShouldNotReachHere(); + insn = &Assembler::str; // unreachable } if (info) add_debug_info_for_null_check_here(info); @@ -1110,6 +1112,7 @@ void LIR_Assembler::emit_opBranch(LIR_OpBranch* op) { case lir_cond_greaterEqual: acond = (is_unordered ? Assembler::HS : Assembler::GE); break; case lir_cond_greater: acond = (is_unordered ? Assembler::HI : Assembler::GT); break; default: ShouldNotReachHere(); + acond = Assembler::EQ; // unreachable } } else { switch (op->cond()) { @@ -1121,7 +1124,8 @@ void LIR_Assembler::emit_opBranch(LIR_OpBranch* op) { case lir_cond_greater: acond = Assembler::GT; break; case lir_cond_belowEqual: acond = Assembler::LS; break; case lir_cond_aboveEqual: acond = Assembler::HS; break; - default: ShouldNotReachHere(); + default: ShouldNotReachHere(); + acond = Assembler::EQ; // unreachable } } __ br(acond,*(op->label())); @@ -1313,7 +1317,9 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L ciMethodData* md; ciProfileData* data; - if (op->should_profile()) { + const bool should_profile = op->should_profile(); + + if (should_profile) { ciMethod* method = op->profiled_method(); assert(method != NULL, "Should have method"); int bci = op->profiled_bci(); @@ -1324,8 +1330,8 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check"); } Label profile_cast_success, profile_cast_failure; - Label *success_target = op->should_profile() ? &profile_cast_success : success; - Label *failure_target = op->should_profile() ? &profile_cast_failure : failure; + Label *success_target = should_profile ? &profile_cast_success : success; + Label *failure_target = should_profile ? &profile_cast_failure : failure; if (obj == k_RInfo) { k_RInfo = dst; @@ -1341,7 +1347,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L assert_different_registers(obj, k_RInfo, klass_RInfo); - if (op->should_profile()) { + if (should_profile) { Label not_null; __ cbnz(obj, not_null); // Object is null; update MDO and exit @@ -1413,7 +1419,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L // successful cast, fall through to profile or jump } } - if (op->should_profile()) { + if (should_profile) { Register mdo = klass_RInfo, recv = k_RInfo; __ bind(profile_cast_success); __ mov_metadata(mdo, md->constant_encoding()); @@ -1438,6 +1444,8 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { + const bool should_profile = op->should_profile(); + LIR_Code code = op->code(); if (code == lir_store_check) { Register value = op->object()->as_register(); @@ -1452,7 +1460,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { ciMethodData* md; ciProfileData* data; - if (op->should_profile()) { + if (should_profile) { ciMethod* method = op->profiled_method(); assert(method != NULL, "Should have method"); int bci = op->profiled_bci(); @@ -1463,10 +1471,10 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check"); } Label profile_cast_success, profile_cast_failure, done; - Label *success_target = op->should_profile() ? &profile_cast_success : &done; - Label *failure_target = op->should_profile() ? &profile_cast_failure : stub->entry(); + Label *success_target = should_profile ? &profile_cast_success : &done; + Label *failure_target = should_profile ? &profile_cast_failure : stub->entry(); - if (op->should_profile()) { + if (should_profile) { Label not_null; __ cbnz(value, not_null); // Object is null; update MDO and exit @@ -1502,7 +1510,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { __ cbzw(k_RInfo, *failure_target); // fall through to the success case - if (op->should_profile()) { + if (should_profile) { Register mdo = klass_RInfo, recv = k_RInfo; __ bind(profile_cast_success); __ mov_metadata(mdo, md->constant_encoding()); @@ -1621,9 +1629,10 @@ void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, L case lir_cond_lessEqual: acond = Assembler::LE; ncond = Assembler::GT; break; case lir_cond_greaterEqual: acond = Assembler::GE; ncond = Assembler::LT; break; case lir_cond_greater: acond = Assembler::GT; ncond = Assembler::LE; break; - case lir_cond_belowEqual: Unimplemented(); break; - case lir_cond_aboveEqual: Unimplemented(); break; + case lir_cond_belowEqual: + case lir_cond_aboveEqual: default: ShouldNotReachHere(); + acond = Assembler::EQ; ncond = Assembler::NE; // unreachable } assert(result->is_single_cpu() || result->is_double_cpu(), @@ -1724,6 +1733,7 @@ void LIR_Assembler::arith_op(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr break; default: ShouldNotReachHere(); + c = 0; // unreachable break; } @@ -1926,6 +1936,7 @@ void LIR_Assembler::comp_op(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, break; default: ShouldNotReachHere(); + imm = 0; // unreachable break; } @@ -3123,6 +3134,9 @@ void LIR_Assembler::atomic_op(LIR_Code code, LIR_Opr src, LIR_Opr data, LIR_Opr break; default: ShouldNotReachHere(); + lda = &MacroAssembler::ldaxr; + add = &MacroAssembler::add; + stl = &MacroAssembler::stlxr; // unreachable } switch (code) { diff --git a/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp index 21c7cfc93ff..191c4e45571 100644 --- a/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp @@ -238,6 +238,7 @@ LIR_Opr LIRGenerator::load_immediate(int x, BasicType type) { } } else { ShouldNotReachHere(); + r = NULL; // unreachable } return r; } diff --git a/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.cpp index 96a967fb961..e29c1ec0e22 100644 --- a/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.cpp @@ -230,6 +230,7 @@ void InterpreterGenerator::generate_transcendental_entry(AbstractInterpreter::Me break; default: ShouldNotReachHere(); + fn = NULL; // unreachable } const int gpargs = 0, rtype = 3; __ mov(rscratch1, fn); diff --git a/hotspot/src/cpu/aarch64/vm/jniFastGetField_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/jniFastGetField_aarch64.cpp index 14c8367f371..b2f21031f18 100644 --- a/hotspot/src/cpu/aarch64/vm/jniFastGetField_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/jniFastGetField_aarch64.cpp @@ -61,6 +61,7 @@ address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) { case T_FLOAT: name = "jni_fast_GetFloatField"; break; case T_DOUBLE: name = "jni_fast_GetDoubleField"; break; default: ShouldNotReachHere(); + name = NULL; // unreachable } ResourceMark rm; BufferBlob* blob = BufferBlob::create(name, BUFFER_SIZE); @@ -125,6 +126,7 @@ address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) { case T_FLOAT: slow_case_addr = jni_GetFloatField_addr(); break; case T_DOUBLE: slow_case_addr = jni_GetDoubleField_addr(); break; default: ShouldNotReachHere(); + slow_case_addr = NULL; // unreachable } { From e699dcb655ccf905eb6bc47ca0c5807197edc06e Mon Sep 17 00:00:00 2001 From: Dmitrij Pochepko Date: Wed, 16 Dec 2015 18:38:02 +0300 Subject: [PATCH 051/146] 8141351: Create tests for direct invoke instructions testing Tests for invoke* instructions Reviewed-by: twisti --- hotspot/make/test/JtregNative.gmk | 1 + .../compiler/calls/common/CallInterface.java | 35 +++ .../test/compiler/calls/common/CallsBase.java | 217 ++++++++++++++++++ .../compiler/calls/common/InvokeDynamic.java | 99 ++++++++ .../calls/common/InvokeDynamicPatcher.java | 171 ++++++++++++++ .../calls/common/InvokeInterface.java | 84 +++++++ .../compiler/calls/common/InvokeSpecial.java | 80 +++++++ .../compiler/calls/common/InvokeStatic.java | 91 ++++++++ .../compiler/calls/common/InvokeVirtual.java | 81 +++++++ .../compiler/calls/common/libCallsNative.c | 148 ++++++++++++ .../CompiledInvokeDynamic2CompiledTest.java | 45 ++++ ...CompiledInvokeDynamic2InterpretedTest.java | 39 ++++ .../CompiledInvokeDynamic2NativeTest.java | 39 ++++ .../CompiledInvokeInterface2CompiledTest.java | 43 ++++ ...mpiledInvokeInterface2InterpretedTest.java | 37 +++ .../CompiledInvokeInterface2NativeTest.java | 37 +++ .../CompiledInvokeSpecial2CompiledTest.java | 43 ++++ ...CompiledInvokeSpecial2InterpretedTest.java | 37 +++ .../CompiledInvokeSpecial2NativeTest.java | 37 +++ .../CompiledInvokeStatic2CompiledTest.java | 43 ++++ .../CompiledInvokeStatic2InterpretedTest.java | 37 +++ .../CompiledInvokeStatic2NativeTest.java | 37 +++ .../CompiledInvokeVirtual2CompiledTest.java | 43 ++++ ...CompiledInvokeVirtual2InterpretedTest.java | 37 +++ .../CompiledInvokeVirtual2NativeTest.java | 37 +++ ...InterpretedInvokeDynamic2CompiledTest.java | 39 ++++ ...erpretedInvokeDynamic2InterpretedTest.java | 36 +++ .../InterpretedInvokeDynamic2NativeTest.java | 36 +++ ...terpretedInvokeInterface2CompiledTest.java | 37 +++ ...pretedInvokeInterface2InterpretedTest.java | 34 +++ ...InterpretedInvokeInterface2NativeTest.java | 34 +++ ...InterpretedInvokeSpecial2CompiledTest.java | 37 +++ ...erpretedInvokeSpecial2InterpretedTest.java | 34 +++ .../InterpretedInvokeSpecial2NativeTest.java | 34 +++ .../InterpretedInvokeStatic2CompiledTest.java | 37 +++ ...terpretedInvokeStatic2InterpretedTest.java | 34 +++ .../InterpretedInvokeStatic2NativeTest.java | 34 +++ ...InterpretedInvokeVirtual2CompiledTest.java | 37 +++ ...erpretedInvokeVirtual2InterpretedTest.java | 34 +++ .../InterpretedInvokeVirtual2NativeTest.java | 34 +++ .../NativeInvokeSpecial2CompiledTest.java | 37 +++ .../NativeInvokeSpecial2InterpretedTest.java | 34 +++ .../NativeInvokeSpecial2NativeTest.java | 34 +++ .../NativeInvokeStatic2CompiledTest.java | 37 +++ .../NativeInvokeStatic2InterpretedTest.java | 34 +++ .../NativeInvokeStatic2NativeTest.java | 34 +++ .../NativeInvokeVirtual2CompiledTest.java | 37 +++ .../NativeInvokeVirtual2InterpretedTest.java | 34 +++ .../NativeInvokeVirtual2NativeTest.java | 34 +++ 49 files changed, 2444 insertions(+) create mode 100644 hotspot/test/compiler/calls/common/CallInterface.java create mode 100644 hotspot/test/compiler/calls/common/CallsBase.java create mode 100644 hotspot/test/compiler/calls/common/InvokeDynamic.java create mode 100644 hotspot/test/compiler/calls/common/InvokeDynamicPatcher.java create mode 100644 hotspot/test/compiler/calls/common/InvokeInterface.java create mode 100644 hotspot/test/compiler/calls/common/InvokeSpecial.java create mode 100644 hotspot/test/compiler/calls/common/InvokeStatic.java create mode 100644 hotspot/test/compiler/calls/common/InvokeVirtual.java create mode 100644 hotspot/test/compiler/calls/common/libCallsNative.c create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2CompiledTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2InterpretedTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2CompiledTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2InterpretedTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2CompiledTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2InterpretedTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2CompiledTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2InterpretedTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2CompiledTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2InterpretedTest.java create mode 100644 hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2CompiledTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2InterpretedTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2CompiledTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2InterpretedTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2CompiledTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2InterpretedTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2CompiledTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2InterpretedTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2CompiledTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2InterpretedTest.java create mode 100644 hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java create mode 100644 hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java create mode 100644 hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java create mode 100644 hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java create mode 100644 hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java create mode 100644 hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java create mode 100644 hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java create mode 100644 hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java create mode 100644 hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java create mode 100644 hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java diff --git a/hotspot/make/test/JtregNative.gmk b/hotspot/make/test/JtregNative.gmk index d49a03757e7..109c04d37fb 100644 --- a/hotspot/make/test/JtregNative.gmk +++ b/hotspot/make/test/JtregNative.gmk @@ -47,6 +47,7 @@ BUILD_HOTSPOT_JTREG_NATIVE_SRC := \ $(HOTSPOT_TOPDIR)/test/runtime/jni/ToStringInInterfaceTest \ $(HOTSPOT_TOPDIR)/test/runtime/SameObject \ $(HOTSPOT_TOPDIR)/test/compiler/floatingpoint/ \ + $(HOTSPOT_TOPDIR)/test/compiler/calls \ # # Add conditional directories here when needed. diff --git a/hotspot/test/compiler/calls/common/CallInterface.java b/hotspot/test/compiler/calls/common/CallInterface.java new file mode 100644 index 00000000000..84b7b075150 --- /dev/null +++ b/hotspot/test/compiler/calls/common/CallInterface.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package compiler.calls.common; + +/** + * A test interface used for InvokeInterface + */ +public interface CallInterface { + public boolean callee(int param1, long param2, float param3, double param4, + String param5); + + public boolean calleeNative(int param1, long param2, float param3, + double param4, String param5); +} diff --git a/hotspot/test/compiler/calls/common/CallsBase.java b/hotspot/test/compiler/calls/common/CallsBase.java new file mode 100644 index 00000000000..f6a9ad93f23 --- /dev/null +++ b/hotspot/test/compiler/calls/common/CallsBase.java @@ -0,0 +1,217 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package compiler.calls.common; + +import compiler.testlibrary.CompilerUtils; +import java.lang.reflect.Method; +import java.util.Arrays; +import jdk.test.lib.Asserts; +import sun.hotspot.WhiteBox; + +/** + * A common class for Invoke* classes + */ +public abstract class CallsBase { + public static final String CALL_ERR_MSG = "Call insuccessfull"; + protected final Method calleeMethod; + protected final Method callerMethod; + protected final WhiteBox wb = WhiteBox.getWhiteBox(); + protected int compileCallee = -1; + protected int compileCaller = -1; + protected boolean nativeCallee = false; + protected boolean nativeCaller = false; + protected boolean calleeVisited = false; + protected boolean checkCallerCompilationLevel; + protected boolean checkCalleeCompilationLevel; + protected int expectedCallerCompilationLevel; + protected int expectedCalleeCompilationLevel; + + protected CallsBase() { + try { + callerMethod = getClass().getDeclaredMethod("caller"); + calleeMethod = getClass().getDeclaredMethod("callee", + getCalleeParametersTypes()); + wb.testSetDontInlineMethod(callerMethod, /* dontinline= */ true); + wb.testSetDontInlineMethod(calleeMethod, /* dontinline= */ true); + } catch (NoSuchMethodException e) { + throw new Error("TEST BUG: can't find test method", e); + } + } + + /** + * Provides callee parameters types to search method + * @return array of types + */ + protected Class[] getCalleeParametersTypes() { + return new Class[] {int.class, long.class, float.class, + double.class, String.class}; + } + + /** + * Loads native library(libCallsNative.so) + */ + protected static void loadNativeLibrary() { + System.loadLibrary("CallsNative"); + } + + /** + * Checks if requested compilation levels are inside of current vm capabilities + * @return true if vm is capable of requested compilation levels + */ + protected final boolean compilationLevelsSupported() { + int[] compLevels = CompilerUtils.getAvailableCompilationLevels(); + boolean callerCompLevelSupported = compileCaller > 0 + && Arrays.stream(compLevels) + .filter(elem -> elem == compileCaller) + .findAny() + .isPresent(); + boolean calleeCompLevelSupported = compileCallee > 0 + && Arrays.stream(compLevels) + .filter(elem -> elem == compileCallee) + .findAny() + .isPresent(); + return callerCompLevelSupported && calleeCompLevelSupported; + } + + /** + * Parse test arguments + * @param args test arguments + */ + protected final void parseArgs(String args[]) { + for (int i = 0; i < args.length; i++) { + switch (args[i]) { + case "-nativeCallee": + nativeCallee = true; + break; + case "-nativeCaller": + nativeCaller = true; + break; + case "-compileCallee": + compileCallee = Integer.parseInt(args[++i]); + break; + case "-compileCaller": + compileCaller = Integer.parseInt(args[++i]); + break; + case "-checkCallerCompileLevel": + checkCallerCompilationLevel = true; + expectedCallerCompilationLevel = Integer.parseInt(args[++i]); + break; + case "-checkCalleeCompileLevel": + checkCalleeCompilationLevel = true; + expectedCalleeCompilationLevel = Integer.parseInt(args[++i]); + break; + default: + throw new Error("Can't parse test parameter:" + args[i]); + } + } + } + + /** + * Run basic logic of a test by doing compile + * action(if needed). An arguments can be -compileCallee + * $calleeCompilationLevel and/or -compileCaller $callerCompilationLevel + * and/or -nativeCaller and/or -nativeCallee to indicate that native methods + * for caller/callee should be used + * @param args test args + */ + protected final void runTest(String args[]) { + parseArgs(args); + if (compilationLevelsSupported()) { + if (nativeCaller || nativeCallee) { + CallsBase.loadNativeLibrary(); + } + Object lock = getLockObject(); + Asserts.assertNotNull(lock, "Lock object is null"); + /* a following lock is needed in case several instances of this + test are launched in same vm */ + synchronized (lock) { + if (compileCaller > 0 || compileCallee > 0) { + caller(); // call once to have everything loaded + calleeVisited = false; // reset state + } + // compile with requested level if needed + if (compileCallee > 0) { + compileMethod(calleeMethod, compileCallee); + } + if (checkCalleeCompilationLevel) { + Asserts.assertEQ(expectedCalleeCompilationLevel, + wb.getMethodCompilationLevel(calleeMethod), + "Unexpected callee compilation level"); + } + if (compileCaller > 0) { + compileMethod(callerMethod, compileCaller); + } + if (checkCallerCompilationLevel) { + Asserts.assertEQ(expectedCallerCompilationLevel, + wb.getMethodCompilationLevel(callerMethod), + "Unexpected caller compilation level"); + } + // do calling work + if (nativeCaller) { + callerNative(); + } else { + caller(); + } + } + } else { + System.out.println("WARNING: Requested compilation levels are " + + "out of current vm capabilities. Skipping."); + } + } + + /** + * A method to compile another method, searching it by name in current class + * @param method a method to compile + * @param compLevel a compilation level + */ + protected final void compileMethod(Method method, int compLevel) { + wb.deoptimizeMethod(method); + Asserts.assertTrue(wb.isMethodCompilable(method, compLevel)); + wb.enqueueMethodForCompilation(method, compLevel); + } + + /* + * @return Object to lock on during execution + */ + + protected abstract Object getLockObject(); + + protected abstract void caller(); + + protected abstract void callerNative(); + + /** + * A method checking values. Should be used to verify if all parameters are + * passed as expected. Parameter N should have a value indicating number "N" + * in respective type representation. + */ + public static void checkValues(int param1, long param2, float param3, + double param4, String param5) { + Asserts.assertEQ(param1, 1); + Asserts.assertEQ(param2, 2L); + Asserts.assertEQ(param3, 3.0f); + Asserts.assertEQ(param4, 4.0d); + Asserts.assertEQ(param5, "5"); + } +} diff --git a/hotspot/test/compiler/calls/common/InvokeDynamic.java b/hotspot/test/compiler/calls/common/InvokeDynamic.java new file mode 100644 index 00000000000..018a2992e80 --- /dev/null +++ b/hotspot/test/compiler/calls/common/InvokeDynamic.java @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package compiler.calls.common; + +import java.lang.invoke.CallSite; +import java.lang.invoke.ConstantCallSite; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; + +/** + * A test class checking InvokeDynamic instruction. + * This is not quite "ready-to-use" class, since javac can't generate indy + * directly(only as part of lambda init) so, this class bytecode should be + * patched with method "caller" which uses indy. Other methods can be written in + * java for easier support and readability. + */ + +public class InvokeDynamic extends CallsBase { + private static final Object LOCK = new Object(); + + public static void main(String args[]) { + new InvokeDynamic().runTest(args); + } + + /** + * Caller method to call "callee" method. Must be overwritten with InvokeDynamicPatcher + */ + @Override + public void caller() { + } + + /** + * A bootstrap method for invokedynamic + * @param lookup a lookup object + * @param methodName methodName + * @param type method type + * @return CallSite for method + */ + public static CallSite bootstrapMethod(MethodHandles.Lookup lookup, + String methodName, MethodType type) throws IllegalAccessException, + NoSuchMethodException { + MethodType mtype = MethodType.methodType(boolean.class, + new Class[]{int.class, long.class, float.class, + double.class, String.class}); + return new ConstantCallSite(lookup.findVirtual(lookup.lookupClass(), + methodName, mtype)); + } + + /** + * A callee method, assumed to be called by "caller" + */ + public boolean callee(int param1, long param2, float param3, double param4, + String param5) { + calleeVisited = true; + CallsBase.checkValues(param1, param2, param3, param4, param5); + return true; + } + + /** + * A native callee method, assumed to be called by "caller" + */ + public native boolean calleeNative(int param1, long param2, float param3, + double param4, String param5); + + /** + * Returns object to lock execution on + * @return lock object + */ + @Override + protected Object getLockObject() { + return LOCK; + } + + @Override + protected void callerNative() { + throw new Error("No native call for invokedynamic"); + } +} diff --git a/hotspot/test/compiler/calls/common/InvokeDynamicPatcher.java b/hotspot/test/compiler/calls/common/InvokeDynamicPatcher.java new file mode 100644 index 00000000000..644f0a21b6e --- /dev/null +++ b/hotspot/test/compiler/calls/common/InvokeDynamicPatcher.java @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package compiler.calls.common; + +import java.io.FileInputStream; +import java.io.IOException; +import java.lang.invoke.CallSite; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.net.URISyntaxException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardOpenOption; +import jdk.internal.org.objectweb.asm.ClassReader; +import jdk.internal.org.objectweb.asm.ClassVisitor; +import jdk.internal.org.objectweb.asm.ClassWriter; +import jdk.internal.org.objectweb.asm.Handle; +import jdk.internal.org.objectweb.asm.Label; +import jdk.internal.org.objectweb.asm.MethodVisitor; +import jdk.internal.org.objectweb.asm.Opcodes; + +/** + * A class which patch InvokeDynamic class bytecode with invokydynamic + instruction, rewriting "caller" method to call "callee" method using + invokedynamic + */ +public class InvokeDynamicPatcher extends ClassVisitor { + + private static final String CLASS = InvokeDynamic.class.getName() + .replace('.', '/'); + private static final String CALLER_METHOD_NAME = "caller"; + private static final String CALLEE_METHOD_NAME = "callee"; + private static final String NATIVE_CALLEE_METHOD_NAME = "calleeNative"; + private static final String BOOTSTRAP_METHOD_NAME = "bootstrapMethod"; + private static final String CALL_NATIVE_FIELD = "nativeCallee"; + private static final String CALL_NATIVE_FIELD_DESC = "Z"; + private static final String CALLEE_METHOD_DESC + = "(L" + CLASS + ";IJFDLjava/lang/String;)Z"; + private static final String ASSERTTRUE_METHOD_DESC + = "(ZLjava/lang/String;)V"; + private static final String ASSERTS_CLASS = "jdk/test/lib/Asserts"; + private static final String ASSERTTRUE_METHOD_NAME = "assertTrue"; + + public static void main(String args[]) { + ClassReader cr; + Path filePath; + try { + filePath = Paths.get(InvokeDynamic.class.getProtectionDomain().getCodeSource() + .getLocation().toURI()).resolve(CLASS + ".class"); + } catch (URISyntaxException ex) { + throw new Error("TESTBUG: Can't get code source" + ex, ex); + } + try (FileInputStream fis = new FileInputStream(filePath.toFile())) { + cr = new ClassReader(fis); + } catch (IOException e) { + throw new Error("Error reading file", e); + } + ClassWriter cw = new ClassWriter(cr, + ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS); + cr.accept(new InvokeDynamicPatcher(Opcodes.ASM5, cw), 0); + try { + Files.write(filePath, cw.toByteArray(), + StandardOpenOption.WRITE); + } catch (IOException e) { + throw new Error(e); + } + } + + public InvokeDynamicPatcher(int api, ClassWriter cw) { + super(api, cw); + } + + @Override + public MethodVisitor visitMethod(final int access, final String name, + final String desc, final String signature, + final String[] exceptions) { + /* a code generate looks like + * 0: aload_0 + * 1: ldc #125 // int 1 + * 3: ldc2_w #126 // long 2l + * 6: ldc #128 // float 3.0f + * 8: ldc2_w #129 // double 4.0d + * 11: ldc #132 // String 5 + * 13: aload_0 + * 14: getfield #135 // Field nativeCallee:Z + * 17: ifeq 28 + * 20: invokedynamic #181, 0 // InvokeDynamic #1:calleeNative:(Lcompiler/calls/common/InvokeDynamic;IJFDLjava/lang/String;)Z + * 25: goto 33 + * 28: invokedynamic #183, 0 // InvokeDynamic #1:callee:(Lcompiler/calls/common/InvokeDynamic;IJFDLjava/lang/String;)Z + * 33: ldc #185 // String Call insuccessfull + * 35: invokestatic #191 // Method jdk/test/lib/Asserts.assertTrue:(ZLjava/lang/String;)V + * 38: return + * + * or, using java-like pseudo-code + * if (this.nativeCallee == false) { + * invokedynamic-call-return-value = invokedynamic-of-callee + * } else { + * invokedynamic-call-return-value = invokedynamic-of-nativeCallee + * } + * Asserts.assertTrue(invokedynamic-call-return-value, error-message); + * return; + */ + if (name.equals(CALLER_METHOD_NAME)) { + MethodVisitor mv = cv.visitMethod(access, name, desc, + signature, exceptions); + Label nonNativeLabel = new Label(); + Label checkLabel = new Label(); + MethodType mtype = MethodType.methodType(CallSite.class, + MethodHandles.Lookup.class, String.class, MethodType.class); + Handle bootstrap = new Handle(Opcodes.H_INVOKESTATIC, CLASS, + BOOTSTRAP_METHOD_NAME, mtype.toMethodDescriptorString()); + mv.visitCode(); + // push callee parameters onto stack + mv.visitVarInsn(Opcodes.ALOAD, 0);//push "this" + mv.visitLdcInsn(1); + mv.visitLdcInsn(2L); + mv.visitLdcInsn(3.0f); + mv.visitLdcInsn(4.0d); + mv.visitLdcInsn("5"); + // params loaded. let's decide what method to call + mv.visitVarInsn(Opcodes.ALOAD, 0); // push "this" + // get nativeCallee field + mv.visitFieldInsn(Opcodes.GETFIELD, CLASS, CALL_NATIVE_FIELD, + CALL_NATIVE_FIELD_DESC); + // if nativeCallee == false goto nonNativeLabel + mv.visitJumpInsn(Opcodes.IFEQ, nonNativeLabel); + // invokedynamic nativeCalleeMethod using bootstrap method + mv.visitInvokeDynamicInsn(NATIVE_CALLEE_METHOD_NAME, + CALLEE_METHOD_DESC, bootstrap); + // goto checkLabel + mv.visitJumpInsn(Opcodes.GOTO, checkLabel); + // label: nonNativeLabel + mv.visitLabel(nonNativeLabel); + // invokedynamic calleeMethod using bootstrap method + mv.visitInvokeDynamicInsn(CALLEE_METHOD_NAME, CALLEE_METHOD_DESC, + bootstrap); + mv.visitLabel(checkLabel); + mv.visitLdcInsn(CallsBase.CALL_ERR_MSG); + mv.visitMethodInsn(Opcodes.INVOKESTATIC, ASSERTS_CLASS, + ASSERTTRUE_METHOD_NAME, ASSERTTRUE_METHOD_DESC, false); + // label: return + mv.visitInsn(Opcodes.RETURN); + mv.visitMaxs(0, 0); + mv.visitEnd(); + return null; + } + return super.visitMethod(access, name, desc, signature, exceptions); + } +} diff --git a/hotspot/test/compiler/calls/common/InvokeInterface.java b/hotspot/test/compiler/calls/common/InvokeInterface.java new file mode 100644 index 00000000000..7ae77d5c4ee --- /dev/null +++ b/hotspot/test/compiler/calls/common/InvokeInterface.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package compiler.calls.common; + +import jdk.test.lib.Asserts; + +/** + * A test class checking InvokeInterface instruction + */ +public class InvokeInterface extends CallsBase implements CallInterface { + private static final Object LOCK = new Object(); + + public static void main(String args[]) { + new InvokeInterface().runTest(args); + } + + /** + * A caller method, assumed to called "callee"/"calleeNative" + */ + @Override + public void caller() { + // cast to CallInterface to force invokeinterface usage + if (nativeCallee) { + Asserts.assertTrue(((CallInterface) this) + .calleeNative(1, 2L, 3.0f, 4.0d, "5"), CALL_ERR_MSG); + } else { + Asserts.assertTrue(((CallInterface) this) + .callee(1, 2L, 3.0f, 4.0d, "5"), CALL_ERR_MSG); + } + } + + /** + * A callee method, assumed to be called by "caller"/"callerNative" + */ + @Override + public boolean callee(int param1, long param2, float param3, double param4, + String param5) { + calleeVisited = true; + CallsBase.checkValues(param1, param2, param3, param4, param5); + return true; + } + + /** + * A native callee method, assumed to be called by "caller"/"callerNative" + */ + @Override + public native boolean calleeNative(int param1, long param2, float param3, + double param4, String param5); + + /** + * Returns object to lock execution on + * @return lock object + */ + @Override + protected Object getLockObject() { + return LOCK; + } + + @Override + protected void callerNative() { + throw new Error("No native call for invokeinterface"); + } +} diff --git a/hotspot/test/compiler/calls/common/InvokeSpecial.java b/hotspot/test/compiler/calls/common/InvokeSpecial.java new file mode 100644 index 00000000000..1eb34873a83 --- /dev/null +++ b/hotspot/test/compiler/calls/common/InvokeSpecial.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package compiler.calls.common; + +import jdk.test.lib.Asserts; + +/** + * A test class checking InvokeSpecial instruction + */ +public class InvokeSpecial extends CallsBase { + private static final Object LOCK = new Object(); + + public static void main(String args[]) { + new InvokeSpecial().runTest(args); + } + + /** + * A native caller method, assumed to called "callee"/"calleeNative" + */ + @Override + public native void callerNative(); + + /** + * A caller method, assumed to called "callee"/"calleeNative" + */ + @Override + public void caller() { + if (nativeCallee) { + Asserts.assertTrue(calleeNative(1, 2L, 3.0f, 4.0d, "5"), CALL_ERR_MSG); + } else { + Asserts.assertTrue(callee(1, 2L, 3.0f, 4.0d, "5"), CALL_ERR_MSG); + } + } + + /** + * A callee method, assumed to be called by "caller"/"callerNative" + */ + private boolean callee(int param1, long param2, float param3, double param4, + String param5) { + calleeVisited = true; + CallsBase.checkValues(param1, param2, param3, param4, param5); + return true; + } + + /** + * A native callee method, assumed to be called by "caller"/"callerNative" + */ + public native boolean calleeNative(int param1, long param2, float param3, + double param4, String param5); + + /** + * Returns object to lock execution on + * @return lock object + */ + @Override + protected Object getLockObject() { + return LOCK; + } +} diff --git a/hotspot/test/compiler/calls/common/InvokeStatic.java b/hotspot/test/compiler/calls/common/InvokeStatic.java new file mode 100644 index 00000000000..18abcae7327 --- /dev/null +++ b/hotspot/test/compiler/calls/common/InvokeStatic.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package compiler.calls.common; + +import jdk.test.lib.Asserts; + +/** + * A test class checking InvokeStatic instruction + */ +public class InvokeStatic extends CallsBase { + private static final Object LOCK = new Object(); + + public static void main(String args[]) { + new InvokeStatic().runTest(args); + } + + /** + * A native caller method, assumed to called "callee"/"calleeNative" + */ + @Override + public native void callerNative(); + + /** + * A caller method, assumed to called "callee"/"calleeNative" + */ + @Override + public void caller() { + if (nativeCallee) { + Asserts.assertTrue(calleeNative(this, 1, 2L, 3.0f, 4.0d, "5"), + CALL_ERR_MSG); + } else { + Asserts.assertTrue(callee(this, 1, 2L, 3.0f, 4.0d, "5"), + CALL_ERR_MSG); + } + } + + /** + * A callee method, assumed to be called by "caller"/"callerNative" + */ + public static boolean callee(InvokeStatic instance, int param1, + long param2, float param3, double param4, String param5) { + instance.calleeVisited = true; + CallsBase.checkValues(param1, param2, param3, param4, param5); + return true; + } + + /** + * A native callee method, assumed to be called by "caller"/"callerNative" + */ + public static native boolean calleeNative(InvokeStatic instance, + int param1, long param2, float param3, double param4, String param5); + + /** + * Returns object to lock execution on + * @return lock object + */ + @Override + protected Object getLockObject() { + return LOCK; + } + + /** + * Provides callee parameters types to search method + * @return array of types + */ + protected Class[] getCalleeParametersTypes() { + return new Class[]{InvokeStatic.class, int.class, long.class, + float.class, double.class, String.class}; + } +} diff --git a/hotspot/test/compiler/calls/common/InvokeVirtual.java b/hotspot/test/compiler/calls/common/InvokeVirtual.java new file mode 100644 index 00000000000..6443fd63bc3 --- /dev/null +++ b/hotspot/test/compiler/calls/common/InvokeVirtual.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package compiler.calls.common; + +import jdk.test.lib.Asserts; + +/** + * A test class checking InvokeVirtual instruction + */ + +public class InvokeVirtual extends CallsBase { + private static final Object LOCK = new Object(); + + public static void main(String args[]) { + new InvokeVirtual().runTest(args); + } + + /** + * A native caller method, assumed to called "callee"/"calleeNative" + */ + @Override + public native void callerNative(); + + /** + * A caller method, assumed to called "callee"/"calleeNative" + */ + @Override + public void caller() { + if (nativeCallee) { + Asserts.assertTrue(calleeNative(1, 2L, 3.0f, 4.0d, "5"), CALL_ERR_MSG); + } else { + Asserts.assertTrue(callee(1, 2L, 3.0f, 4.0d, "5"), CALL_ERR_MSG); + } + } + + /** + * A callee method, assumed to be called by "caller"/"callerNative" + */ + public boolean callee(int param1, long param2, float param3, double param4, + String param5) { + calleeVisited = true; + CallsBase.checkValues(param1, param2, param3, param4, param5); + return true; + } + + /** + * A native callee method, assumed to be called by "caller"/"callerNative" + */ + public native boolean calleeNative(int param1, long param2, float param3, + double param4, String param5); + + /** + * Returns object to lock execution on + * @return lock object + */ + @Override + protected Object getLockObject() { + return LOCK; + } +} diff --git a/hotspot/test/compiler/calls/common/libCallsNative.c b/hotspot/test/compiler/calls/common/libCallsNative.c new file mode 100644 index 00000000000..aacaacc3de1 --- /dev/null +++ b/hotspot/test/compiler/calls/common/libCallsNative.c @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include + +#include "jni.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define METHOD_SIGNATURE "(IJFDLjava/lang/String;)Z" +#define STATIC_CALLEE_SIGNATURE "(Lcompiler/calls/common/InvokeStatic;IJFDLjava/lang/String;)Z" +#define BASE_CLASS "compiler/calls/common/CallsBase" + +#define CHECK_EXCEPTIONS if ((*env)->ExceptionCheck(env)) return +#define CHECK_EXCEPTIONS_FALSE if ((*env)->ExceptionCheck(env)) return JNI_FALSE + +#define IS_STATIC 1 +#define NOT_STATIC 0 + +jboolean doCalleeWork(JNIEnv *env, jobject self, jint param1, jlong param2, + jfloat param3, jdouble param4, jstring param5) { + jclass cls = (*env)->GetObjectClass(env, self); + jfieldID calleeVisitedID = (*env)->GetFieldID(env, cls, "calleeVisited", "Z"); + jclass CheckCallsBaseClass; + jmethodID checkValuesID; + CHECK_EXCEPTIONS_FALSE; + (*env)->SetBooleanField(env, self, calleeVisitedID, JNI_TRUE); + CHECK_EXCEPTIONS_FALSE; + CheckCallsBaseClass = (*env)->FindClass(env, BASE_CLASS); + CHECK_EXCEPTIONS_FALSE; + checkValuesID = (*env)->GetStaticMethodID(env, CheckCallsBaseClass, + "checkValues", "(IJFDLjava/lang/String;)V"); + CHECK_EXCEPTIONS_FALSE; + (*env)->CallStaticVoidMethod(env, CheckCallsBaseClass, checkValuesID, + param1, param2, param3, param4, param5); + return JNI_TRUE; +} + +JNIEXPORT jboolean JNICALL Java_compiler_calls_common_InvokeDynamic_calleeNative(JNIEnv *env, jobject obj, + jint param1, jlong param2, jfloat param3, jdouble param4, jstring param5) { + return doCalleeWork(env, obj, param1, param2, param3, param4, param5); +} + +JNIEXPORT jboolean JNICALL Java_compiler_calls_common_InvokeInterface_calleeNative(JNIEnv *env, jobject obj, + jint param1, jlong param2, jfloat param3, jdouble param4, jstring param5) { + return doCalleeWork(env, obj, param1, param2, param3, param4, param5); +} + +JNIEXPORT jboolean JNICALL Java_compiler_calls_common_InvokeSpecial_calleeNative(JNIEnv *env, jobject obj, + jint param1, jlong param2, jfloat param3, jdouble param4, jstring param5) { + return doCalleeWork(env, obj, param1, param2, param3, param4, param5); +} + +JNIEXPORT jboolean JNICALL Java_compiler_calls_common_InvokeVirtual_calleeNative(JNIEnv *env, jobject obj, + jint param1, jlong param2, jfloat param3, jdouble param4, jstring param5) { + return doCalleeWork(env, obj, param1, param2, param3, param4, param5); +} + +JNIEXPORT jboolean JNICALL Java_compiler_calls_common_InvokeStatic_calleeNative(JNIEnv *env, jclass obj, + jobject self, jint param1, jlong param2, jfloat param3, jdouble param4, jstring param5) { + return doCalleeWork(env, self, param1, param2, param3, param4, param5); +} + +void doCallerWork(JNIEnv *env, jobject obj, int isStatic) { + jclass cls = (*env)->GetObjectClass(env, obj); + jmethodID calleeMethodID = 0; + jfieldID errorMessageID; + jfieldID nativeCalleeID; + jobject errorMessage; + jmethodID assertTrue; + jboolean callNative; + jclass assertsClass; + jclass baseClass; + jboolean result; + char* methodName; + CHECK_EXCEPTIONS; + nativeCalleeID = (*env)->GetFieldID(env, cls, "nativeCallee", "Z"); + CHECK_EXCEPTIONS; + callNative = (*env)->GetBooleanField(env, obj, nativeCalleeID); + CHECK_EXCEPTIONS; + methodName = (callNative == JNI_TRUE) ? "calleeNative" : "callee"; + if (isStatic) { + calleeMethodID = (*env)->GetStaticMethodID(env, cls, methodName, + STATIC_CALLEE_SIGNATURE); + } else { + calleeMethodID = (*env)->GetMethodID(env, cls, methodName, METHOD_SIGNATURE); + } + CHECK_EXCEPTIONS; + if (isStatic) { + result = (*env)->CallStaticBooleanMethod(env, cls, calleeMethodID, obj, + (jint) 1, (jlong) 2L, (jfloat) 3.0f, (jdouble) 4.0, (*env)->NewStringUTF(env, "5")); + } else { + result = (*env)->CallBooleanMethod(env, obj, calleeMethodID, + (jint) 1, (jlong) 2L, (jfloat) 3.0f, (jdouble) 4.0, (*env)->NewStringUTF(env, "5")); + } + CHECK_EXCEPTIONS; + baseClass = (*env)->FindClass(env, BASE_CLASS); + CHECK_EXCEPTIONS; + errorMessageID = (*env)->GetStaticFieldID(env, baseClass, + "CALL_ERR_MSG", "Ljava/lang/String;"); + CHECK_EXCEPTIONS; + errorMessage = (*env)->GetStaticObjectField(env, baseClass, errorMessageID); + CHECK_EXCEPTIONS; + assertsClass = (*env)->FindClass(env, "jdk/test/lib/Asserts"); + CHECK_EXCEPTIONS; + assertTrue = (*env)->GetStaticMethodID(env, assertsClass, + "assertTrue", "(ZLjava/lang/String;)V"); + (*env)->CallStaticVoidMethod(env, assertsClass, assertTrue, result, + errorMessage); +} + +JNIEXPORT void JNICALL Java_compiler_calls_common_InvokeSpecial_callerNative(JNIEnv *env, jobject obj) { + doCallerWork(env, obj, NOT_STATIC); +} + +JNIEXPORT void JNICALL Java_compiler_calls_common_InvokeVirtual_callerNative(JNIEnv *env, jobject obj) { + doCallerWork(env, obj, NOT_STATIC); +} + +JNIEXPORT void JNICALL Java_compiler_calls_common_InvokeStatic_callerNative(JNIEnv *env, jobject obj) { + doCallerWork(env, obj, IS_STATIC); +} + +#ifdef __cplusplus +} +#endif diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2CompiledTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2CompiledTest.java new file mode 100644 index 00000000000..dd4daef9849 --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2CompiledTest.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeDynamic + * @build compiler.calls.common.InvokeDynamicPatcher + * @run driver compiler.calls.common.InvokeDynamicPatcher + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeDynamic + * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeDynamic + * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 4 -checkCalleeCompileLevel 4 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeDynamic + * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeDynamic + * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 4 -checkCalleeCompileLevel 4 + * @summary check calls from compiled to compiled using InvokeDynamic + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2InterpretedTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2InterpretedTest.java new file mode 100644 index 00000000000..3074acbc1a8 --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2InterpretedTest.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeDynamic + * @build compiler.calls.common.InvokeDynamicPatcher + * @run driver compiler.calls.common.InvokeDynamicPatcher + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::callee compiler.calls.common.InvokeDynamic + * -compileCaller 1 -checkCallerCompileLevel 1 -checkCalleeCompileLevel 0 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::callee compiler.calls.common.InvokeDynamic + * -compileCaller 4 -checkCallerCompileLevel 4 -checkCalleeCompileLevel 0 + * @summary check calls from compiled to interpreted using InvokeDynamic + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java new file mode 100644 index 00000000000..b06cbf5c89c --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeDynamic + * @build compiler.calls.common.InvokeDynamicPatcher + * @run driver compiler.calls.common.InvokeDynamicPatcher + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeDynamic + * -compileCaller 1 -checkCallerCompileLevel 1 -nativeCallee + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeDynamic + * -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee + * @summary check calls from compiled to native using InvokeDynamic + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2CompiledTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2CompiledTest.java new file mode 100644 index 00000000000..fec0fda8aee --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2CompiledTest.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeInterface + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeInterface + * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeInterface + * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 4 -checkCalleeCompileLevel 4 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeInterface + * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeInterface + * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 4 -checkCalleeCompileLevel 4 + * @summary check calls from compiled to compiled using InvokeInterface + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2InterpretedTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2InterpretedTest.java new file mode 100644 index 00000000000..2baf4e7caa8 --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2InterpretedTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeInterface + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::callee compiler.calls.common.InvokeInterface + * -compileCaller 1 -checkCallerCompileLevel 1 -checkCalleeCompileLevel 0 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::callee compiler.calls.common.InvokeInterface + * -compileCaller 4 -checkCallerCompileLevel 4 -checkCalleeCompileLevel 0 + * @summary check calls from compiled to interpreted using InvokeInterface + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java new file mode 100644 index 00000000000..ec394a10f93 --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeInterface + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeInterface + * -compileCaller 1 -checkCallerCompileLevel 1 -nativeCallee + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeInterface + * -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee + * @summary check calls from compiled to native using InvokeInterface + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2CompiledTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2CompiledTest.java new file mode 100644 index 00000000000..5d659f5bbef --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2CompiledTest.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeSpecial + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeSpecial + * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeSpecial + * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 4 -checkCalleeCompileLevel 4 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeSpecial + * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeSpecial + * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 4 -checkCalleeCompileLevel 4 + * @summary check calls from compiled to compiled using InvokeSpecial + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2InterpretedTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2InterpretedTest.java new file mode 100644 index 00000000000..1a6c6c9ec17 --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2InterpretedTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeSpecial + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::callee compiler.calls.common.InvokeSpecial + * -compileCaller 1 -checkCallerCompileLevel 1 -checkCalleeCompileLevel 0 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::callee compiler.calls.common.InvokeSpecial + * -compileCaller 4 -checkCallerCompileLevel 4 -checkCalleeCompileLevel 0 + * @summary check calls from compiled to interpreted using InvokeSpecial + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java new file mode 100644 index 00000000000..e1b64749d22 --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeSpecial + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeSpecial + * -compileCaller 1 -checkCallerCompileLevel 1 -nativeCallee + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeSpecial + * -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee + * @summary check calls from compiled to native using InvokeSpecial + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2CompiledTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2CompiledTest.java new file mode 100644 index 00000000000..f31ef6ba9ff --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2CompiledTest.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeStatic + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeStatic + * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeStatic + * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 4 -checkCalleeCompileLevel 4 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeStatic + * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeStatic + * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 4 -checkCalleeCompileLevel 4 + * @summary check calls from compiled to compiled using InvokeStatic + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2InterpretedTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2InterpretedTest.java new file mode 100644 index 00000000000..8a8b8565a05 --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2InterpretedTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeStatic + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::callee compiler.calls.common.InvokeStatic + * -compileCaller 1 -checkCallerCompileLevel 1 -checkCalleeCompileLevel 0 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::callee compiler.calls.common.InvokeStatic + * -compileCaller 4 -checkCallerCompileLevel 4 -checkCalleeCompileLevel 0 + * @summary check calls from compiled to interpreted using InvokeStatic + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java new file mode 100644 index 00000000000..955a727f00b --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeStatic + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeStatic + * -compileCaller 1 -checkCallerCompileLevel 1 -nativeCallee + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeStatic + * -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee + * @summary check calls from compiled to native using InvokeStatic + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2CompiledTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2CompiledTest.java new file mode 100644 index 00000000000..53fb39ac117 --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2CompiledTest.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeVirtual + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeVirtual + * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeVirtual + * -compileCaller 1 -checkCallerCompileLevel 1 -compileCallee 4 -checkCalleeCompileLevel 4 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeVirtual + * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeVirtual + * -compileCaller 4 -checkCallerCompileLevel 4 -compileCallee 4 -checkCalleeCompileLevel 4 + * @summary check calls from compiled to compiled using InvokeVirtual + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2InterpretedTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2InterpretedTest.java new file mode 100644 index 00000000000..d875be780df --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2InterpretedTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeVirtual + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::callee compiler.calls.common.InvokeVirtual + * -compileCaller 1 -checkCallerCompileLevel 1 -checkCalleeCompileLevel 0 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::callee compiler.calls.common.InvokeVirtual + * -compileCaller 4 -checkCallerCompileLevel 4 -checkCalleeCompileLevel 0 + * @summary check calls from compiled to interpreted using InvokeVirtual + */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java new file mode 100644 index 00000000000..0f69bb50cf4 --- /dev/null +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeVirtual + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeVirtual + * -compileCaller 1 -checkCallerCompileLevel 1 -nativeCallee + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeVirtual + * -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee + * @summary check calls from compiled to native using InvokeVirtual + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2CompiledTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2CompiledTest.java new file mode 100644 index 00000000000..28b38025db6 --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2CompiledTest.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeDynamic + * @build compiler.calls.common.InvokeDynamicPatcher + * @run driver compiler.calls.common.InvokeDynamicPatcher + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::caller -Xbatch compiler.calls.common.InvokeDynamic + * -checkCallerCompileLevel 0 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::caller -Xbatch compiler.calls.common.InvokeDynamic + * -checkCallerCompileLevel 0 -compileCallee 4 -checkCalleeCompileLevel 4 + * @summary check calls from interpreted to compiled using InvokeDynamic + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2InterpretedTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2InterpretedTest.java new file mode 100644 index 00000000000..3359e8104be --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2InterpretedTest.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeDynamic + * @build compiler.calls.common.InvokeDynamicPatcher + * @run driver compiler.calls.common.InvokeDynamicPatcher + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::caller -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::callee compiler.calls.common.InvokeDynamic + * -checkCallerCompileLevel 0 -checkCalleeCompileLevel 0 + * @summary check calls from interpreted to interpreted using InvokeDynamic + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java new file mode 100644 index 00000000000..03fbfdda2a4 --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeDynamic + * @build compiler.calls.common.InvokeDynamicPatcher + * @run driver compiler.calls.common.InvokeDynamicPatcher + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::caller compiler.calls.common.InvokeDynamic + * -checkCallerCompileLevel 0 -nativeCallee + * @summary check calls from interpreted to native using InvokeDynamic + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2CompiledTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2CompiledTest.java new file mode 100644 index 00000000000..84b4e5016ca --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2CompiledTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeInterface + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::caller -Xbatch compiler.calls.common.InvokeInterface + * -checkCallerCompileLevel 0 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::caller -Xbatch compiler.calls.common.InvokeInterface + * -checkCallerCompileLevel 0 -compileCallee 4 -checkCalleeCompileLevel 4 + * @summary check calls from interpreted to compiled using InvokeInterface + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2InterpretedTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2InterpretedTest.java new file mode 100644 index 00000000000..a4f204f1d34 --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2InterpretedTest.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeInterface + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::caller -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::callee compiler.calls.common.InvokeInterface + * -checkCallerCompileLevel 0 -checkCalleeCompileLevel 0 + * @summary check calls from interpreted to interpreted using InvokeInterface + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java new file mode 100644 index 00000000000..ca0044524e0 --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeInterface + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::caller compiler.calls.common.InvokeInterface + * -checkCallerCompileLevel 0 -nativeCallee + * @summary check calls from interpreted to native using InvokeInterface + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2CompiledTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2CompiledTest.java new file mode 100644 index 00000000000..d47585abf29 --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2CompiledTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeSpecial + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::caller -Xbatch compiler.calls.common.InvokeSpecial + * -checkCallerCompileLevel 0 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::caller -Xbatch compiler.calls.common.InvokeSpecial + * -checkCallerCompileLevel 0 -compileCallee 4 -checkCalleeCompileLevel 4 + * @summary check calls from interpreted to compiled using InvokeSpecial + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2InterpretedTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2InterpretedTest.java new file mode 100644 index 00000000000..9c047fa9502 --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2InterpretedTest.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeSpecial + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::caller -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::callee compiler.calls.common.InvokeSpecial + * -checkCallerCompileLevel 0 -checkCalleeCompileLevel 0 + * @summary check calls from interpreted to interpreted using InvokeSpecial + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java new file mode 100644 index 00000000000..768d5eb9dae --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeSpecial + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::caller compiler.calls.common.InvokeSpecial + * -checkCallerCompileLevel 0 -nativeCallee + * @summary check calls from interpreted to native using InvokeSpecial + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2CompiledTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2CompiledTest.java new file mode 100644 index 00000000000..de4f6c2b995 --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2CompiledTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeStatic + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::caller -Xbatch compiler.calls.common.InvokeStatic + * -checkCallerCompileLevel 0 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::caller -Xbatch compiler.calls.common.InvokeStatic + * -checkCallerCompileLevel 0 -compileCallee 4 -checkCalleeCompileLevel 4 + * @summary check calls from interpreted to compiled using InvokeStatic + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2InterpretedTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2InterpretedTest.java new file mode 100644 index 00000000000..06339099281 --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2InterpretedTest.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeStatic + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::caller -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::callee compiler.calls.common.InvokeStatic + * -checkCallerCompileLevel 0 -checkCalleeCompileLevel 0 + * @summary check calls from interpreted to interpreted using InvokeStatic + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java new file mode 100644 index 00000000000..2a7deda7655 --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeStatic + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::caller compiler.calls.common.InvokeStatic + * -checkCallerCompileLevel 0 -nativeCallee + * @summary check calls from interpreted to native using InvokeStatic + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2CompiledTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2CompiledTest.java new file mode 100644 index 00000000000..fb7a645ec8d --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2CompiledTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeVirtual + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::caller -Xbatch compiler.calls.common.InvokeVirtual + * -checkCallerCompileLevel 0 -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::caller -Xbatch compiler.calls.common.InvokeVirtual + * -checkCallerCompileLevel 0 -compileCallee 4 -checkCalleeCompileLevel 4 + * @summary check calls from interpreted to compiled using InvokeVirtual + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2InterpretedTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2InterpretedTest.java new file mode 100644 index 00000000000..c4eecef1d80 --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2InterpretedTest.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeVirtual + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::caller -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::callee compiler.calls.common.InvokeVirtual + * -checkCallerCompileLevel 0 -checkCalleeCompileLevel 0 + * @summary check calls from interpreted to interpreted using InvokeVirtual + */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java new file mode 100644 index 00000000000..2ac9911b4d3 --- /dev/null +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeVirtual + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::caller compiler.calls.common.InvokeVirtual + * -checkCallerCompileLevel 0 -nativeCallee + * @summary check calls from interpreted to native using InvokeVirtual + */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java new file mode 100644 index 00000000000..1a303bdf088 --- /dev/null +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeSpecial + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeSpecial + * -nativeCaller -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeSpecial + * -nativeCaller -compileCallee 4 -checkCalleeCompileLevel 4 + * @summary check calls from native to compiled using InvokeSpecial + */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java new file mode 100644 index 00000000000..517422adf6e --- /dev/null +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeSpecial + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::callee compiler.calls.common.InvokeSpecial + * -nativeCaller -checkCalleeCompileLevel 0 + * @summary check calls from native to interpreted using InvokeSpecial + */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java new file mode 100644 index 00000000000..9b3d7ad166a --- /dev/null +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeSpecial + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * compiler.calls.common.InvokeSpecial + * -nativeCaller -nativeCallee + * @summary check calls from native to native using InvokeSpecial + */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java new file mode 100644 index 00000000000..546ed827801 --- /dev/null +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeStatic + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeStatic + * -nativeCaller -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeStatic + * -nativeCaller -compileCallee 4 -checkCalleeCompileLevel 4 + * @summary check calls from native to compiled using InvokeStatic + */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java new file mode 100644 index 00000000000..5e480d82f36 --- /dev/null +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeStatic + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::callee compiler.calls.common.InvokeStatic + * -nativeCaller -checkCalleeCompileLevel 0 + * @summary check calls from native to interpreted using InvokeStatic + */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java new file mode 100644 index 00000000000..9ace6ea67b5 --- /dev/null +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeStatic + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * compiler.calls.common.InvokeStatic + * -nativeCaller -nativeCallee + * @summary check calls from native to native using InvokeStatic + */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java new file mode 100644 index 00000000000..56059718e81 --- /dev/null +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeVirtual + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeVirtual + * -nativeCaller -compileCallee 1 -checkCalleeCompileLevel 1 + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -Xbatch compiler.calls.common.InvokeVirtual + * -nativeCaller -compileCallee 4 -checkCalleeCompileLevel 4 + * @summary check calls from native to compiled using InvokeVirtual + */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java new file mode 100644 index 00000000000..09777265bc3 --- /dev/null +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeVirtual + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::callee compiler.calls.common.InvokeVirtual + * -nativeCaller -checkCalleeCompileLevel 0 + * @summary check calls from native to interpreted using InvokeVirtual + */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java new file mode 100644 index 00000000000..d4ddd119fc3 --- /dev/null +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib /testlibrary / + * @build compiler.calls.common.InvokeVirtual + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * compiler.calls.common.InvokeVirtual + * -nativeCaller -nativeCallee + * @summary check calls from native to native using InvokeVirtual + */ From 8c0ad215bc399e86467b76ef5240aa8f4aded866 Mon Sep 17 00:00:00 2001 From: Nils Eliasson Date: Wed, 16 Dec 2015 15:38:28 +0100 Subject: [PATCH 052/146] 8144246: adding lots of directives via jcmd may produce OOM crash Add a limit to the number of directives Reviewed-by: kvn --- .../src/share/vm/compiler/compileBroker.cpp | 2 +- .../share/vm/compiler/compilerDirectives.cpp | 8 +++++ .../share/vm/compiler/compilerDirectives.hpp | 1 + .../share/vm/compiler/directivesParser.cpp | 32 ++++++++++++++++--- .../share/vm/compiler/directivesParser.hpp | 2 ++ hotspot/src/share/vm/runtime/globals.hpp | 7 ++-- hotspot/src/share/vm/utilities/json.cpp | 1 - .../parser/DirectiveStressTest.java | 2 +- .../parser/HugeDirectiveUtil.java | 1 + 9 files changed, 46 insertions(+), 10 deletions(-) diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp index 9881a31435e..eea5af567bd 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.cpp +++ b/hotspot/src/share/vm/compiler/compileBroker.cpp @@ -215,7 +215,7 @@ bool compileBroker_init() { if (DirectivesParser::has_file()) { return DirectivesParser::parse_from_flag(); - } else if (PrintCompilerDirectives) { + } else if (CompilerDirectivesPrint) { // Print default directive even when no other was added DirectivesStack::print(tty); } diff --git a/hotspot/src/share/vm/compiler/compilerDirectives.cpp b/hotspot/src/share/vm/compiler/compilerDirectives.cpp index 4d10aec5307..3d1c9a2fcb1 100644 --- a/hotspot/src/share/vm/compiler/compilerDirectives.cpp +++ b/hotspot/src/share/vm/compiler/compilerDirectives.cpp @@ -487,6 +487,14 @@ void DirectivesStack::pop_inner() { DirectivesStack::release(tmp); } +bool DirectivesStack::check_capacity(int request_size, outputStream* st) { + if ((request_size + _depth) > CompilerDirectivesLimit) { + st->print_cr("Could not add %i more directives. Currently %i/%i directives.", request_size, _depth, CompilerDirectivesLimit); + return false; + } + return true; +} + void DirectivesStack::clear() { // holding the lock during the whole operation ensuring consistent result MutexLockerEx locker(DirectivesStack_lock, Mutex::_no_safepoint_check_flag); diff --git a/hotspot/src/share/vm/compiler/compilerDirectives.hpp b/hotspot/src/share/vm/compiler/compilerDirectives.hpp index 421012c687e..e345a54ee5a 100644 --- a/hotspot/src/share/vm/compiler/compilerDirectives.hpp +++ b/hotspot/src/share/vm/compiler/compilerDirectives.hpp @@ -89,6 +89,7 @@ public: static DirectiveSet* getDefaultDirective(AbstractCompiler* comp); static void push(CompilerDirectives* directive); static void pop(); + static bool check_capacity(int request_size, outputStream* st); static void clear(); static void print(outputStream* st); static void release(DirectiveSet* set); diff --git a/hotspot/src/share/vm/compiler/directivesParser.cpp b/hotspot/src/share/vm/compiler/directivesParser.cpp index 7c2b15404ac..bd69cf1799e 100644 --- a/hotspot/src/share/vm/compiler/directivesParser.cpp +++ b/hotspot/src/share/vm/compiler/directivesParser.cpp @@ -30,6 +30,7 @@ #include void DirectivesParser::push_tmp(CompilerDirectives* dir) { + _tmp_depth++; dir->set_next(_tmp_top); _tmp_top = dir; } @@ -41,17 +42,29 @@ CompilerDirectives* DirectivesParser::pop_tmp() { CompilerDirectives* tmp = _tmp_top; _tmp_top = _tmp_top->next(); tmp->set_next(NULL); + _tmp_depth--; return tmp; } +void DirectivesParser::clean_tmp() { + CompilerDirectives* tmp = pop_tmp(); + while (tmp != NULL) { + delete tmp; + tmp = pop_tmp(); + } + assert(_tmp_depth == 0, "Consistency"); +} + bool DirectivesParser::parse_string(const char* text, outputStream* st) { DirectivesParser cd(text, st); if (cd.valid()) { return cd.install_directives(); + } else { + cd.clean_tmp(); + st->flush(); + st->print_cr("Parsing of compiler directives failed"); + return false; } - st->flush(); - st->print_cr("Parsing of compiler directives failed"); - return false; } bool DirectivesParser::has_file() { @@ -91,6 +104,12 @@ bool DirectivesParser::parse_from_file_inner(const char* filename, outputStream* } bool DirectivesParser::install_directives() { + // Check limit + if (!DirectivesStack::check_capacity(_tmp_depth, _st)) { + clean_tmp(); + return false; + } + // Pop from internal temporary stack and push to compileBroker. CompilerDirectives* tmp = pop_tmp(); int i = 0; @@ -104,7 +123,7 @@ bool DirectivesParser::install_directives() { return false; } else { _st->print_cr("%i compiler directives added", i); - if (PrintCompilerDirectives) { + if (CompilerDirectivesPrint) { // Print entire directives stack after new has been pushed. DirectivesStack::print(_st); } @@ -113,7 +132,7 @@ bool DirectivesParser::install_directives() { } DirectivesParser::DirectivesParser(const char* text, outputStream* st) -: JSON(text, false, st), depth(0), current_directive(NULL), current_directiveset(NULL), _tmp_top(NULL) { +: JSON(text, false, st), depth(0), current_directive(NULL), current_directiveset(NULL), _tmp_top(NULL), _tmp_depth(0) { #ifndef PRODUCT memset(stack, 0, MAX_DEPTH * sizeof(stack[0])); #endif @@ -121,6 +140,8 @@ DirectivesParser::DirectivesParser(const char* text, outputStream* st) } DirectivesParser::~DirectivesParser() { + assert(_tmp_top == NULL, "Consistency"); + assert(_tmp_depth == 0, "Consistency"); } const DirectivesParser::key DirectivesParser::keys[] = { @@ -584,6 +605,7 @@ void DirectivesParser::test(const char* text, bool should_pass) { tty->print("-- DirectivesParser test failed as expected --\n"); } } + cd.clean_tmp(); } bool DirectivesParser::test() { diff --git a/hotspot/src/share/vm/compiler/directivesParser.hpp b/hotspot/src/share/vm/compiler/directivesParser.hpp index 9defc95fab9..d0d7eb31388 100644 --- a/hotspot/src/share/vm/compiler/directivesParser.hpp +++ b/hotspot/src/share/vm/compiler/directivesParser.hpp @@ -126,8 +126,10 @@ private: DirectiveSet* current_directiveset; void push_tmp(CompilerDirectives* dir); + void clean_tmp(); CompilerDirectives* pop_tmp(); CompilerDirectives* _tmp_top; // temporary storage for dirs while parsing + int _tmp_depth; // Number of directives that has been parsed but not installed. static uint mask(keytype kt); diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index acfcd6735f4..eef5fbb3120 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -4268,8 +4268,11 @@ public: diagnostic(bool, CompilerDirectivesIgnoreCompileCommands, false, \ "Disable backwards compatibility for compile commands.") \ \ - diagnostic(bool, PrintCompilerDirectives, false, \ - "Print compiler directives on installation.") + diagnostic(bool, CompilerDirectivesPrint, false, \ + "Print compiler directives on installation.") \ + diagnostic(int, CompilerDirectivesLimit, 50, \ + "Limit on number of compiler directives.") + /* * Macros for factoring of globals diff --git a/hotspot/src/share/vm/utilities/json.cpp b/hotspot/src/share/vm/utilities/json.cpp index e7df3d0de70..2064bb81e7a 100644 --- a/hotspot/src/share/vm/utilities/json.cpp +++ b/hotspot/src/share/vm/utilities/json.cpp @@ -750,7 +750,6 @@ bool JSONTest::test() { JSONTest::test("{ key : 1 }", true); JSONTest::test("{ key : 1, }", true); - JSONTest::test("{ key : 1.2 }", true); JSONTest::test("{ key : true }", true); JSONTest::test("{ key : true, }", true); JSONTest::test("{ key : false }", true); diff --git a/hotspot/test/compiler/compilercontrol/parser/DirectiveStressTest.java b/hotspot/test/compiler/compilercontrol/parser/DirectiveStressTest.java index 8e23273e643..ef1a311beca 100644 --- a/hotspot/test/compiler/compilercontrol/parser/DirectiveStressTest.java +++ b/hotspot/test/compiler/compilercontrol/parser/DirectiveStressTest.java @@ -44,7 +44,7 @@ import java.util.stream.Collectors; public class DirectiveStressTest { private static final int AMOUNT = Integer.getInteger( "compiler.compilercontrol.parser.DirectiveStressTest.amount", - Short.MAX_VALUE * 2 + 2); + 999); private static final List DESCRIPTORS = new PoolHelper().getAllMethods().stream() .map(pair -> AbstractTestBase.getValidMethodDescriptor( diff --git a/hotspot/test/compiler/compilercontrol/parser/HugeDirectiveUtil.java b/hotspot/test/compiler/compilercontrol/parser/HugeDirectiveUtil.java index d5100ccc33d..6bf59324810 100644 --- a/hotspot/test/compiler/compilercontrol/parser/HugeDirectiveUtil.java +++ b/hotspot/test/compiler/compilercontrol/parser/HugeDirectiveUtil.java @@ -117,6 +117,7 @@ public final class HugeDirectiveUtil { try { output = ProcessTools.executeTestJvm( "-XX:+UnlockDiagnosticVMOptions", + "-XX:CompilerDirectivesLimit=1000", "-XX:CompilerDirectivesFile=" + fileName, "-version"); } catch (Throwable thr) { From 2bb757d0eb1999b86bc983d5bcec6c79ed2a0ef3 Mon Sep 17 00:00:00 2001 From: Nils Eliasson Date: Wed, 16 Dec 2015 15:39:11 +0100 Subject: [PATCH 053/146] 8145345: LogCompilation output is empty after JEP165: Compiler Control Fix default init and compilecommand update Reviewed-by: kvn --- .../share/vm/compiler/compilerDirectives.cpp | 21 ++++++++++++------- .../share/vm/compiler/compilerDirectives.hpp | 6 +++--- .../share/vm/compiler/directivesParser.cpp | 2 +- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/hotspot/src/share/vm/compiler/compilerDirectives.cpp b/hotspot/src/share/vm/compiler/compilerDirectives.cpp index 3d1c9a2fcb1..4f6162a96eb 100644 --- a/hotspot/src/share/vm/compiler/compilerDirectives.cpp +++ b/hotspot/src/share/vm/compiler/compilerDirectives.cpp @@ -86,16 +86,21 @@ void CompilerDirectives::print(outputStream* st) { //--- } -void CompilerDirectives::finalize() { +void CompilerDirectives::finalize(outputStream* st) { if (_c1_store != NULL) { - _c1_store->finalize(); + _c1_store->finalize(st); } if (_c2_store != NULL) { - _c2_store->finalize(); + _c2_store->finalize(st); } } -void DirectiveSet::finalize() { +void DirectiveSet::finalize(outputStream* st) { + // Check LogOption and warn + if (LogOption && !LogCompilation) { + st->print_cr("Warning: +LogCompilation must be set to enable compilation logging from directives"); + } + // if any flag has been modified - set directive as enabled // unless it already has been explicitly set. if (!_modified[EnableIndex]) { @@ -252,12 +257,14 @@ DirectiveSet* DirectiveSet::compilecommand_compatibility_init(methodHandle metho changed = true; } } - if (CompilerOracle::should_log(method)) { - if (!_modified[LogIndex]) { - set->LogOption = true; + if (!_modified[LogIndex]) { + bool log = CompilerOracle::should_log(method); + if (log != set->LogOption) { + set->LogOption = log; changed = true; } } + if (CompilerOracle::should_print(method)) { if (!_modified[PrintAssemblyIndex]) { set->PrintAssemblyOption = true; diff --git a/hotspot/src/share/vm/compiler/compilerDirectives.hpp b/hotspot/src/share/vm/compiler/compilerDirectives.hpp index e345a54ee5a..1720aa4c4b3 100644 --- a/hotspot/src/share/vm/compiler/compilerDirectives.hpp +++ b/hotspot/src/share/vm/compiler/compilerDirectives.hpp @@ -39,7 +39,7 @@ cflags(Exclude, bool, false, X) \ cflags(BreakAtExecute, bool, false, X) \ cflags(BreakAtCompile, bool, false, X) \ - cflags(Log, bool, false, X) \ + cflags(Log, bool, LogCompilation, X) \ cflags(PrintAssembly, bool, PrintAssembly, PrintAssembly) \ cflags(PrintInlining, bool, PrintInlining, PrintInlining) \ cflags(PrintNMethods, bool, PrintNMethods, PrintNMethods) \ @@ -117,7 +117,7 @@ public: bool matches_inline(methodHandle method, int inline_action); static DirectiveSet* clone(DirectiveSet const* src); bool is_intrinsic_disabled(methodHandle method); - void finalize(); + void finalize(outputStream* st); typedef enum { #define enum_of_flags(name, type, dvalue, cc_flag) name##Index, @@ -177,7 +177,7 @@ public: DirectiveSet* get_for(AbstractCompiler *comp); void print(outputStream* st); bool is_default_directive() { return _next == NULL; } - void finalize(); + void finalize(outputStream* st); void inc_refcount(); void dec_refcount(); diff --git a/hotspot/src/share/vm/compiler/directivesParser.cpp b/hotspot/src/share/vm/compiler/directivesParser.cpp index bd69cf1799e..16720ceb4db 100644 --- a/hotspot/src/share/vm/compiler/directivesParser.cpp +++ b/hotspot/src/share/vm/compiler/directivesParser.cpp @@ -542,7 +542,7 @@ bool DirectivesParser::callback(JSON_TYPE t, JSON_VAL* v, uint rlimit) { error(INTERNAL_ERROR, "Directive missing required match."); return false; } - current_directive->finalize(); + current_directive->finalize(_st); push_tmp(current_directive); current_directive = NULL; break; From 74cff677d4c9acd1b566442eb09e197a015831f6 Mon Sep 17 00:00:00 2001 From: Nils Eliasson Date: Wed, 9 Dec 2015 13:37:59 +0100 Subject: [PATCH 054/146] 8144091: CompilerControl: directive file doesn't override inlining rules Fix correct overrides Reviewed-by: roland --- .../share/vm/compiler/compilerDirectives.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/hotspot/src/share/vm/compiler/compilerDirectives.cpp b/hotspot/src/share/vm/compiler/compilerDirectives.cpp index 4f6162a96eb..6ffeaa5a6c4 100644 --- a/hotspot/src/share/vm/compiler/compilerDirectives.cpp +++ b/hotspot/src/share/vm/compiler/compilerDirectives.cpp @@ -313,7 +313,7 @@ CompilerDirectives* DirectiveSet::directive() { bool DirectiveSet::matches_inline(methodHandle method, int inline_action) { if (_inlinematchers != NULL) { - if (_inlinematchers->match(method, InlineMatcher::force_inline)) { + if (_inlinematchers->match(method, inline_action)) { return true; } } @@ -325,11 +325,11 @@ bool DirectiveSet::should_inline(ciMethod* inlinee) { VM_ENTRY_MARK; methodHandle mh(THREAD, inlinee->get_Method()); - if (matches_inline(mh, InlineMatcher::force_inline)) { - return true; + if (_inlinematchers != NULL) { + return matches_inline(mh, InlineMatcher::force_inline); } - if (!CompilerDirectivesIgnoreCompileCommandsOption && CompilerOracle::should_inline(mh)) { - return true; + if (!CompilerDirectivesIgnoreCompileCommandsOption) { + return CompilerOracle::should_inline(mh); } return false; } @@ -339,11 +339,11 @@ bool DirectiveSet::should_not_inline(ciMethod* inlinee) { VM_ENTRY_MARK; methodHandle mh(THREAD, inlinee->get_Method()); - if (matches_inline(mh, InlineMatcher::dont_inline)) { - return true; + if (_inlinematchers != NULL) { + return matches_inline(mh, InlineMatcher::dont_inline); } - if (!CompilerDirectivesIgnoreCompileCommandsOption && CompilerOracle::should_not_inline(mh)) { - return true; + if (!CompilerDirectivesIgnoreCompileCommandsOption) { + return CompilerOracle::should_not_inline(mh); } return false; } From 6996edcbb5af817d4ad616bef6714e2ed9364432 Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Wed, 9 Dec 2015 14:56:02 +0100 Subject: [PATCH 055/146] 8144219: [posix] Remove redundant code around os::print_siginfo() For posix platforms, consolidate os::print_siginfo() in os_posix.cpp and remove cds fault special handling Reviewed-by: dholmes, simonis --- hotspot/src/os/aix/vm/os_aix.cpp | 5 -- hotspot/src/os/bsd/vm/os_bsd.cpp | 18 ------- hotspot/src/os/linux/vm/os_linux.cpp | 19 -------- hotspot/src/os/posix/vm/os_posix.cpp | 48 +++++++++++-------- hotspot/src/os/posix/vm/os_posix.hpp | 3 -- hotspot/src/os/posix/vm/vmError_posix.cpp | 20 ++++++++ hotspot/src/os/solaris/vm/os_solaris.cpp | 17 ------- hotspot/src/os/windows/vm/os_windows.cpp | 13 +---- hotspot/src/os/windows/vm/vmError_windows.cpp | 20 ++++++++ hotspot/src/share/vm/runtime/os.hpp | 2 +- hotspot/src/share/vm/utilities/vmError.cpp | 8 ++++ hotspot/src/share/vm/utilities/vmError.hpp | 4 ++ 12 files changed, 84 insertions(+), 93 deletions(-) diff --git a/hotspot/src/os/aix/vm/os_aix.cpp b/hotspot/src/os/aix/vm/os_aix.cpp index 560fe57ea54..691ee9b8fb7 100644 --- a/hotspot/src/os/aix/vm/os_aix.cpp +++ b/hotspot/src/os/aix/vm/os_aix.cpp @@ -1647,11 +1647,6 @@ void os::pd_print_cpu_info(outputStream* st, char* buf, size_t buflen) { st->cr(); } -void os::print_siginfo(outputStream* st, void* siginfo) { - os::Posix::print_siginfo_brief(st, (const siginfo_t*) siginfo); - st->cr(); -} - static void print_signal_handler(outputStream* st, int sig, char* buf, size_t buflen); diff --git a/hotspot/src/os/bsd/vm/os_bsd.cpp b/hotspot/src/os/bsd/vm/os_bsd.cpp index 0ce150c9989..891a66b8d25 100644 --- a/hotspot/src/os/bsd/vm/os_bsd.cpp +++ b/hotspot/src/os/bsd/vm/os_bsd.cpp @@ -1710,24 +1710,6 @@ void os::print_memory_info(outputStream* st) { st->cr(); } -void os::print_siginfo(outputStream* st, void* siginfo) { - const siginfo_t* si = (const siginfo_t*)siginfo; - - os::Posix::print_siginfo_brief(st, si); - - if (si && (si->si_signo == SIGBUS || si->si_signo == SIGSEGV) && - UseSharedSpaces) { - FileMapInfo* mapinfo = FileMapInfo::current_info(); - if (mapinfo->is_in_shared_space(si->si_addr)) { - st->print("\n\nError accessing class data sharing archive." \ - " Mapped file inaccessible during execution, " \ - " possible disk/network problem."); - } - } - st->cr(); -} - - static void print_signal_handler(outputStream* st, int sig, char* buf, size_t buflen); diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp index d667b561773..4b8cb0bbde1 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -2237,25 +2237,6 @@ void os::get_summary_cpu_info(char* cpuinfo, size_t length) { #endif } -void os::print_siginfo(outputStream* st, void* siginfo) { - const siginfo_t* si = (const siginfo_t*)siginfo; - - os::Posix::print_siginfo_brief(st, si); -#if INCLUDE_CDS - if (si && (si->si_signo == SIGBUS || si->si_signo == SIGSEGV) && - UseSharedSpaces) { - FileMapInfo* mapinfo = FileMapInfo::current_info(); - if (mapinfo->is_in_shared_space(si->si_addr)) { - st->print("\n\nError accessing class data sharing archive." \ - " Mapped file inaccessible during execution, " \ - " possible disk/network problem."); - } - } -#endif - st->cr(); -} - - static void print_signal_handler(outputStream* st, int sig, char* buf, size_t buflen); diff --git a/hotspot/src/os/posix/vm/os_posix.cpp b/hotspot/src/os/posix/vm/os_posix.cpp index 8e442f3dfcd..029004337cd 100644 --- a/hotspot/src/os/posix/vm/os_posix.cpp +++ b/hotspot/src/os/posix/vm/os_posix.cpp @@ -981,50 +981,60 @@ static bool get_signal_code_description(const siginfo_t* si, enum_sigcode_desc_t return true; } -// A POSIX conform, platform-independend siginfo print routine. -// Short print out on one line. -void os::Posix::print_siginfo_brief(outputStream* os, const siginfo_t* si) { +void os::print_siginfo(outputStream* os, const void* si0) { + + const siginfo_t* const si = (const siginfo_t*) si0; + char buf[20]; - os->print("siginfo: "); + os->print("siginfo:"); if (!si) { - os->print(""); + os->print(" "); return; } - // See print_siginfo_full() for details. const int sig = si->si_signo; - os->print("si_signo: %d (%s)", sig, os::Posix::get_signal_name(sig, buf, sizeof(buf))); + os->print(" si_signo: %d (%s)", sig, os::Posix::get_signal_name(sig, buf, sizeof(buf))); enum_sigcode_desc_t ed; - if (get_signal_code_description(si, &ed)) { - os->print(", si_code: %d (%s)", si->si_code, ed.s_name); - } else { - os->print(", si_code: %d (unknown)", si->si_code); - } + get_signal_code_description(si, &ed); + os->print(", si_code: %d (%s)", si->si_code, ed.s_name); if (si->si_errno) { os->print(", si_errno: %d", si->si_errno); } - const int me = (int) ::getpid(); - const int pid = (int) si->si_pid; + // Output additional information depending on the signal code. + // Note: Many implementations lump si_addr, si_pid, si_uid etc. together as unions, + // so it depends on the context which member to use. For synchronous error signals, + // we print si_addr, unless the signal was sent by another process or thread, in + // which case we print out pid or tid of the sender. if (si->si_code == SI_USER || si->si_code == SI_QUEUE) { - if (IS_VALID_PID(pid) && pid != me) { - os->print(", sent from pid: %d (uid: %d)", pid, (int) si->si_uid); + const pid_t pid = si->si_pid; + os->print(", si_pid: %ld", (long) pid); + if (IS_VALID_PID(pid)) { + const pid_t me = getpid(); + if (me == pid) { + os->print(" (current process)"); + } + } else { + os->print(" (invalid)"); + } + os->print(", si_uid: %ld", (long) si->si_uid); + if (sig == SIGCHLD) { + os->print(", si_status: %d", si->si_status); } } else if (sig == SIGSEGV || sig == SIGBUS || sig == SIGILL || sig == SIGTRAP || sig == SIGFPE) { os->print(", si_addr: " PTR_FORMAT, p2i(si->si_addr)); #ifdef SIGPOLL } else if (sig == SIGPOLL) { - os->print(", si_band: " PTR64_FORMAT, (uint64_t)si->si_band); + os->print(", si_band: %ld", si->si_band); #endif - } else if (sig == SIGCHLD) { - os->print_cr(", si_pid: %d, si_uid: %d, si_status: %d", (int) si->si_pid, si->si_uid, si->si_status); } + } int os::Posix::unblock_thread_signal_mask(const sigset_t *set) { diff --git a/hotspot/src/os/posix/vm/os_posix.hpp b/hotspot/src/os/posix/vm/os_posix.hpp index c3d9967186c..be464ea8fa1 100644 --- a/hotspot/src/os/posix/vm/os_posix.hpp +++ b/hotspot/src/os/posix/vm/os_posix.hpp @@ -73,9 +73,6 @@ public: // Prints a one-line description of a combination of sigaction.sa_flags. static void print_sa_flags(outputStream* st, int flags); - // A POSIX conform, platform-independend siginfo print routine. - static void print_siginfo_brief(outputStream* os, const siginfo_t* si); - static address ucontext_get_pc(const ucontext_t* ctx); // Set PC into context. Needed for continuation after signal. static void ucontext_set_pc(ucontext_t* ctx, address pc); diff --git a/hotspot/src/os/posix/vm/vmError_posix.cpp b/hotspot/src/os/posix/vm/vmError_posix.cpp index 6fb04af4dd3..23cafc4aeeb 100644 --- a/hotspot/src/os/posix/vm/vmError_posix.cpp +++ b/hotspot/src/os/posix/vm/vmError_posix.cpp @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "memory/filemap.hpp" #include "runtime/arguments.hpp" #include "runtime/os.hpp" #include "runtime/thread.hpp" @@ -122,3 +123,22 @@ void VMError::reset_signal_handlers() { os::Posix::unblock_thread_signal_mask(&newset); } + +// Write a hint to the stream in case siginfo relates to a segv/bus error +// and the offending address points into CDS archive. +void VMError::check_failing_cds_access(outputStream* st, const void* siginfo) { + if (siginfo && UseSharedSpaces) { + const siginfo_t* const si = (siginfo_t*)siginfo; + if (si->si_signo == SIGBUS || si->si_signo == SIGSEGV) { + const void* const fault_addr = si->si_addr; + if (fault_addr != NULL) { + FileMapInfo* const mapinfo = FileMapInfo::current_info(); + if (mapinfo->is_in_shared_space(fault_addr)) { + st->print("Error accessing class data sharing archive. " + "Mapped file inaccessible during execution, possible disk/network problem."); + } + } + } + } +} + diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp index 5b49ce9d95f..2191b9ea658 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.cpp +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp @@ -1906,23 +1906,6 @@ void os::print_memory_info(outputStream* st) { (void) check_addr0(st); } -void os::print_siginfo(outputStream* st, void* siginfo) { - const siginfo_t* si = (const siginfo_t*)siginfo; - - os::Posix::print_siginfo_brief(st, si); - - if (si && (si->si_signo == SIGBUS || si->si_signo == SIGSEGV) && - UseSharedSpaces) { - FileMapInfo* mapinfo = FileMapInfo::current_info(); - if (mapinfo->is_in_shared_space(si->si_addr)) { - st->print("\n\nError accessing class data sharing archive." \ - " Mapped file inaccessible during execution, " \ - " possible disk/network problem."); - } - } - st->cr(); -} - // Moved from whole group, because we need them here for diagnostic // prints. #define OLDMAXSIGNUM 32 diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index e35a2810f5d..24ea2e71321 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -1798,8 +1798,8 @@ void os::print_memory_info(outputStream* st) { st->cr(); } -void os::print_siginfo(outputStream *st, void *siginfo) { - EXCEPTION_RECORD* er = (EXCEPTION_RECORD*)siginfo; +void os::print_siginfo(outputStream *st, const void* siginfo) { + const EXCEPTION_RECORD* const er = (EXCEPTION_RECORD*)siginfo; st->print("siginfo:"); char tmp[64]; @@ -1819,15 +1819,6 @@ void os::print_siginfo(outputStream *st, void *siginfo) { er->ExceptionInformation[0]); } st->print(" " INTPTR_FORMAT, er->ExceptionInformation[1]); - - if (er->ExceptionCode == EXCEPTION_IN_PAGE_ERROR && UseSharedSpaces) { - FileMapInfo* mapinfo = FileMapInfo::current_info(); - if (mapinfo->is_in_shared_space((void*)er->ExceptionInformation[1])) { - st->print("\n\nError accessing class data sharing archive." \ - " Mapped file inaccessible during execution, " \ - " possible disk/network problem."); - } - } } else { int num = er->NumberParameters; if (num > 0) { diff --git a/hotspot/src/os/windows/vm/vmError_windows.cpp b/hotspot/src/os/windows/vm/vmError_windows.cpp index d80fe55fe3b..ea6821be344 100644 --- a/hotspot/src/os/windows/vm/vmError_windows.cpp +++ b/hotspot/src/os/windows/vm/vmError_windows.cpp @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "memory/filemap.hpp" #include "runtime/arguments.hpp" #include "runtime/os.hpp" #include "runtime/thread.hpp" @@ -46,3 +47,22 @@ LONG WINAPI crash_handler(struct _EXCEPTION_POINTERS* exceptionInfo) { void VMError::reset_signal_handlers() { SetUnhandledExceptionFilter(crash_handler); } + +// Write a hint to the stream in case siginfo relates to a segv/bus error +// and the offending address points into CDS archive. +void VMError::check_failing_cds_access(outputStream* st, const void* siginfo) { + if (siginfo && UseSharedSpaces) { + const EXCEPTION_RECORD* const er = (const EXCEPTION_RECORD*)siginfo; + if (er->ExceptionCode == EXCEPTION_IN_PAGE_ERROR && + er->NumberParameters >= 2) { + const void* const fault_addr = (const void*) er->ExceptionInformation[1]; + if (fault_addr != NULL) { + FileMapInfo* const mapinfo = FileMapInfo::current_info(); + if (mapinfo->is_in_shared_space(fault_addr)) { + st->print("Error accessing class data sharing archive. " + "Mapped file inaccessible during execution, possible disk/network problem."); + } + } + } + } +} diff --git a/hotspot/src/share/vm/runtime/os.hpp b/hotspot/src/share/vm/runtime/os.hpp index bebfaaa375a..3dda79cf0ce 100644 --- a/hotspot/src/share/vm/runtime/os.hpp +++ b/hotspot/src/share/vm/runtime/os.hpp @@ -606,7 +606,7 @@ class os: AllStatic { static void print_environment_variables(outputStream* st, const char** env_list); static void print_context(outputStream* st, const void* context); static void print_register_info(outputStream* st, const void* context); - static void print_siginfo(outputStream* st, void* siginfo); + static void print_siginfo(outputStream* st, const void* siginfo); static void print_signal_handlers(outputStream* st, char* buf, size_t buflen); static void print_date_and_time(outputStream* st, char* buf, size_t buflen); diff --git a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp index c12e37526e5..23c3195db4d 100644 --- a/hotspot/src/share/vm/utilities/vmError.cpp +++ b/hotspot/src/share/vm/utilities/vmError.cpp @@ -597,6 +597,14 @@ void VMError::report(outputStream* st, bool _verbose) { st->cr(); } + STEP(245, "(CDS archive access warning)" ) + + // Print an explicit hint if we crashed on access to the CDS archive. + if (_verbose && _siginfo) { + check_failing_cds_access(st, _siginfo); + st->cr(); + } + STEP(250, "(printing register info)") // decode register contents if possible diff --git a/hotspot/src/share/vm/utilities/vmError.hpp b/hotspot/src/share/vm/utilities/vmError.hpp index e7cce398fd3..62ce62e3e30 100644 --- a/hotspot/src/share/vm/utilities/vmError.hpp +++ b/hotspot/src/share/vm/utilities/vmError.hpp @@ -92,6 +92,10 @@ class VMError : public AllStatic { return (id != OOM_MALLOC_ERROR) && (id != OOM_MMAP_ERROR); } + // Write a hint to the stream in case siginfo relates to a segv/bus error + // and the offending address points into CDS store. + static void check_failing_cds_access(outputStream* st, const void* siginfo); + static void report_and_die(Thread* thread, unsigned int sig, address pc, void* siginfo, void* context, const char* detail_fmt, ...) ATTRIBUTE_PRINTF(6, 7); static void report_and_die(const char* message, const char* detail_fmt, ...) ATTRIBUTE_PRINTF(2, 3); From ae65f88b0f3f54dd9bed0bd533f742d64d647ef3 Mon Sep 17 00:00:00 2001 From: Mikael Gerdin Date: Wed, 9 Dec 2015 16:05:24 +0100 Subject: [PATCH 056/146] 8144714: Add extension point to G1 evacuation closures Reviewed-by: ehelin, jmasa --- .../src/share/vm/gc/g1/g1CollectedHeap.hpp | 3 +++ hotspot/src/share/vm/gc/g1/g1InCSetState.hpp | 19 +++++++++++++++---- hotspot/src/share/vm/gc/g1/g1OopClosures.hpp | 2 +- .../share/vm/gc/g1/g1OopClosures.inline.hpp | 15 ++++++++++++--- .../share/vm/gc/g1/g1ParScanThreadState.hpp | 1 + .../vm/gc/g1/g1ParScanThreadState.inline.hpp | 4 ++-- .../vm/gc/g1/g1ParScanThreadState_ext.cpp | 7 +++++++ .../src/share/vm/gc/g1/g1SharedClosures.hpp | 14 +++++++------- 8 files changed, 48 insertions(+), 17 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp index cfedf798e2d..eb1292876d6 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp @@ -573,6 +573,9 @@ public: void register_old_region_with_cset(HeapRegion* r) { _in_cset_fast_test.set_in_old(r->hrm_index()); } + inline void register_ext_region_with_cset(HeapRegion* r) { + _in_cset_fast_test.set_ext(r->hrm_index()); + } void clear_in_cset(const HeapRegion* hr) { _in_cset_fast_test.clear(hr); } diff --git a/hotspot/src/share/vm/gc/g1/g1InCSetState.hpp b/hotspot/src/share/vm/gc/g1/g1InCSetState.hpp index 6490fea9ad3..8343a9c3f4d 100644 --- a/hotspot/src/share/vm/gc/g1/g1InCSetState.hpp +++ b/hotspot/src/share/vm/gc/g1/g1InCSetState.hpp @@ -53,8 +53,12 @@ struct InCSetState { // frequency of the checks. // The most common check is whether the region is in the collection set or not, // this encoding allows us to use an > 0 check. - // The other values are simply encoded in increasing generation order, which - // makes getting the next generation fast by a simple increment. + // The positive values are encoded in increasing generation order, which + // makes getting the next generation fast by a simple increment. They are also + // used to index into arrays. + // The negative values are used for objects requiring various special cases, + // for example eager reclamation of humongous objects. + Ext = -2, // Extension point Humongous = -1, // The region is humongous NotInCSet = 0, // The region is not in the collection set. Young = 1, // The region is in the collection set and a young region. @@ -76,10 +80,11 @@ struct InCSetState { bool is_humongous() const { return _value == Humongous; } bool is_young() const { return _value == Young; } bool is_old() const { return _value == Old; } + bool is_ext() const { return _value == Ext; } #ifdef ASSERT - bool is_default() const { return !is_in_cset_or_humongous(); } - bool is_valid() const { return (_value >= Humongous) && (_value < Num); } + bool is_default() const { return _value == NotInCSet; } + bool is_valid() const { return (_value >= Ext) && (_value < Num); } bool is_valid_gen() const { return (_value >= Young && _value <= Old); } #endif }; @@ -105,6 +110,12 @@ class G1InCSetStateFastTestBiasedMappedArray : public G1BiasedMappedArray +template class G1ParCopyClosure : public G1ParCopyHelper { public: G1ParCopyClosure(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) : diff --git a/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp b/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp index 82a997eca79..efad4ae2caa 100644 --- a/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp @@ -90,6 +90,8 @@ inline void G1ParScanClosure::do_oop_nv(T* p) { } else { if (state.is_humongous()) { _g1->set_humongous_is_live(obj); + } else if (state.is_ext()) { + _par_scan_state->do_oop_ext(p); } _par_scan_state->update_rs(_from, p, obj); } @@ -102,12 +104,15 @@ inline void G1ParPushHeapRSClosure::do_oop_nv(T* p) { if (!oopDesc::is_null(heap_oop)) { oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); - if (_g1->is_in_cset_or_humongous(obj)) { + const InCSetState state = _g1->in_cset_state(obj); + if (state.is_in_cset_or_humongous()) { Prefetch::write(obj->mark_addr(), 0); Prefetch::read(obj->mark_addr(), (HeapWordSize*2)); // Place on the references queue _par_scan_state->push_on_queue(p); + } else if (state.is_ext()) { + _par_scan_state->do_oop_ext(p); } else { assert(!_g1->obj_in_cs(obj), "checking"); } @@ -249,9 +254,9 @@ void G1ParCopyHelper::mark_forwarded_object(oop from_obj, oop to_obj) { _cm->grayRoot(to_obj, (size_t) from_obj->size(), _worker_id); } -template +template template -void G1ParCopyClosure::do_oop_nv(T* p) { +void G1ParCopyClosure::do_oop_nv(T* p) { T heap_oop = oopDesc::load_heap_oop(p); if (oopDesc::is_null(heap_oop)) { @@ -286,6 +291,10 @@ void G1ParCopyClosure::do_oop_nv(T* p) { if (state.is_humongous()) { _g1->set_humongous_is_live(obj); } + + if (use_ext && state.is_ext()) { + _par_scan_state->do_oop_ext(p); + } // The object is not in collection set. If we're a root scanning // closure during an initial mark pause then attempt to mark the object. if (do_mark_object == G1MarkFromRoot) { diff --git a/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.hpp b/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.hpp index 0b86e4c9c71..9f3ace0705b 100644 --- a/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.hpp +++ b/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.hpp @@ -96,6 +96,7 @@ class G1ParScanThreadState : public CHeapObj { bool verify_task(StarTask ref) const; #endif // ASSERT + template void do_oop_ext(T* ref); template void push_on_queue(T* ref); template void update_rs(HeapRegion* from, T* p, oop o) { diff --git a/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.inline.hpp b/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.inline.hpp index 86774c4723e..23d9a1bd462 100644 --- a/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/g1ParScanThreadState.inline.hpp @@ -50,8 +50,8 @@ template void G1ParScanThreadState::do_oop_evac(T* p, HeapRegion* from } else if (in_cset_state.is_humongous()) { _g1h->set_humongous_is_live(obj); } else { - assert(!in_cset_state.is_in_cset_or_humongous(), - "In_cset_state must be NotInCSet here, but is " CSETSTATE_FORMAT, in_cset_state.value()); + assert(in_cset_state.is_default() || in_cset_state.is_ext(), + "In_cset_state must be NotInCSet or Ext here, but is " CSETSTATE_FORMAT, in_cset_state.value()); } assert(obj != NULL, "Must be"); diff --git a/hotspot/src/share/vm/gc/g1/g1ParScanThreadState_ext.cpp b/hotspot/src/share/vm/gc/g1/g1ParScanThreadState_ext.cpp index 0e91d3ae448..9183f0d5a92 100644 --- a/hotspot/src/share/vm/gc/g1/g1ParScanThreadState_ext.cpp +++ b/hotspot/src/share/vm/gc/g1/g1ParScanThreadState_ext.cpp @@ -29,3 +29,10 @@ G1ParScanThreadState* G1ParScanThreadStateSet::new_par_scan_state(uint worker_id, size_t young_cset_length) { return new G1ParScanThreadState(_g1h, worker_id, young_cset_length); } + +template +void G1ParScanThreadState::do_oop_ext(T* ref) { +} + +template void G1ParScanThreadState::do_oop_ext(oop* ref); +template void G1ParScanThreadState::do_oop_ext(narrowOop* ref); diff --git a/hotspot/src/share/vm/gc/g1/g1SharedClosures.hpp b/hotspot/src/share/vm/gc/g1/g1SharedClosures.hpp index 85ee225227c..2c9352394ae 100644 --- a/hotspot/src/share/vm/gc/g1/g1SharedClosures.hpp +++ b/hotspot/src/share/vm/gc/g1/g1SharedClosures.hpp @@ -31,15 +31,15 @@ class G1CollectedHeap; class G1ParScanThreadState; // Simple holder object for a complete set of closures used by the G1 evacuation code. -template +template class G1SharedClosures VALUE_OBJ_CLASS_SPEC { public: - G1ParCopyClosure _oops; - G1ParCopyClosure _oop_in_klass; - G1KlassScanClosure _klass_in_cld_closure; - CLDToKlassAndOopClosure _clds; - G1CodeBlobClosure _codeblobs; - BufferingOopClosure _buffered_oops; + G1ParCopyClosure _oops; + G1ParCopyClosure _oop_in_klass; + G1KlassScanClosure _klass_in_cld_closure; + CLDToKlassAndOopClosure _clds; + G1CodeBlobClosure _codeblobs; + BufferingOopClosure _buffered_oops; G1SharedClosures(G1CollectedHeap* g1h, G1ParScanThreadState* pss, bool process_only_dirty_klasses, bool must_claim_cld) : _oops(g1h, pss), From a39fa54251bcb6b5284a5c7becc09ad8f71f743f Mon Sep 17 00:00:00 2001 From: Christian Tornqvist Date: Thu, 10 Dec 2015 09:42:22 -0800 Subject: [PATCH 057/146] 8015396: double a%b returns NaN for some (a,b) (|a| < inf, |b|>0) Reviewed-by: coleenp, gtriantafill --- .../src/os/windows/vm/sharedRuntimeRem.cpp | 162 ++++++++++++++++++ .../src/share/vm/runtime/sharedRuntime.cpp | 8 +- .../src/share/vm/runtime/sharedRuntime.hpp | 6 + .../test/compiler/floatingpoint/ModNaN.java | 1 - 4 files changed, 174 insertions(+), 3 deletions(-) create mode 100644 hotspot/src/os/windows/vm/sharedRuntimeRem.cpp diff --git a/hotspot/src/os/windows/vm/sharedRuntimeRem.cpp b/hotspot/src/os/windows/vm/sharedRuntimeRem.cpp new file mode 100644 index 00000000000..23b2619882d --- /dev/null +++ b/hotspot/src/os/windows/vm/sharedRuntimeRem.cpp @@ -0,0 +1,162 @@ +/* +* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* This code is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 only, as +* published by the Free Software Foundation. +* +* This code is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +* version 2 for more details (a copy is included in the LICENSE file that +* accompanied this code). +* +* You should have received a copy of the GNU General Public License version +* 2 along with this work; if not, write to the Free Software Foundation, +* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +* +* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +* or visit www.oracle.com if you need additional information or have any +* questions. +* +*/ + +#include "precompiled.hpp" + +#ifdef _WIN64 +// These are copied defines from fdlibm.h, this allows us to keep the code +// the same as in the JDK, for easier maintenance. + +#define __HI(x) *(1+(int*)&x) +#define __LO(x) *(int*)&x + +// This code is a copy of __ieee754_fmod() from the JDK's libfdlibm and is +// used as a workaround for issues with the Windows x64 CRT implementation +// of fmod. Microsoft has acknowledged that this is an issue in Visual Studio +// 2012 and forward, but has not provided a time frame for a fix other than that +// it'll not be fixed in Visual Studio 2013 or 2015. + +static const double one = 1.0, Zero[] = { 0.0, -0.0, }; + +double SharedRuntime::fmod_winx64(double x, double y) +{ + int n, hx, hy, hz, ix, iy, sx, i; + unsigned lx, ly, lz; + + hx = __HI(x); /* high word of x */ + lx = __LO(x); /* low word of x */ + hy = __HI(y); /* high word of y */ + ly = __LO(y); /* low word of y */ + sx = hx & 0x80000000; /* sign of x */ + hx ^= sx; /* |x| */ + hy &= 0x7fffffff; /* |y| */ + +#pragma warning( disable : 4146 ) + /* purge off exception values */ + if ((hy | ly) == 0 || (hx >= 0x7ff00000) || /* y=0,or x not finite */ + ((hy | ((ly | -ly) >> 31))>0x7ff00000)) /* or y is NaN */ +#pragma warning( default : 4146 ) + return (x*y) / (x*y); + if (hx <= hy) { + if ((hx> 31]; /* |x|=|y| return x*0*/ + } + + /* determine ix = ilogb(x) */ + if (hx<0x00100000) { /* subnormal x */ + if (hx == 0) { + for (ix = -1043, i = lx; i>0; i <<= 1) ix -= 1; + } + else { + for (ix = -1022, i = (hx << 11); i>0; i <<= 1) ix -= 1; + } + } + else ix = (hx >> 20) - 1023; + + /* determine iy = ilogb(y) */ + if (hy<0x00100000) { /* subnormal y */ + if (hy == 0) { + for (iy = -1043, i = ly; i>0; i <<= 1) iy -= 1; + } + else { + for (iy = -1022, i = (hy << 11); i>0; i <<= 1) iy -= 1; + } + } + else iy = (hy >> 20) - 1023; + + /* set up {hx,lx}, {hy,ly} and align y to x */ + if (ix >= -1022) + hx = 0x00100000 | (0x000fffff & hx); + else { /* subnormal x, shift x to normal */ + n = -1022 - ix; + if (n <= 31) { + hx = (hx << n) | (lx >> (32 - n)); + lx <<= n; + } + else { + hx = lx << (n - 32); + lx = 0; + } + } + if (iy >= -1022) + hy = 0x00100000 | (0x000fffff & hy); + else { /* subnormal y, shift y to normal */ + n = -1022 - iy; + if (n <= 31) { + hy = (hy << n) | (ly >> (32 - n)); + ly <<= n; + } + else { + hy = ly << (n - 32); + ly = 0; + } + } + + /* fix point fmod */ + n = ix - iy; + while (n--) { + hz = hx - hy; lz = lx - ly; if (lx> 31); lx = lx + lx; } + else { + if ((hz | lz) == 0) /* return sign(x)*0 */ + return Zero[(unsigned)sx >> 31]; + hx = hz + hz + (lz >> 31); lx = lz + lz; + } + } + hz = hx - hy; lz = lx - ly; if (lx= 0) { hx = hz; lx = lz; } + + /* convert back to floating value and restore the sign */ + if ((hx | lx) == 0) /* return sign(x)*0 */ + return Zero[(unsigned)sx >> 31]; + while (hx<0x00100000) { /* normalize x */ + hx = hx + hx + (lx >> 31); lx = lx + lx; + iy -= 1; + } + if (iy >= -1022) { /* normalize output */ + hx = ((hx - 0x00100000) | ((iy + 1023) << 20)); + __HI(x) = hx | sx; + __LO(x) = lx; + } + else { /* subnormal output */ + n = -1022 - iy; + if (n <= 20) { + lx = (lx >> n) | ((unsigned)hx << (32 - n)); + hx >>= n; + } + else if (n <= 31) { + lx = (hx << (32 - n)) | (lx >> n); hx = sx; + } + else { + lx = hx >> (n - 32); hx = sx; + } + __HI(x) = hx | sx; + __LO(x) = lx; + x *= one; /* create necessary signal */ + } + return x; /* exact output */ +} + +#endif diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp index 68440ee89cf..e1d1392131d 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp @@ -254,8 +254,10 @@ JRT_LEAF(jfloat, SharedRuntime::frem(jfloat x, jfloat y)) ((ybits.i & float_sign_mask) == float_infinity) ) { return x; } -#endif + return ((jfloat)fmod_winx64((double)x, (double)y)); +#else return ((jfloat)fmod((double)x,(double)y)); +#endif JRT_END @@ -269,8 +271,10 @@ JRT_LEAF(jdouble, SharedRuntime::drem(jdouble x, jdouble y)) ((ybits.l & double_sign_mask) == double_infinity) ) { return x; } -#endif + return ((jdouble)fmod_winx64((double)x, (double)y)); +#else return ((jdouble)fmod((double)x,(double)y)); +#endif JRT_END #ifdef __SOFTFP__ diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.hpp b/hotspot/src/share/vm/runtime/sharedRuntime.hpp index cfb63f37dee..d41145435bb 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.hpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.hpp @@ -100,6 +100,12 @@ class SharedRuntime: AllStatic { static jfloat frem(jfloat x, jfloat y); static jdouble drem(jdouble x, jdouble y); + +#ifdef _WIN64 + // Workaround for fmod issue in the Windows x64 CRT + static double fmod_winx64(double x, double y); +#endif + #ifdef __SOFTFP__ static jfloat fadd(jfloat x, jfloat y); static jfloat fsub(jfloat x, jfloat y); diff --git a/hotspot/test/compiler/floatingpoint/ModNaN.java b/hotspot/test/compiler/floatingpoint/ModNaN.java index 4cd2f4aefde..32313dd2370 100644 --- a/hotspot/test/compiler/floatingpoint/ModNaN.java +++ b/hotspot/test/compiler/floatingpoint/ModNaN.java @@ -25,7 +25,6 @@ * @test * @bug 8015396 * @summary double a%b returns NaN for some (a,b) (|a| < inf, |b|>0) (on Core i7 980X) - * @ignore 8015396 * @run main ModNaN */ public class ModNaN { From c7396ec06d76a0489552d8cfade9acf3462fd8d0 Mon Sep 17 00:00:00 2001 From: Christian Tornqvist Date: Wed, 9 Dec 2015 11:00:38 -0800 Subject: [PATCH 058/146] 8144921: Remove JDK6_OR_EARLIER code from os_windows Reviewed-by: dholmes, mseledtsov, gtriantafill --- hotspot/src/os/windows/vm/os_windows.cpp | 257 ----------------------- hotspot/src/os/windows/vm/os_windows.hpp | 45 ---- 2 files changed, 302 deletions(-) diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index a1b18f68966..b7083b1f0d4 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -5529,8 +5529,6 @@ bool os::start_debugging(char *buf, int buflen) { return yes; } -#ifndef JDK6_OR_EARLIER - void os::Kernel32Dll::initialize() { initializeCommon(); } @@ -5705,261 +5703,6 @@ char* os::build_agent_function_name(const char *sym_name, const char *lib_name, return agent_entry_name; } -#else -// Kernel32 API -typedef BOOL (WINAPI* SwitchToThread_Fn)(void); -typedef HANDLE (WINAPI* CreateToolhelp32Snapshot_Fn)(DWORD, DWORD); -typedef BOOL (WINAPI* Module32First_Fn)(HANDLE, LPMODULEENTRY32); -typedef BOOL (WINAPI* Module32Next_Fn)(HANDLE, LPMODULEENTRY32); -typedef void (WINAPI* GetNativeSystemInfo_Fn)(LPSYSTEM_INFO); - -SwitchToThread_Fn os::Kernel32Dll::_SwitchToThread = NULL; -CreateToolhelp32Snapshot_Fn os::Kernel32Dll::_CreateToolhelp32Snapshot = NULL; -Module32First_Fn os::Kernel32Dll::_Module32First = NULL; -Module32Next_Fn os::Kernel32Dll::_Module32Next = NULL; -GetNativeSystemInfo_Fn os::Kernel32Dll::_GetNativeSystemInfo = NULL; - -void os::Kernel32Dll::initialize() { - if (!initialized) { - HMODULE handle = ::GetModuleHandle("Kernel32.dll"); - assert(handle != NULL, "Just check"); - - _SwitchToThread = (SwitchToThread_Fn)::GetProcAddress(handle, "SwitchToThread"); - _CreateToolhelp32Snapshot = (CreateToolhelp32Snapshot_Fn) - ::GetProcAddress(handle, "CreateToolhelp32Snapshot"); - _Module32First = (Module32First_Fn)::GetProcAddress(handle, "Module32First"); - _Module32Next = (Module32Next_Fn)::GetProcAddress(handle, "Module32Next"); - _GetNativeSystemInfo = (GetNativeSystemInfo_Fn)::GetProcAddress(handle, "GetNativeSystemInfo"); - initializeCommon(); // resolve the functions that always need resolving - - initialized = TRUE; - } -} - -BOOL os::Kernel32Dll::SwitchToThread() { - assert(initialized && _SwitchToThread != NULL, - "SwitchToThreadAvailable() not yet called"); - return _SwitchToThread(); -} - - -BOOL os::Kernel32Dll::SwitchToThreadAvailable() { - if (!initialized) { - initialize(); - } - return _SwitchToThread != NULL; -} - -// Help tools -BOOL os::Kernel32Dll::HelpToolsAvailable() { - if (!initialized) { - initialize(); - } - return _CreateToolhelp32Snapshot != NULL && - _Module32First != NULL && - _Module32Next != NULL; -} - -HANDLE os::Kernel32Dll::CreateToolhelp32Snapshot(DWORD dwFlags, - DWORD th32ProcessId) { - assert(initialized && _CreateToolhelp32Snapshot != NULL, - "HelpToolsAvailable() not yet called"); - - return _CreateToolhelp32Snapshot(dwFlags, th32ProcessId); -} - -BOOL os::Kernel32Dll::Module32First(HANDLE hSnapshot,LPMODULEENTRY32 lpme) { - assert(initialized && _Module32First != NULL, - "HelpToolsAvailable() not yet called"); - - return _Module32First(hSnapshot, lpme); -} - -inline BOOL os::Kernel32Dll::Module32Next(HANDLE hSnapshot, - LPMODULEENTRY32 lpme) { - assert(initialized && _Module32Next != NULL, - "HelpToolsAvailable() not yet called"); - - return _Module32Next(hSnapshot, lpme); -} - - -BOOL os::Kernel32Dll::GetNativeSystemInfoAvailable() { - if (!initialized) { - initialize(); - } - return _GetNativeSystemInfo != NULL; -} - -void os::Kernel32Dll::GetNativeSystemInfo(LPSYSTEM_INFO lpSystemInfo) { - assert(initialized && _GetNativeSystemInfo != NULL, - "GetNativeSystemInfoAvailable() not yet called"); - - _GetNativeSystemInfo(lpSystemInfo); -} - -// PSAPI API - - -typedef BOOL (WINAPI *EnumProcessModules_Fn)(HANDLE, HMODULE *, DWORD, LPDWORD); -typedef BOOL (WINAPI *GetModuleFileNameEx_Fn)(HANDLE, HMODULE, LPTSTR, DWORD); -typedef BOOL (WINAPI *GetModuleInformation_Fn)(HANDLE, HMODULE, LPMODULEINFO, DWORD); - -EnumProcessModules_Fn os::PSApiDll::_EnumProcessModules = NULL; -GetModuleFileNameEx_Fn os::PSApiDll::_GetModuleFileNameEx = NULL; -GetModuleInformation_Fn os::PSApiDll::_GetModuleInformation = NULL; -BOOL os::PSApiDll::initialized = FALSE; - -void os::PSApiDll::initialize() { - if (!initialized) { - HMODULE handle = os::win32::load_Windows_dll("PSAPI.DLL", NULL, 0); - if (handle != NULL) { - _EnumProcessModules = (EnumProcessModules_Fn)::GetProcAddress(handle, - "EnumProcessModules"); - _GetModuleFileNameEx = (GetModuleFileNameEx_Fn)::GetProcAddress(handle, - "GetModuleFileNameExA"); - _GetModuleInformation = (GetModuleInformation_Fn)::GetProcAddress(handle, - "GetModuleInformation"); - } - initialized = TRUE; - } -} - - - -BOOL os::PSApiDll::EnumProcessModules(HANDLE hProcess, HMODULE *lpModule, - DWORD cb, LPDWORD lpcbNeeded) { - assert(initialized && _EnumProcessModules != NULL, - "PSApiAvailable() not yet called"); - return _EnumProcessModules(hProcess, lpModule, cb, lpcbNeeded); -} - -DWORD os::PSApiDll::GetModuleFileNameEx(HANDLE hProcess, HMODULE hModule, - LPTSTR lpFilename, DWORD nSize) { - assert(initialized && _GetModuleFileNameEx != NULL, - "PSApiAvailable() not yet called"); - return _GetModuleFileNameEx(hProcess, hModule, lpFilename, nSize); -} - -BOOL os::PSApiDll::GetModuleInformation(HANDLE hProcess, HMODULE hModule, - LPMODULEINFO lpmodinfo, DWORD cb) { - assert(initialized && _GetModuleInformation != NULL, - "PSApiAvailable() not yet called"); - return _GetModuleInformation(hProcess, hModule, lpmodinfo, cb); -} - -BOOL os::PSApiDll::PSApiAvailable() { - if (!initialized) { - initialize(); - } - return _EnumProcessModules != NULL && - _GetModuleFileNameEx != NULL && - _GetModuleInformation != NULL; -} - - -// WinSock2 API -typedef int (PASCAL FAR* WSAStartup_Fn)(WORD, LPWSADATA); -typedef struct hostent *(PASCAL FAR *gethostbyname_Fn)(...); - -WSAStartup_Fn os::WinSock2Dll::_WSAStartup = NULL; -gethostbyname_Fn os::WinSock2Dll::_gethostbyname = NULL; -BOOL os::WinSock2Dll::initialized = FALSE; - -void os::WinSock2Dll::initialize() { - if (!initialized) { - HMODULE handle = os::win32::load_Windows_dll("ws2_32.dll", NULL, 0); - if (handle != NULL) { - _WSAStartup = (WSAStartup_Fn)::GetProcAddress(handle, "WSAStartup"); - _gethostbyname = (gethostbyname_Fn)::GetProcAddress(handle, "gethostbyname"); - } - initialized = TRUE; - } -} - - -BOOL os::WinSock2Dll::WSAStartup(WORD wVersionRequested, LPWSADATA lpWSAData) { - assert(initialized && _WSAStartup != NULL, - "WinSock2Available() not yet called"); - return _WSAStartup(wVersionRequested, lpWSAData); -} - -struct hostent* os::WinSock2Dll::gethostbyname(const char *name) { - assert(initialized && _gethostbyname != NULL, - "WinSock2Available() not yet called"); - return _gethostbyname(name); -} - -BOOL os::WinSock2Dll::WinSock2Available() { - if (!initialized) { - initialize(); - } - return _WSAStartup != NULL && - _gethostbyname != NULL; -} - -typedef BOOL (WINAPI *AdjustTokenPrivileges_Fn)(HANDLE, BOOL, PTOKEN_PRIVILEGES, DWORD, PTOKEN_PRIVILEGES, PDWORD); -typedef BOOL (WINAPI *OpenProcessToken_Fn)(HANDLE, DWORD, PHANDLE); -typedef BOOL (WINAPI *LookupPrivilegeValue_Fn)(LPCTSTR, LPCTSTR, PLUID); - -AdjustTokenPrivileges_Fn os::Advapi32Dll::_AdjustTokenPrivileges = NULL; -OpenProcessToken_Fn os::Advapi32Dll::_OpenProcessToken = NULL; -LookupPrivilegeValue_Fn os::Advapi32Dll::_LookupPrivilegeValue = NULL; -BOOL os::Advapi32Dll::initialized = FALSE; - -void os::Advapi32Dll::initialize() { - if (!initialized) { - HMODULE handle = os::win32::load_Windows_dll("advapi32.dll", NULL, 0); - if (handle != NULL) { - _AdjustTokenPrivileges = (AdjustTokenPrivileges_Fn)::GetProcAddress(handle, - "AdjustTokenPrivileges"); - _OpenProcessToken = (OpenProcessToken_Fn)::GetProcAddress(handle, - "OpenProcessToken"); - _LookupPrivilegeValue = (LookupPrivilegeValue_Fn)::GetProcAddress(handle, - "LookupPrivilegeValueA"); - } - initialized = TRUE; - } -} - -BOOL os::Advapi32Dll::AdjustTokenPrivileges(HANDLE TokenHandle, - BOOL DisableAllPrivileges, - PTOKEN_PRIVILEGES NewState, - DWORD BufferLength, - PTOKEN_PRIVILEGES PreviousState, - PDWORD ReturnLength) { - assert(initialized && _AdjustTokenPrivileges != NULL, - "AdvapiAvailable() not yet called"); - return _AdjustTokenPrivileges(TokenHandle, DisableAllPrivileges, NewState, - BufferLength, PreviousState, ReturnLength); -} - -BOOL os::Advapi32Dll::OpenProcessToken(HANDLE ProcessHandle, - DWORD DesiredAccess, - PHANDLE TokenHandle) { - assert(initialized && _OpenProcessToken != NULL, - "AdvapiAvailable() not yet called"); - return _OpenProcessToken(ProcessHandle, DesiredAccess, TokenHandle); -} - -BOOL os::Advapi32Dll::LookupPrivilegeValue(LPCTSTR lpSystemName, - LPCTSTR lpName, PLUID lpLuid) { - assert(initialized && _LookupPrivilegeValue != NULL, - "AdvapiAvailable() not yet called"); - return _LookupPrivilegeValue(lpSystemName, lpName, lpLuid); -} - -BOOL os::Advapi32Dll::AdvapiAvailable() { - if (!initialized) { - initialize(); - } - return _AdjustTokenPrivileges != NULL && - _OpenProcessToken != NULL && - _LookupPrivilegeValue != NULL; -} - -#endif - #ifndef PRODUCT // test the code path in reserve_memory_special() that tries to allocate memory in a single diff --git a/hotspot/src/os/windows/vm/os_windows.hpp b/hotspot/src/os/windows/vm/os_windows.hpp index 19de558ce85..dd3911c48a7 100644 --- a/hotspot/src/os/windows/vm/os_windows.hpp +++ b/hotspot/src/os/windows/vm/os_windows.hpp @@ -183,26 +183,11 @@ class PlatformParker : public CHeapObj { } ; -// JDK7 requires VS2010 -#if _MSC_VER < 1600 -#define JDK6_OR_EARLIER 1 -#endif - - - class WinSock2Dll: AllStatic { public: static BOOL WSAStartup(WORD, LPWSADATA); static struct hostent* gethostbyname(const char *name); static BOOL WinSock2Available(); -#ifdef JDK6_OR_EARLIER -private: - static int (PASCAL FAR* _WSAStartup)(WORD, LPWSADATA); - static struct hostent *(PASCAL FAR *_gethostbyname)(...); - static BOOL initialized; - - static void initialize(); -#endif }; class Kernel32Dll: AllStatic { @@ -244,16 +229,6 @@ private: static void initialize(); static void initializeCommon(); - -#ifdef JDK6_OR_EARLIER -private: - static BOOL (WINAPI *_SwitchToThread)(void); - static HANDLE (WINAPI* _CreateToolhelp32Snapshot)(DWORD,DWORD); - static BOOL (WINAPI* _Module32First)(HANDLE,LPMODULEENTRY32); - static BOOL (WINAPI* _Module32Next)(HANDLE,LPMODULEENTRY32); - static void (WINAPI *_GetNativeSystemInfo)(LPSYSTEM_INFO); -#endif - }; class Advapi32Dll: AllStatic { @@ -263,16 +238,6 @@ public: static BOOL LookupPrivilegeValue(LPCTSTR, LPCTSTR, PLUID); static BOOL AdvapiAvailable(); - -#ifdef JDK6_OR_EARLIER -private: - static BOOL (WINAPI *_AdjustTokenPrivileges)(HANDLE, BOOL, PTOKEN_PRIVILEGES, DWORD, PTOKEN_PRIVILEGES, PDWORD); - static BOOL (WINAPI *_OpenProcessToken)(HANDLE, DWORD, PHANDLE); - static BOOL (WINAPI *_LookupPrivilegeValue)(LPCTSTR, LPCTSTR, PLUID); - static BOOL initialized; - - static void initialize(); -#endif }; class PSApiDll: AllStatic { @@ -282,16 +247,6 @@ public: static BOOL GetModuleInformation(HANDLE, HMODULE, LPMODULEINFO, DWORD); static BOOL PSApiAvailable(); - -#ifdef JDK6_OR_EARLIER -private: - static BOOL (WINAPI *_EnumProcessModules)(HANDLE, HMODULE *, DWORD, LPDWORD); - static BOOL (WINAPI *_GetModuleFileNameEx)(HANDLE, HMODULE, LPTSTR, DWORD);; - static BOOL (WINAPI *_GetModuleInformation)(HANDLE, HMODULE, LPMODULEINFO, DWORD); - static BOOL initialized; - - static void initialize(); -#endif }; #endif // OS_WINDOWS_VM_OS_WINDOWS_HPP From 1f55a9122c23404171f40294fc30fc2f24518491 Mon Sep 17 00:00:00 2001 From: David Lindholm Date: Thu, 10 Dec 2015 08:50:36 +0100 Subject: [PATCH 059/146] 8145073: Filename and linenumber are not printed for asserts any more Reviewed-by: dholmes, stuefe --- hotspot/src/os/posix/vm/os_posix.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hotspot/src/os/posix/vm/os_posix.cpp b/hotspot/src/os/posix/vm/os_posix.cpp index 55de3ebc259..dd4f0f3486d 100644 --- a/hotspot/src/os/posix/vm/os_posix.cpp +++ b/hotspot/src/os/posix/vm/os_posix.cpp @@ -736,12 +736,12 @@ bool os::Posix::is_valid_signal(int sig) { } // Returns: -// "invalid ()" for an invalid signal number +// NULL for an invalid signal number // "SIG" for a valid but unknown signal number // signal name otherwise. const char* os::exception_name(int sig, char* buf, size_t size) { if (!os::Posix::is_valid_signal(sig)) { - jio_snprintf(buf, size, "invalid (%d)", sig); + return NULL; } const char* const name = os::Posix::get_signal_name(sig, buf, size); if (strcmp(name, "UNKNOWN") == 0) { From d7bb6e9a9719f499c154bfa71b9947e6397519e7 Mon Sep 17 00:00:00 2001 From: Dmitry Samersoff Date: Thu, 10 Dec 2015 12:05:53 +0300 Subject: [PATCH 060/146] 8139484: [Findbugs] new sun.jvm.hotspot.SAGetopt(String[]) may expose internal representation Clone array instead of just assign it Reviewed-by: dholmes --- hotspot/agent/src/share/classes/sun/jvm/hotspot/SAGetopt.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/SAGetopt.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/SAGetopt.java index bae1d3dcc28..e3a0793abad 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/SAGetopt.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/SAGetopt.java @@ -37,7 +37,7 @@ public class SAGetopt { private boolean _optreset; // special handling of first call public SAGetopt(String[] args) { - _argv = args; + _argv = args.clone(); _optind = 0; _optopt = 1; _optarg = null; From f9b7fc0201c8e0c92bac4feabe8af56355ac8507 Mon Sep 17 00:00:00 2001 From: Dmitry Dmitriev Date: Thu, 10 Dec 2015 14:50:47 +0300 Subject: [PATCH 061/146] 8144197: Possible use after free in Arguments::add_property function Reviewed-by: dholmes, goetz --- hotspot/src/share/vm/runtime/arguments.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index a2d34ccdc6e..017f4693dd7 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -1308,18 +1308,20 @@ bool Arguments::add_property(const char* prop) { PropertyList_unique_add(&_system_properties, key, value, true); } else { if (strcmp(key, "sun.java.command") == 0) { - if (_java_command != NULL) { - os::free(_java_command); - } + char *old_java_command = _java_command; _java_command = os::strdup_check_oom(value, mtInternal); - } else if (strcmp(key, "java.vendor.url.bug") == 0) { - if (_java_vendor_url_bug != DEFAULT_VENDOR_URL_BUG) { - assert(_java_vendor_url_bug != NULL, "_java_vendor_url_bug is NULL"); - os::free((void *)_java_vendor_url_bug); + if (old_java_command != NULL) { + os::free(old_java_command); } + } else if (strcmp(key, "java.vendor.url.bug") == 0) { + const char* old_java_vendor_url_bug = _java_vendor_url_bug; // save it in _java_vendor_url_bug, so JVM fatal error handler can access // its value without going through the property list or making a Java call. _java_vendor_url_bug = os::strdup_check_oom(value, mtInternal); + if (old_java_vendor_url_bug != DEFAULT_VENDOR_URL_BUG) { + assert(old_java_vendor_url_bug != NULL, "_java_vendor_url_bug is NULL"); + os::free((void *)old_java_vendor_url_bug); + } } // Create new property and add at the end of the list From 57d8a71115b8fc9a2eb2be876a396c474c207cf3 Mon Sep 17 00:00:00 2001 From: Staffan Larsen Date: Thu, 10 Dec 2015 16:09:36 +0100 Subject: [PATCH 062/146] 8145099: Better error message when SA can't attach to a process Reviewed-by: jbachorik, stuefe --- hotspot/agent/src/os/linux/LinuxDebuggerLocal.c | 7 +++++-- hotspot/agent/src/os/linux/libproc.h | 2 +- hotspot/agent/src/os/linux/ps_proc.c | 16 ++++++++++------ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c b/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c index 6a80036daf8..f4ed4db6d33 100644 --- a/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c +++ b/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c @@ -223,9 +223,12 @@ JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_at verifyBitness(env, (char *) &buf); CHECK_EXCEPTION; + char err_buf[200]; struct ps_prochandle* ph; - if ( (ph = Pgrab(jpid)) == NULL) { - THROW_NEW_DEBUGGER_EXCEPTION("Can't attach to the process"); + if ( (ph = Pgrab(jpid, err_buf, sizeof(err_buf))) == NULL) { + char msg[230]; + snprintf(msg, sizeof(msg), "Can't attach to the process: %s", err_buf); + THROW_NEW_DEBUGGER_EXCEPTION(msg); } (*env)->SetLongField(env, this_obj, p_ps_prochandle_ID, (jlong)(intptr_t)ph); fillThreadsAndLoadObjects(env, this_obj, ph); diff --git a/hotspot/agent/src/os/linux/libproc.h b/hotspot/agent/src/os/linux/libproc.h index 0f5423ea5fb..f4ddec2e371 100644 --- a/hotspot/agent/src/os/linux/libproc.h +++ b/hotspot/agent/src/os/linux/libproc.h @@ -86,7 +86,7 @@ typedef int bool; struct ps_prochandle; // attach to a process -struct ps_prochandle* Pgrab(pid_t pid); +struct ps_prochandle* Pgrab(pid_t pid, char* err_buf, size_t err_buf_len); // attach to a core dump struct ps_prochandle* Pgrab_core(const char* execfile, const char* corefile); diff --git a/hotspot/agent/src/os/linux/ps_proc.c b/hotspot/agent/src/os/linux/ps_proc.c index 7d9d2611c3b..dc02008a90c 100644 --- a/hotspot/agent/src/os/linux/ps_proc.c +++ b/hotspot/agent/src/os/linux/ps_proc.c @@ -215,9 +215,12 @@ static bool ptrace_waitpid(pid_t pid) { } // attach to a process/thread specified by "pid" -static bool ptrace_attach(pid_t pid) { +static bool ptrace_attach(pid_t pid, char* err_buf, size_t err_buf_len) { if (ptrace(PTRACE_ATTACH, pid, NULL, NULL) < 0) { - print_debug("ptrace(PTRACE_ATTACH, ..) failed for %d\n", pid); + char buf[200]; + char* msg = strerror_r(errno, buf, sizeof(buf)); + snprintf(err_buf, err_buf_len, "ptrace(PTRACE_ATTACH, ..) failed for %d: %s", pid, msg); + print_debug("%s\n", err_buf); return false; } else { return ptrace_waitpid(pid); @@ -370,16 +373,17 @@ static ps_prochandle_ops process_ops = { }; // attach to the process. One and only one exposed stuff -struct ps_prochandle* Pgrab(pid_t pid) { +struct ps_prochandle* Pgrab(pid_t pid, char* err_buf, size_t err_buf_len) { struct ps_prochandle* ph = NULL; thread_info* thr = NULL; if ( (ph = (struct ps_prochandle*) calloc(1, sizeof(struct ps_prochandle))) == NULL) { - print_debug("can't allocate memory for ps_prochandle\n"); + snprintf(err_buf, err_buf_len, "can't allocate memory for ps_prochandle"); + print_debug("%s\n", err_buf); return NULL; } - if (ptrace_attach(pid) != true) { + if (ptrace_attach(pid, err_buf, err_buf_len) != true) { free(ph); return NULL; } @@ -402,7 +406,7 @@ struct ps_prochandle* Pgrab(pid_t pid) { thr = ph->threads; while (thr) { // don't attach to the main thread again - if (ph->pid != thr->lwp_id && ptrace_attach(thr->lwp_id) != true) { + if (ph->pid != thr->lwp_id && ptrace_attach(thr->lwp_id, err_buf, err_buf_len) != true) { // even if one attach fails, we get return NULL Prelease(ph); return NULL; From 4fd73ebe16a69b37f99d15873cda2bebc12c07c3 Mon Sep 17 00:00:00 2001 From: Joseph Provino Date: Thu, 10 Dec 2015 13:38:18 -0500 Subject: [PATCH 063/146] 8139871: G1CollectorPolicy::_cur_mark_stop_world_time_ms is never read from Remove dead code Reviewed-by: tschatzl, jwilhelm --- hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp | 3 --- hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp | 1 - 2 files changed, 4 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp index e3c39c71a6e..fb22b840d8b 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp @@ -901,7 +901,6 @@ void G1CollectorPolicy::record_concurrent_mark_init_end(double collector_state()->set_during_marking(true); assert(!collector_state()->initiate_conc_mark_if_possible(), "we should have cleared it by now"); collector_state()->set_during_initial_mark_pause(false); - _cur_mark_stop_world_time_ms = mark_init_elapsed_time_ms; } void G1CollectorPolicy::record_concurrent_mark_remark_start() { @@ -913,7 +912,6 @@ void G1CollectorPolicy::record_concurrent_mark_remark_end() { double end_time_sec = os::elapsedTime(); double elapsed_time_ms = (end_time_sec - _mark_remark_start_sec)*1000.0; _concurrent_mark_remark_times_ms->add(elapsed_time_ms); - _cur_mark_stop_world_time_ms += elapsed_time_ms; _prev_collection_pause_end_ms += elapsed_time_ms; record_pause(Remark, _mark_remark_start_sec, end_time_sec); @@ -1833,7 +1831,6 @@ void G1CollectorPolicy::record_concurrent_mark_cleanup_end() { double end_sec = os::elapsedTime(); double elapsed_time_ms = (end_sec - _mark_cleanup_start_sec) * 1000.0; _concurrent_mark_cleanup_times_ms->add(elapsed_time_ms); - _cur_mark_stop_world_time_ms += elapsed_time_ms; _prev_collection_pause_end_ms += elapsed_time_ms; record_pause(Cleanup, _mark_cleanup_start_sec, end_sec); diff --git a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp index 232f14488d5..b2abdb8fcc5 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp @@ -492,7 +492,6 @@ private: // This set of variables tracks the collector efficiency, in order to // determine whether we should initiate a new marking. - double _cur_mark_stop_world_time_ms; double _mark_remark_start_sec; double _mark_cleanup_start_sec; From ffeb0bdad07683a9658bac407b87bb369767a63c Mon Sep 17 00:00:00 2001 From: Bengt Rutisson Date: Thu, 10 Dec 2015 14:57:55 +0100 Subject: [PATCH 064/146] 8145092: Use Unified Logging for the GC logging JEP-271. VM changes contributed by brutisso, test changes contributed by david. Co-authored-by: David Lindholm Reviewed-by: sjohanss, david, brutisso --- hotspot/src/os/windows/vm/os_windows.cpp | 6 +- hotspot/src/share/vm/Xusage.txt | 1 - .../src/share/vm/gc/cms/allocationStats.hpp | 9 +- .../vm/gc/cms/compactibleFreeListSpace.cpp | 141 ++-- .../vm/gc/cms/compactibleFreeListSpace.hpp | 13 +- .../gc/cms/concurrentMarkSweepGeneration.cpp | 781 ++++++------------ .../gc/cms/concurrentMarkSweepGeneration.hpp | 13 +- .../src/share/vm/gc/cms/parNewGeneration.cpp | 63 +- .../share/vm/gc/cms/parOopClosures.inline.hpp | 9 +- hotspot/src/share/vm/gc/cms/promotionInfo.hpp | 2 +- .../src/share/vm/gc/cms/vmCMSOperations.cpp | 6 +- .../share/vm/gc/g1/collectionSetChooser.cpp | 5 +- .../vm/gc/g1/concurrentG1RefineThread.cpp | 21 +- hotspot/src/share/vm/gc/g1/concurrentMark.cpp | 308 +++---- hotspot/src/share/vm/gc/g1/concurrentMark.hpp | 4 +- .../share/vm/gc/g1/concurrentMarkThread.cpp | 48 +- .../share/vm/gc/g1/concurrentMarkThread.hpp | 1 - .../src/share/vm/gc/g1/g1BlockOffsetTable.cpp | 12 +- .../src/share/vm/gc/g1/g1CollectedHeap.cpp | 583 +++++-------- .../src/share/vm/gc/g1/g1CollectedHeap.hpp | 25 +- .../src/share/vm/gc/g1/g1CollectorPolicy.cpp | 323 ++------ .../src/share/vm/gc/g1/g1CollectorPolicy.hpp | 7 +- hotspot/src/share/vm/gc/g1/g1ErgoVerbose.cpp | 66 -- hotspot/src/share/vm/gc/g1/g1ErgoVerbose.hpp | 204 ----- hotspot/src/share/vm/gc/g1/g1EvacStats.cpp | 150 ++-- hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp | 232 +++--- hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp | 4 +- hotspot/src/share/vm/gc/g1/g1HRPrinter.cpp | 37 +- hotspot/src/share/vm/gc/g1/g1HRPrinter.hpp | 42 +- hotspot/src/share/vm/gc/g1/g1IHOPControl.cpp | 47 +- hotspot/src/share/vm/gc/g1/g1Log.cpp | 70 -- hotspot/src/share/vm/gc/g1/g1Log.hpp | 65 -- hotspot/src/share/vm/gc/g1/g1MarkSweep.cpp | 20 +- hotspot/src/share/vm/gc/g1/g1RemSet.cpp | 60 +- hotspot/src/share/vm/gc/g1/g1RemSet.hpp | 5 +- .../src/share/vm/gc/g1/g1RemSetSummary.cpp | 4 +- .../src/share/vm/gc/g1/g1RemSetSummary.hpp | 1 + .../vm/gc/g1/g1SATBCardTableModRefBS.cpp | 16 +- .../src/share/vm/gc/g1/g1StringDedupQueue.cpp | 8 +- .../src/share/vm/gc/g1/g1StringDedupQueue.hpp | 2 +- .../src/share/vm/gc/g1/g1StringDedupStat.cpp | 44 +- .../src/share/vm/gc/g1/g1StringDedupStat.hpp | 4 +- .../src/share/vm/gc/g1/g1StringDedupTable.cpp | 28 +- .../src/share/vm/gc/g1/g1StringDedupTable.hpp | 2 +- .../share/vm/gc/g1/g1StringDedupThread.cpp | 20 +- .../share/vm/gc/g1/g1StringDedupThread.hpp | 2 +- hotspot/src/share/vm/gc/g1/g1_globals.hpp | 46 +- hotspot/src/share/vm/gc/g1/heapRegion.cpp | 141 ++-- .../src/share/vm/gc/g1/heapRegionRemSet.cpp | 40 +- .../src/share/vm/gc/g1/heapRegionRemSet.hpp | 2 +- hotspot/src/share/vm/gc/g1/heapRegionSet.cpp | 18 - hotspot/src/share/vm/gc/g1/heapRegionSet.hpp | 2 - hotspot/src/share/vm/gc/g1/satbMarkQueue.cpp | 24 +- hotspot/src/share/vm/gc/g1/survRateGroup.cpp | 35 +- .../src/share/vm/gc/g1/vm_operations_g1.cpp | 9 +- .../src/share/vm/gc/g1/workerDataArray.cpp | 4 +- .../src/share/vm/gc/g1/workerDataArray.hpp | 6 - .../share/vm/gc/g1/workerDataArray.inline.hpp | 2 - hotspot/src/share/vm/gc/g1/youngList.cpp | 32 +- .../vm/gc/parallel/adjoiningGenerations.cpp | 67 +- .../src/share/vm/gc/parallel/asPSOldGen.cpp | 30 +- .../src/share/vm/gc/parallel/asPSYoungGen.cpp | 180 ++-- .../vm/gc/parallel/cardTableExtension.cpp | 35 +- .../share/vm/gc/parallel/gcTaskManager.cpp | 63 +- .../src/share/vm/gc/parallel/gcTaskThread.cpp | 37 +- .../vm/gc/parallel/parallelScavengeHeap.cpp | 30 +- .../vm/gc/parallel/parallelScavengeHeap.hpp | 31 +- hotspot/src/share/vm/gc/parallel/pcTasks.cpp | 26 +- .../vm/gc/parallel/psAdaptiveSizePolicy.cpp | 402 ++++----- .../vm/gc/parallel/psAdaptiveSizePolicy.hpp | 2 +- .../vm/gc/parallel/psCompactionManager.cpp | 26 +- .../src/share/vm/gc/parallel/psMarkSweep.cpp | 65 +- hotspot/src/share/vm/gc/parallel/psOldGen.cpp | 71 +- .../vm/gc/parallel/psParallelCompact.cpp | 440 +++++----- .../vm/gc/parallel/psParallelCompact.hpp | 12 +- .../vm/gc/parallel/psPromotionManager.cpp | 26 +- .../vm/gc/parallel/psPromotionManager.hpp | 2 +- .../gc/parallel/psPromotionManager.inline.hpp | 17 +- .../src/share/vm/gc/parallel/psScavenge.cpp | 112 +-- .../vm/gc/parallel/psScavenge.inline.hpp | 13 +- .../share/vm/gc/parallel/psVirtualspace.cpp | 14 - .../share/vm/gc/parallel/psVirtualspace.hpp | 1 - .../src/share/vm/gc/parallel/psYoungGen.cpp | 229 ++--- .../share/vm/gc/serial/defNewGeneration.cpp | 121 +-- .../share/vm/gc/serial/defNewGeneration.hpp | 1 - .../src/share/vm/gc/serial/genMarkSweep.cpp | 19 +- hotspot/src/share/vm/gc/serial/markSweep.cpp | 26 +- .../share/vm/gc/serial/tenuredGeneration.cpp | 56 +- .../share/vm/gc/shared/adaptiveSizePolicy.cpp | 125 ++- .../share/vm/gc/shared/adaptiveSizePolicy.hpp | 56 +- hotspot/src/share/vm/gc/shared/ageTable.cpp | 17 +- .../share/vm/gc/shared/blockOffsetTable.cpp | 19 +- .../src/share/vm/gc/shared/cardGeneration.cpp | 105 +-- .../share/vm/gc/shared/cardTableModRefBS.cpp | 50 +- .../src/share/vm/gc/shared/collectedHeap.cpp | 64 +- .../src/share/vm/gc/shared/collectedHeap.hpp | 19 +- .../share/vm/gc/shared/collectorPolicy.cpp | 38 +- hotspot/src/share/vm/gc/shared/gcCause.hpp | 32 - hotspot/src/share/vm/gc/shared/gcId.cpp | 13 + hotspot/src/share/vm/gc/shared/gcId.hpp | 1 + hotspot/src/share/vm/gc/shared/gcLocker.cpp | 28 +- hotspot/src/share/vm/gc/shared/gcLocker.hpp | 1 + .../src/share/vm/gc/shared/gcTraceTime.cpp | 79 +- .../src/share/vm/gc/shared/gcTraceTime.hpp | 48 +- .../share/vm/gc/shared/gcTraceTime.inline.hpp | 149 ++++ .../share/vm/gc/shared/genCollectedHeap.cpp | 120 +-- .../share/vm/gc/shared/genCollectedHeap.hpp | 13 +- hotspot/src/share/vm/gc/shared/generation.cpp | 23 +- hotspot/src/share/vm/gc/shared/generation.hpp | 3 - hotspot/src/share/vm/gc/shared/plab.cpp | 13 +- hotspot/src/share/vm/gc/shared/plab.hpp | 2 - .../share/vm/gc/shared/referenceProcessor.cpp | 174 ++-- .../share/vm/gc/shared/referenceProcessor.hpp | 4 +- hotspot/src/share/vm/gc/shared/space.hpp | 2 - .../src/share/vm/gc/shared/spaceDecorator.cpp | 9 +- hotspot/src/share/vm/gc/shared/taskqueue.cpp | 10 +- .../vm/gc/shared/threadLocalAllocBuffer.cpp | 98 +-- .../shared/threadLocalAllocBuffer.inline.hpp | 30 +- .../src/share/vm/gc/shared/vmGCOperations.cpp | 18 +- hotspot/src/share/vm/logging/logPrefix.hpp | 33 +- hotspot/src/share/vm/logging/logTag.hpp | 41 + .../share/vm/memory/binaryTreeDictionary.cpp | 78 +- .../share/vm/memory/binaryTreeDictionary.hpp | 4 +- hotspot/src/share/vm/memory/filemap.cpp | 4 +- .../share/vm/memory/freeBlockDictionary.hpp | 6 +- hotspot/src/share/vm/memory/metaspace.cpp | 275 +++--- hotspot/src/share/vm/memory/universe.cpp | 79 +- hotspot/src/share/vm/memory/universe.hpp | 23 +- hotspot/src/share/vm/oops/instanceKlass.cpp | 2 +- .../share/vm/oops/instanceRefKlass.inline.hpp | 8 +- hotspot/src/share/vm/prims/jni.cpp | 1 - hotspot/src/share/vm/prims/jvmtiEnv.cpp | 18 +- hotspot/src/share/vm/prims/whitebox.cpp | 2 +- hotspot/src/share/vm/runtime/arguments.cpp | 157 +--- hotspot/src/share/vm/runtime/arguments.hpp | 4 - hotspot/src/share/vm/runtime/globals.hpp | 172 +--- .../src/share/vm/runtime/interfaceSupport.cpp | 12 +- hotspot/src/share/vm/runtime/java.cpp | 13 +- hotspot/src/share/vm/runtime/jniHandles.cpp | 5 +- hotspot/src/share/vm/runtime/os.cpp | 2 +- hotspot/src/share/vm/runtime/safepoint.cpp | 5 - hotspot/src/share/vm/runtime/timer.cpp | 2 - hotspot/src/share/vm/runtime/vmThread.cpp | 2 +- .../src/share/vm/runtime/vm_operations.cpp | 2 +- .../src/share/vm/runtime/vm_operations.hpp | 14 - .../share/vm/services/diagnosticCommand.cpp | 10 - .../share/vm/services/diagnosticCommand.hpp | 17 - .../src/share/vm/services/memoryService.cpp | 9 +- .../src/share/vm/services/memoryService.hpp | 3 +- .../src/share/vm/services/runtimeService.cpp | 21 +- hotspot/src/share/vm/utilities/debug.cpp | 2 +- hotspot/src/share/vm/utilities/numberSeq.cpp | 2 +- hotspot/src/share/vm/utilities/ostream.cpp | 316 +------ hotspot/src/share/vm/utilities/ostream.hpp | 26 - hotspot/test/TEST.groups | 1 - hotspot/test/gc/7072527/TestFullGCCount.java | 2 +- hotspot/test/gc/TestDisableExplicitGC.java | 6 +- hotspot/test/gc/TestGCLogRotationViaJcmd.java | 79 -- hotspot/test/gc/TestVerifyDuringStartup.java | 3 +- hotspot/test/gc/TestVerifySilently.java | 6 +- .../TestTargetSurvivorRatioFlag.java | 4 +- .../TestUnrecognizedVMOptionsHandling.java | 8 +- .../TestVerifyBeforeAndAfterGCFlags.java | 7 +- .../TestCMSClassUnloadingEnabledHWM.java | 12 +- .../TestG1ClassUnloadingHWM.java | 11 +- hotspot/test/gc/cms/DisableResizePLAB.java | 2 +- .../gc/cms/TestCMSScavengeBeforeRemark.java | 2 +- .../TestDynamicNumberOfGCThreads.java | 2 +- .../g1/TestEagerReclaimHumongousRegions.java | 2 +- ...rReclaimHumongousRegionsClearMarkBits.java | 2 +- ...tEagerReclaimHumongousRegionsWithRefs.java | 2 +- ...stG1TraceEagerReclaimHumongousObjects.java | 24 +- hotspot/test/gc/g1/TestGCLogMessages.java | 82 +- .../gc/g1/TestHumongousAllocInitialMark.java | 4 +- .../TestHumongousAllocNearlyFullRegion.java | 4 +- .../TestNoEagerReclaimOfHumongousRegions.java | 2 +- hotspot/test/gc/g1/TestPLABOutput.java | 5 +- hotspot/test/gc/g1/TestPrintGCDetails.java | 59 -- .../g1/TestPrintRegionRememberedSetInfo.java | 5 +- hotspot/test/gc/g1/TestRemsetLogging.java | 87 ++ ...n.java => TestRemsetLoggingPerRegion.java} | 20 +- ...ads.java => TestRemsetLoggingThreads.java} | 16 +- ...Tools.java => TestRemsetLoggingTools.java} | 5 +- .../test/gc/g1/TestShrinkAuxiliaryData.java | 2 +- .../gc/g1/TestStringDeduplicationTools.java | 48 +- .../gc/g1/TestStringSymbolTableStats.java | 2 +- .../test/gc/g1/TestSummarizeRSetStats.java | 87 -- hotspot/test/gc/g1/mixedgc/TestLogging.java | 10 +- hotspot/test/gc/logging/TestGCId.java | 39 +- .../test/gc/logging/TestPrintReferences.java | 16 +- hotspot/test/gc/serial/HeapChangeLogging.java | 4 +- hotspot/test/gc/whitebox/TestWBGC.java | 2 +- .../test/runtime/7158988/FieldMonitor.java | 2 +- .../PrintGCApplicationConcurrentTime.java | 2 +- .../runtime/CommandLine/TestVMOptions.java | 2 +- .../CompressedClassPointers.java | 8 +- .../CompressedClassSpaceSize.java | 4 +- .../serviceability/dcmd/gc/RunGCTest.java | 4 +- .../serviceability/dcmd/vm/FlagsTest.java | 3 +- .../logging/TestLogRotation.java} | 17 +- 200 files changed, 3331 insertions(+), 6147 deletions(-) delete mode 100644 hotspot/src/share/vm/gc/g1/g1ErgoVerbose.cpp delete mode 100644 hotspot/src/share/vm/gc/g1/g1ErgoVerbose.hpp delete mode 100644 hotspot/src/share/vm/gc/g1/g1Log.cpp delete mode 100644 hotspot/src/share/vm/gc/g1/g1Log.hpp create mode 100644 hotspot/src/share/vm/gc/shared/gcTraceTime.inline.hpp delete mode 100644 hotspot/test/gc/TestGCLogRotationViaJcmd.java delete mode 100644 hotspot/test/gc/g1/TestPrintGCDetails.java create mode 100644 hotspot/test/gc/g1/TestRemsetLogging.java rename hotspot/test/gc/g1/{TestSummarizeRSetStatsPerRegion.java => TestRemsetLoggingPerRegion.java} (66%) rename hotspot/test/gc/g1/{TestSummarizeRSetStatsThreads.java => TestRemsetLoggingThreads.java} (83%) rename hotspot/test/gc/g1/{TestSummarizeRSetStatsTools.java => TestRemsetLoggingTools.java} (97%) delete mode 100644 hotspot/test/gc/g1/TestSummarizeRSetStats.java rename hotspot/test/{gc/6941923/Test6941923.java => serviceability/logging/TestLogRotation.java} (89%) diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index b7083b1f0d4..7b2bf6d9e9c 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -5719,7 +5719,7 @@ char* os::build_agent_function_name(const char *sym_name, const char *lib_name, void TestReserveMemorySpecial_test() { if (!UseLargePages) { if (VerboseInternalVMTests) { - gclog_or_tty->print("Skipping test because large pages are disabled"); + tty->print("Skipping test because large pages are disabled"); } return; } @@ -5735,7 +5735,7 @@ void TestReserveMemorySpecial_test() { char* result = os::reserve_memory_special(large_allocation_size, os::large_page_size(), NULL, false); if (result == NULL) { if (VerboseInternalVMTests) { - gclog_or_tty->print("Failed to allocate control block with size " SIZE_FORMAT ". Skipping remainder of test.", + tty->print("Failed to allocate control block with size " SIZE_FORMAT ". Skipping remainder of test.", large_allocation_size); } } else { @@ -5748,7 +5748,7 @@ void TestReserveMemorySpecial_test() { char* actual_location = os::reserve_memory_special(expected_allocation_size, os::large_page_size(), expected_location, false); if (actual_location == NULL) { if (VerboseInternalVMTests) { - gclog_or_tty->print("Failed to allocate any memory at " PTR_FORMAT " size " SIZE_FORMAT ". Skipping remainder of test.", + tty->print("Failed to allocate any memory at " PTR_FORMAT " size " SIZE_FORMAT ". Skipping remainder of test.", expected_location, large_allocation_size); } } else { diff --git a/hotspot/src/share/vm/Xusage.txt b/hotspot/src/share/vm/Xusage.txt index 8b3d4650a72..3849f8f8e2c 100644 --- a/hotspot/src/share/vm/Xusage.txt +++ b/hotspot/src/share/vm/Xusage.txt @@ -8,7 +8,6 @@ prepend in front of bootstrap class path -Xnoclassgc disable class garbage collection -Xlog: control JVM logging, use -Xlog:help for details - -Xloggc: log GC status to a file with time stamps -Xbatch disable background compilation -Xms set initial Java heap size -Xmx set maximum Java heap size diff --git a/hotspot/src/share/vm/gc/cms/allocationStats.hpp b/hotspot/src/share/vm/gc/cms/allocationStats.hpp index a2259276fe3..747b2904bed 100644 --- a/hotspot/src/share/vm/gc/cms/allocationStats.hpp +++ b/hotspot/src/share/vm/gc/cms/allocationStats.hpp @@ -26,6 +26,7 @@ #define SHARE_VM_GC_CMS_ALLOCATIONSTATS_HPP #include "gc/shared/gcUtil.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/macros.hpp" @@ -119,11 +120,9 @@ class AllocationStats VALUE_OBJ_CLASS_SPEC { ssize_t old_desired = _desired; float delta_ise = (CMSExtrapolateSweep ? intra_sweep_estimate : 0.0); _desired = (ssize_t)(new_rate * (inter_sweep_estimate + delta_ise)); - if (PrintFLSStatistics > 1) { - gclog_or_tty->print_cr("demand: " SSIZE_FORMAT ", old_rate: %f, current_rate: %f, " - "new_rate: %f, old_desired: " SSIZE_FORMAT ", new_desired: " SSIZE_FORMAT, - demand, old_rate, rate, new_rate, old_desired, _desired); - } + log_trace(gc, freelist)("demand: " SSIZE_FORMAT ", old_rate: %f, current_rate: %f, " + "new_rate: %f, old_desired: " SSIZE_FORMAT ", new_desired: " SSIZE_FORMAT, + demand, old_rate, rate, new_rate, old_desired, _desired); } } diff --git a/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp b/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp index 933186d34fe..f302a7f9678 100644 --- a/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp +++ b/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.cpp @@ -400,17 +400,16 @@ void CompactibleFreeListSpace::print_on(outputStream* st) const { void CompactibleFreeListSpace::print_indexed_free_lists(outputStream* st) const { - reportIndexedFreeListStatistics(); - gclog_or_tty->print_cr("Layout of Indexed Freelists"); - gclog_or_tty->print_cr("---------------------------"); + reportIndexedFreeListStatistics(st); + st->print_cr("Layout of Indexed Freelists"); + st->print_cr("---------------------------"); AdaptiveFreeList::print_labels_on(st, "size"); for (size_t i = IndexSetStart; i < IndexSetSize; i += IndexSetStride) { - _indexedFreeList[i].print_on(gclog_or_tty); - for (FreeChunk* fc = _indexedFreeList[i].head(); fc != NULL; - fc = fc->next()) { - gclog_or_tty->print_cr("\t[" PTR_FORMAT "," PTR_FORMAT ") %s", - p2i(fc), p2i((HeapWord*)fc + i), - fc->cantCoalesce() ? "\t CC" : ""); + _indexedFreeList[i].print_on(st); + for (FreeChunk* fc = _indexedFreeList[i].head(); fc != NULL; fc = fc->next()) { + st->print_cr("\t[" PTR_FORMAT "," PTR_FORMAT ") %s", + p2i(fc), p2i((HeapWord*)fc + i), + fc->cantCoalesce() ? "\t CC" : ""); } } } @@ -422,7 +421,7 @@ const { void CompactibleFreeListSpace::print_dictionary_free_lists(outputStream* st) const { - _dictionary->report_statistics(); + _dictionary->report_statistics(st); st->print_cr("Layout of Freelists in Tree"); st->print_cr("---------------------------"); _dictionary->print_free_lists(st); @@ -472,54 +471,58 @@ size_t BlkPrintingClosure::do_blk(HeapWord* addr) { return sz; } -void CompactibleFreeListSpace::dump_at_safepoint_with_locks(CMSCollector* c, - outputStream* st) { - st->print_cr("\n========================="); +void CompactibleFreeListSpace::dump_at_safepoint_with_locks(CMSCollector* c, outputStream* st) { + st->print_cr("========================="); st->print_cr("Block layout in CMS Heap:"); st->print_cr("========================="); BlkPrintingClosure bpcl(c, this, c->markBitMap(), st); blk_iterate(&bpcl); - st->print_cr("\n======================================="); + st->print_cr("======================================="); st->print_cr("Order & Layout of Promotion Info Blocks"); st->print_cr("======================================="); print_promo_info_blocks(st); - st->print_cr("\n==========================="); + st->print_cr("==========================="); st->print_cr("Order of Indexed Free Lists"); st->print_cr("========================="); print_indexed_free_lists(st); - st->print_cr("\n================================="); + st->print_cr("================================="); st->print_cr("Order of Free Lists in Dictionary"); st->print_cr("================================="); print_dictionary_free_lists(st); } -void CompactibleFreeListSpace::reportFreeListStatistics() const { +void CompactibleFreeListSpace::reportFreeListStatistics(const char* title) const { assert_lock_strong(&_freelistLock); - assert(PrintFLSStatistics != 0, "Reporting error"); - _dictionary->report_statistics(); - if (PrintFLSStatistics > 1) { - reportIndexedFreeListStatistics(); + LogHandle(gc, freelist, stats) log; + if (!log.is_debug()) { + return; + } + log.debug("%s", title); + _dictionary->report_statistics(log.debug_stream()); + if (log.is_trace()) { + ResourceMark rm; + reportIndexedFreeListStatistics(log.trace_stream()); size_t total_size = totalSizeInIndexedFreeLists() + _dictionary->total_chunk_size(DEBUG_ONLY(freelistLock())); - gclog_or_tty->print(" free=" SIZE_FORMAT " frag=%1.4f\n", total_size, flsFrag()); + log.trace(" free=" SIZE_FORMAT " frag=%1.4f", total_size, flsFrag()); } } -void CompactibleFreeListSpace::reportIndexedFreeListStatistics() const { +void CompactibleFreeListSpace::reportIndexedFreeListStatistics(outputStream* st) const { assert_lock_strong(&_freelistLock); - gclog_or_tty->print("Statistics for IndexedFreeLists:\n" - "--------------------------------\n"); + st->print_cr("Statistics for IndexedFreeLists:"); + st->print_cr("--------------------------------"); size_t total_size = totalSizeInIndexedFreeLists(); - size_t free_blocks = numFreeBlocksInIndexedFreeLists(); - gclog_or_tty->print("Total Free Space: " SIZE_FORMAT "\n", total_size); - gclog_or_tty->print("Max Chunk Size: " SIZE_FORMAT "\n", maxChunkSizeInIndexedFreeLists()); - gclog_or_tty->print("Number of Blocks: " SIZE_FORMAT "\n", free_blocks); + size_t free_blocks = numFreeBlocksInIndexedFreeLists(); + st->print_cr("Total Free Space: " SIZE_FORMAT, total_size); + st->print_cr("Max Chunk Size: " SIZE_FORMAT, maxChunkSizeInIndexedFreeLists()); + st->print_cr("Number of Blocks: " SIZE_FORMAT, free_blocks); if (free_blocks != 0) { - gclog_or_tty->print("Av. Block Size: " SIZE_FORMAT "\n", total_size/free_blocks); + st->print_cr("Av. Block Size: " SIZE_FORMAT, total_size/free_blocks); } } @@ -1824,10 +1827,7 @@ CompactibleFreeListSpace::sweep_completed() { void CompactibleFreeListSpace::gc_prologue() { assert_locked(); - if (PrintFLSStatistics != 0) { - gclog_or_tty->print("Before GC:\n"); - reportFreeListStatistics(); - } + reportFreeListStatistics("Before GC:"); refillLinearAllocBlocksIfNeeded(); } @@ -1837,11 +1837,7 @@ CompactibleFreeListSpace::gc_epilogue() { assert(_promoInfo.noPromotions(), "_promoInfo inconsistency"); _promoInfo.stopTrackingPromotions(); repairLinearAllocationBlocks(); - // Print Space's stats - if (PrintFLSStatistics != 0) { - gclog_or_tty->print("After GC:\n"); - reportFreeListStatistics(); - } + reportFreeListStatistics("After GC:"); } // Iteration support, mostly delegated from a CMS generation @@ -2014,9 +2010,7 @@ void CompactibleFreeListSpace::beginSweepFLCensus( size_t i; for (i = IndexSetStart; i < IndexSetSize; i += IndexSetStride) { AdaptiveFreeList* fl = &_indexedFreeList[i]; - if (PrintFLSStatistics > 1) { - gclog_or_tty->print("size[" SIZE_FORMAT "] : ", i); - } + log_trace(gc, freelist)("size[" SIZE_FORMAT "] : ", i); fl->compute_desired(inter_sweep_current, inter_sweep_estimate, intra_sweep_estimate); fl->set_coal_desired((ssize_t)((double)fl->desired() * CMSSmallCoalSurplusPercent)); fl->set_before_sweep(fl->count()); @@ -2065,16 +2059,10 @@ void CompactibleFreeListSpace::clearFLCensus() { } void CompactibleFreeListSpace::endSweepFLCensus(size_t sweep_count) { - if (PrintFLSStatistics > 0) { - HeapWord* largestAddr = (HeapWord*) dictionary()->find_largest_dict(); - gclog_or_tty->print_cr("CMS: Large block " PTR_FORMAT, - p2i(largestAddr)); - } + log_debug(gc, freelist)("CMS: Large block " PTR_FORMAT, p2i(dictionary()->find_largest_dict())); setFLSurplus(); setFLHints(); - if (PrintGC && PrintFLSCensus > 0) { - printFLCensus(sweep_count); - } + printFLCensus(sweep_count); clearFLCensus(); assert_locked(); _dictionary->end_sweep_dict_census(CMSLargeSplitSurplusPercent); @@ -2213,14 +2201,15 @@ class VerifyAllBlksClosure: public BlkClosure { } } if (res == 0) { - gclog_or_tty->print_cr("Livelock: no rank reduction!"); - gclog_or_tty->print_cr( - " Current: addr = " PTR_FORMAT ", size = " SIZE_FORMAT ", obj = %s, live = %s \n" - " Previous: addr = " PTR_FORMAT ", size = " SIZE_FORMAT ", obj = %s, live = %s \n", + LogHandle(gc, verify) log; + log.info("Livelock: no rank reduction!"); + log.info(" Current: addr = " PTR_FORMAT ", size = " SIZE_FORMAT ", obj = %s, live = %s \n" + " Previous: addr = " PTR_FORMAT ", size = " SIZE_FORMAT ", obj = %s, live = %s \n", p2i(addr), res, was_obj ?"true":"false", was_live ?"true":"false", p2i(_last_addr), _last_size, _last_was_obj?"true":"false", _last_was_live?"true":"false"); - _sp->print_on(gclog_or_tty); - guarantee(false, "Seppuku!"); + ResourceMark rm; + _sp->print_on(log.info_stream()); + guarantee(false, "Verification failed."); } _last_addr = addr; _last_size = res; @@ -2386,17 +2375,23 @@ void CompactibleFreeListSpace::check_free_list_consistency() const { void CompactibleFreeListSpace::printFLCensus(size_t sweep_count) const { assert_lock_strong(&_freelistLock); + LogHandle(gc, freelist, census) log; + if (!log.is_debug()) { + return; + } AdaptiveFreeList total; - gclog_or_tty->print("end sweep# " SIZE_FORMAT "\n", sweep_count); - AdaptiveFreeList::print_labels_on(gclog_or_tty, "size"); + log.debug("end sweep# " SIZE_FORMAT, sweep_count); + ResourceMark rm; + outputStream* out = log.debug_stream(); + AdaptiveFreeList::print_labels_on(out, "size"); size_t total_free = 0; for (size_t i = IndexSetStart; i < IndexSetSize; i += IndexSetStride) { const AdaptiveFreeList *fl = &_indexedFreeList[i]; total_free += fl->count() * fl->size(); if (i % (40*IndexSetStride) == 0) { - AdaptiveFreeList::print_labels_on(gclog_or_tty, "size"); + AdaptiveFreeList::print_labels_on(out, "size"); } - fl->print_on(gclog_or_tty); + fl->print_on(out); total.set_bfr_surp( total.bfr_surp() + fl->bfr_surp() ); total.set_surplus( total.surplus() + fl->surplus() ); total.set_desired( total.desired() + fl->desired() ); @@ -2408,14 +2403,13 @@ void CompactibleFreeListSpace::printFLCensus(size_t sweep_count) const { total.set_split_births(total.split_births() + fl->split_births()); total.set_split_deaths(total.split_deaths() + fl->split_deaths()); } - total.print_on(gclog_or_tty, "TOTAL"); - gclog_or_tty->print_cr("Total free in indexed lists " - SIZE_FORMAT " words", total_free); - gclog_or_tty->print("growth: %8.5f deficit: %8.5f\n", - (double)(total.split_births()+total.coal_births()-total.split_deaths()-total.coal_deaths())/ - (total.prev_sweep() != 0 ? (double)total.prev_sweep() : 1.0), - (double)(total.desired() - total.count())/(total.desired() != 0 ? (double)total.desired() : 1.0)); - _dictionary->print_dict_census(); + total.print_on(out, "TOTAL"); + log.debug("Total free in indexed lists " SIZE_FORMAT " words", total_free); + log.debug("growth: %8.5f deficit: %8.5f", + (double)(total.split_births()+total.coal_births()-total.split_deaths()-total.coal_deaths())/ + (total.prev_sweep() != 0 ? (double)total.prev_sweep() : 1.0), + (double)(total.desired() - total.count())/(total.desired() != 0 ? (double)total.desired() : 1.0)); + _dictionary->print_dict_census(out); } /////////////////////////////////////////////////////////////////////////// @@ -2544,10 +2538,7 @@ void CFLS_LAB::compute_desired_plab_size() { // Reset counters for next round _global_num_workers[i] = 0; _global_num_blocks[i] = 0; - if (PrintOldPLAB) { - gclog_or_tty->print_cr("[" SIZE_FORMAT "]: " SIZE_FORMAT, - i, (size_t)_blocks_to_claim[i].average()); - } + log_trace(gc, plab)("[" SIZE_FORMAT "]: " SIZE_FORMAT, i, (size_t)_blocks_to_claim[i].average()); } } } @@ -2584,10 +2575,8 @@ void CFLS_LAB::retire(int tid) { _indexedFreeList[i].set_size(i); } } - if (PrintOldPLAB) { - gclog_or_tty->print_cr("%d[" SIZE_FORMAT "]: " SIZE_FORMAT "/" SIZE_FORMAT "/" SIZE_FORMAT, - tid, i, num_retire, _num_blocks[i], (size_t)_blocks_to_claim[i].average()); - } + log_trace(gc, plab)("%d[" SIZE_FORMAT "]: " SIZE_FORMAT "/" SIZE_FORMAT "/" SIZE_FORMAT, + tid, i, num_retire, _num_blocks[i], (size_t)_blocks_to_claim[i].average()); // Reset stats for next round _num_blocks[i] = 0; } diff --git a/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.hpp b/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.hpp index 3cfc3a665f5..5c233452a16 100644 --- a/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.hpp +++ b/hotspot/src/share/vm/gc/cms/compactibleFreeListSpace.hpp @@ -29,6 +29,7 @@ #include "gc/cms/promotionInfo.hpp" #include "gc/shared/blockOffsetTable.hpp" #include "gc/shared/space.hpp" +#include "logging/log.hpp" #include "memory/binaryTreeDictionary.hpp" #include "memory/freeList.hpp" @@ -275,8 +276,8 @@ class CompactibleFreeListSpace: public CompactibleSpace { void verify_objects_initialized() const; // Statistics reporting helper functions - void reportFreeListStatistics() const; - void reportIndexedFreeListStatistics() const; + void reportFreeListStatistics(const char* title) const; + void reportIndexedFreeListStatistics(outputStream* st) const; size_t maxChunkSizeInIndexedFreeLists() const; size_t numFreeBlocksInIndexedFreeLists() const; // Accessor @@ -450,11 +451,9 @@ class CompactibleFreeListSpace: public CompactibleSpace { void save_sweep_limit() { _sweep_limit = BlockOffsetArrayUseUnallocatedBlock ? unallocated_block() : end(); - if (CMSTraceSweeper) { - gclog_or_tty->print_cr(">>>>> Saving sweep limit " PTR_FORMAT - " for space [" PTR_FORMAT "," PTR_FORMAT ") <<<<<<", - p2i(_sweep_limit), p2i(bottom()), p2i(end())); - } + log_develop_trace(gc, sweep)(">>>>> Saving sweep limit " PTR_FORMAT + " for space [" PTR_FORMAT "," PTR_FORMAT ") <<<<<<", + p2i(_sweep_limit), p2i(bottom()), p2i(end())); } NOT_PRODUCT( void clear_sweep_limit() { _sweep_limit = NULL; } diff --git a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp index 3b7a7d91605..92ede42baef 100644 --- a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp +++ b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp @@ -47,13 +47,14 @@ #include "gc/shared/gcPolicyCounters.hpp" #include "gc/shared/gcTimer.hpp" #include "gc/shared/gcTrace.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/genOopClosures.inline.hpp" #include "gc/shared/isGCActiveMark.hpp" #include "gc/shared/referencePolicy.hpp" #include "gc/shared/strongRootsScope.hpp" #include "gc/shared/taskqueue.inline.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" #include "memory/iterator.inline.hpp" #include "memory/padded.hpp" @@ -65,6 +66,7 @@ #include "runtime/handles.inline.hpp" #include "runtime/java.hpp" #include "runtime/orderAccess.inline.hpp" +#include "runtime/timer.hpp" #include "runtime/vmThread.hpp" #include "services/memoryService.hpp" #include "services/runtimeService.hpp" @@ -367,13 +369,9 @@ double CMSStats::time_until_cms_gen_full() const { cms_adjustment = cms_adjustment * cms_free_adjustment_factor(cms_free); cms_free_dbl = cms_free_dbl * cms_adjustment; - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr("CMSStats::time_until_cms_gen_full: cms_free " - SIZE_FORMAT " expected_promotion " SIZE_FORMAT, - cms_free, expected_promotion); - gclog_or_tty->print_cr(" cms_free_dbl %f cms_consumption_rate %f", - cms_free_dbl, cms_consumption_rate() + 1.0); - } + log_trace(gc)("CMSStats::time_until_cms_gen_full: cms_free " SIZE_FORMAT " expected_promotion " SIZE_FORMAT, + cms_free, expected_promotion); + log_trace(gc)(" cms_free_dbl %f cms_consumption_rate %f", cms_free_dbl, cms_consumption_rate() + 1.0); // Add 1 in case the consumption rate goes to zero. return cms_free_dbl / (cms_consumption_rate() + 1.0); } @@ -402,12 +400,8 @@ double CMSStats::time_until_cms_start() const { // If a concurrent mode failure occurred recently, we want to be // more conservative and halve our expected time_until_cms_gen_full() if (work > deadline) { - if (Verbose && PrintGCDetails) { - gclog_or_tty->print( - " CMSCollector: collect because of anticipated promotion " - "before full %3.7f + %3.7f > %3.7f ", cms_duration(), - gc0_period(), time_until_cms_gen_full()); - } + log_develop_trace(gc)("CMSCollector: collect because of anticipated promotion before full %3.7f + %3.7f > %3.7f ", + cms_duration(), gc0_period(), time_until_cms_gen_full()); return 0.0; } return work - deadline; @@ -669,31 +663,6 @@ void ConcurrentMarkSweepGeneration::print_statistics() { } #endif -void ConcurrentMarkSweepGeneration::printOccupancy(const char *s) { - GenCollectedHeap* gch = GenCollectedHeap::heap(); - if (PrintGCDetails) { - // I didn't want to change the logging when removing the level concept, - // but I guess this logging could say "old" or something instead of "1". - assert(gch->is_old_gen(this), - "The CMS generation should be the old generation"); - uint level = 1; - if (Verbose) { - gclog_or_tty->print("[%u %s-%s: " SIZE_FORMAT "(" SIZE_FORMAT ")]", - level, short_name(), s, used(), capacity()); - } else { - gclog_or_tty->print("[%u %s-%s: " SIZE_FORMAT "K(" SIZE_FORMAT "K)]", - level, short_name(), s, used() / K, capacity() / K); - } - } - if (Verbose) { - gclog_or_tty->print(" " SIZE_FORMAT "(" SIZE_FORMAT ")", - gch->used(), gch->capacity()); - } else { - gclog_or_tty->print(" " SIZE_FORMAT "K(" SIZE_FORMAT "K)", - gch->used() / K, gch->capacity() / K); - } -} - size_t ConcurrentMarkSweepGeneration::contiguous_available() const { // dld proposes an improvement in precision here. If the committed @@ -717,21 +686,18 @@ bool ConcurrentMarkSweepGeneration::promotion_attempt_is_safe(size_t max_promoti size_t available = max_available(); size_t av_promo = (size_t)gc_stats()->avg_promoted()->padded_average(); bool res = (available >= av_promo) || (available >= max_promotion_in_bytes); - if (Verbose && PrintGCDetails) { - gclog_or_tty->print_cr( - "CMS: promo attempt is%s safe: available(" SIZE_FORMAT ") %s av_promo(" SIZE_FORMAT ")," - "max_promo(" SIZE_FORMAT ")", - res? "":" not", available, res? ">=":"<", - av_promo, max_promotion_in_bytes); - } + log_trace(gc, promotion)("CMS: promo attempt is%s safe: available(" SIZE_FORMAT ") %s av_promo(" SIZE_FORMAT "), max_promo(" SIZE_FORMAT ")", + res? "":" not", available, res? ">=":"<", av_promo, max_promotion_in_bytes); return res; } // At a promotion failure dump information on block layout in heap // (cms old generation). void ConcurrentMarkSweepGeneration::promotion_failure_occurred() { - if (CMSDumpAtPromotionFailure) { - cmsSpace()->dump_at_safepoint_with_locks(collector(), gclog_or_tty); + LogHandle(gc, promotion) log; + if (log.is_trace()) { + ResourceMark rm; + cmsSpace()->dump_at_safepoint_with_locks(collector(), log.trace_stream()); } } @@ -787,27 +753,26 @@ void ConcurrentMarkSweepGeneration::compute_new_size_free_list() { size_t desired_capacity = (size_t)(used() / ((double) 1 - desired_free_percentage)); assert(desired_capacity >= capacity(), "invalid expansion size"); size_t expand_bytes = MAX2(desired_capacity - capacity(), MinHeapDeltaBytes); - if (PrintGCDetails && Verbose) { + LogHandle(gc) log; + if (log.is_trace()) { size_t desired_capacity = (size_t)(used() / ((double) 1 - desired_free_percentage)); - gclog_or_tty->print_cr("\nFrom compute_new_size: "); - gclog_or_tty->print_cr(" Free fraction %f", free_percentage); - gclog_or_tty->print_cr(" Desired free fraction %f", desired_free_percentage); - gclog_or_tty->print_cr(" Maximum free fraction %f", maximum_free_percentage); - gclog_or_tty->print_cr(" Capacity " SIZE_FORMAT, capacity() / 1000); - gclog_or_tty->print_cr(" Desired capacity " SIZE_FORMAT, desired_capacity / 1000); + log.trace("From compute_new_size: "); + log.trace(" Free fraction %f", free_percentage); + log.trace(" Desired free fraction %f", desired_free_percentage); + log.trace(" Maximum free fraction %f", maximum_free_percentage); + log.trace(" Capacity " SIZE_FORMAT, capacity() / 1000); + log.trace(" Desired capacity " SIZE_FORMAT, desired_capacity / 1000); GenCollectedHeap* gch = GenCollectedHeap::heap(); assert(gch->is_old_gen(this), "The CMS generation should always be the old generation"); size_t young_size = gch->young_gen()->capacity(); - gclog_or_tty->print_cr(" Young gen size " SIZE_FORMAT, young_size / 1000); - gclog_or_tty->print_cr(" unsafe_max_alloc_nogc " SIZE_FORMAT, unsafe_max_alloc_nogc() / 1000); - gclog_or_tty->print_cr(" contiguous available " SIZE_FORMAT, contiguous_available() / 1000); - gclog_or_tty->print_cr(" Expand by " SIZE_FORMAT " (bytes)", expand_bytes); + log.trace(" Young gen size " SIZE_FORMAT, young_size / 1000); + log.trace(" unsafe_max_alloc_nogc " SIZE_FORMAT, unsafe_max_alloc_nogc() / 1000); + log.trace(" contiguous available " SIZE_FORMAT, contiguous_available() / 1000); + log.trace(" Expand by " SIZE_FORMAT " (bytes)", expand_bytes); } // safe if expansion fails expand_for_gc_cause(expand_bytes, 0, CMSExpansionCause::_satisfy_free_ratio); - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr(" Expanded free fraction %f", ((double) free()) / capacity()); - } + log.trace(" Expanded free fraction %f", ((double) free()) / capacity()); } else { size_t desired_capacity = (size_t)(used() / ((double) 1 - desired_free_percentage)); assert(desired_capacity <= capacity(), "invalid expansion size"); @@ -1145,10 +1110,7 @@ bool ConcurrentMarkSweepGeneration::should_collect(bool full, bool CMSCollector::shouldConcurrentCollect() { if (_full_gc_requested) { - if (Verbose && PrintGCDetails) { - gclog_or_tty->print_cr("CMSCollector: collect because of explicit " - " gc request (or gc_locker)"); - } + log_trace(gc)("CMSCollector: collect because of explicit gc request (or gc_locker)"); return true; } @@ -1156,24 +1118,21 @@ bool CMSCollector::shouldConcurrentCollect() { // ------------------------------------------------------------------ // Print out lots of information which affects the initiation of // a collection. - if (PrintCMSInitiationStatistics && stats().valid()) { - gclog_or_tty->print("CMSCollector shouldConcurrentCollect: "); - gclog_or_tty->stamp(); - gclog_or_tty->cr(); - stats().print_on(gclog_or_tty); - gclog_or_tty->print_cr("time_until_cms_gen_full %3.7f", - stats().time_until_cms_gen_full()); - gclog_or_tty->print_cr("free=" SIZE_FORMAT, _cmsGen->free()); - gclog_or_tty->print_cr("contiguous_available=" SIZE_FORMAT, - _cmsGen->contiguous_available()); - gclog_or_tty->print_cr("promotion_rate=%g", stats().promotion_rate()); - gclog_or_tty->print_cr("cms_allocation_rate=%g", stats().cms_allocation_rate()); - gclog_or_tty->print_cr("occupancy=%3.7f", _cmsGen->occupancy()); - gclog_or_tty->print_cr("initiatingOccupancy=%3.7f", _cmsGen->initiating_occupancy()); - gclog_or_tty->print_cr("cms_time_since_begin=%3.7f", stats().cms_time_since_begin()); - gclog_or_tty->print_cr("cms_time_since_end=%3.7f", stats().cms_time_since_end()); - gclog_or_tty->print_cr("metadata initialized %d", - MetaspaceGC::should_concurrent_collect()); + LogHandle(gc) log; + if (log.is_trace() && stats().valid()) { + log.trace("CMSCollector shouldConcurrentCollect: "); + ResourceMark rm; + stats().print_on(log.debug_stream()); + log.trace("time_until_cms_gen_full %3.7f", stats().time_until_cms_gen_full()); + log.trace("free=" SIZE_FORMAT, _cmsGen->free()); + log.trace("contiguous_available=" SIZE_FORMAT, _cmsGen->contiguous_available()); + log.trace("promotion_rate=%g", stats().promotion_rate()); + log.trace("cms_allocation_rate=%g", stats().cms_allocation_rate()); + log.trace("occupancy=%3.7f", _cmsGen->occupancy()); + log.trace("initiatingOccupancy=%3.7f", _cmsGen->initiating_occupancy()); + log.trace("cms_time_since_begin=%3.7f", stats().cms_time_since_begin()); + log.trace("cms_time_since_end=%3.7f", stats().cms_time_since_end()); + log.trace("metadata initialized %d", MetaspaceGC::should_concurrent_collect()); } // ------------------------------------------------------------------ @@ -1191,12 +1150,8 @@ bool CMSCollector::shouldConcurrentCollect() { // this branch will not fire after the first successful CMS // collection because the stats should then be valid. if (_cmsGen->occupancy() >= _bootstrap_occupancy) { - if (Verbose && PrintGCDetails) { - gclog_or_tty->print_cr( - " CMSCollector: collect for bootstrapping statistics:" - " occupancy = %f, boot occupancy = %f", _cmsGen->occupancy(), - _bootstrap_occupancy); - } + log_trace(gc)(" CMSCollector: collect for bootstrapping statistics: occupancy = %f, boot occupancy = %f", + _cmsGen->occupancy(), _bootstrap_occupancy); return true; } } @@ -1208,9 +1163,7 @@ bool CMSCollector::shouldConcurrentCollect() { // XXX We need to make sure that the gen expansion // criterion dovetails well with this. XXX NEED TO FIX THIS if (_cmsGen->should_concurrent_collect()) { - if (Verbose && PrintGCDetails) { - gclog_or_tty->print_cr("CMS old gen initiated"); - } + log_trace(gc)("CMS old gen initiated"); return true; } @@ -1221,16 +1174,12 @@ bool CMSCollector::shouldConcurrentCollect() { assert(gch->collector_policy()->is_generation_policy(), "You may want to check the correctness of the following"); if (gch->incremental_collection_will_fail(true /* consult_young */)) { - if (Verbose && PrintGCDetails) { - gclog_or_tty->print("CMSCollector: collect because incremental collection will fail "); - } + log_trace(gc)("CMSCollector: collect because incremental collection will fail "); return true; } if (MetaspaceGC::should_concurrent_collect()) { - if (Verbose && PrintGCDetails) { - gclog_or_tty->print("CMSCollector: collect for metadata allocation "); - } + log_trace(gc)("CMSCollector: collect for metadata allocation "); return true; } @@ -1244,13 +1193,11 @@ bool CMSCollector::shouldConcurrentCollect() { // Check the CMS time since begin (we do not check the stats validity // as we want to be able to trigger the first CMS cycle as well) if (stats().cms_time_since_begin() >= (CMSTriggerInterval / ((double) MILLIUNITS))) { - if (Verbose && PrintGCDetails) { - if (stats().valid()) { - gclog_or_tty->print_cr("CMSCollector: collect because of trigger interval (time since last begin %3.7f secs)", - stats().cms_time_since_begin()); - } else { - gclog_or_tty->print_cr("CMSCollector: collect because of trigger interval (first collection)"); - } + if (stats().valid()) { + log_trace(gc)("CMSCollector: collect because of trigger interval (time since last begin %3.7f secs)", + stats().cms_time_since_begin()); + } else { + log_trace(gc)("CMSCollector: collect because of trigger interval (first collection)"); } return true; } @@ -1293,20 +1240,15 @@ bool ConcurrentMarkSweepGeneration::should_concurrent_collect() const { assert_lock_strong(freelistLock()); if (occupancy() > initiating_occupancy()) { - if (PrintGCDetails && Verbose) { - gclog_or_tty->print(" %s: collect because of occupancy %f / %f ", - short_name(), occupancy(), initiating_occupancy()); - } + log_trace(gc)(" %s: collect because of occupancy %f / %f ", + short_name(), occupancy(), initiating_occupancy()); return true; } if (UseCMSInitiatingOccupancyOnly) { return false; } if (expansion_cause() == CMSExpansionCause::_satisfy_allocation) { - if (PrintGCDetails && Verbose) { - gclog_or_tty->print(" %s: collect because expanded for allocation ", - short_name()); - } + log_trace(gc)(" %s: collect because expanded for allocation ", short_name()); return true; } return false; @@ -1363,13 +1305,9 @@ bool CMSCollector::is_external_interruption() { void CMSCollector::report_concurrent_mode_interruption() { if (is_external_interruption()) { - if (PrintGCDetails) { - gclog_or_tty->print(" (concurrent mode interrupted)"); - } + log_debug(gc)("Concurrent mode interrupted"); } else { - if (PrintGCDetails) { - gclog_or_tty->print(" (concurrent mode failure)"); - } + log_debug(gc)("Concurrent mode failure"); _gc_tracer_cm->report_concurrent_mode_failure(); } } @@ -1503,11 +1441,9 @@ void CMSCollector::acquire_control_and_collect(bool full, "VM thread should have CMS token"); getFreelistLocks(); bitMapLock()->lock_without_safepoint_check(); - if (TraceCMSState) { - gclog_or_tty->print_cr("CMS foreground collector has asked for control " - INTPTR_FORMAT " with first state %d", p2i(Thread::current()), first_state); - gclog_or_tty->print_cr(" gets control with state %d", _collectorState); - } + log_debug(gc, state)("CMS foreground collector has asked for control " INTPTR_FORMAT " with first state %d", + p2i(Thread::current()), first_state); + log_debug(gc, state)(" gets control with state %d", _collectorState); // Inform cms gen if this was due to partial collection failing. // The CMS gen may use this fact to determine its expansion policy. @@ -1581,7 +1517,7 @@ void CMSCollector::do_compaction_work(bool clear_all_soft_refs) { SerialOldTracer* gc_tracer = GenMarkSweep::gc_tracer(); gc_tracer->report_gc_start(gch->gc_cause(), gc_timer->gc_start()); - GCTraceTime t("CMS:MSC ", PrintGCDetails && Verbose, true, NULL); + GCTraceTime(Trace, gc) t("CMS:MSC"); // Temporarily widen the span of the weak reference processing to // the entire heap. @@ -1666,33 +1602,34 @@ void CMSCollector::do_compaction_work(bool clear_all_soft_refs) { } void CMSCollector::print_eden_and_survivor_chunk_arrays() { + LogHandle(gc, heap) log; + if (!log.is_trace()) { + return; + } + ContiguousSpace* eden_space = _young_gen->eden(); ContiguousSpace* from_space = _young_gen->from(); ContiguousSpace* to_space = _young_gen->to(); // Eden if (_eden_chunk_array != NULL) { - gclog_or_tty->print_cr("eden " PTR_FORMAT "-" PTR_FORMAT "-" PTR_FORMAT "(" SIZE_FORMAT ")", - p2i(eden_space->bottom()), p2i(eden_space->top()), - p2i(eden_space->end()), eden_space->capacity()); - gclog_or_tty->print_cr("_eden_chunk_index=" SIZE_FORMAT ", " - "_eden_chunk_capacity=" SIZE_FORMAT, - _eden_chunk_index, _eden_chunk_capacity); + log.trace("eden " PTR_FORMAT "-" PTR_FORMAT "-" PTR_FORMAT "(" SIZE_FORMAT ")", + p2i(eden_space->bottom()), p2i(eden_space->top()), + p2i(eden_space->end()), eden_space->capacity()); + log.trace("_eden_chunk_index=" SIZE_FORMAT ", _eden_chunk_capacity=" SIZE_FORMAT, + _eden_chunk_index, _eden_chunk_capacity); for (size_t i = 0; i < _eden_chunk_index; i++) { - gclog_or_tty->print_cr("_eden_chunk_array[" SIZE_FORMAT "]=" PTR_FORMAT, - i, p2i(_eden_chunk_array[i])); + log.trace("_eden_chunk_array[" SIZE_FORMAT "]=" PTR_FORMAT, i, p2i(_eden_chunk_array[i])); } } // Survivor if (_survivor_chunk_array != NULL) { - gclog_or_tty->print_cr("survivor " PTR_FORMAT "-" PTR_FORMAT "-" PTR_FORMAT "(" SIZE_FORMAT ")", - p2i(from_space->bottom()), p2i(from_space->top()), - p2i(from_space->end()), from_space->capacity()); - gclog_or_tty->print_cr("_survivor_chunk_index=" SIZE_FORMAT ", " - "_survivor_chunk_capacity=" SIZE_FORMAT, - _survivor_chunk_index, _survivor_chunk_capacity); + log.trace("survivor " PTR_FORMAT "-" PTR_FORMAT "-" PTR_FORMAT "(" SIZE_FORMAT ")", + p2i(from_space->bottom()), p2i(from_space->top()), + p2i(from_space->end()), from_space->capacity()); + log.trace("_survivor_chunk_index=" SIZE_FORMAT ", _survivor_chunk_capacity=" SIZE_FORMAT, + _survivor_chunk_index, _survivor_chunk_capacity); for (size_t i = 0; i < _survivor_chunk_index; i++) { - gclog_or_tty->print_cr("_survivor_chunk_array[" SIZE_FORMAT "]=" PTR_FORMAT, - i, p2i(_survivor_chunk_array[i])); + log.trace("_survivor_chunk_array[" SIZE_FORMAT "]=" PTR_FORMAT, i, p2i(_survivor_chunk_array[i])); } } } @@ -1781,11 +1718,7 @@ void CMSCollector::collect_in_background(GCCause::Cause cause) { _collection_count_start = gch->total_full_collections(); } - // Used for PrintGC - size_t prev_used = 0; - if (PrintGC && Verbose) { - prev_used = _cmsGen->used(); - } + size_t prev_used = _cmsGen->used(); // The change of the collection state is normally done at this level; // the exceptions are phases that are executed while the world is @@ -1796,10 +1729,8 @@ void CMSCollector::collect_in_background(GCCause::Cause cause) { // while the world is stopped because the foreground collector already // has the world stopped and would deadlock. while (_collectorState != Idling) { - if (TraceCMSState) { - gclog_or_tty->print_cr("Thread " INTPTR_FORMAT " in CMS state %d", - p2i(Thread::current()), _collectorState); - } + log_debug(gc, state)("Thread " INTPTR_FORMAT " in CMS state %d", + p2i(Thread::current()), _collectorState); // The foreground collector // holds the Heap_lock throughout its collection. // holds the CMS token (but not the lock) @@ -1829,11 +1760,8 @@ void CMSCollector::collect_in_background(GCCause::Cause cause) { // done this round. assert(_foregroundGCShouldWait == false, "We set it to false in " "waitForForegroundGC()"); - if (TraceCMSState) { - gclog_or_tty->print_cr("CMS Thread " INTPTR_FORMAT - " exiting collection CMS state %d", - p2i(Thread::current()), _collectorState); - } + log_debug(gc, state)("CMS Thread " INTPTR_FORMAT " exiting collection CMS state %d", + p2i(Thread::current()), _collectorState); return; } else { // The background collector can run but check to see if the @@ -1937,10 +1865,8 @@ void CMSCollector::collect_in_background(GCCause::Cause cause) { ShouldNotReachHere(); break; } - if (TraceCMSState) { - gclog_or_tty->print_cr(" Thread " INTPTR_FORMAT " done - next CMS state %d", - p2i(Thread::current()), _collectorState); - } + log_debug(gc, state)(" Thread " INTPTR_FORMAT " done - next CMS state %d", + p2i(Thread::current()), _collectorState); assert(_foregroundGCShouldWait, "block post-condition"); } @@ -1959,14 +1885,10 @@ void CMSCollector::collect_in_background(GCCause::Cause cause) { assert(!ConcurrentMarkSweepThread::cms_thread_has_cms_token(), "Possible deadlock"); } - if (TraceCMSState) { - gclog_or_tty->print_cr("CMS Thread " INTPTR_FORMAT - " exiting collection CMS state %d", - p2i(Thread::current()), _collectorState); - } - if (PrintGC && Verbose) { - _cmsGen->print_heap_change(prev_used); - } + log_debug(gc, state)("CMS Thread " INTPTR_FORMAT " exiting collection CMS state %d", + p2i(Thread::current()), _collectorState); + log_info(gc, heap)("Old: " SIZE_FORMAT "K->" SIZE_FORMAT "K(" SIZE_FORMAT "K)", + prev_used / K, _cmsGen->used()/K, _cmsGen->capacity() /K); } void CMSCollector::register_gc_start(GCCause::Cause cause) { @@ -2018,10 +1940,8 @@ bool CMSCollector::waitForForegroundGC() { ConcurrentMarkSweepThread::CMS_cms_wants_token); // Get a possibly blocked foreground thread going CGC_lock->notify(); - if (TraceCMSState) { - gclog_or_tty->print_cr("CMS Thread " INTPTR_FORMAT " waiting at CMS state %d", - p2i(Thread::current()), _collectorState); - } + log_debug(gc, state)("CMS Thread " INTPTR_FORMAT " waiting at CMS state %d", + p2i(Thread::current()), _collectorState); while (_foregroundGCIsActive) { CGC_lock->wait(Mutex::_no_safepoint_check_flag); } @@ -2030,10 +1950,8 @@ bool CMSCollector::waitForForegroundGC() { ConcurrentMarkSweepThread::clear_CMS_flag( ConcurrentMarkSweepThread::CMS_cms_wants_token); } - if (TraceCMSState) { - gclog_or_tty->print_cr("CMS Thread " INTPTR_FORMAT " continuing at CMS state %d", - p2i(Thread::current()), _collectorState); - } + log_debug(gc, state)("CMS Thread " INTPTR_FORMAT " continuing at CMS state %d", + p2i(Thread::current()), _collectorState); return res; } @@ -2130,11 +2048,8 @@ void ConcurrentMarkSweepGeneration::gc_prologue_work(bool full, NOT_PRODUCT( assert(_numObjectsPromoted == 0, "check"); assert(_numWordsPromoted == 0, "check"); - if (Verbose && PrintGC) { - gclog_or_tty->print("Allocated " SIZE_FORMAT " objects, " - SIZE_FORMAT " bytes concurrently", - _numObjectsAllocated, _numWordsAllocated*sizeof(HeapWord)); - } + log_develop_trace(gc, alloc)("Allocated " SIZE_FORMAT " objects, " SIZE_FORMAT " bytes concurrently", + _numObjectsAllocated, _numWordsAllocated*sizeof(HeapWord)); _numObjectsAllocated = 0; _numWordsAllocated = 0; ) @@ -2211,21 +2126,15 @@ void ConcurrentMarkSweepGeneration::gc_epilogue_work(bool full) { NOT_PRODUCT( assert(_numObjectsAllocated == 0, "check"); assert(_numWordsAllocated == 0, "check"); - if (Verbose && PrintGC) { - gclog_or_tty->print("Promoted " SIZE_FORMAT " objects, " - SIZE_FORMAT " bytes", - _numObjectsPromoted, _numWordsPromoted*sizeof(HeapWord)); - } + log_develop_trace(gc, promotion)("Promoted " SIZE_FORMAT " objects, " SIZE_FORMAT " bytes", + _numObjectsPromoted, _numWordsPromoted*sizeof(HeapWord)); _numObjectsPromoted = 0; _numWordsPromoted = 0; ) - if (PrintGC && Verbose) { - // Call down the chain in contiguous_available needs the freelistLock - // so print this out before releasing the freeListLock. - gclog_or_tty->print(" Contiguous available " SIZE_FORMAT " bytes ", - contiguous_available()); - } + // Call down the chain in contiguous_available needs the freelistLock + // so print this out before releasing the freeListLock. + log_develop_trace(gc)(" Contiguous available " SIZE_FORMAT " bytes ", contiguous_available()); } #ifndef PRODUCT @@ -2309,8 +2218,10 @@ class VerifyMarkedClosure: public BitMapClosure { bool do_bit(size_t offset) { HeapWord* addr = _marks->offsetToHeapWord(offset); if (!_marks->isMarked(addr)) { - oop(addr)->print_on(gclog_or_tty); - gclog_or_tty->print_cr(" (" INTPTR_FORMAT " should have been marked)", p2i(addr)); + LogHandle(gc, verify) log; + ResourceMark rm; + oop(addr)->print_on(log.info_stream()); + log.info(" (" INTPTR_FORMAT " should have been marked)", p2i(addr)); _failed = true; } return true; @@ -2319,8 +2230,8 @@ class VerifyMarkedClosure: public BitMapClosure { bool failed() { return _failed; } }; -bool CMSCollector::verify_after_remark(bool silent) { - if (!silent) gclog_or_tty->print(" [Verifying CMS Marking... "); +bool CMSCollector::verify_after_remark() { + GCTraceTime(Info, gc, verify) tm("Verifying CMS Marking."); MutexLockerEx ml(verification_mark_bm()->lock(), Mutex::_no_safepoint_check_flag); static bool init = false; @@ -2383,7 +2294,6 @@ bool CMSCollector::verify_after_remark(bool silent) { warning("Unrecognized value " UINTX_FORMAT " for CMSRemarkVerifyVariant", CMSRemarkVerifyVariant); } - if (!silent) gclog_or_tty->print(" done] "); return true; } @@ -2435,8 +2345,10 @@ void CMSCollector::verify_after_remark_work_1() { VerifyMarkedClosure vcl(markBitMap()); verification_mark_bm()->iterate(&vcl); if (vcl.failed()) { - gclog_or_tty->print("Verification failed"); - gch->print_on(gclog_or_tty); + LogHandle(gc, verify) log; + log.info("Verification failed"); + ResourceMark rm; + gch->print_on(log.info_stream()); fatal("CMS: failed marking verification after remark"); } } @@ -2729,10 +2641,7 @@ void ConcurrentMarkSweepGeneration::expand_for_gc_cause( // a new CMS cycle. if (success) { set_expansion_cause(cause); - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr("Expanded CMS gen for %s", - CMSExpansionCause::to_string(cause)); - } + log_trace(gc)("Expanded CMS gen for %s", CMSExpansionCause::to_string(cause)); } } @@ -2800,9 +2709,7 @@ void ConcurrentMarkSweepGeneration::assert_correct_size_change_locking() { void ConcurrentMarkSweepGeneration::shrink_free_list_by(size_t bytes) { assert_locked_or_safepoint(Heap_lock); assert_lock_strong(freelistLock()); - if (PrintGCDetails && Verbose) { - warning("Shrinking of CMS not yet implemented"); - } + log_trace(gc)("Shrinking of CMS not yet implemented"); return; } @@ -2812,63 +2719,35 @@ void ConcurrentMarkSweepGeneration::shrink_free_list_by(size_t bytes) { class CMSPhaseAccounting: public StackObj { public: CMSPhaseAccounting(CMSCollector *collector, - const char *phase, - bool print_cr = true); + const char *title); ~CMSPhaseAccounting(); private: CMSCollector *_collector; - const char *_phase; - elapsedTimer _wallclock; - bool _print_cr; + const char *_title; + GCTraceConcTime(Info, gc) _trace_time; public: // Not MT-safe; so do not pass around these StackObj's // where they may be accessed by other threads. jlong wallclock_millis() { - assert(_wallclock.is_active(), "Wall clock should not stop"); - _wallclock.stop(); // to record time - jlong ret = _wallclock.milliseconds(); - _wallclock.start(); // restart - return ret; + return TimeHelper::counter_to_millis(os::elapsed_counter() - _trace_time.start_time()); } }; CMSPhaseAccounting::CMSPhaseAccounting(CMSCollector *collector, - const char *phase, - bool print_cr) : - _collector(collector), _phase(phase), _print_cr(print_cr) { + const char *title) : + _collector(collector), _title(title), _trace_time(title) { - if (PrintCMSStatistics != 0) { - _collector->resetYields(); - } - if (PrintGCDetails) { - gclog_or_tty->gclog_stamp(); - gclog_or_tty->print_cr("[%s-concurrent-%s-start]", - _collector->cmsGen()->short_name(), _phase); - } + _collector->resetYields(); _collector->resetTimer(); - _wallclock.start(); _collector->startTimer(); } CMSPhaseAccounting::~CMSPhaseAccounting() { - assert(_wallclock.is_active(), "Wall clock should not have stopped"); _collector->stopTimer(); - _wallclock.stop(); - if (PrintGCDetails) { - gclog_or_tty->gclog_stamp(); - gclog_or_tty->print("[%s-concurrent-%s: %3.3f/%3.3f secs]", - _collector->cmsGen()->short_name(), - _phase, _collector->timerValue(), _wallclock.seconds()); - if (_print_cr) { - gclog_or_tty->cr(); - } - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr(" (CMS-concurrent-%s yielded %d times)", _phase, - _collector->yields()); - } - } + log_debug(gc)("Concurrent active time: %.3fms", TimeHelper::counter_to_seconds(_collector->timerTicks())); + log_trace(gc)(" (CMS %s yielded %d times)", _title, _collector->yields()); } // CMS work @@ -2935,8 +2814,7 @@ void CMSCollector::checkpointRootsInitialWork() { // CMS collection cycle. setup_cms_unloading_and_verification_state(); - NOT_PRODUCT(GCTraceTime t("\ncheckpointRootsInitialWork", - PrintGCDetails && Verbose, true, _gc_timer_cm);) + GCTraceTime(Trace, gc) ts("checkpointRootsInitialWork", _gc_timer_cm); // Reset all the PLAB chunk arrays if necessary. if (_survivor_plab_array != NULL && !CMSPLABRecordAlways) { @@ -2967,9 +2845,7 @@ void CMSCollector::checkpointRootsInitialWork() { // the klasses. The claimed marks need to be cleared before marking starts. ClassLoaderDataGraph::clear_claimed_marks(); - if (CMSPrintEdenSurvivorChunks) { - print_eden_and_survivor_chunk_arrays(); - } + print_eden_and_survivor_chunk_arrays(); { #if defined(COMPILER2) || INCLUDE_JVMCI @@ -3040,17 +2916,15 @@ bool CMSCollector::markFromRoots() { // weak ref discovery by the young generation collector. CMSTokenSyncWithLocks ts(true, bitMapLock()); - TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); - CMSPhaseAccounting pa(this, "mark", !PrintGCDetails); + GCTraceCPUTime tcpu; + CMSPhaseAccounting pa(this, "Concrurrent Mark"); bool res = markFromRootsWork(); if (res) { _collectorState = Precleaning; } else { // We failed and a foreground collection wants to take over assert(_foregroundGCIsActive, "internal state inconsistency"); assert(_restart_addr == NULL, "foreground will restart from scratch"); - if (PrintGCDetails) { - gclog_or_tty->print_cr("bailing out to foreground collection"); - } + log_debug(gc)("bailing out to foreground collection"); } verify_overflow_empty(); return res; @@ -3255,22 +3129,14 @@ void CMSConcMarkingTask::work(uint worker_id) { _timer.start(); do_scan_and_mark(worker_id, _cms_space); _timer.stop(); - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr("Finished cms space scanning in %dth thread: %3.3f sec", - worker_id, _timer.seconds()); - // XXX: need xxx/xxx type of notation, two timers - } + log_trace(gc, task)("Finished cms space scanning in %dth thread: %3.3f sec", worker_id, _timer.seconds()); // ... do work stealing _timer.reset(); _timer.start(); do_work_steal(worker_id); _timer.stop(); - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr("Finished work stealing in %dth thread: %3.3f sec", - worker_id, _timer.seconds()); - // XXX: need xxx/xxx type of notation, two timers - } + log_trace(gc, task)("Finished work stealing in %dth thread: %3.3f sec", worker_id, _timer.seconds()); assert(_collector->_markStack.isEmpty(), "Should have been emptied"); assert(work_queue(worker_id)->size() == 0, "Should have been emptied"); // Note that under the current task protocol, the @@ -3485,10 +3351,7 @@ void Par_ConcMarkingClosure::do_oop(oop obj) { if (simulate_overflow || !(_work_queue->push(obj) || _overflow_stack->par_push(obj))) { // stack overflow - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr("CMS marking stack overflow (benign) at " - SIZE_FORMAT, _overflow_stack->capacity()); - } + log_trace(gc)("CMS marking stack overflow (benign) at " SIZE_FORMAT, _overflow_stack->capacity()); // We cannot assert that the overflow stack is full because // it may have been emptied since. assert(simulate_overflow || @@ -3573,9 +3436,7 @@ void CMSConcMarkingTask::coordinator_yield() { _bit_map_lock->unlock(); ConcurrentMarkSweepThread::desynchronize(true); _collector->stopTimer(); - if (PrintCMSStatistics != 0) { - _collector->incrementYields(); - } + _collector->incrementYields(); // It is possible for whichever thread initiated the yield request // not to get a chance to wake up and take the bitmap lock between @@ -3737,8 +3598,8 @@ void CMSCollector::preclean() { } else { _start_sampling = false; } - TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); - CMSPhaseAccounting pa(this, "preclean", !PrintGCDetails); + GCTraceCPUTime tcpu; + CMSPhaseAccounting pa(this, "Concurrent Preclean"); preclean_work(CMSPrecleanRefLists1, CMSPrecleanSurvivors1); } CMSTokenSync x(true); // is cms thread @@ -3766,8 +3627,8 @@ void CMSCollector::abortable_preclean() { // CMSScheduleRemarkEdenSizeThreshold >= max eden size // we will never do an actual abortable preclean cycle. if (get_eden_used() > CMSScheduleRemarkEdenSizeThreshold) { - TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); - CMSPhaseAccounting pa(this, "abortable-preclean", !PrintGCDetails); + GCTraceCPUTime tcpu; + CMSPhaseAccounting pa(this, "Concurrent Abortable Preclean"); // We need more smarts in the abortable preclean // loop below to deal with cases where allocation // in young gen is very very slow, and our precleaning @@ -3789,15 +3650,11 @@ void CMSCollector::abortable_preclean() { // been at it for too long. if ((CMSMaxAbortablePrecleanLoops != 0) && loops >= CMSMaxAbortablePrecleanLoops) { - if (PrintGCDetails) { - gclog_or_tty->print(" CMS: abort preclean due to loops "); - } + log_debug(gc)(" CMS: abort preclean due to loops "); break; } if (pa.wallclock_millis() > CMSMaxAbortablePrecleanTime) { - if (PrintGCDetails) { - gclog_or_tty->print(" CMS: abort preclean due to time "); - } + log_debug(gc)(" CMS: abort preclean due to time "); break; } // If we are doing little work each iteration, we should @@ -3810,10 +3667,8 @@ void CMSCollector::abortable_preclean() { waited++; } } - if (PrintCMSStatistics > 0) { - gclog_or_tty->print(" [" SIZE_FORMAT " iterations, " SIZE_FORMAT " waits, " SIZE_FORMAT " cards)] ", - loops, waited, cumworkdone); - } + log_trace(gc)(" [" SIZE_FORMAT " iterations, " SIZE_FORMAT " waits, " SIZE_FORMAT " cards)] ", + loops, waited, cumworkdone); } CMSTokenSync x(true); // is cms thread if (_collectorState != Idling) { @@ -3957,9 +3812,7 @@ size_t CMSCollector::preclean_work(bool clean_refs, bool clean_survivor) { numIter < CMSPrecleanIter; numIter++, lastNumCards = curNumCards, cumNumCards += curNumCards) { curNumCards = preclean_mod_union_table(_cmsGen, &smoac_cl); - if (Verbose && PrintGCDetails) { - gclog_or_tty->print(" (modUnionTable: " SIZE_FORMAT " cards)", curNumCards); - } + log_trace(gc)(" (modUnionTable: " SIZE_FORMAT " cards)", curNumCards); // Either there are very few dirty cards, so re-mark // pause will be small anyway, or our pre-cleaning isn't // that much faster than the rate at which cards are being @@ -3979,10 +3832,8 @@ size_t CMSCollector::preclean_work(bool clean_refs, bool clean_survivor) { curNumCards = preclean_card_table(_cmsGen, &smoac_cl); cumNumCards += curNumCards; - if (PrintGCDetails && PrintCMSStatistics != 0) { - gclog_or_tty->print_cr(" (cardTable: " SIZE_FORMAT " cards, re-scanned " SIZE_FORMAT " cards, " SIZE_FORMAT " iterations)", - curNumCards, cumNumCards, numIter); - } + log_trace(gc)(" (cardTable: " SIZE_FORMAT " cards, re-scanned " SIZE_FORMAT " cards, " SIZE_FORMAT " iterations)", + curNumCards, cumNumCards, numIter); return cumNumCards; // as a measure of useful work done } @@ -4236,19 +4087,17 @@ void CMSCollector::checkpointRootsFinal() { verify_work_stacks_empty(); verify_overflow_empty(); - if (PrintGCDetails) { - gclog_or_tty->print("[YG occupancy: " SIZE_FORMAT " K (" SIZE_FORMAT " K)]", - _young_gen->used() / K, - _young_gen->capacity() / K); - } + log_debug(gc)("YG occupancy: " SIZE_FORMAT " K (" SIZE_FORMAT " K)", + _young_gen->used() / K, _young_gen->capacity() / K); { if (CMSScavengeBeforeRemark) { GenCollectedHeap* gch = GenCollectedHeap::heap(); // Temporarily set flag to false, GCH->do_collection will // expect it to be false and set to true FlagSetting fl(gch->_is_gc_active, false); - NOT_PRODUCT(GCTraceTime t("Scavenge-Before-Remark", - PrintGCDetails && Verbose, true, _gc_timer_cm);) + + GCTraceTime(Trace, gc) tm("Pause Scavenge Before Remark", _gc_timer_cm); + gch->do_collection(true, // full (i.e. force, see below) false, // !clear_all_soft_refs 0, // size @@ -4266,7 +4115,7 @@ void CMSCollector::checkpointRootsFinal() { } void CMSCollector::checkpointRootsFinalWork() { - NOT_PRODUCT(GCTraceTime tr("checkpointRootsFinalWork", PrintGCDetails, false, _gc_timer_cm);) + GCTraceTime(Trace, gc) tm("checkpointRootsFinalWork", _gc_timer_cm); assert(haveFreelistLocks(), "must have free list locks"); assert_lock_strong(bitMapLock()); @@ -4298,9 +4147,7 @@ void CMSCollector::checkpointRootsFinalWork() { // Update the saved marks which may affect the root scans. gch->save_marks(); - if (CMSPrintEdenSurvivorChunks) { - print_eden_and_survivor_chunk_arrays(); - } + print_eden_and_survivor_chunk_arrays(); { #if defined(COMPILER2) || INCLUDE_JVMCI @@ -4318,10 +4165,10 @@ void CMSCollector::checkpointRootsFinalWork() { // the most recent young generation GC, minus those cleaned up by the // concurrent precleaning. if (CMSParallelRemarkEnabled) { - GCTraceTime t("Rescan (parallel) ", PrintGCDetails, false, _gc_timer_cm); + GCTraceTime(Debug, gc) t("Rescan (parallel)", _gc_timer_cm); do_remark_parallel(); } else { - GCTraceTime t("Rescan (non-parallel) ", PrintGCDetails, false, _gc_timer_cm); + GCTraceTime(Debug, gc) t("Rescan (non-parallel)", _gc_timer_cm); do_remark_non_parallel(); } } @@ -4329,7 +4176,7 @@ void CMSCollector::checkpointRootsFinalWork() { verify_overflow_empty(); { - NOT_PRODUCT(GCTraceTime ts("refProcessingWork", PrintGCDetails, false, _gc_timer_cm);) + GCTraceTime(Trace, gc) ts("refProcessingWork", _gc_timer_cm); refProcessingWork(); } verify_work_stacks_empty(); @@ -4348,13 +4195,8 @@ void CMSCollector::checkpointRootsFinalWork() { size_t ser_ovflw = _ser_pmc_remark_ovflw + _ser_pmc_preclean_ovflw + _ser_kac_ovflw + _ser_kac_preclean_ovflw; if (ser_ovflw > 0) { - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr("Marking stack overflow (benign) " - "(pmc_pc=" SIZE_FORMAT ", pmc_rm=" SIZE_FORMAT ", kac=" SIZE_FORMAT - ", kac_preclean=" SIZE_FORMAT ")", - _ser_pmc_preclean_ovflw, _ser_pmc_remark_ovflw, - _ser_kac_ovflw, _ser_kac_preclean_ovflw); - } + log_trace(gc)("Marking stack overflow (benign) (pmc_pc=" SIZE_FORMAT ", pmc_rm=" SIZE_FORMAT ", kac=" SIZE_FORMAT ", kac_preclean=" SIZE_FORMAT ")", + _ser_pmc_preclean_ovflw, _ser_pmc_remark_ovflw, _ser_kac_ovflw, _ser_kac_preclean_ovflw); _markStack.expand(); _ser_pmc_remark_ovflw = 0; _ser_pmc_preclean_ovflw = 0; @@ -4362,26 +4204,19 @@ void CMSCollector::checkpointRootsFinalWork() { _ser_kac_ovflw = 0; } if (_par_pmc_remark_ovflw > 0 || _par_kac_ovflw > 0) { - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr("Work queue overflow (benign) " - "(pmc_rm=" SIZE_FORMAT ", kac=" SIZE_FORMAT ")", - _par_pmc_remark_ovflw, _par_kac_ovflw); - } - _par_pmc_remark_ovflw = 0; + log_trace(gc)("Work queue overflow (benign) (pmc_rm=" SIZE_FORMAT ", kac=" SIZE_FORMAT ")", + _par_pmc_remark_ovflw, _par_kac_ovflw); + _par_pmc_remark_ovflw = 0; _par_kac_ovflw = 0; } - if (PrintCMSStatistics != 0) { - if (_markStack._hit_limit > 0) { - gclog_or_tty->print_cr(" (benign) Hit max stack size limit (" SIZE_FORMAT ")", - _markStack._hit_limit); - } - if (_markStack._failed_double > 0) { - gclog_or_tty->print_cr(" (benign) Failed stack doubling (" SIZE_FORMAT ")," - " current capacity " SIZE_FORMAT, - _markStack._failed_double, - _markStack.capacity()); - } - } + if (_markStack._hit_limit > 0) { + log_trace(gc)(" (benign) Hit max stack size limit (" SIZE_FORMAT ")", + _markStack._hit_limit); + } + if (_markStack._failed_double > 0) { + log_trace(gc)(" (benign) Failed stack doubling (" SIZE_FORMAT "), current capacity " SIZE_FORMAT, + _markStack._failed_double, _markStack.capacity()); + } _markStack._hit_limit = 0; _markStack._failed_double = 0; @@ -4415,11 +4250,7 @@ void CMSParInitialMarkTask::work(uint worker_id) { { work_on_young_gen_roots(worker_id, &par_mri_cl); _timer.stop(); - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr( - "Finished young gen initial mark scan work in %dth thread: %3.3f sec", - worker_id, _timer.seconds()); - } + log_trace(gc, task)("Finished young gen initial mark scan work in %dth thread: %3.3f sec", worker_id, _timer.seconds()); } // ---------- remaining roots -------------- @@ -4440,11 +4271,7 @@ void CMSParInitialMarkTask::work(uint worker_id) { || (_collector->CMSCollector::roots_scanning_options() & GenCollectedHeap::SO_AllCodeCache), "if we didn't scan the code cache, we have to be ready to drop nmethods with expired weak oops"); _timer.stop(); - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr( - "Finished remaining root initial mark scan work in %dth thread: %3.3f sec", - worker_id, _timer.seconds()); - } + log_trace(gc, task)("Finished remaining root initial mark scan work in %dth thread: %3.3f sec", worker_id, _timer.seconds()); } // Parallel remark task @@ -4557,11 +4384,7 @@ void CMSParRemarkTask::work(uint worker_id) { { work_on_young_gen_roots(worker_id, &par_mrias_cl); _timer.stop(); - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr( - "Finished young gen rescan work in %dth thread: %3.3f sec", - worker_id, _timer.seconds()); - } + log_trace(gc, task)("Finished young gen rescan work in %dth thread: %3.3f sec", worker_id, _timer.seconds()); } // ---------- remaining roots -------------- @@ -4580,11 +4403,7 @@ void CMSParRemarkTask::work(uint worker_id) { || (_collector->CMSCollector::roots_scanning_options() & GenCollectedHeap::SO_AllCodeCache), "if we didn't scan the code cache, we have to be ready to drop nmethods with expired weak oops"); _timer.stop(); - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr( - "Finished remaining root rescan work in %dth thread: %3.3f sec", - worker_id, _timer.seconds()); - } + log_trace(gc, task)("Finished remaining root rescan work in %dth thread: %3.3f sec", worker_id, _timer.seconds()); // ---------- unhandled CLD scanning ---------- if (worker_id == 0) { // Single threaded at the moment. @@ -4603,11 +4422,7 @@ void CMSParRemarkTask::work(uint worker_id) { ClassLoaderDataGraph::remember_new_clds(false); _timer.stop(); - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr( - "Finished unhandled CLD scanning work in %dth thread: %3.3f sec", - worker_id, _timer.seconds()); - } + log_trace(gc, task)("Finished unhandled CLD scanning work in %dth thread: %3.3f sec", worker_id, _timer.seconds()); } // ---------- dirty klass scanning ---------- @@ -4620,11 +4435,7 @@ void CMSParRemarkTask::work(uint worker_id) { ClassLoaderDataGraph::classes_do(&remark_klass_closure); _timer.stop(); - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr( - "Finished dirty klass scanning work in %dth thread: %3.3f sec", - worker_id, _timer.seconds()); - } + log_trace(gc, task)("Finished dirty klass scanning work in %dth thread: %3.3f sec", worker_id, _timer.seconds()); } // We might have added oops to ClassLoaderData::_handles during the @@ -4642,11 +4453,7 @@ void CMSParRemarkTask::work(uint worker_id) { // "worker_id" is passed to select the task_queue for "worker_id" do_dirty_card_rescan_tasks(_cms_space, worker_id, &par_mrias_cl); _timer.stop(); - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr( - "Finished dirty card rescan work in %dth thread: %3.3f sec", - worker_id, _timer.seconds()); - } + log_trace(gc, task)("Finished dirty card rescan work in %dth thread: %3.3f sec", worker_id, _timer.seconds()); // ---------- steal work from other threads ... // ---------- ... and drain overflow list. @@ -4654,11 +4461,7 @@ void CMSParRemarkTask::work(uint worker_id) { _timer.start(); do_work_steal(worker_id, &par_mrias_cl, _collector->hash_seed(worker_id)); _timer.stop(); - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr( - "Finished work stealing in %dth thread: %3.3f sec", - worker_id, _timer.seconds()); - } + log_trace(gc, task)("Finished work stealing in %dth thread: %3.3f sec", worker_id, _timer.seconds()); } // Note that parameter "i" is not used. @@ -4852,11 +4655,7 @@ CMSParRemarkTask::do_work_steal(int i, Par_MarkRefsIntoAndScanClosure* cl, break; // nirvana from the infinite cycle } } - NOT_PRODUCT( - if (PrintCMSStatistics != 0) { - gclog_or_tty->print("\n\t(%d: stole %d oops)", i, num_steals); - } - ) + log_develop_trace(gc, task)("\t(%d: stole %d oops)", i, num_steals); assert(work_q->size() == 0 && _collector->overflow_list_is_empty(), "Else our work is not yet done"); } @@ -4953,9 +4752,7 @@ void CMSCollector::merge_survivor_plab_arrays(ContiguousSpace* surv, } // We are all done; record the size of the _survivor_chunk_array _survivor_chunk_index = i; // exclusive: [0, i) - if (PrintCMSStatistics > 0) { - gclog_or_tty->print(" (Survivor:" SIZE_FORMAT "chunks) ", i); - } + log_trace(gc, survivor)(" (Survivor:" SIZE_FORMAT "chunks) ", i); // Verify that we used up all the recorded entries #ifdef ASSERT size_t total = 0; @@ -4967,10 +4764,8 @@ void CMSCollector::merge_survivor_plab_arrays(ContiguousSpace* surv, // Check that the merged array is in sorted order if (total > 0) { for (size_t i = 0; i < total - 1; i++) { - if (PrintCMSStatistics > 0) { - gclog_or_tty->print(" (chunk" SIZE_FORMAT ":" INTPTR_FORMAT ") ", - i, p2i(_survivor_chunk_array[i])); - } + log_develop_trace(gc, survivor)(" (chunk" SIZE_FORMAT ":" INTPTR_FORMAT ") ", + i, p2i(_survivor_chunk_array[i])); assert(_survivor_chunk_array[i] < _survivor_chunk_array[i+1], "Not sorted"); } @@ -5104,7 +4899,7 @@ void CMSCollector::do_remark_non_parallel() { NULL, // space is set further below &_markBitMap, &_markStack, &mrias_cl); { - GCTraceTime t("grey object rescan", PrintGCDetails, false, _gc_timer_cm); + GCTraceTime(Trace, gc) t("Grey Object Rescan", _gc_timer_cm); // Iterate over the dirty cards, setting the corresponding bits in the // mod union table. { @@ -5129,10 +4924,7 @@ void CMSCollector::do_remark_non_parallel() { _modUnionTable.dirty_range_iterate_clear(cms_span, &markFromDirtyCardsClosure); verify_work_stacks_empty(); - if (PrintCMSStatistics != 0) { - gclog_or_tty->print(" (re-scanned " SIZE_FORMAT " dirty cards in cms gen) ", - markFromDirtyCardsClosure.num_dirty_cards()); - } + log_trace(gc)(" (re-scanned " SIZE_FORMAT " dirty cards in cms gen) ", markFromDirtyCardsClosure.num_dirty_cards()); } } if (VerifyDuringGC && @@ -5141,7 +4933,7 @@ void CMSCollector::do_remark_non_parallel() { Universe::verify(); } { - GCTraceTime t("root rescan", PrintGCDetails, false, _gc_timer_cm); + GCTraceTime(Trace, gc) t("Root Rescan", _gc_timer_cm); verify_work_stacks_empty(); @@ -5163,7 +4955,7 @@ void CMSCollector::do_remark_non_parallel() { } { - GCTraceTime t("visit unhandled CLDs", PrintGCDetails, false, _gc_timer_cm); + GCTraceTime(Trace, gc) t("Visit Unhandled CLDs", _gc_timer_cm); verify_work_stacks_empty(); @@ -5182,7 +4974,7 @@ void CMSCollector::do_remark_non_parallel() { } { - GCTraceTime t("dirty klass scan", PrintGCDetails, false, _gc_timer_cm); + GCTraceTime(Trace, gc) t("Dirty Klass Scan", _gc_timer_cm); verify_work_stacks_empty(); @@ -5344,11 +5136,7 @@ void CMSRefProcTaskProxy::do_work_steal(int i, break; // nirvana from the infinite cycle } } - NOT_PRODUCT( - if (PrintCMSStatistics != 0) { - gclog_or_tty->print("\n\t(%d: stole %d oops)", i, num_steals); - } - ) + log_develop_trace(gc, task)("\t(%d: stole %d oops)", i, num_steals); } void CMSRefProcTaskExecutor::execute(ProcessTask& task) @@ -5390,7 +5178,7 @@ void CMSCollector::refProcessingWork() { _span, &_markBitMap, &_markStack, &cmsKeepAliveClosure, false /* !preclean */); { - GCTraceTime t("weak refs processing", PrintGCDetails, false, _gc_timer_cm); + GCTraceTime(Debug, gc) t("Weak Refs Processing", _gc_timer_cm); ReferenceProcessorStats stats; if (rp->processing_is_mt()) { @@ -5432,7 +5220,7 @@ void CMSCollector::refProcessingWork() { if (should_unload_classes()) { { - GCTraceTime t("class unloading", PrintGCDetails, false, _gc_timer_cm); + GCTraceTime(Debug, gc) t("Class Unloading", _gc_timer_cm); // Unload classes and purge the SystemDictionary. bool purged_class = SystemDictionary::do_unloading(&_is_alive_closure); @@ -5445,13 +5233,13 @@ void CMSCollector::refProcessingWork() { } { - GCTraceTime t("scrub symbol table", PrintGCDetails, false, _gc_timer_cm); + GCTraceTime(Debug, gc) t("Scrub Symbol Table", _gc_timer_cm); // Clean up unreferenced symbols in symbol table. SymbolTable::unlink(); } { - GCTraceTime t("scrub string table", PrintGCDetails, false, _gc_timer_cm); + GCTraceTime(Debug, gc) t("Scrub String Table", _gc_timer_cm); // Delete entries for dead interned strings. StringTable::unlink(&_is_alive_closure); } @@ -5518,8 +5306,8 @@ void CMSCollector::sweep() { _intra_sweep_timer.reset(); _intra_sweep_timer.start(); { - TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); - CMSPhaseAccounting pa(this, "sweep", !PrintGCDetails); + GCTraceCPUTime tcpu; + CMSPhaseAccounting pa(this, "Concurrent Sweep"); // First sweep the old gen { CMSTokenSyncWithLocks ts(true, _cmsGen->freelistLock(), @@ -5602,13 +5390,8 @@ void ConcurrentMarkSweepGeneration::setNearLargestChunk() { size_t largestOffset = pointer_delta(largestAddr, minAddr); size_t nearLargestOffset = (size_t)((double)largestOffset * nearLargestPercent) - MinChunkSize; - if (PrintFLSStatistics != 0) { - gclog_or_tty->print_cr( - "CMS: Large Block: " PTR_FORMAT ";" - " Proximity: " PTR_FORMAT " -> " PTR_FORMAT, - p2i(largestAddr), - p2i(_cmsSpace->nearLargestChunk()), p2i(minAddr + nearLargestOffset)); - } + log_debug(gc, freelist)("CMS: Large Block: " PTR_FORMAT "; Proximity: " PTR_FORMAT " -> " PTR_FORMAT, + p2i(largestAddr), p2i(_cmsSpace->nearLargestChunk()), p2i(minAddr + nearLargestOffset)); _cmsSpace->set_nearLargestChunk(minAddr + nearLargestOffset); } @@ -5702,8 +5485,8 @@ void CMSCollector::reset_concurrent() { // Clear the mark bitmap (no grey objects to start with) // for the next cycle. - TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); - CMSPhaseAccounting cmspa(this, "reset", !PrintGCDetails); + GCTraceCPUTime tcpu; + CMSPhaseAccounting cmspa(this, "Concurrent Reset"); HeapWord* curAddr = _markBitMap.startWord(); while (curAddr < _markBitMap.endWord()) { @@ -5719,9 +5502,7 @@ void CMSCollector::reset_concurrent() { bitMapLock()->unlock(); ConcurrentMarkSweepThread::desynchronize(true); stopTimer(); - if (PrintCMSStatistics != 0) { - incrementYields(); - } + incrementYields(); // See the comment in coordinator_yield() for (unsigned i = 0; i < CMSYieldSleepCount && @@ -5758,25 +5539,20 @@ void CMSCollector::reset_stw() { } void CMSCollector::do_CMS_operation(CMS_op_type op, GCCause::Cause gc_cause) { - TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); - GCTraceTime t(GCCauseString("GC", gc_cause), PrintGC, !PrintGCDetails, NULL); + GCTraceCPUTime tcpu; TraceCollectorStats tcs(counters()); switch (op) { case CMS_op_checkpointRootsInitial: { + GCTraceTime(Info, gc) t("Pause Initial Mark", NULL, GCCause::_no_gc, true); SvcGCMarker sgcm(SvcGCMarker::OTHER); checkpointRootsInitial(); - if (PrintGC) { - _cmsGen->printOccupancy("initial-mark"); - } break; } case CMS_op_checkpointRootsFinal: { + GCTraceTime(Info, gc) t("Pause Remark", NULL, GCCause::_no_gc, true); SvcGCMarker sgcm(SvcGCMarker::OTHER); checkpointRootsFinal(); - if (PrintGC) { - _cmsGen->printOccupancy("remark"); - } break; } default: @@ -5989,9 +5765,9 @@ bool CMSMarkStack::allocate(size_t size) { void CMSMarkStack::expand() { assert(_capacity <= MarkStackSizeMax, "stack bigger than permitted"); if (_capacity == MarkStackSizeMax) { - if (_hit_limit++ == 0 && !CMSConcurrentMTEnabled && PrintGCDetails) { + if (_hit_limit++ == 0 && !CMSConcurrentMTEnabled) { // We print a warning message only once per CMS cycle. - gclog_or_tty->print_cr(" (benign) Hit CMSMarkStack max size limit"); + log_debug(gc)(" (benign) Hit CMSMarkStack max size limit"); } return; } @@ -6011,12 +5787,11 @@ void CMSMarkStack::expand() { _base = (oop*)(_virtual_space.low()); _index = 0; _capacity = new_capacity; - } else if (_failed_double++ == 0 && !CMSConcurrentMTEnabled && PrintGCDetails) { + } else if (_failed_double++ == 0 && !CMSConcurrentMTEnabled) { // Failed to double capacity, continue; // we print a detail message only once per CMS cycle. - gclog_or_tty->print(" (benign) Failed to expand marking stack from " SIZE_FORMAT "K to " - SIZE_FORMAT "K", - _capacity / K, new_capacity / K); + log_debug(gc)(" (benign) Failed to expand marking stack from " SIZE_FORMAT "K to " SIZE_FORMAT "K", + _capacity / K, new_capacity / K); } } @@ -6093,8 +5868,10 @@ void MarkRefsIntoVerifyClosure::do_oop(oop obj) { if (_span.contains(addr)) { _verification_bm->mark(addr); if (!_cms_bm->isMarked(addr)) { - oop(addr)->print(); - gclog_or_tty->print_cr(" (" INTPTR_FORMAT " should have been marked)", p2i(addr)); + LogHandle(gc, verify) log; + ResourceMark rm; + oop(addr)->print_on(log.info_stream()); + log.info(" (" INTPTR_FORMAT " should have been marked)", p2i(addr)); fatal("... aborting"); } } @@ -6190,9 +5967,7 @@ void MarkRefsIntoAndScanClosure::do_yield_work() { _freelistLock->unlock(); ConcurrentMarkSweepThread::desynchronize(true); _collector->stopTimer(); - if (PrintCMSStatistics != 0) { - _collector->incrementYields(); - } + _collector->incrementYields(); // See the comment in coordinator_yield() for (unsigned i = 0; @@ -6348,9 +6123,7 @@ void ScanMarkedObjectsAgainCarefullyClosure::do_yield_work() { _freelistLock->unlock(); ConcurrentMarkSweepThread::desynchronize(true); _collector->stopTimer(); - if (PrintCMSStatistics != 0) { - _collector->incrementYields(); - } + _collector->incrementYields(); // See the comment in coordinator_yield() for (unsigned i = 0; i < CMSYieldSleepCount && @@ -6417,9 +6190,7 @@ void SurvivorSpacePrecleanClosure::do_yield_work() { _bit_map->lock()->unlock(); ConcurrentMarkSweepThread::desynchronize(true); _collector->stopTimer(); - if (PrintCMSStatistics != 0) { - _collector->incrementYields(); - } + _collector->incrementYields(); // See the comment in coordinator_yield() for (unsigned i = 0; i < CMSYieldSleepCount && @@ -6572,9 +6343,7 @@ void MarkFromRootsClosure::do_yield_work() { _bitMap->lock()->unlock(); ConcurrentMarkSweepThread::desynchronize(true); _collector->stopTimer(); - if (PrintCMSStatistics != 0) { - _collector->incrementYields(); - } + _collector->incrementYields(); // See the comment in coordinator_yield() for (unsigned i = 0; i < CMSYieldSleepCount && @@ -6880,17 +6649,15 @@ void PushAndMarkVerifyClosure::do_oop(oop obj) { // Oop lies in _span and isn't yet grey or black _verification_bm->mark(addr); // now grey if (!_cms_bm->isMarked(addr)) { - oop(addr)->print(); - gclog_or_tty->print_cr(" (" INTPTR_FORMAT " should have been marked)", - p2i(addr)); + LogHandle(gc, verify) log; + ResourceMark rm; + oop(addr)->print_on(log.info_stream()); + log.info(" (" INTPTR_FORMAT " should have been marked)", p2i(addr)); fatal("... aborting"); } if (!_mark_stack->push(obj)) { // stack overflow - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr("CMS marking stack overflow (benign) at " - SIZE_FORMAT, _mark_stack->capacity()); - } + log_trace(gc)("CMS marking stack overflow (benign) at " SIZE_FORMAT, _mark_stack->capacity()); assert(_mark_stack->isFull(), "Else push should have succeeded"); handle_stack_overflow(addr); } @@ -6990,10 +6757,7 @@ void PushOrMarkClosure::do_oop(oop obj) { } ) if (simulate_overflow || !_markStack->push(obj)) { // stack overflow - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr("CMS marking stack overflow (benign) at " - SIZE_FORMAT, _markStack->capacity()); - } + log_trace(gc)("CMS marking stack overflow (benign) at " SIZE_FORMAT, _markStack->capacity()); assert(simulate_overflow || _markStack->isFull(), "Else push should have succeeded"); handle_stack_overflow(addr); } @@ -7042,10 +6806,7 @@ void Par_PushOrMarkClosure::do_oop(oop obj) { if (simulate_overflow || !(_work_queue->push(obj) || _overflow_stack->par_push(obj))) { // stack overflow - if (PrintCMSStatistics != 0) { - gclog_or_tty->print_cr("CMS marking stack overflow (benign) at " - SIZE_FORMAT, _overflow_stack->capacity()); - } + log_trace(gc)("CMS marking stack overflow (benign) at " SIZE_FORMAT, _overflow_stack->capacity()); // We cannot assert that the overflow stack is full because // it may have been emptied since. assert(simulate_overflow || @@ -7207,9 +6968,7 @@ void CMSPrecleanRefsYieldClosure::do_yield_work() { ConcurrentMarkSweepThread::desynchronize(true); _collector->stopTimer(); - if (PrintCMSStatistics != 0) { - _collector->incrementYields(); - } + _collector->incrementYields(); // See the comment in coordinator_yield() for (unsigned i = 0; i < CMSYieldSleepCount && @@ -7240,10 +6999,7 @@ void MarkFromDirtyCardsClosure::do_MemRegion(MemRegion mr) { // However, that would be too strong in one case -- the last // partition ends at _unallocated_block which, in general, can be // an arbitrary boundary, not necessarily card aligned. - if (PrintCMSStatistics != 0) { - _num_dirty_cards += - mr.word_size()/CardTableModRefBS::card_size_in_words; - } + _num_dirty_cards += mr.word_size()/CardTableModRefBS::card_size_in_words; _space->object_iterate_mem(mr, &_scan_cl); } @@ -7276,10 +7032,8 @@ SweepClosure::SweepClosure(CMSCollector* collector, ) assert(_limit >= _sp->bottom() && _limit <= _sp->end(), "sweep _limit out of bounds"); - if (CMSTraceSweeper) { - gclog_or_tty->print_cr("\n====================\nStarting new sweep with limit " PTR_FORMAT, - p2i(_limit)); - } + log_develop_trace(gc, sweep)("===================="); + log_develop_trace(gc, sweep)("Starting new sweep with limit " PTR_FORMAT, p2i(_limit)); } void SweepClosure::print_on(outputStream* st) const { @@ -7306,42 +7060,32 @@ SweepClosure::~SweepClosure() { print(); ShouldNotReachHere(); } - if (Verbose && PrintGC) { - gclog_or_tty->print("Collected " SIZE_FORMAT " objects, " SIZE_FORMAT " bytes", - _numObjectsFreed, _numWordsFreed*sizeof(HeapWord)); - gclog_or_tty->print_cr("\nLive " SIZE_FORMAT " objects, " - SIZE_FORMAT " bytes " - "Already free " SIZE_FORMAT " objects, " SIZE_FORMAT " bytes", - _numObjectsLive, _numWordsLive*sizeof(HeapWord), - _numObjectsAlreadyFree, _numWordsAlreadyFree*sizeof(HeapWord)); - size_t totalBytes = (_numWordsFreed + _numWordsLive + _numWordsAlreadyFree) - * sizeof(HeapWord); - gclog_or_tty->print_cr("Total sweep: " SIZE_FORMAT " bytes", totalBytes); - if (PrintCMSStatistics && CMSVerifyReturnedBytes) { - size_t indexListReturnedBytes = _sp->sumIndexedFreeListArrayReturnedBytes(); - size_t dict_returned_bytes = _sp->dictionary()->sum_dict_returned_bytes(); - size_t returned_bytes = indexListReturnedBytes + dict_returned_bytes; - gclog_or_tty->print("Returned " SIZE_FORMAT " bytes", returned_bytes); - gclog_or_tty->print(" Indexed List Returned " SIZE_FORMAT " bytes", - indexListReturnedBytes); - gclog_or_tty->print_cr(" Dictionary Returned " SIZE_FORMAT " bytes", - dict_returned_bytes); - } + if (log_is_enabled(Debug, gc, sweep)) { + log_debug(gc, sweep)("Collected " SIZE_FORMAT " objects, " SIZE_FORMAT " bytes", + _numObjectsFreed, _numWordsFreed*sizeof(HeapWord)); + log_debug(gc, sweep)("Live " SIZE_FORMAT " objects, " SIZE_FORMAT " bytes Already free " SIZE_FORMAT " objects, " SIZE_FORMAT " bytes", + _numObjectsLive, _numWordsLive*sizeof(HeapWord), _numObjectsAlreadyFree, _numWordsAlreadyFree*sizeof(HeapWord)); + size_t totalBytes = (_numWordsFreed + _numWordsLive + _numWordsAlreadyFree) * sizeof(HeapWord); + log_debug(gc, sweep)("Total sweep: " SIZE_FORMAT " bytes", totalBytes); } - if (CMSTraceSweeper) { - gclog_or_tty->print_cr("end of sweep with _limit = " PTR_FORMAT "\n================", - p2i(_limit)); + + if (log_is_enabled(Trace, gc, sweep) && CMSVerifyReturnedBytes) { + size_t indexListReturnedBytes = _sp->sumIndexedFreeListArrayReturnedBytes(); + size_t dict_returned_bytes = _sp->dictionary()->sum_dict_returned_bytes(); + size_t returned_bytes = indexListReturnedBytes + dict_returned_bytes; + log_trace(gc, sweep)("Returned " SIZE_FORMAT " bytes Indexed List Returned " SIZE_FORMAT " bytes Dictionary Returned " SIZE_FORMAT " bytes", + returned_bytes, indexListReturnedBytes, dict_returned_bytes); } + log_develop_trace(gc, sweep)("end of sweep with _limit = " PTR_FORMAT, p2i(_limit)); + log_develop_trace(gc, sweep)("================"); } #endif // PRODUCT void SweepClosure::initialize_free_range(HeapWord* freeFinger, bool freeRangeInFreeLists) { - if (CMSTraceSweeper) { - gclog_or_tty->print("---- Start free range at " PTR_FORMAT " with free block (%d)\n", - p2i(freeFinger), freeRangeInFreeLists); - } + log_develop_trace(gc, sweep)("---- Start free range at " PTR_FORMAT " with free block (%d)", + p2i(freeFinger), freeRangeInFreeLists); assert(!inFreeRange(), "Trampling existing free range"); set_inFreeRange(true); set_lastFreeRangeCoalesced(false); @@ -7407,13 +7151,9 @@ size_t SweepClosure::do_blk_careful(HeapWord* addr) { "freeFinger() " PTR_FORMAT " is out-of-bounds", p2i(freeFinger())); flush_cur_free_chunk(freeFinger(), pointer_delta(addr, freeFinger())); - if (CMSTraceSweeper) { - gclog_or_tty->print("Sweep: last chunk: "); - gclog_or_tty->print("put_free_blk " PTR_FORMAT " (" SIZE_FORMAT ") " - "[coalesced:%d]\n", - p2i(freeFinger()), pointer_delta(addr, freeFinger()), - lastFreeRangeCoalesced() ? 1 : 0); - } + log_develop_trace(gc, sweep)("Sweep: last chunk: put_free_blk " PTR_FORMAT " (" SIZE_FORMAT ") [coalesced:%d]", + p2i(freeFinger()), pointer_delta(addr, freeFinger()), + lastFreeRangeCoalesced() ? 1 : 0); } // help the iterator loop finish @@ -7624,9 +7364,7 @@ void SweepClosure::do_post_free_or_garbage_chunk(FreeChunk* fc, assert(_sp->verify_chunk_in_free_list(fc), "free chunk is not in free lists"); } - if (CMSTraceSweeper) { - gclog_or_tty->print_cr(" -- pick up another chunk at " PTR_FORMAT " (" SIZE_FORMAT ")", p2i(fc), chunkSize); - } + log_develop_trace(gc, sweep)(" -- pick up another chunk at " PTR_FORMAT " (" SIZE_FORMAT ")", p2i(fc), chunkSize); HeapWord* const fc_addr = (HeapWord*) fc; @@ -7727,16 +7465,12 @@ void SweepClosure::lookahead_and_flush(FreeChunk* fc, size_t chunk_size) { p2i(eob), p2i(eob-1), p2i(_limit), p2i(_sp->bottom()), p2i(_sp->end()), p2i(fc), chunk_size); if (eob >= _limit) { assert(eob == _limit || fc->is_free(), "Only a free chunk should allow us to cross over the limit"); - if (CMSTraceSweeper) { - gclog_or_tty->print_cr("_limit " PTR_FORMAT " reached or crossed by block " - "[" PTR_FORMAT "," PTR_FORMAT ") in space " - "[" PTR_FORMAT "," PTR_FORMAT ")", - p2i(_limit), p2i(fc), p2i(eob), p2i(_sp->bottom()), p2i(_sp->end())); - } + log_develop_trace(gc, sweep)("_limit " PTR_FORMAT " reached or crossed by block " + "[" PTR_FORMAT "," PTR_FORMAT ") in space " + "[" PTR_FORMAT "," PTR_FORMAT ")", + p2i(_limit), p2i(fc), p2i(eob), p2i(_sp->bottom()), p2i(_sp->end())); // Return the storage we are tracking back into the free lists. - if (CMSTraceSweeper) { - gclog_or_tty->print_cr("Flushing ... "); - } + log_develop_trace(gc, sweep)("Flushing ... "); assert(freeFinger() < eob, "Error"); flush_cur_free_chunk( freeFinger(), pointer_delta(eob, freeFinger())); } @@ -7753,10 +7487,7 @@ void SweepClosure::flush_cur_free_chunk(HeapWord* chunk, size_t size) { assert(!_sp->verify_chunk_in_free_list(fc), "chunk should not be in free lists yet"); } - if (CMSTraceSweeper) { - gclog_or_tty->print_cr(" -- add free block " PTR_FORMAT " (" SIZE_FORMAT ") to free lists", - p2i(chunk), size); - } + log_develop_trace(gc, sweep)(" -- add free block " PTR_FORMAT " (" SIZE_FORMAT ") to free lists", p2i(chunk), size); // A new free range is going to be starting. The current // free range has not been added to the free lists yet or // was removed so add it back. @@ -7767,8 +7498,8 @@ void SweepClosure::flush_cur_free_chunk(HeapWord* chunk, size_t size) { } _sp->addChunkAndRepairOffsetTable(chunk, size, lastFreeRangeCoalesced()); - } else if (CMSTraceSweeper) { - gclog_or_tty->print_cr("Already in free list: nothing to flush"); + } else { + log_develop_trace(gc, sweep)("Already in free list: nothing to flush"); } set_inFreeRange(false); set_freeRangeInFreeLists(false); @@ -7799,9 +7530,7 @@ void SweepClosure::do_yield_work(HeapWord* addr) { _freelistLock->unlock(); ConcurrentMarkSweepThread::desynchronize(true); _collector->stopTimer(); - if (PrintCMSStatistics != 0) { - _collector->incrementYields(); - } + _collector->incrementYields(); // See the comment in coordinator_yield() for (unsigned i = 0; i < CMSYieldSleepCount && @@ -7826,10 +7555,8 @@ bool debug_verify_chunk_in_free_list(FreeChunk* fc) { #endif void SweepClosure::print_free_block_coalesced(FreeChunk* fc) const { - if (CMSTraceSweeper) { - gclog_or_tty->print_cr("Sweep:coal_free_blk " PTR_FORMAT " (" SIZE_FORMAT ")", - p2i(fc), fc->size()); - } + log_develop_trace(gc, sweep)("Sweep:coal_free_blk " PTR_FORMAT " (" SIZE_FORMAT ")", + p2i(fc), fc->size()); } // CMSIsAliveClosure diff --git a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp index 10eb76fb35b..2e579152e38 100644 --- a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp +++ b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.hpp @@ -35,6 +35,7 @@ #include "gc/shared/generationCounters.hpp" #include "gc/shared/space.hpp" #include "gc/shared/taskqueue.hpp" +#include "logging/log.hpp" #include "memory/freeBlockDictionary.hpp" #include "memory/iterator.hpp" #include "memory/virtualspace.hpp" @@ -308,9 +309,8 @@ class ChunkArray: public CHeapObj { void reset() { _index = 0; - if (_overflows > 0 && PrintCMSStatistics > 1) { - warning("CMS: ChunkArray[" SIZE_FORMAT "] overflowed " SIZE_FORMAT " times", - _capacity, _overflows); + if (_overflows > 0) { + log_trace(gc)("CMS: ChunkArray[" SIZE_FORMAT "] overflowed " SIZE_FORMAT " times", _capacity, _overflows); } _overflows = 0; } @@ -451,7 +451,7 @@ class CMSStats VALUE_OBJ_CLASS_SPEC { // Debugging. void print_on(outputStream* st) const PRODUCT_RETURN; - void print() const { print_on(gclog_or_tty); } + void print() const { print_on(tty); } }; // A closure related to weak references processing which @@ -935,7 +935,7 @@ class CMSCollector: public CHeapObj { void startTimer() { assert(!_timer.is_active(), "Error"); _timer.start(); } void stopTimer() { assert( _timer.is_active(), "Error"); _timer.stop(); } void resetTimer() { assert(!_timer.is_active(), "Error"); _timer.reset(); } - double timerValue() { assert(!_timer.is_active(), "Error"); return _timer.seconds(); } + jlong timerTicks() { assert(!_timer.is_active(), "Error"); return _timer.ticks(); } int yields() { return _numYields; } void resetYields() { _numYields = 0; } @@ -961,7 +961,7 @@ class CMSCollector: public CHeapObj { // Debugging void verify(); - bool verify_after_remark(bool silent = VerifySilently); + bool verify_after_remark(); void verify_ok_to_terminate() const PRODUCT_RETURN; void verify_work_stacks_empty() const PRODUCT_RETURN; void verify_overflow_empty() const PRODUCT_RETURN; @@ -1234,7 +1234,6 @@ class ConcurrentMarkSweepGeneration: public CardGeneration { const char* name() const; virtual const char* short_name() const { return "CMS"; } void print() const; - void printOccupancy(const char* s); // Resize the generation after a compacting GC. The // generation can be treated as a contiguous space diff --git a/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp b/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp index 890c84bc694..2cd32b097dc 100644 --- a/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp +++ b/hotspot/src/share/vm/gc/cms/parNewGeneration.cpp @@ -34,7 +34,7 @@ #include "gc/shared/gcHeapSummary.hpp" #include "gc/shared/gcTimer.hpp" #include "gc/shared/gcTrace.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/genOopClosures.inline.hpp" #include "gc/shared/generation.hpp" @@ -45,6 +45,7 @@ #include "gc/shared/strongRootsScope.hpp" #include "gc/shared/taskqueue.inline.hpp" #include "gc/shared/workgroup.hpp" +#include "logging/log.hpp" #include "memory/resourceArea.hpp" #include "oops/objArrayOop.hpp" #include "oops/oop.inline.hpp" @@ -270,9 +271,9 @@ void ParScanThreadState::undo_alloc_in_to_space(HeapWord* obj, size_t word_sz) { } void ParScanThreadState::print_promotion_failure_size() { - if (_promotion_failed_info.has_failed() && PrintPromotionFailure) { - gclog_or_tty->print(" (%d: promotion failure size = " SIZE_FORMAT ") ", - _thread_num, _promotion_failed_info.first_size()); + if (_promotion_failed_info.has_failed()) { + log_trace(gc, promotion)(" (%d: promotion failure size = " SIZE_FORMAT ") ", + _thread_num, _promotion_failed_info.first_size()); } } @@ -298,11 +299,11 @@ public: #if TASKQUEUE_STATS static void - print_termination_stats_hdr(outputStream* const st = gclog_or_tty); - void print_termination_stats(outputStream* const st = gclog_or_tty); + print_termination_stats_hdr(outputStream* const st); + void print_termination_stats(); static void - print_taskqueue_stats_hdr(outputStream* const st = gclog_or_tty); - void print_taskqueue_stats(outputStream* const st = gclog_or_tty); + print_taskqueue_stats_hdr(outputStream* const st); + void print_taskqueue_stats(); void reset_stats(); #endif // TASKQUEUE_STATS @@ -383,7 +384,15 @@ void ParScanThreadStateSet::print_termination_stats_hdr(outputStream* const st) st->print_raw_cr("--- --------- --------- ------ --------- ------ --------"); } -void ParScanThreadStateSet::print_termination_stats(outputStream* const st) { +void ParScanThreadStateSet::print_termination_stats() { + LogHandle(gc, task, stats) log; + if (!log.is_debug()) { + return; + } + + ResourceMark rm; + outputStream* st = log.debug_stream(); + print_termination_stats_hdr(st); for (int i = 0; i < length(); ++i) { @@ -404,7 +413,13 @@ void ParScanThreadStateSet::print_taskqueue_stats_hdr(outputStream* const st) { st->print_raw("--- "); TaskQueueStats::print_header(2, st); st->cr(); } -void ParScanThreadStateSet::print_taskqueue_stats(outputStream* const st) { +void ParScanThreadStateSet::print_taskqueue_stats() { + if (!develop_log_is_enabled(Trace, gc, task, stats)) { + return; + } + LogHandle(gc, task, stats) log; + ResourceMark rm; + outputStream* st = log.trace_stream(); print_taskqueue_stats_hdr(st); TaskQueueStats totals; @@ -823,9 +838,7 @@ void ParNewGeneration::handle_promotion_failed(GenCollectedHeap* gch, ParScanThr _promo_failure_scan_stack.clear(true); // Clear cached segments. remove_forwarding_pointers(); - if (PrintGCDetails) { - gclog_or_tty->print(" (promotion failed)"); - } + log_info(gc, promotion)("Promotion failed"); // All the spaces are in play for mark-sweep. swap_spaces(); // Make life simpler for CMS || rescan; see 6483690. from()->set_next_compaction_space(to()); @@ -882,9 +895,7 @@ void ParNewGeneration::collect(bool full, size_policy->minor_collection_begin(); } - GCTraceTime t1(GCCauseString("GC", gch->gc_cause()), PrintGC && !PrintGCDetails, true, NULL); - // Capture heap used before collection (for printing). - size_t gch_prev_used = gch->used(); + GCTraceTime(Trace, gc) t1("ParNew", NULL, gch->gc_cause()); age_table()->clear(); to()->clear(SpaceDecorator::Mangle); @@ -990,12 +1001,8 @@ void ParNewGeneration::collect(bool full, plab_stats()->adjust_desired_plab_sz(); } - if (PrintGC && !PrintGCDetails) { - gch->print_heap_change(gch_prev_used); - } - - TASKQUEUE_STATS_ONLY(if (PrintTerminationStats) thread_state_set.print_termination_stats()); - TASKQUEUE_STATS_ONLY(if (PrintTaskqueue) thread_state_set.print_taskqueue_stats()); + TASKQUEUE_STATS_ONLY(thread_state_set.print_termination_stats()); + TASKQUEUE_STATS_ONLY(thread_state_set.print_taskqueue_stats()); if (UseAdaptiveSizePolicy) { size_policy->minor_collection_end(gch->gc_cause()); @@ -1150,11 +1157,9 @@ oop ParNewGeneration::copy_to_survivor_space(ParScanThreadState* par_scan_state, // This code must come after the CAS test, or it will print incorrect // information. - if (TraceScavenge) { - gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", - is_in_reserved(new_obj) ? "copying" : "tenuring", - new_obj->klass()->internal_name(), p2i(old), p2i(new_obj), new_obj->size()); - } + log_develop_trace(gc, scavenge)("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", + is_in_reserved(new_obj) ? "copying" : "tenuring", + new_obj->klass()->internal_name(), p2i(old), p2i(new_obj), new_obj->size()); if (forward_ptr == NULL) { oop obj_to_push = new_obj; @@ -1176,9 +1181,7 @@ oop ParNewGeneration::copy_to_survivor_space(ParScanThreadState* par_scan_state, ) if (simulate_overflow || !par_scan_state->work_queue()->push(obj_to_push)) { // Add stats for overflow pushes. - if (Verbose && PrintGCDetails) { - gclog_or_tty->print("queue overflow!\n"); - } + log_develop_trace(gc)("Queue Overflow"); push_on_overflow_list(old, par_scan_state); TASKQUEUE_STATS_ONLY(par_scan_state->taskqueue_stats().record_overflow(0)); } diff --git a/hotspot/src/share/vm/gc/cms/parOopClosures.inline.hpp b/hotspot/src/share/vm/gc/cms/parOopClosures.inline.hpp index 6619cb09225..6f8011eefd7 100644 --- a/hotspot/src/share/vm/gc/cms/parOopClosures.inline.hpp +++ b/hotspot/src/share/vm/gc/cms/parOopClosures.inline.hpp @@ -30,6 +30,7 @@ #include "gc/shared/cardTableRS.hpp" #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/genOopClosures.inline.hpp" +#include "logging/log.hpp" template inline void ParScanWeakRefClosure::do_oop_work(T* p) { assert (!oopDesc::is_null(*p), "null weak reference?"); @@ -108,11 +109,9 @@ inline void ParScanClosure::do_oop_work(T* p, if (m->is_marked()) { // Contains forwarding pointer. new_obj = ParNewGeneration::real_forwardee(obj); oopDesc::encode_store_heap_oop_not_null(p, new_obj); - if (TraceScavenge) { - gclog_or_tty->print_cr("{%s %s ( " PTR_FORMAT " ) " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", - "forwarded ", - new_obj->klass()->internal_name(), p2i(p), p2i((void *)obj), p2i((void *)new_obj), new_obj->size()); - } + log_develop_trace(gc, scavenge)("{%s %s ( " PTR_FORMAT " ) " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", + "forwarded ", + new_obj->klass()->internal_name(), p2i(p), p2i((void *)obj), p2i((void *)new_obj), new_obj->size()); } else { size_t obj_sz = obj->size_given_klass(objK); new_obj = _g->copy_to_survivor_space(_par_scan_state, obj, obj_sz, m); diff --git a/hotspot/src/share/vm/gc/cms/promotionInfo.hpp b/hotspot/src/share/vm/gc/cms/promotionInfo.hpp index beb9d4d6068..d42a8dbd119 100644 --- a/hotspot/src/share/vm/gc/cms/promotionInfo.hpp +++ b/hotspot/src/share/vm/gc/cms/promotionInfo.hpp @@ -132,7 +132,7 @@ class SpoolBlock: public FreeChunk { } void print_on(outputStream* st) const; - void print() const { print_on(gclog_or_tty); } + void print() const { print_on(tty); } }; class PromotionInfo VALUE_OBJ_CLASS_SPEC { diff --git a/hotspot/src/share/vm/gc/cms/vmCMSOperations.cpp b/hotspot/src/share/vm/gc/cms/vmCMSOperations.cpp index 426c41e1d67..dcdfa854377 100644 --- a/hotspot/src/share/vm/gc/cms/vmCMSOperations.cpp +++ b/hotspot/src/share/vm/gc/cms/vmCMSOperations.cpp @@ -28,7 +28,7 @@ #include "gc/cms/vmCMSOperations.hpp" #include "gc/shared/gcLocker.inline.hpp" #include "gc/shared/gcTimer.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/isGCActiveMark.hpp" #include "runtime/interfaceSupport.hpp" #include "runtime/os.hpp" @@ -58,7 +58,7 @@ void VM_CMS_Operation::release_and_notify_pending_list_lock() { void VM_CMS_Operation::verify_before_gc() { if (VerifyBeforeGC && GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) { - GCTraceTime tm("Verify Before", false, false, _collector->_gc_timer_cm); + GCTraceTime(Info, gc, verify) tm("Verify Before", _collector->_gc_timer_cm); HandleMark hm; FreelistLocker x(_collector); MutexLockerEx y(_collector->bitMapLock(), Mutex::_no_safepoint_check_flag); @@ -70,7 +70,7 @@ void VM_CMS_Operation::verify_before_gc() { void VM_CMS_Operation::verify_after_gc() { if (VerifyAfterGC && GenCollectedHeap::heap()->total_collections() >= VerifyGCStartAt) { - GCTraceTime tm("Verify After", false, false, _collector->_gc_timer_cm); + GCTraceTime(Info, gc, verify) tm("Verify After", _collector->_gc_timer_cm); HandleMark hm; FreelistLocker x(_collector); MutexLockerEx y(_collector->bitMapLock(), Mutex::_no_safepoint_check_flag); diff --git a/hotspot/src/share/vm/gc/g1/collectionSetChooser.cpp b/hotspot/src/share/vm/gc/g1/collectionSetChooser.cpp index 9ac0304a02b..fcc1f8e526f 100644 --- a/hotspot/src/share/vm/gc/g1/collectionSetChooser.cpp +++ b/hotspot/src/share/vm/gc/g1/collectionSetChooser.cpp @@ -26,7 +26,6 @@ #include "gc/g1/collectionSetChooser.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectorPolicy.hpp" -#include "gc/g1/g1ErgoVerbose.hpp" #include "gc/shared/space.inline.hpp" #include "runtime/atomic.inline.hpp" @@ -136,8 +135,8 @@ void CollectionSetChooser::sort_regions() { assert(regions_at(i) != NULL, "Should be true by sorting!"); } #endif // ASSERT - if (G1PrintRegionLivenessInfo) { - G1PrintRegionLivenessInfoClosure cl(gclog_or_tty, "Post-Sorting"); + if (log_is_enabled(Trace, gc, liveness)) { + G1PrintRegionLivenessInfoClosure cl("Post-Sorting"); for (uint i = 0; i < _end; ++i) { HeapRegion* r = regions_at(i); cl.doHeapRegion(r); diff --git a/hotspot/src/share/vm/gc/g1/concurrentG1RefineThread.cpp b/hotspot/src/share/vm/gc/g1/concurrentG1RefineThread.cpp index a65b0638a82..aabf6790d80 100644 --- a/hotspot/src/share/vm/gc/g1/concurrentG1RefineThread.cpp +++ b/hotspot/src/share/vm/gc/g1/concurrentG1RefineThread.cpp @@ -28,6 +28,7 @@ #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectorPolicy.hpp" #include "gc/g1/suspendibleThreadSet.hpp" +#include "logging/log.hpp" #include "memory/resourceArea.hpp" #include "runtime/handles.inline.hpp" #include "runtime/mutexLocker.hpp" @@ -88,11 +89,8 @@ bool ConcurrentG1RefineThread::is_active() { void ConcurrentG1RefineThread::activate() { MutexLockerEx x(_monitor, Mutex::_no_safepoint_check_flag); if (!is_primary()) { - if (G1TraceConcRefinement) { - DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set(); - gclog_or_tty->print_cr("G1-Refine-activated worker %d, on threshold %d, current %d", - _worker_id, _threshold, (int)dcqs.completed_buffers_num()); - } + log_debug(gc, refine)("G1-Refine-activated worker %d, on threshold %d, current %d", + _worker_id, _threshold, JavaThread::dirty_card_queue_set().completed_buffers_num()); set_active(true); } else { DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set(); @@ -104,11 +102,8 @@ void ConcurrentG1RefineThread::activate() { void ConcurrentG1RefineThread::deactivate() { MutexLockerEx x(_monitor, Mutex::_no_safepoint_check_flag); if (!is_primary()) { - if (G1TraceConcRefinement) { - DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set(); - gclog_or_tty->print_cr("G1-Refine-deactivated worker %d, off threshold %d, current %d", - _worker_id, _deactivation_threshold, (int)dcqs.completed_buffers_num()); - } + log_debug(gc, refine)("G1-Refine-deactivated worker %d, off threshold %d, current %d", + _worker_id, _deactivation_threshold, JavaThread::dirty_card_queue_set().completed_buffers_num()); set_active(false); } else { DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set(); @@ -174,9 +169,7 @@ void ConcurrentG1RefineThread::run_service() { } } - if (G1TraceConcRefinement) { - gclog_or_tty->print_cr("G1-Refine-stop"); - } + log_debug(gc, refine)("G1-Refine-stop"); } void ConcurrentG1RefineThread::stop() { @@ -199,4 +192,4 @@ void ConcurrentG1RefineThread::stop() { void ConcurrentG1RefineThread::stop_service() { MutexLockerEx x(_monitor, Mutex::_no_safepoint_check_flag); _monitor->notify(); -} \ No newline at end of file +} diff --git a/hotspot/src/share/vm/gc/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc/g1/concurrentMark.cpp index 5ad17675ed3..e1f73491452 100644 --- a/hotspot/src/share/vm/gc/g1/concurrentMark.cpp +++ b/hotspot/src/share/vm/gc/g1/concurrentMark.cpp @@ -31,8 +31,6 @@ #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectorPolicy.hpp" #include "gc/g1/g1CollectorState.hpp" -#include "gc/g1/g1ErgoVerbose.hpp" -#include "gc/g1/g1Log.hpp" #include "gc/g1/g1OopClosures.inline.hpp" #include "gc/g1/g1RemSet.hpp" #include "gc/g1/g1StringDedup.hpp" @@ -44,12 +42,13 @@ #include "gc/shared/gcId.hpp" #include "gc/shared/gcTimer.hpp" #include "gc/shared/gcTrace.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/genOopClosures.inline.hpp" #include "gc/shared/referencePolicy.hpp" #include "gc/shared/strongRootsScope.hpp" #include "gc/shared/taskqueue.inline.hpp" #include "gc/shared/vmGCOperations.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" #include "memory/resourceArea.hpp" #include "oops/oop.inline.hpp" @@ -232,9 +231,7 @@ void CMMarkStack::expand() { // Clear expansion flag _should_expand = false; if (_capacity == (jint) MarkStackSizeMax) { - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr(" (benign) Can't expand marking stack capacity, at max size limit"); - } + log_trace(gc)("(benign) Can't expand marking stack capacity, at max size limit"); return; } // Double capacity if possible @@ -254,12 +251,9 @@ void CMMarkStack::expand() { _index = 0; _capacity = new_capacity; } else { - if (PrintGCDetails && Verbose) { - // Failed to double capacity, continue; - gclog_or_tty->print(" (benign) Failed to expand marking stack capacity from " - SIZE_FORMAT "K to " SIZE_FORMAT "K", - _capacity / K, new_capacity / K); - } + // Failed to double capacity, continue; + log_trace(gc)("(benign) Failed to expand marking stack capacity from " SIZE_FORMAT "K to " SIZE_FORMAT "K", + _capacity / K, new_capacity / K); } } @@ -848,10 +842,7 @@ void ConcurrentMark::enter_first_sync_barrier(uint worker_id) { // marking. reset_marking_state(true /* clear_overflow */); - if (G1Log::fine()) { - gclog_or_tty->gclog_stamp(); - gclog_or_tty->print_cr("[GC concurrent-mark-reset-for-overflow]"); - } + log_info(gc)("Concurrent Mark reset for overflow"); } } @@ -987,8 +978,6 @@ public: }; void ConcurrentMark::scanRootRegions() { - double scan_start = os::elapsedTime(); - // Start of concurrent marking. ClassLoaderDataGraph::clear_claimed_marks(); @@ -996,10 +985,7 @@ void ConcurrentMark::scanRootRegions() { // at least one root region to scan. So, if it's false, we // should not attempt to do any further work. if (root_regions()->scan_in_progress()) { - if (G1Log::fine()) { - gclog_or_tty->gclog_stamp(); - gclog_or_tty->print_cr("[GC concurrent-root-region-scan-start]"); - } + GCTraceConcTime(Info, gc) tt("Concurrent Root Region Scan"); _parallel_marking_threads = calc_parallel_marking_threads(); assert(parallel_marking_threads() <= max_parallel_marking_threads(), @@ -1010,11 +996,6 @@ void ConcurrentMark::scanRootRegions() { _parallel_workers->set_active_workers(active_workers); _parallel_workers->run_task(&task); - if (G1Log::fine()) { - gclog_or_tty->gclog_stamp(); - gclog_or_tty->print_cr("[GC concurrent-root-region-scan-end, %1.7lf secs]", os::elapsedTime() - scan_start); - } - // It's possible that has_aborted() is true here without actually // aborting the survivor scan earlier. This is OK as it's // mainly used for sanity checking. @@ -1049,22 +1030,6 @@ void ConcurrentMark::markFromRoots() { print_stats(); } -// Helper class to get rid of some boilerplate code. -class G1CMTraceTime : public StackObj { - GCTraceTimeImpl _gc_trace_time; - static bool doit_and_prepend(bool doit) { - if (doit) { - gclog_or_tty->put(' '); - } - return doit; - } - - public: - G1CMTraceTime(const char* title, bool doit) - : _gc_trace_time(title, doit_and_prepend(doit), false, G1CollectedHeap::heap()->gc_timer_cm()) { - } -}; - void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) { // world is stopped at this checkpoint assert(SafepointSynchronize::is_at_safepoint(), @@ -1083,8 +1048,7 @@ void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) { if (VerifyDuringGC) { HandleMark hm; // handle scope g1h->prepare_for_verify(); - Universe::verify(VerifyOption_G1UsePrevMarking, - " VerifyDuringGC:(before)"); + Universe::verify(VerifyOption_G1UsePrevMarking, "During GC (before)"); } g1h->check_bitmaps("Remark Start"); @@ -1102,16 +1066,13 @@ void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) { if (has_overflown()) { // Oops. We overflowed. Restart concurrent marking. _restart_for_overflow = true; - if (G1TraceMarkStackOverflow) { - gclog_or_tty->print_cr("\nRemark led to restart for overflow."); - } + log_develop_trace(gc)("Remark led to restart for overflow."); // Verify the heap w.r.t. the previous marking bitmap. if (VerifyDuringGC) { HandleMark hm; // handle scope g1h->prepare_for_verify(); - Universe::verify(VerifyOption_G1UsePrevMarking, - " VerifyDuringGC:(overflow)"); + Universe::verify(VerifyOption_G1UsePrevMarking, "During GC (overflow)"); } // Clear the marking state because we will be restarting @@ -1119,7 +1080,7 @@ void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) { reset_marking_state(); } else { { - G1CMTraceTime trace("GC aggregate-data", G1Log::finer()); + GCTraceTime(Debug, gc) trace("GC Aggregate Data", g1h->gc_timer_cm()); // Aggregate the per-task counting data that we have accumulated // while marking. @@ -1136,8 +1097,7 @@ void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) { if (VerifyDuringGC) { HandleMark hm; // handle scope g1h->prepare_for_verify(); - Universe::verify(VerifyOption_G1UseNextMarking, - " VerifyDuringGC:(after)"); + Universe::verify(VerifyOption_G1UseNextMarking, "During GC (after)"); } g1h->check_bitmaps("Remark End"); assert(!restart_for_overflow(), "sanity"); @@ -1656,8 +1616,7 @@ void ConcurrentMark::cleanup() { if (VerifyDuringGC) { HandleMark hm; // handle scope g1h->prepare_for_verify(); - Universe::verify(VerifyOption_G1UsePrevMarking, - " VerifyDuringGC:(before)"); + Universe::verify(VerifyOption_G1UsePrevMarking, "During GC (before)"); } g1h->check_bitmaps("Cleanup Start"); @@ -1699,8 +1658,8 @@ void ConcurrentMark::cleanup() { double this_final_counting_time = (count_end - start); _total_counting_time += this_final_counting_time; - if (G1PrintRegionLivenessInfo) { - G1PrintRegionLivenessInfoClosure cl(gclog_or_tty, "Post-Marking"); + if (log_is_enabled(Trace, gc, liveness)) { + G1PrintRegionLivenessInfoClosure cl("Post-Marking"); _g1h->heap_region_iterate(&cl); } @@ -1743,10 +1702,6 @@ void ConcurrentMark::cleanup() { double end = os::elapsedTime(); _cleanup_times.add((end - start) * 1000.0); - if (G1Log::fine()) { - g1h->g1_policy()->print_heap_transition(start_used_bytes); - } - // Clean up will have freed any regions completely full of garbage. // Update the soft reference policy with the new heap occupancy. Universe::update_heap_info_at_gc(); @@ -1754,8 +1709,7 @@ void ConcurrentMark::cleanup() { if (VerifyDuringGC) { HandleMark hm; // handle scope g1h->prepare_for_verify(); - Universe::verify(VerifyOption_G1UsePrevMarking, - " VerifyDuringGC:(after)"); + Universe::verify(VerifyOption_G1UsePrevMarking, "During GC (after)"); } g1h->check_bitmaps("Cleanup End"); @@ -1788,11 +1742,9 @@ void ConcurrentMark::completeCleanup() { _cleanup_list.verify_optional(); FreeRegionList tmp_free_list("Tmp Free List"); - if (G1ConcRegionFreeingVerbose) { - gclog_or_tty->print_cr("G1ConcRegionFreeing [complete cleanup] : " - "cleanup list has %u entries", - _cleanup_list.length()); - } + log_develop_trace(gc, freelist)("G1ConcRegionFreeing [complete cleanup] : " + "cleanup list has %u entries", + _cleanup_list.length()); // No one else should be accessing the _cleanup_list at this point, // so it is not necessary to take any locks @@ -1810,13 +1762,11 @@ void ConcurrentMark::completeCleanup() { // region from the _cleanup_list). if ((tmp_free_list.length() % G1SecondaryFreeListAppendLength == 0) || _cleanup_list.is_empty()) { - if (G1ConcRegionFreeingVerbose) { - gclog_or_tty->print_cr("G1ConcRegionFreeing [complete cleanup] : " - "appending %u entries to the secondary_free_list, " - "cleanup list still has %u entries", - tmp_free_list.length(), - _cleanup_list.length()); - } + log_develop_trace(gc, freelist)("G1ConcRegionFreeing [complete cleanup] : " + "appending %u entries to the secondary_free_list, " + "cleanup list still has %u entries", + tmp_free_list.length(), + _cleanup_list.length()); { MutexLockerEx x(SecondaryFreeList_lock, Mutex::_no_safepoint_check_flag); @@ -2073,7 +2023,7 @@ void ConcurrentMark::weakRefsWork(bool clear_all_soft_refs) { // Inner scope to exclude the cleaning of the string and symbol // tables from the displayed time. { - G1CMTraceTime t("GC ref-proc", G1Log::finer()); + GCTraceTime(Debug, gc) trace("GC Ref Proc", g1h->gc_timer_cm()); ReferenceProcessor* rp = g1h->ref_processor_cm(); @@ -2163,24 +2113,24 @@ void ConcurrentMark::weakRefsWork(bool clear_all_soft_refs) { // Unload Klasses, String, Symbols, Code Cache, etc. { - G1CMTraceTime trace("Unloading", G1Log::finer()); + GCTraceTime(Debug, gc) trace("Unloading", g1h->gc_timer_cm()); if (ClassUnloadingWithConcurrentMark) { bool purged_classes; { - G1CMTraceTime trace("System Dictionary Unloading", G1Log::finest()); + GCTraceTime(Trace, gc) trace("System Dictionary Unloading", g1h->gc_timer_cm()); purged_classes = SystemDictionary::do_unloading(&g1_is_alive, false /* Defer klass cleaning */); } { - G1CMTraceTime trace("Parallel Unloading", G1Log::finest()); + GCTraceTime(Trace, gc) trace("Parallel Unloading", g1h->gc_timer_cm()); weakRefsWorkParallelPart(&g1_is_alive, purged_classes); } } if (G1StringDedup::is_enabled()) { - G1CMTraceTime trace("String Deduplication Unlink", G1Log::finest()); + GCTraceTime(Trace, gc) trace("String Deduplication Unlink", g1h->gc_timer_cm()); G1StringDedup::unlink(&g1_is_alive); } } @@ -2301,7 +2251,7 @@ void ConcurrentMark::checkpointRootsFinalWork() { HandleMark hm; G1CollectedHeap* g1h = G1CollectedHeap::heap(); - G1CMTraceTime trace("Finalize Marking", G1Log::finer()); + GCTraceTime(Debug, gc) trace("Finalize Marking", g1h->gc_timer_cm()); g1h->ensure_parsability(false); @@ -2614,12 +2564,13 @@ void ConcurrentMark::clear_all_count_data() { } void ConcurrentMark::print_stats() { - if (G1MarkingVerboseLevel > 0) { - gclog_or_tty->print_cr("---------------------------------------------------------------------"); - for (size_t i = 0; i < _active_tasks; ++i) { - _tasks[i]->print_stats(); - gclog_or_tty->print_cr("---------------------------------------------------------------------"); - } + if (!log_is_enabled(Debug, gc, stats)) { + return; + } + log_debug(gc, stats)("---------------------------------------------------------------------"); + for (size_t i = 0; i < _active_tasks; ++i) { + _tasks[i]->print_stats(); + log_debug(gc, stats)("---------------------------------------------------------------------"); } } @@ -2663,16 +2614,21 @@ void ConcurrentMark::abort() { static void print_ms_time_info(const char* prefix, const char* name, NumberSeq& ns) { - gclog_or_tty->print_cr("%s%5d %12s: total time = %8.2f s (avg = %8.2f ms).", + log_trace(gc, marking)("%s%5d %12s: total time = %8.2f s (avg = %8.2f ms).", prefix, ns.num(), name, ns.sum()/1000.0, ns.avg()); if (ns.num() > 0) { - gclog_or_tty->print_cr("%s [std. dev = %8.2f ms, max = %8.2f ms]", + log_trace(gc, marking)("%s [std. dev = %8.2f ms, max = %8.2f ms]", prefix, ns.sd(), ns.maximum()); } } void ConcurrentMark::print_summary_info() { - gclog_or_tty->print_cr(" Concurrent marking:"); + LogHandle(gc, marking) log; + if (!log.is_trace()) { + return; + } + + log.trace(" Concurrent marking:"); print_ms_time_info(" ", "init marks", _init_times); print_ms_time_info(" ", "remarks", _remark_times); { @@ -2681,25 +2637,16 @@ void ConcurrentMark::print_summary_info() { } print_ms_time_info(" ", "cleanups", _cleanup_times); - gclog_or_tty->print_cr(" Final counting total time = %8.2f s (avg = %8.2f ms).", - _total_counting_time, - (_cleanup_times.num() > 0 ? _total_counting_time * 1000.0 / - (double)_cleanup_times.num() - : 0.0)); + log.trace(" Final counting total time = %8.2f s (avg = %8.2f ms).", + _total_counting_time, (_cleanup_times.num() > 0 ? _total_counting_time * 1000.0 / (double)_cleanup_times.num() : 0.0)); if (G1ScrubRemSets) { - gclog_or_tty->print_cr(" RS scrub total time = %8.2f s (avg = %8.2f ms).", - _total_rs_scrub_time, - (_cleanup_times.num() > 0 ? _total_rs_scrub_time * 1000.0 / - (double)_cleanup_times.num() - : 0.0)); + log.trace(" RS scrub total time = %8.2f s (avg = %8.2f ms).", + _total_rs_scrub_time, (_cleanup_times.num() > 0 ? _total_rs_scrub_time * 1000.0 / (double)_cleanup_times.num() : 0.0)); } - gclog_or_tty->print_cr(" Total stop_world time = %8.2f s.", - (_init_times.sum() + _remark_times.sum() + - _cleanup_times.sum())/1000.0); - gclog_or_tty->print_cr(" Total concurrent time = %8.2f s " - "(%8.2f s marking).", - cmThread()->vtime_accum(), - cmThread()->vtime_mark_accum()); + log.trace(" Total stop_world time = %8.2f s.", + (_init_times.sum() + _remark_times.sum() + _cleanup_times.sum())/1000.0); + log.trace(" Total concurrent time = %8.2f s (%8.2f s marking).", + cmThread()->vtime_accum(), cmThread()->vtime_mark_accum()); } void ConcurrentMark::print_worker_threads_on(outputStream* st) const { @@ -3079,15 +3026,15 @@ void CMTask::drain_satb_buffers() { } void CMTask::print_stats() { - gclog_or_tty->print_cr("Marking Stats, task = %u, calls = %d", - _worker_id, _calls); - gclog_or_tty->print_cr(" Elapsed time = %1.2lfms, Termination time = %1.2lfms", - _elapsed_time_ms, _termination_time_ms); - gclog_or_tty->print_cr(" Step Times (cum): num = %d, avg = %1.2lfms, sd = %1.2lfms", - _step_times_ms.num(), _step_times_ms.avg(), - _step_times_ms.sd()); - gclog_or_tty->print_cr(" max = %1.2lfms, total = %1.2lfms", - _step_times_ms.maximum(), _step_times_ms.sum()); + log_debug(gc, stats)("Marking Stats, task = %u, calls = %d", + _worker_id, _calls); + log_debug(gc, stats)(" Elapsed time = %1.2lfms, Termination time = %1.2lfms", + _elapsed_time_ms, _termination_time_ms); + log_debug(gc, stats)(" Step Times (cum): num = %d, avg = %1.2lfms, sd = %1.2lfms", + _step_times_ms.num(), _step_times_ms.avg(), + _step_times_ms.sd()); + log_debug(gc, stats)(" max = %1.2lfms, total = %1.2lfms", + _step_times_ms.maximum(), _step_times_ms.sum()); } bool ConcurrentMark::try_stealing(uint worker_id, int* hash_seed, oop& obj) { @@ -3587,9 +3534,8 @@ CMTask::CMTask(uint worker_id, #define G1PPRL_SUM_MB_PERC_FORMAT(tag) G1PPRL_SUM_MB_FORMAT(tag) " / %1.2f %%" G1PrintRegionLivenessInfoClosure:: -G1PrintRegionLivenessInfoClosure(outputStream* out, const char* phase_name) - : _out(out), - _total_used_bytes(0), _total_capacity_bytes(0), +G1PrintRegionLivenessInfoClosure(const char* phase_name) + : _total_used_bytes(0), _total_capacity_bytes(0), _total_prev_live_bytes(0), _total_next_live_bytes(0), _hum_used_bytes(0), _hum_capacity_bytes(0), _hum_prev_live_bytes(0), _hum_next_live_bytes(0), @@ -3599,38 +3545,37 @@ G1PrintRegionLivenessInfoClosure(outputStream* out, const char* phase_name) double now = os::elapsedTime(); // Print the header of the output. - _out->cr(); - _out->print_cr(G1PPRL_LINE_PREFIX" PHASE %s @ %1.3f", phase_name, now); - _out->print_cr(G1PPRL_LINE_PREFIX" HEAP" - G1PPRL_SUM_ADDR_FORMAT("reserved") - G1PPRL_SUM_BYTE_FORMAT("region-size"), - p2i(g1_reserved.start()), p2i(g1_reserved.end()), - HeapRegion::GrainBytes); - _out->print_cr(G1PPRL_LINE_PREFIX); - _out->print_cr(G1PPRL_LINE_PREFIX - G1PPRL_TYPE_H_FORMAT - G1PPRL_ADDR_BASE_H_FORMAT - G1PPRL_BYTE_H_FORMAT - G1PPRL_BYTE_H_FORMAT - G1PPRL_BYTE_H_FORMAT - G1PPRL_DOUBLE_H_FORMAT - G1PPRL_BYTE_H_FORMAT - G1PPRL_BYTE_H_FORMAT, - "type", "address-range", - "used", "prev-live", "next-live", "gc-eff", - "remset", "code-roots"); - _out->print_cr(G1PPRL_LINE_PREFIX - G1PPRL_TYPE_H_FORMAT - G1PPRL_ADDR_BASE_H_FORMAT - G1PPRL_BYTE_H_FORMAT - G1PPRL_BYTE_H_FORMAT - G1PPRL_BYTE_H_FORMAT - G1PPRL_DOUBLE_H_FORMAT - G1PPRL_BYTE_H_FORMAT - G1PPRL_BYTE_H_FORMAT, - "", "", - "(bytes)", "(bytes)", "(bytes)", "(bytes/ms)", - "(bytes)", "(bytes)"); + log_trace(gc, liveness)(G1PPRL_LINE_PREFIX" PHASE %s @ %1.3f", phase_name, now); + log_trace(gc, liveness)(G1PPRL_LINE_PREFIX" HEAP" + G1PPRL_SUM_ADDR_FORMAT("reserved") + G1PPRL_SUM_BYTE_FORMAT("region-size"), + p2i(g1_reserved.start()), p2i(g1_reserved.end()), + HeapRegion::GrainBytes); + log_trace(gc, liveness)(G1PPRL_LINE_PREFIX); + log_trace(gc, liveness)(G1PPRL_LINE_PREFIX + G1PPRL_TYPE_H_FORMAT + G1PPRL_ADDR_BASE_H_FORMAT + G1PPRL_BYTE_H_FORMAT + G1PPRL_BYTE_H_FORMAT + G1PPRL_BYTE_H_FORMAT + G1PPRL_DOUBLE_H_FORMAT + G1PPRL_BYTE_H_FORMAT + G1PPRL_BYTE_H_FORMAT, + "type", "address-range", + "used", "prev-live", "next-live", "gc-eff", + "remset", "code-roots"); + log_trace(gc, liveness)(G1PPRL_LINE_PREFIX + G1PPRL_TYPE_H_FORMAT + G1PPRL_ADDR_BASE_H_FORMAT + G1PPRL_BYTE_H_FORMAT + G1PPRL_BYTE_H_FORMAT + G1PPRL_BYTE_H_FORMAT + G1PPRL_DOUBLE_H_FORMAT + G1PPRL_BYTE_H_FORMAT + G1PPRL_BYTE_H_FORMAT, + "", "", + "(bytes)", "(bytes)", "(bytes)", "(bytes/ms)", + "(bytes)", "(bytes)"); } // It takes as a parameter a reference to one of the _hum_* fields, it @@ -3701,18 +3646,18 @@ bool G1PrintRegionLivenessInfoClosure::doHeapRegion(HeapRegion* r) { _total_strong_code_roots_bytes += strong_code_roots_bytes; // Print a line for this particular region. - _out->print_cr(G1PPRL_LINE_PREFIX - G1PPRL_TYPE_FORMAT - G1PPRL_ADDR_BASE_FORMAT - G1PPRL_BYTE_FORMAT - G1PPRL_BYTE_FORMAT - G1PPRL_BYTE_FORMAT - G1PPRL_DOUBLE_FORMAT - G1PPRL_BYTE_FORMAT - G1PPRL_BYTE_FORMAT, - type, p2i(bottom), p2i(end), - used_bytes, prev_live_bytes, next_live_bytes, gc_eff, - remset_bytes, strong_code_roots_bytes); + log_trace(gc, liveness)(G1PPRL_LINE_PREFIX + G1PPRL_TYPE_FORMAT + G1PPRL_ADDR_BASE_FORMAT + G1PPRL_BYTE_FORMAT + G1PPRL_BYTE_FORMAT + G1PPRL_BYTE_FORMAT + G1PPRL_DOUBLE_FORMAT + G1PPRL_BYTE_FORMAT + G1PPRL_BYTE_FORMAT, + type, p2i(bottom), p2i(end), + used_bytes, prev_live_bytes, next_live_bytes, gc_eff, + remset_bytes, strong_code_roots_bytes); return false; } @@ -3721,23 +3666,22 @@ G1PrintRegionLivenessInfoClosure::~G1PrintRegionLivenessInfoClosure() { // add static memory usages to remembered set sizes _total_remset_bytes += HeapRegionRemSet::fl_mem_size() + HeapRegionRemSet::static_mem_size(); // Print the footer of the output. - _out->print_cr(G1PPRL_LINE_PREFIX); - _out->print_cr(G1PPRL_LINE_PREFIX - " SUMMARY" - G1PPRL_SUM_MB_FORMAT("capacity") - G1PPRL_SUM_MB_PERC_FORMAT("used") - G1PPRL_SUM_MB_PERC_FORMAT("prev-live") - G1PPRL_SUM_MB_PERC_FORMAT("next-live") - G1PPRL_SUM_MB_FORMAT("remset") - G1PPRL_SUM_MB_FORMAT("code-roots"), - bytes_to_mb(_total_capacity_bytes), - bytes_to_mb(_total_used_bytes), - perc(_total_used_bytes, _total_capacity_bytes), - bytes_to_mb(_total_prev_live_bytes), - perc(_total_prev_live_bytes, _total_capacity_bytes), - bytes_to_mb(_total_next_live_bytes), - perc(_total_next_live_bytes, _total_capacity_bytes), - bytes_to_mb(_total_remset_bytes), - bytes_to_mb(_total_strong_code_roots_bytes)); - _out->cr(); + log_trace(gc, liveness)(G1PPRL_LINE_PREFIX); + log_trace(gc, liveness)(G1PPRL_LINE_PREFIX + " SUMMARY" + G1PPRL_SUM_MB_FORMAT("capacity") + G1PPRL_SUM_MB_PERC_FORMAT("used") + G1PPRL_SUM_MB_PERC_FORMAT("prev-live") + G1PPRL_SUM_MB_PERC_FORMAT("next-live") + G1PPRL_SUM_MB_FORMAT("remset") + G1PPRL_SUM_MB_FORMAT("code-roots"), + bytes_to_mb(_total_capacity_bytes), + bytes_to_mb(_total_used_bytes), + perc(_total_used_bytes, _total_capacity_bytes), + bytes_to_mb(_total_prev_live_bytes), + perc(_total_prev_live_bytes, _total_capacity_bytes), + bytes_to_mb(_total_next_live_bytes), + perc(_total_next_live_bytes, _total_capacity_bytes), + bytes_to_mb(_total_remset_bytes), + bytes_to_mb(_total_strong_code_roots_bytes)); } diff --git a/hotspot/src/share/vm/gc/g1/concurrentMark.hpp b/hotspot/src/share/vm/gc/g1/concurrentMark.hpp index 6a4260ed323..d6710dc283a 100644 --- a/hotspot/src/share/vm/gc/g1/concurrentMark.hpp +++ b/hotspot/src/share/vm/gc/g1/concurrentMark.hpp @@ -978,8 +978,6 @@ public: // after we sort the old regions at the end of the cleanup operation. class G1PrintRegionLivenessInfoClosure: public HeapRegionClosure { private: - outputStream* _out; - // Accumulators for these values. size_t _total_used_bytes; size_t _total_capacity_bytes; @@ -1024,7 +1022,7 @@ private: public: // The header and footer are printed in the constructor and // destructor respectively. - G1PrintRegionLivenessInfoClosure(outputStream* out, const char* phase_name); + G1PrintRegionLivenessInfoClosure(const char* phase_name); virtual bool doHeapRegion(HeapRegion* r); ~G1PrintRegionLivenessInfoClosure(); }; diff --git a/hotspot/src/share/vm/gc/g1/concurrentMarkThread.cpp b/hotspot/src/share/vm/gc/g1/concurrentMarkThread.cpp index 4884a7742fd..67b31e6683d 100644 --- a/hotspot/src/share/vm/gc/g1/concurrentMarkThread.cpp +++ b/hotspot/src/share/vm/gc/g1/concurrentMarkThread.cpp @@ -26,12 +26,13 @@ #include "gc/g1/concurrentMarkThread.inline.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectorPolicy.hpp" -#include "gc/g1/g1Log.hpp" #include "gc/g1/g1MMUTracker.hpp" #include "gc/g1/suspendibleThreadSet.hpp" #include "gc/g1/vm_operations_g1.hpp" #include "gc/shared/gcId.hpp" #include "gc/shared/gcTrace.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" +#include "logging/log.hpp" #include "memory/resourceArea.hpp" #include "runtime/vmThread.hpp" @@ -78,20 +79,6 @@ public: } }; -// We want to avoid that the logging from the concurrent thread is mixed -// with the logging from a STW GC. So, if necessary join the STS to ensure -// that the logging is done either before or after the STW logging. -void ConcurrentMarkThread::cm_log(bool doit, bool join_sts, const char* fmt, ...) { - if (doit) { - SuspendibleThreadSetJoiner sts_joiner(join_sts); - va_list args; - va_start(args, fmt); - gclog_or_tty->gclog_stamp(); - gclog_or_tty->vprint_cr(fmt, args); - va_end(args); - } -} - // Marking pauses can be scheduled flexibly, so we might delay marking to meet MMU. void ConcurrentMarkThread::delay_to_keep_mmu(G1CollectorPolicy* g1_policy, bool remark) { if (g1_policy->adaptive_young_list_length()) { @@ -143,8 +130,11 @@ void ConcurrentMarkThread::run_service() { _cm->scanRootRegions(); } - double mark_start_sec = os::elapsedTime(); - cm_log(G1Log::fine(), true, "[GC concurrent-mark-start]"); + // It would be nice to use the GCTraceConcTime class here but + // the "end" logging is inside the loop and not at the end of + // a scope. Mimicking the same log output as GCTraceConcTime instead. + jlong mark_start = os::elapsed_counter(); + log_info(gc)("Concurrent Mark (%.3fs)", TimeHelper::counter_to_seconds(mark_start)); int iter = 0; do { @@ -154,20 +144,22 @@ void ConcurrentMarkThread::run_service() { } double mark_end_time = os::elapsedVTime(); - double mark_end_sec = os::elapsedTime(); + jlong mark_end = os::elapsed_counter(); _vtime_mark_accum += (mark_end_time - cycle_start); if (!cm()->has_aborted()) { delay_to_keep_mmu(g1_policy, true /* remark */); - - cm_log(G1Log::fine(), true, "[GC concurrent-mark-end, %1.7lf secs]", mark_end_sec - mark_start_sec); + log_info(gc)("Concurrent Mark (%.3fs, %.3fs) %.3fms", + TimeHelper::counter_to_seconds(mark_start), + TimeHelper::counter_to_seconds(mark_end), + TimeHelper::counter_to_millis(mark_end - mark_start)); CMCheckpointRootsFinalClosure final_cl(_cm); - VM_CGC_Operation op(&final_cl, "GC remark", true /* needs_pll */); + VM_CGC_Operation op(&final_cl, "Pause Remark", true /* needs_pll */); VMThread::execute(&op); } if (cm()->restart_for_overflow()) { - cm_log(G1TraceMarkStackOverflow, true, "Restarting conc marking because of MS overflow in remark (restart #%d).", iter); - cm_log(G1Log::fine(), true, "[GC concurrent-mark-restart-for-overflow]"); + log_debug(gc)("Restarting conc marking because of MS overflow in remark (restart #%d).", iter); + log_info(gc)("Concurrent Mark restart for overflow"); } } while (cm()->restart_for_overflow()); @@ -181,7 +173,7 @@ void ConcurrentMarkThread::run_service() { delay_to_keep_mmu(g1_policy, false /* cleanup */); CMCleanUp cl_cl(_cm); - VM_CGC_Operation op(&cl_cl, "GC cleanup", false /* needs_pll */); + VM_CGC_Operation op(&cl_cl, "Pause Cleanup", false /* needs_pll */); VMThread::execute(&op); } else { // We don't want to update the marking status if a GC pause @@ -201,8 +193,7 @@ void ConcurrentMarkThread::run_service() { // place, it would wait for us to process the regions // reclaimed by cleanup. - double cleanup_start_sec = os::elapsedTime(); - cm_log(G1Log::fine(), false, "[GC concurrent-cleanup-start]"); + GCTraceConcTime(Info, gc) tt("Concurrent Cleanup"); // Now do the concurrent cleanup operation. _cm->completeCleanup(); @@ -217,9 +208,6 @@ void ConcurrentMarkThread::run_service() { // while it's trying to join the STS, which is conditional on // the GC workers finishing. g1h->reset_free_regions_coming(); - - double cleanup_end_sec = os::elapsedTime(); - cm_log(G1Log::fine(), true, "[GC concurrent-cleanup-end, %1.7lf secs]", cleanup_end_sec - cleanup_start_sec); } guarantee(cm()->cleanup_list_is_empty(), "at this point there should be no regions on the cleanup list"); @@ -253,7 +241,7 @@ void ConcurrentMarkThread::run_service() { if (!cm()->has_aborted()) { g1_policy->record_concurrent_mark_cleanup_completed(); } else { - cm_log(G1Log::fine(), false, "[GC concurrent-mark-abort]"); + log_info(gc)("Concurrent Mark abort"); } } diff --git a/hotspot/src/share/vm/gc/g1/concurrentMarkThread.hpp b/hotspot/src/share/vm/gc/g1/concurrentMarkThread.hpp index 13f34d676a9..2dd170916da 100644 --- a/hotspot/src/share/vm/gc/g1/concurrentMarkThread.hpp +++ b/hotspot/src/share/vm/gc/g1/concurrentMarkThread.hpp @@ -40,7 +40,6 @@ class ConcurrentMarkThread: public ConcurrentGCThread { double _vtime_accum; // Accumulated virtual time. double _vtime_mark_accum; - void cm_log(bool doit, bool join_sts, const char* fmt, ...) ATTRIBUTE_PRINTF(4, 5); public: virtual void run(); diff --git a/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.cpp b/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.cpp index a1542adf8e5..a123477e58e 100644 --- a/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.cpp +++ b/hotspot/src/share/vm/gc/g1/g1BlockOffsetTable.cpp @@ -27,6 +27,7 @@ #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/heapRegion.hpp" #include "gc/shared/space.hpp" +#include "logging/log.hpp" #include "oops/oop.inline.hpp" #include "runtime/java.hpp" #include "services/memTracker.hpp" @@ -50,14 +51,9 @@ G1BlockOffsetSharedArray::G1BlockOffsetSharedArray(MemRegion heap, G1RegionToSpa storage->set_mapping_changed_listener(&_listener); - if (TraceBlockOffsetTable) { - gclog_or_tty->print_cr("G1BlockOffsetSharedArray::G1BlockOffsetSharedArray: "); - gclog_or_tty->print_cr(" " - " rs.base(): " PTR_FORMAT - " rs.size(): " SIZE_FORMAT - " rs end(): " PTR_FORMAT, - p2i(bot_reserved.start()), bot_reserved.byte_size(), p2i(bot_reserved.end())); - } + log_trace(gc, bot)("G1BlockOffsetSharedArray::G1BlockOffsetSharedArray: "); + log_trace(gc, bot)(" rs.base(): " PTR_FORMAT " rs.size(): " SIZE_FORMAT " rs end(): " PTR_FORMAT, + p2i(bot_reserved.start()), bot_reserved.byte_size(), p2i(bot_reserved.end())); } bool G1BlockOffsetSharedArray::is_card_boundary(HeapWord* p) const { diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp index e02f80494cd..59fdc8b1381 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp @@ -36,10 +36,8 @@ #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectorPolicy.hpp" #include "gc/g1/g1CollectorState.hpp" -#include "gc/g1/g1ErgoVerbose.hpp" #include "gc/g1/g1EvacStats.inline.hpp" #include "gc/g1/g1GCPhaseTimes.hpp" -#include "gc/g1/g1Log.hpp" #include "gc/g1/g1MarkSweep.hpp" #include "gc/g1/g1OopClosures.inline.hpp" #include "gc/g1/g1ParScanThreadState.inline.hpp" @@ -59,11 +57,12 @@ #include "gc/shared/gcLocker.inline.hpp" #include "gc/shared/gcTimer.hpp" #include "gc/shared/gcTrace.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/generationSpec.hpp" #include "gc/shared/isGCActiveMark.hpp" #include "gc/shared/referenceProcessor.hpp" #include "gc/shared/taskqueue.inline.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" #include "memory/iterator.hpp" #include "oops/oop.inline.hpp" @@ -224,11 +223,9 @@ G1CollectedHeap::new_region_try_secondary_free_list(bool is_old) { MutexLockerEx x(SecondaryFreeList_lock, Mutex::_no_safepoint_check_flag); while (!_secondary_free_list.is_empty() || free_regions_coming()) { if (!_secondary_free_list.is_empty()) { - if (G1ConcRegionFreeingVerbose) { - gclog_or_tty->print_cr("G1ConcRegionFreeing [region alloc] : " - "secondary_free_list has %u entries", - _secondary_free_list.length()); - } + log_develop_trace(gc, freelist)("G1ConcRegionFreeing [region alloc] : " + "secondary_free_list has %u entries", + _secondary_free_list.length()); // It looks as if there are free regions available on the // secondary_free_list. Let's move them to the free_list and try // again to allocate from it. @@ -237,11 +234,9 @@ G1CollectedHeap::new_region_try_secondary_free_list(bool is_old) { assert(_hrm.num_free_regions() > 0, "if the secondary_free_list was not " "empty we should have moved at least one entry to the free_list"); HeapRegion* res = _hrm.allocate_free_region(is_old); - if (G1ConcRegionFreeingVerbose) { - gclog_or_tty->print_cr("G1ConcRegionFreeing [region alloc] : " - "allocated " HR_FORMAT " from secondary_free_list", - HR_FORMAT_PARAMS(res)); - } + log_develop_trace(gc, freelist)("G1ConcRegionFreeing [region alloc] : " + "allocated " HR_FORMAT " from secondary_free_list", + HR_FORMAT_PARAMS(res)); return res; } @@ -251,10 +246,8 @@ G1CollectedHeap::new_region_try_secondary_free_list(bool is_old) { SecondaryFreeList_lock->wait(Mutex::_no_safepoint_check_flag); } - if (G1ConcRegionFreeingVerbose) { - gclog_or_tty->print_cr("G1ConcRegionFreeing [region alloc] : " - "could not allocate from secondary_free_list"); - } + log_develop_trace(gc, freelist)("G1ConcRegionFreeing [region alloc] : " + "could not allocate from secondary_free_list"); return NULL; } @@ -266,10 +259,8 @@ HeapRegion* G1CollectedHeap::new_region(size_t word_size, bool is_old, bool do_e HeapRegion* res; if (G1StressConcRegionFreeing) { if (!_secondary_free_list.is_empty()) { - if (G1ConcRegionFreeingVerbose) { - gclog_or_tty->print_cr("G1ConcRegionFreeing [region alloc] : " - "forced to look at the secondary_free_list"); - } + log_develop_trace(gc, freelist)("G1ConcRegionFreeing [region alloc] : " + "forced to look at the secondary_free_list"); res = new_region_try_secondary_free_list(is_old); if (res != NULL) { return res; @@ -280,10 +271,8 @@ HeapRegion* G1CollectedHeap::new_region(size_t word_size, bool is_old, bool do_e res = _hrm.allocate_free_region(is_old); if (res == NULL) { - if (G1ConcRegionFreeingVerbose) { - gclog_or_tty->print_cr("G1ConcRegionFreeing [region alloc] : " - "res == NULL, trying the secondary_free_list"); - } + log_develop_trace(gc, freelist)("G1ConcRegionFreeing [region alloc] : " + "res == NULL, trying the secondary_free_list"); res = new_region_try_secondary_free_list(is_old); } if (res == NULL && do_expand && _expand_heap_after_alloc_failure) { @@ -293,11 +282,9 @@ HeapRegion* G1CollectedHeap::new_region(size_t word_size, bool is_old, bool do_e // reconsider the use of _expand_heap_after_alloc_failure. assert(SafepointSynchronize::is_at_safepoint(), "invariant"); - ergo_verbose1(ErgoHeapSizing, - "attempt heap expansion", - ergo_format_reason("region allocation request failed") - ergo_format_byte("allocation request"), - word_size * HeapWordSize); + log_debug(gc, ergo, heap)("Attempt heap expansion (region allocation request failed). Allocation request: " SIZE_FORMAT "B", + word_size * HeapWordSize); + if (expand(word_size * HeapWordSize)) { // Given that expand() succeeded in expanding the heap, and we // always expand the heap by an amount aligned to the heap @@ -485,11 +472,9 @@ HeapWord* G1CollectedHeap::humongous_obj_allocate(size_t word_size, AllocationCo if (first != G1_NO_HRM_INDEX) { // We found something. Make sure these regions are committed, i.e. expand // the heap. Alternatively we could do a defragmentation GC. - ergo_verbose1(ErgoHeapSizing, - "attempt heap expansion", - ergo_format_reason("humongous allocation request failed") - ergo_format_byte("allocation request"), - word_size * HeapWordSize); + log_debug(gc, ergo, heap)("Attempt heap expansion (humongous allocation request failed). Allocation request: " SIZE_FORMAT "B", + word_size * HeapWordSize); + _hrm.expand_at(first, obj_regions); g1_policy()->record_new_heap_size(num_regions()); @@ -808,11 +793,9 @@ bool G1CollectedHeap::alloc_archive_regions(MemRegion* ranges, size_t count) { } increase_used(word_size * HeapWordSize); if (commits != 0) { - ergo_verbose1(ErgoHeapSizing, - "attempt heap expansion", - ergo_format_reason("allocate archive regions") - ergo_format_byte("total size"), - HeapRegion::GrainWords * HeapWordSize * commits); + log_debug(gc, ergo, heap)("Attempt heap expansion (allocate archive regions). Total size: " SIZE_FORMAT "B", + HeapRegion::GrainWords * HeapWordSize * commits); + } // Mark each G1 region touched by the range as archive, add it to the old set, @@ -993,11 +976,8 @@ void G1CollectedHeap::dealloc_archive_regions(MemRegion* ranges, size_t count) { } if (uncommitted_regions != 0) { - ergo_verbose1(ErgoHeapSizing, - "attempt heap shrinking", - ergo_format_reason("uncommitted archive regions") - ergo_format_byte("total size"), - HeapRegion::GrainWords * HeapWordSize * uncommitted_regions); + log_debug(gc, ergo, heap)("Attempt heap shrinking (uncommitted archive regions). Total size: " SIZE_FORMAT "B", + HeapRegion::GrainWords * HeapWordSize * uncommitted_regions); } decrease_used(size_used); } @@ -1236,8 +1216,11 @@ public: }; void G1CollectedHeap::print_hrm_post_compaction() { - PostCompactionPrinterClosure cl(hr_printer()); - heap_region_iterate(&cl); + if (_hr_printer.is_active()) { + PostCompactionPrinterClosure cl(hr_printer()); + heap_region_iterate(&cl); + } + } bool G1CollectedHeap::do_full_collection(bool explicit_gc, @@ -1258,7 +1241,6 @@ bool G1CollectedHeap::do_full_collection(bool explicit_gc, SvcGCMarker sgcm(SvcGCMarker::FULL); ResourceMark rm; - G1Log::update_level(); print_heap_before_gc(); trace_heap_before_gc(gc_tracer); @@ -1276,10 +1258,10 @@ bool G1CollectedHeap::do_full_collection(bool explicit_gc, // Timing assert(!GCCause::is_user_requested_gc(gc_cause()) || explicit_gc, "invariant"); - TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty); + GCTraceCPUTime tcpu; { - GCTraceTime t(GCCauseString("Full GC", gc_cause()), G1Log::fine(), true, NULL); + GCTraceTime(Info, gc) tm("Pause Full", NULL, gc_cause(), true); TraceCollectorStats tcs(g1mm()->full_collection_counters()); TraceMemoryManagerStats tms(true /* fullGC */, gc_cause()); @@ -1330,11 +1312,6 @@ bool G1CollectedHeap::do_full_collection(bool explicit_gc, _allocator->abandon_gc_alloc_regions(); g1_rem_set()->cleanupHRRS(); - // We should call this after we retire any currently active alloc - // regions so that all the ALLOC / RETIRE events are generated - // before the start GC event. - _hr_printer.start_gc(true /* full */, (size_t) total_collections()); - // We may have added regions to the current incremental collection // set between the last GC or pause and now. We need to clear the // incremental collection set and then start rebuilding it afresh @@ -1401,14 +1378,10 @@ bool G1CollectedHeap::do_full_collection(bool explicit_gc, resize_if_necessary_after_full_collection(); - if (_hr_printer.is_active()) { - // We should do this after we potentially resize the heap so - // that all the COMMIT / UNCOMMIT events are generated before - // the end GC event. - - print_hrm_post_compaction(); - _hr_printer.end_gc(true /* full */, (size_t) total_collections()); - } + // We should do this after we potentially resize the heap so + // that all the COMMIT / UNCOMMIT events are generated before + // the compaction events. + print_hrm_post_compaction(); G1HotCardCache* hot_card_cache = _cg1r->hot_card_cache(); if (hot_card_cache->use_cache()) { @@ -1477,10 +1450,6 @@ bool G1CollectedHeap::do_full_collection(bool explicit_gc, g1_policy()->record_full_collection_end(); - if (G1Log::fine()) { - g1_policy()->print_heap_transition(); - } - // We must call G1MonitoringSupport::update_sizes() in the same scoping level // as an active TraceMemoryManagerStats object (i.e. before the destructor for the // TraceMemoryManagerStats is called) so that the G1 memory pools are updated @@ -1490,9 +1459,7 @@ bool G1CollectedHeap::do_full_collection(bool explicit_gc, gc_epilogue(true); } - if (G1Log::finer()) { - g1_policy()->print_detailed_heap_transition(true /* full */); - } + g1_policy()->print_detailed_heap_transition(); print_heap_after_gc(); trace_heap_after_gc(gc_tracer); @@ -1570,30 +1537,22 @@ void G1CollectedHeap::resize_if_necessary_after_full_collection() { if (capacity_after_gc < minimum_desired_capacity) { // Don't expand unless it's significant size_t expand_bytes = minimum_desired_capacity - capacity_after_gc; - ergo_verbose4(ErgoHeapSizing, - "attempt heap expansion", - ergo_format_reason("capacity lower than " - "min desired capacity after Full GC") - ergo_format_byte("capacity") - ergo_format_byte("occupancy") - ergo_format_byte_perc("min desired capacity"), - capacity_after_gc, used_after_gc, - minimum_desired_capacity, (double) MinHeapFreeRatio); + + log_debug(gc, ergo, heap)("Attempt heap expansion (capacity lower than min desired capacity after Full GC). " + "Capacity: " SIZE_FORMAT "B occupancy: " SIZE_FORMAT "B min_desired_capacity: " SIZE_FORMAT "B (" UINTX_FORMAT " %%)", + capacity_after_gc, used_after_gc, minimum_desired_capacity, MinHeapFreeRatio); + expand(expand_bytes); // No expansion, now see if we want to shrink } else if (capacity_after_gc > maximum_desired_capacity) { // Capacity too large, compute shrinking size size_t shrink_bytes = capacity_after_gc - maximum_desired_capacity; - ergo_verbose4(ErgoHeapSizing, - "attempt heap shrinking", - ergo_format_reason("capacity higher than " - "max desired capacity after Full GC") - ergo_format_byte("capacity") - ergo_format_byte("occupancy") - ergo_format_byte_perc("max desired capacity"), - capacity_after_gc, used_after_gc, - maximum_desired_capacity, (double) MaxHeapFreeRatio); + + log_debug(gc, ergo, heap)("Attempt heap shrinking (capacity higher than max desired capacity after Full GC). " + "Capacity: " SIZE_FORMAT "B occupancy: " SIZE_FORMAT "B min_desired_capacity: " SIZE_FORMAT "B (" UINTX_FORMAT " %%)", + capacity_after_gc, used_after_gc, minimum_desired_capacity, MinHeapFreeRatio); + shrink(shrink_bytes); } } @@ -1699,11 +1658,10 @@ HeapWord* G1CollectedHeap::expand_and_allocate(size_t word_size, AllocationConte verify_region_sets_optional(); size_t expand_bytes = MAX2(word_size * HeapWordSize, MinHeapDeltaBytes); - ergo_verbose1(ErgoHeapSizing, - "attempt heap expansion", - ergo_format_reason("allocation request failed") - ergo_format_byte("allocation request"), - word_size * HeapWordSize); + log_debug(gc, ergo, heap)("Attempt heap expansion (allocation request failed). Allocation request: " SIZE_FORMAT "B", + word_size * HeapWordSize); + + if (expand(expand_bytes)) { _hrm.verify_optional(); verify_region_sets_optional(); @@ -1718,16 +1676,12 @@ bool G1CollectedHeap::expand(size_t expand_bytes, double* expand_time_ms) { size_t aligned_expand_bytes = ReservedSpace::page_align_size_up(expand_bytes); aligned_expand_bytes = align_size_up(aligned_expand_bytes, HeapRegion::GrainBytes); - ergo_verbose2(ErgoHeapSizing, - "expand the heap", - ergo_format_byte("requested expansion amount") - ergo_format_byte("attempted expansion amount"), - expand_bytes, aligned_expand_bytes); + + log_debug(gc, ergo, heap)("Expand the heap. requested expansion amount:" SIZE_FORMAT "B expansion amount:" SIZE_FORMAT "B", + expand_bytes, aligned_expand_bytes); if (is_maximal_no_gc()) { - ergo_verbose0(ErgoHeapSizing, - "did not expand the heap", - ergo_format_reason("heap already fully expanded")); + log_debug(gc, ergo, heap)("Did not expand the heap (heap already fully expanded)"); return false; } @@ -1745,9 +1699,8 @@ bool G1CollectedHeap::expand(size_t expand_bytes, double* expand_time_ms) { assert(actual_expand_bytes <= aligned_expand_bytes, "post-condition"); g1_policy()->record_new_heap_size(num_regions()); } else { - ergo_verbose0(ErgoHeapSizing, - "did not expand the heap", - ergo_format_reason("heap expansion operation failed")); + log_debug(gc, ergo, heap)("Did not expand the heap (heap expansion operation failed)"); + // The expansion of the virtual storage space was unsuccessful. // Let's see if it was because we ran out of swap. if (G1ExitOnExpansionFailure && @@ -1769,18 +1722,13 @@ void G1CollectedHeap::shrink_helper(size_t shrink_bytes) { uint num_regions_removed = _hrm.shrink_by(num_regions_to_remove); size_t shrunk_bytes = num_regions_removed * HeapRegion::GrainBytes; - ergo_verbose3(ErgoHeapSizing, - "shrink the heap", - ergo_format_byte("requested shrinking amount") - ergo_format_byte("aligned shrinking amount") - ergo_format_byte("attempted shrinking amount"), - shrink_bytes, aligned_shrink_bytes, shrunk_bytes); + + log_debug(gc, ergo, heap)("Shrink the heap. requested shrinking amount: " SIZE_FORMAT "B aligned shrinking amount: " SIZE_FORMAT "B attempted shrinking amount: " SIZE_FORMAT "B", + shrink_bytes, aligned_shrink_bytes, shrunk_bytes); if (num_regions_removed > 0) { g1_policy()->record_new_heap_size(num_regions()); } else { - ergo_verbose0(ErgoHeapSizing, - "did not shrink the heap", - ergo_format_reason("heap shrinking operation failed")); + log_debug(gc, ergo, heap)("Did not expand the heap (heap shrinking operation failed)"); } } @@ -1892,8 +1840,8 @@ G1RegionToSpaceMapper* G1CollectedHeap::create_aux_memory_mapper(const char* des translation_factor, mtGC); if (TracePageSizes) { - gclog_or_tty->print_cr("G1 '%s': pg_sz=" SIZE_FORMAT " base=" PTR_FORMAT " size=" SIZE_FORMAT " alignment=" SIZE_FORMAT " reqsize=" SIZE_FORMAT, - description, preferred_page_size, p2i(rs.base()), rs.size(), rs.alignment(), size); + tty->print_cr("G1 '%s': pg_sz=" SIZE_FORMAT " base=" PTR_FORMAT " size=" SIZE_FORMAT " alignment=" SIZE_FORMAT " reqsize=" SIZE_FORMAT, + description, preferred_page_size, p2i(rs.base()), rs.size(), rs.alignment(), size); } return result; } @@ -1902,16 +1850,10 @@ jint G1CollectedHeap::initialize() { CollectedHeap::pre_initialize(); os::enable_vtime(); - G1Log::init(); - // Necessary to satisfy locking discipline assertions. MutexLocker x(Heap_lock); - // We have to initialize the printer before committing the heap, as - // it will be used then. - _hr_printer.set_active(G1PrintHeapRegions); - // While there are no constraints in the GC code that HeapWordSize // be any particular value, there are multiple other areas in the // system which believe this to be true (e.g. oop->object_size in some @@ -2104,7 +2046,7 @@ jint G1CollectedHeap::initialize() { void G1CollectedHeap::stop() { // Stop all concurrent threads. We do this to make sure these threads - // do not continue to execute and access resources (e.g. gclog_or_tty) + // do not continue to execute and access resources (e.g. logging) // that are destroyed during shutdown. _cg1r->stop(); _cmThread->stop(); @@ -2221,9 +2163,8 @@ public: virtual bool doHeapRegion(HeapRegion* hr) { unsigned region_gc_time_stamp = hr->get_gc_time_stamp(); if (_gc_time_stamp != region_gc_time_stamp) { - gclog_or_tty->print_cr("Region " HR_FORMAT " has GC time stamp = %d, " - "expected %d", HR_FORMAT_PARAMS(hr), - region_gc_time_stamp, _gc_time_stamp); + log_info(gc, verify)("Region " HR_FORMAT " has GC time stamp = %d, expected %d", HR_FORMAT_PARAMS(hr), + region_gc_time_stamp, _gc_time_stamp); _failures = true; } return false; @@ -2816,12 +2757,13 @@ public: if (!oopDesc::is_null(heap_oop)) { oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); if (_g1h->is_obj_dead_cond(obj, _vo)) { - gclog_or_tty->print_cr("Root location " PTR_FORMAT " " - "points to dead obj " PTR_FORMAT, p2i(p), p2i(obj)); + LogHandle(gc, verify) log; + log.info("Root location " PTR_FORMAT " points to dead obj " PTR_FORMAT, p2i(p), p2i(obj)); if (_vo == VerifyOption_G1UseMarkWord) { - gclog_or_tty->print_cr(" Mark word: " INTPTR_FORMAT, (intptr_t)obj->mark()); + log.info(" Mark word: " PTR_FORMAT, p2i(obj->mark())); } - obj->print_on(gclog_or_tty); + ResourceMark rm; + obj->print_on(log.info_stream()); _failures = true; } } @@ -2866,10 +2808,10 @@ class G1VerifyCodeRootOopClosure: public OopClosure { // Verify that the strong code root list for this region // contains the nmethod if (!hrrs->strong_code_roots_list_contains(_nm)) { - gclog_or_tty->print_cr("Code root location " PTR_FORMAT " " - "from nmethod " PTR_FORMAT " not in strong " - "code roots for region [" PTR_FORMAT "," PTR_FORMAT ")", - p2i(p), p2i(_nm), p2i(hr->bottom()), p2i(hr->end())); + log_info(gc, verify)("Code root location " PTR_FORMAT " " + "from nmethod " PTR_FORMAT " not in strong " + "code roots for region [" PTR_FORMAT "," PTR_FORMAT ")", + p2i(p), p2i(_nm), p2i(hr->bottom()), p2i(hr->end())); _failures = true; } } @@ -3047,12 +2989,8 @@ public: r->object_iterate(¬_dead_yet_cl); if (_vo != VerifyOption_G1UseNextMarking) { if (r->max_live_bytes() < not_dead_yet_cl.live_bytes()) { - gclog_or_tty->print_cr("[" PTR_FORMAT "," PTR_FORMAT "] " - "max_live_bytes " SIZE_FORMAT " " - "< calculated " SIZE_FORMAT, - p2i(r->bottom()), p2i(r->end()), - r->max_live_bytes(), - not_dead_yet_cl.live_bytes()); + log_info(gc, verify)("[" PTR_FORMAT "," PTR_FORMAT "] max_live_bytes " SIZE_FORMAT " < calculated " SIZE_FORMAT, + p2i(r->bottom()), p2i(r->end()), r->max_live_bytes(), not_dead_yet_cl.live_bytes()); _failures = true; } } else { @@ -3100,85 +3038,75 @@ public: } }; -void G1CollectedHeap::verify(bool silent, VerifyOption vo) { - if (SafepointSynchronize::is_at_safepoint()) { - assert(Thread::current()->is_VM_thread(), - "Expected to be executed serially by the VM thread at this point"); +void G1CollectedHeap::verify(VerifyOption vo) { + if (!SafepointSynchronize::is_at_safepoint()) { + log_info(gc, verify)("Skipping verification. Not at safepoint."); + } - if (!silent) { gclog_or_tty->print("Roots "); } - VerifyRootsClosure rootsCl(vo); - VerifyKlassClosure klassCl(this, &rootsCl); - CLDToKlassAndOopClosure cldCl(&klassCl, &rootsCl, false); + assert(Thread::current()->is_VM_thread(), + "Expected to be executed serially by the VM thread at this point"); - // We apply the relevant closures to all the oops in the - // system dictionary, class loader data graph, the string table - // and the nmethods in the code cache. - G1VerifyCodeRootOopClosure codeRootsCl(this, &rootsCl, vo); - G1VerifyCodeRootBlobClosure blobsCl(&codeRootsCl); + log_debug(gc, verify)("Roots"); + VerifyRootsClosure rootsCl(vo); + VerifyKlassClosure klassCl(this, &rootsCl); + CLDToKlassAndOopClosure cldCl(&klassCl, &rootsCl, false); - { - G1RootProcessor root_processor(this, 1); - root_processor.process_all_roots(&rootsCl, - &cldCl, - &blobsCl); + // We apply the relevant closures to all the oops in the + // system dictionary, class loader data graph, the string table + // and the nmethods in the code cache. + G1VerifyCodeRootOopClosure codeRootsCl(this, &rootsCl, vo); + G1VerifyCodeRootBlobClosure blobsCl(&codeRootsCl); + + { + G1RootProcessor root_processor(this, 1); + root_processor.process_all_roots(&rootsCl, + &cldCl, + &blobsCl); + } + + bool failures = rootsCl.failures() || codeRootsCl.failures(); + + if (vo != VerifyOption_G1UseMarkWord) { + // If we're verifying during a full GC then the region sets + // will have been torn down at the start of the GC. Therefore + // verifying the region sets will fail. So we only verify + // the region sets when not in a full GC. + log_debug(gc, verify)("HeapRegionSets"); + verify_region_sets(); + } + + log_debug(gc, verify)("HeapRegions"); + if (GCParallelVerificationEnabled && ParallelGCThreads > 1) { + + G1ParVerifyTask task(this, vo); + workers()->run_task(&task); + if (task.failures()) { + failures = true; } - bool failures = rootsCl.failures() || codeRootsCl.failures(); - - if (vo != VerifyOption_G1UseMarkWord) { - // If we're verifying during a full GC then the region sets - // will have been torn down at the start of the GC. Therefore - // verifying the region sets will fail. So we only verify - // the region sets when not in a full GC. - if (!silent) { gclog_or_tty->print("HeapRegionSets "); } - verify_region_sets(); - } - - if (!silent) { gclog_or_tty->print("HeapRegions "); } - if (GCParallelVerificationEnabled && ParallelGCThreads > 1) { - - G1ParVerifyTask task(this, vo); - workers()->run_task(&task); - if (task.failures()) { - failures = true; - } - - } else { - VerifyRegionClosure blk(false, vo); - heap_region_iterate(&blk); - if (blk.failures()) { - failures = true; - } - } - - if (G1StringDedup::is_enabled()) { - if (!silent) gclog_or_tty->print("StrDedup "); - G1StringDedup::verify(); - } - - if (failures) { - gclog_or_tty->print_cr("Heap:"); - // It helps to have the per-region information in the output to - // help us track down what went wrong. This is why we call - // print_extended_on() instead of print_on(). - print_extended_on(gclog_or_tty); - gclog_or_tty->cr(); - gclog_or_tty->flush(); - } - guarantee(!failures, "there should not have been any failures"); } else { - if (!silent) { - gclog_or_tty->print("(SKIPPING Roots, HeapRegionSets, HeapRegions, RemSet"); - if (G1StringDedup::is_enabled()) { - gclog_or_tty->print(", StrDedup"); - } - gclog_or_tty->print(") "); + VerifyRegionClosure blk(false, vo); + heap_region_iterate(&blk); + if (blk.failures()) { + failures = true; } } -} -void G1CollectedHeap::verify(bool silent) { - verify(silent, VerifyOption_G1UsePrevMarking); + if (G1StringDedup::is_enabled()) { + log_debug(gc, verify)("StrDedup"); + G1StringDedup::verify(); + } + + if (failures) { + log_info(gc, verify)("Heap after failed verification:"); + // It helps to have the per-region information in the output to + // help us track down what went wrong. This is why we call + // print_extended_on() instead of print_on(). + LogHandle(gc, verify) log; + ResourceMark rm; + print_extended_on(log.info_stream()); + } + guarantee(!failures, "there should not have been any failures"); } double G1CollectedHeap::verify(bool guard, const char* msg) { @@ -3196,12 +3124,12 @@ double G1CollectedHeap::verify(bool guard, const char* msg) { } void G1CollectedHeap::verify_before_gc() { - double verify_time_ms = verify(VerifyBeforeGC, " VerifyBeforeGC:"); + double verify_time_ms = verify(VerifyBeforeGC, "Before GC"); g1_policy()->phase_times()->record_verify_before_time_ms(verify_time_ms); } void G1CollectedHeap::verify_after_gc() { - double verify_time_ms = verify(VerifyAfterGC, " VerifyAfterGC:"); + double verify_time_ms = verify(VerifyAfterGC, "After GC"); g1_policy()->phase_times()->record_verify_after_time_ms(verify_time_ms); } @@ -3311,12 +3239,8 @@ void G1CollectedHeap::print_tracing_info() const { // to that. g1_policy()->print_tracing_info(); } - if (G1SummarizeRSetStats) { - g1_rem_set()->print_summary_info(); - } - if (G1SummarizeConcMark) { - concurrent_mark()->print_summary_info(); - } + g1_rem_set()->print_summary_info(); + concurrent_mark()->print_summary_info(); g1_policy()->print_yg_surv_rate_info(); } @@ -3334,28 +3258,27 @@ public: size_t occupied = hrrs->occupied(); _occupied_sum += occupied; - gclog_or_tty->print_cr("Printing RSet for region " HR_FORMAT, - HR_FORMAT_PARAMS(r)); + tty->print_cr("Printing RSet for region " HR_FORMAT, HR_FORMAT_PARAMS(r)); if (occupied == 0) { - gclog_or_tty->print_cr(" RSet is empty"); + tty->print_cr(" RSet is empty"); } else { hrrs->print(); } - gclog_or_tty->print_cr("----------"); + tty->print_cr("----------"); return false; } PrintRSetsClosure(const char* msg) : _msg(msg), _occupied_sum(0) { - gclog_or_tty->cr(); - gclog_or_tty->print_cr("========================================"); - gclog_or_tty->print_cr("%s", msg); - gclog_or_tty->cr(); + tty->cr(); + tty->print_cr("========================================"); + tty->print_cr("%s", msg); + tty->cr(); } ~PrintRSetsClosure() { - gclog_or_tty->print_cr("Occupied Sum: " SIZE_FORMAT, _occupied_sum); - gclog_or_tty->print_cr("========================================"); - gclog_or_tty->cr(); + tty->print_cr("Occupied Sum: " SIZE_FORMAT, _occupied_sum); + tty->print_cr("========================================"); + tty->cr(); } }; @@ -3413,20 +3336,12 @@ void G1CollectedHeap::gc_prologue(bool full /* Ignored */) { accumulate_statistics_all_tlabs(); ensure_parsability(true); - if (G1SummarizeRSetStats && (G1SummarizeRSetStatsPeriod > 0) && - (total_collections() % G1SummarizeRSetStatsPeriod == 0)) { - g1_rem_set()->print_periodic_summary_info("Before GC RS summary"); - } + g1_rem_set()->print_periodic_summary_info("Before GC RS summary", total_collections()); } void G1CollectedHeap::gc_epilogue(bool full) { - - if (G1SummarizeRSetStats && - (G1SummarizeRSetStatsPeriod > 0) && - // we are at the end of the GC. Total collections has already been increased. - ((total_collections() - 1) % G1SummarizeRSetStatsPeriod == 0)) { - g1_rem_set()->print_periodic_summary_info("After GC RS summary"); - } + // we are at the end of the GC. Total collections has already been increased. + g1_rem_set()->print_periodic_summary_info("After GC RS summary", total_collections() - 1); // FIXME: what is this about? // I'm ignoring the "fill_newgen()" call if "alloc_event_enabled" @@ -3672,7 +3587,14 @@ void G1CollectedHeap::print_taskqueue_stats_hdr(outputStream* const st) { st->print_raw("--- "); TaskQueueStats::print_header(2, st); st->cr(); } -void G1CollectedHeap::print_taskqueue_stats(outputStream* const st) const { +void G1CollectedHeap::print_taskqueue_stats() const { + if (!develop_log_is_enabled(Trace, gc, task, stats)) { + return; + } + LogHandle(gc, task, stats) log; + ResourceMark rm; + outputStream* st = log.trace_stream(); + print_taskqueue_stats_hdr(st); TaskQueueStats totals; @@ -3694,41 +3616,17 @@ void G1CollectedHeap::reset_taskqueue_stats() { } #endif // TASKQUEUE_STATS -void G1CollectedHeap::log_gc_header() { - if (!G1Log::fine()) { - return; +void G1CollectedHeap::log_gc_footer(double pause_time_counter) { + if (evacuation_failed()) { + log_info(gc)("To-space exhausted"); } - gclog_or_tty->gclog_stamp(); + double pause_time_sec = TimeHelper::counter_to_seconds(pause_time_counter); + g1_policy()->print_phases(pause_time_sec); - GCCauseString gc_cause_str = GCCauseString("GC pause", gc_cause()) - .append(collector_state()->gcs_are_young() ? "(young)" : "(mixed)") - .append(collector_state()->during_initial_mark_pause() ? " (initial-mark)" : ""); - - gclog_or_tty->print("[%s", (const char*)gc_cause_str); + g1_policy()->print_detailed_heap_transition(); } -void G1CollectedHeap::log_gc_footer(double pause_time_sec) { - if (!G1Log::fine()) { - return; - } - - if (G1Log::finer()) { - if (evacuation_failed()) { - gclog_or_tty->print(" (to-space exhausted)"); - } - gclog_or_tty->print_cr(", %3.7f secs]", pause_time_sec); - g1_policy()->print_phases(pause_time_sec); - g1_policy()->print_detailed_heap_transition(); - } else { - if (evacuation_failed()) { - gclog_or_tty->print("--"); - } - g1_policy()->print_heap_transition(); - gclog_or_tty->print_cr(", %3.7f secs]", pause_time_sec); - } - gclog_or_tty->flush(); -} void G1CollectedHeap::wait_for_root_region_scanning() { double scan_wait_start = os::elapsedTime(); @@ -3764,7 +3662,6 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { wait_for_root_region_scanning(); - G1Log::update_level(); print_heap_before_gc(); trace_heap_before_gc(_gc_tracer_stw); @@ -3801,16 +3698,25 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { _gc_tracer_stw->report_yc_type(collector_state()->yc_type()); - TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty); + GCTraceCPUTime tcpu; uint active_workers = AdaptiveSizePolicy::calc_active_workers(workers()->total_workers(), workers()->active_workers(), Threads::number_of_non_daemon_threads()); workers()->set_active_workers(active_workers); + FormatBuffer<> gc_string("Pause "); + if (collector_state()->during_initial_mark_pause()) { + gc_string.append("Initial Mark"); + } else if (collector_state()->gcs_are_young()) { + gc_string.append("Young"); + } else { + gc_string.append("Mixed"); + } + GCTraceTime(Info, gc) tm(gc_string, NULL, gc_cause(), true); double pause_start_sec = os::elapsedTime(); + double pause_start_counter = os::elapsed_counter(); g1_policy()->note_gc_start(active_workers); - log_gc_header(); TraceCollectorStats tcs(g1mm()->incremental_collection_counters()); TraceMemoryManagerStats tms(false /* fullGC */, gc_cause()); @@ -3868,11 +3774,6 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { // of the collection set!). _allocator->release_mutator_alloc_region(); - // We should call this after we retire the mutator alloc - // region(s) so that all the ALLOC / RETIRE events are generated - // before the start GC event. - _hr_printer.start_gc(false /* full */, (size_t) total_collections()); - // This timing is only used by the ergonomics to handle our pause target. // It is unclear why this should not include the full pause. We will // investigate this in CR 7178365. @@ -3996,7 +3897,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { size_t expand_bytes = g1_policy()->expansion_amount(); if (expand_bytes > 0) { size_t bytes_before = capacity(); - // No need for an ergo verbose message here, + // No need for an ergo logging here, // expansion_amount() does this when it returns a value > 0. double expand_ms; if (!expand(expand_bytes, &expand_ms)) { @@ -4056,12 +3957,6 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { // CM reference discovery will be re-enabled if necessary. } - // We should do this after we potentially expand the heap so - // that all the COMMIT events are generated before the end GC - // event, and after we retire the GC alloc regions so that all - // RETIRE events are generated before the end GC event. - _hr_printer.end_gc(false /* full */, (size_t) total_collections()); - #ifdef TRACESPINNING ParallelTaskTerminator::print_termination_counts(); #endif @@ -4070,7 +3965,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { } // Print the remainder of the GC log output. - log_gc_footer(os::elapsedTime() - pause_start_sec); + log_gc_footer(os::elapsed_counter() - pause_start_counter); // It is not yet to safe to tell the concurrent mark to // start as we have some optional output below. We don't want the @@ -4080,7 +3975,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { _hrm.verify_optional(); verify_region_sets_optional(); - TASKQUEUE_STATS_ONLY(if (PrintTaskqueue) print_taskqueue_stats()); + TASKQUEUE_STATS_ONLY(print_taskqueue_stats()); TASKQUEUE_STATS_ONLY(reset_taskqueue_stats()); print_heap_after_gc(); @@ -4235,13 +4130,12 @@ public: assert(pss->queue_is_empty(), "should be empty"); - if (PrintTerminationStats) { + if (log_is_enabled(Debug, gc, task, stats)) { MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag); size_t lab_waste; size_t lab_undo_waste; pss->waste(lab_waste, lab_undo_waste); - _g1h->print_termination_stats(gclog_or_tty, - worker_id, + _g1h->print_termination_stats(worker_id, (os::elapsedTime() - start_sec) * 1000.0, /* elapsed time */ strong_roots_sec * 1000.0, /* strong roots time */ term_sec * 1000.0, /* evac term time */ @@ -4259,22 +4153,22 @@ public: } }; -void G1CollectedHeap::print_termination_stats_hdr(outputStream* const st) { - st->print_raw_cr("GC Termination Stats"); - st->print_raw_cr(" elapsed --strong roots-- -------termination------- ------waste (KiB)------"); - st->print_raw_cr("thr ms ms % ms % attempts total alloc undo"); - st->print_raw_cr("--- --------- --------- ------ --------- ------ -------- ------- ------- -------"); +void G1CollectedHeap::print_termination_stats_hdr() { + log_debug(gc, task, stats)("GC Termination Stats"); + log_debug(gc, task, stats)(" elapsed --strong roots-- -------termination------- ------waste (KiB)------"); + log_debug(gc, task, stats)("thr ms ms %% ms %% attempts total alloc undo"); + log_debug(gc, task, stats)("--- --------- --------- ------ --------- ------ -------- ------- ------- -------"); } -void G1CollectedHeap::print_termination_stats(outputStream* const st, - uint worker_id, +void G1CollectedHeap::print_termination_stats(uint worker_id, double elapsed_ms, double strong_roots_ms, double term_ms, size_t term_attempts, size_t alloc_buffer_waste, size_t undo_waste) const { - st->print_cr("%3d %9.2f %9.2f %6.2f " + log_debug(gc, task, stats) + ("%3d %9.2f %9.2f %6.2f " "%9.2f %6.2f " SIZE_FORMAT_W(8) " " SIZE_FORMAT_W(7) " " SIZE_FORMAT_W(7) " " SIZE_FORMAT_W(7), worker_id, elapsed_ms, strong_roots_ms, strong_roots_ms * 100 / elapsed_ms, @@ -4323,13 +4217,11 @@ public: "claim value %d after unlink less than initial symbol table size %d", SymbolTable::parallel_claimed_index(), _initial_symbol_table_size); - if (G1TraceStringSymbolTableScrubbing) { - gclog_or_tty->print_cr("Cleaned string and symbol table, " - "strings: " SIZE_FORMAT " processed, " SIZE_FORMAT " removed, " - "symbols: " SIZE_FORMAT " processed, " SIZE_FORMAT " removed", - strings_processed(), strings_removed(), - symbols_processed(), symbols_removed()); - } + log_debug(gc, stringdedup)("Cleaned string and symbol table, " + "strings: " SIZE_FORMAT " processed, " SIZE_FORMAT " removed, " + "symbols: " SIZE_FORMAT " processed, " SIZE_FORMAT " removed", + strings_processed(), strings_removed(), + symbols_processed(), symbols_removed()); } void work(uint worker_id) { @@ -5169,10 +5061,7 @@ void G1CollectedHeap::evacuate_collection_set(EvacuationInfo& evacuation_info, G ClassLoaderDataGraph::clear_claimed_marks(); } - // The individual threads will set their evac-failure closures. - if (PrintTerminationStats) { - print_termination_stats_hdr(gclog_or_tty); - } + print_termination_stats_hdr(); workers()->run_task(&g1_par_task); end_par_time_sec = os::elapsedTime(); @@ -5411,11 +5300,8 @@ bool G1CollectedHeap::verify_no_bits_over_tams(const char* bitmap_name, CMBitMap "tams: " PTR_FORMAT " end: " PTR_FORMAT, p2i(tams), p2i(end)); HeapWord* result = bitmap->getNextMarkedWordAddress(tams, end); if (result < end) { - gclog_or_tty->cr(); - gclog_or_tty->print_cr("## wrong marked address on %s bitmap: " PTR_FORMAT, - bitmap_name, p2i(result)); - gclog_or_tty->print_cr("## %s tams: " PTR_FORMAT " end: " PTR_FORMAT, - bitmap_name, p2i(tams), p2i(end)); + log_info(gc, verify)("## wrong marked address on %s bitmap: " PTR_FORMAT, bitmap_name, p2i(result)); + log_info(gc, verify)("## %s tams: " PTR_FORMAT " end: " PTR_FORMAT, bitmap_name, p2i(tams), p2i(end)); return false; } return true; @@ -5440,9 +5326,8 @@ bool G1CollectedHeap::verify_bitmaps(const char* caller, HeapRegion* hr) { res_n = verify_no_bits_over_tams("next", next_bitmap, ntams, end); } if (!res_p || !res_n) { - gclog_or_tty->print_cr("#### Bitmap verification failed for " HR_FORMAT, - HR_FORMAT_PARAMS(hr)); - gclog_or_tty->print_cr("#### Caller: %s", caller); + log_info(gc, verify)("#### Bitmap verification failed for " HR_FORMAT, HR_FORMAT_PARAMS(hr)); + log_info(gc, verify)("#### Caller: %s", caller); return false; } return true; @@ -5494,42 +5379,42 @@ class G1CheckCSetFastTableClosure : public HeapRegionClosure { InCSetState cset_state = (InCSetState) G1CollectedHeap::heap()->_in_cset_fast_test.get_by_index(i); if (hr->is_humongous()) { if (hr->in_collection_set()) { - gclog_or_tty->print_cr("\n## humongous region %u in CSet", i); + log_info(gc, verify)("## humongous region %u in CSet", i); _failures = true; return true; } if (cset_state.is_in_cset()) { - gclog_or_tty->print_cr("\n## inconsistent cset state " CSETSTATE_FORMAT " for humongous region %u", cset_state.value(), i); + log_info(gc, verify)("## inconsistent cset state " CSETSTATE_FORMAT " for humongous region %u", cset_state.value(), i); _failures = true; return true; } if (hr->is_continues_humongous() && cset_state.is_humongous()) { - gclog_or_tty->print_cr("\n## inconsistent cset state " CSETSTATE_FORMAT " for continues humongous region %u", cset_state.value(), i); + log_info(gc, verify)("## inconsistent cset state " CSETSTATE_FORMAT " for continues humongous region %u", cset_state.value(), i); _failures = true; return true; } } else { if (cset_state.is_humongous()) { - gclog_or_tty->print_cr("\n## inconsistent cset state " CSETSTATE_FORMAT " for non-humongous region %u", cset_state.value(), i); + log_info(gc, verify)("## inconsistent cset state " CSETSTATE_FORMAT " for non-humongous region %u", cset_state.value(), i); _failures = true; return true; } if (hr->in_collection_set() != cset_state.is_in_cset()) { - gclog_or_tty->print_cr("\n## in CSet %d / cset state " CSETSTATE_FORMAT " inconsistency for region %u", - hr->in_collection_set(), cset_state.value(), i); + log_info(gc, verify)("## in CSet %d / cset state " CSETSTATE_FORMAT " inconsistency for region %u", + hr->in_collection_set(), cset_state.value(), i); _failures = true; return true; } if (cset_state.is_in_cset()) { if (hr->is_young() != (cset_state.is_young())) { - gclog_or_tty->print_cr("\n## is_young %d / cset state " CSETSTATE_FORMAT " inconsistency for region %u", - hr->is_young(), cset_state.value(), i); + log_info(gc, verify)("## is_young %d / cset state " CSETSTATE_FORMAT " inconsistency for region %u", + hr->is_young(), cset_state.value(), i); _failures = true; return true; } if (hr->is_old() != (cset_state.is_old())) { - gclog_or_tty->print_cr("\n## is_old %d / cset state " CSETSTATE_FORMAT " inconsistency for region %u", - hr->is_old(), cset_state.value(), i); + log_info(gc, verify)("## is_old %d / cset state " CSETSTATE_FORMAT " inconsistency for region %u", + hr->is_old(), cset_state.value(), i); _failures = true; return true; } @@ -5746,9 +5631,7 @@ class G1FreeHumongousRegionClosure : public HeapRegionClosure { uint region_idx = r->hrm_index(); if (!g1h->is_humongous_reclaim_candidate(region_idx) || !r->rem_set()->is_empty()) { - - if (G1TraceEagerReclaimHumongousObjects) { - gclog_or_tty->print_cr("Live humongous region %u object size " SIZE_FORMAT " start " PTR_FORMAT " with remset " SIZE_FORMAT " code roots " SIZE_FORMAT " is marked %d reclaim candidate %d type array %d", + log_debug(gc, humongous)("Live humongous region %u object size " SIZE_FORMAT " start " PTR_FORMAT " with remset " SIZE_FORMAT " code roots " SIZE_FORMAT " is marked %d reclaim candidate %d type array %d", region_idx, (size_t)obj->size() * HeapWordSize, p2i(r->bottom()), @@ -5758,8 +5641,6 @@ class G1FreeHumongousRegionClosure : public HeapRegionClosure { g1h->is_humongous_reclaim_candidate(region_idx), obj->is_typeArray() ); - } - return false; } @@ -5767,8 +5648,7 @@ class G1FreeHumongousRegionClosure : public HeapRegionClosure { "Only eagerly reclaiming type arrays is supported, but the object " PTR_FORMAT " is not.", p2i(r->bottom())); - if (G1TraceEagerReclaimHumongousObjects) { - gclog_or_tty->print_cr("Dead humongous region %u object size " SIZE_FORMAT " start " PTR_FORMAT " with remset " SIZE_FORMAT " code roots " SIZE_FORMAT " is marked %d reclaim candidate %d type array %d", + log_debug(gc, humongous)("Dead humongous region %u object size " SIZE_FORMAT " start " PTR_FORMAT " with remset " SIZE_FORMAT " code roots " SIZE_FORMAT " is marked %d reclaim candidate %d type array %d", region_idx, (size_t)obj->size() * HeapWordSize, p2i(r->bottom()), @@ -5778,7 +5658,7 @@ class G1FreeHumongousRegionClosure : public HeapRegionClosure { g1h->is_humongous_reclaim_candidate(region_idx), obj->is_typeArray() ); - } + // Need to clear mark bit of the humongous object if already set. if (next_bitmap->isMarked(r->bottom())) { next_bitmap->clear(r->bottom()); @@ -5812,7 +5692,7 @@ void G1CollectedHeap::eagerly_reclaim_humongous_regions() { assert_at_safepoint(true); if (!G1EagerReclaimHumongousObjects || - (!_has_humongous_reclaim_candidates && !G1TraceEagerReclaimHumongousObjects)) { + (!_has_humongous_reclaim_candidates && !log_is_enabled(Debug, gc, humongous))) { g1_policy()->phase_times()->record_fast_reclaim_humongous_time_ms(0.0, 0); return; } @@ -5865,10 +5745,7 @@ void G1CollectedHeap::abandon_collection_set(HeapRegion* cs_head) { } void G1CollectedHeap::set_free_regions_coming() { - if (G1ConcRegionFreeingVerbose) { - gclog_or_tty->print_cr("G1ConcRegionFreeing [cm thread] : " - "setting free regions coming"); - } + log_develop_trace(gc, freelist)("G1ConcRegionFreeing [cm thread] : setting free regions coming"); assert(!free_regions_coming(), "pre-condition"); _free_regions_coming = true; @@ -5883,10 +5760,7 @@ void G1CollectedHeap::reset_free_regions_coming() { SecondaryFreeList_lock->notify_all(); } - if (G1ConcRegionFreeingVerbose) { - gclog_or_tty->print_cr("G1ConcRegionFreeing [cm thread] : " - "reset free regions coming"); - } + log_develop_trace(gc, freelist)("G1ConcRegionFreeing [cm thread] : reset free regions coming"); } void G1CollectedHeap::wait_while_free_regions_coming() { @@ -5896,10 +5770,7 @@ void G1CollectedHeap::wait_while_free_regions_coming() { return; } - if (G1ConcRegionFreeingVerbose) { - gclog_or_tty->print_cr("G1ConcRegionFreeing [other] : " - "waiting for free regions"); - } + log_develop_trace(gc, freelist)("G1ConcRegionFreeing [other] : waiting for free regions"); { MutexLockerEx x(SecondaryFreeList_lock, Mutex::_no_safepoint_check_flag); @@ -5908,10 +5779,7 @@ void G1CollectedHeap::wait_while_free_regions_coming() { } } - if (G1ConcRegionFreeingVerbose) { - gclog_or_tty->print_cr("G1ConcRegionFreeing [other] : " - "done waiting for free regions"); - } + log_develop_trace(gc, freelist)("G1ConcRegionFreeing [other] : done waiting for free regions"); } bool G1CollectedHeap::is_old_gc_alloc_region(HeapRegion* hr) { @@ -5929,8 +5797,8 @@ public: NoYoungRegionsClosure() : _success(true) { } bool doHeapRegion(HeapRegion* r) { if (r->is_young()) { - gclog_or_tty->print_cr("Region [" PTR_FORMAT ", " PTR_FORMAT ") tagged as young", - p2i(r->bottom()), p2i(r->end())); + log_info(gc, verify)("Region [" PTR_FORMAT ", " PTR_FORMAT ") tagged as young", + p2i(r->bottom()), p2i(r->end())); _success = false; } return false; @@ -6180,11 +6048,8 @@ HeapRegion* G1CollectedHeap::alloc_highest_free_region() { if (index != G1_NO_HRM_INDEX) { if (expanded) { - ergo_verbose1(ErgoHeapSizing, - "attempt heap expansion", - ergo_format_reason("requested address range outside heap bounds") - ergo_format_byte("region size"), - HeapRegion::GrainWords * HeapWordSize); + log_debug(gc, ergo, heap)("Attempt heap expansion (requested address range outside heap bounds). region size: " SIZE_FORMAT "B", + HeapRegion::GrainWords * HeapWordSize); } _hrm.allocate_free_regions_starting_at(index, 1); return region_at(index); diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp index eb1292876d6..9bd26d31175 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp @@ -290,8 +290,7 @@ private: void verify_before_gc(); void verify_after_gc(); - void log_gc_header(); - void log_gc_footer(double pause_time_sec); + void log_gc_footer(double pause_time_counter); void trace_heap(GCWhen::Type when, const GCTracer* tracer); @@ -704,8 +703,8 @@ protected: void shrink_helper(size_t expand_bytes); #if TASKQUEUE_STATS - static void print_taskqueue_stats_hdr(outputStream* const st = gclog_or_tty); - void print_taskqueue_stats(outputStream* const st = gclog_or_tty) const; + static void print_taskqueue_stats_hdr(outputStream* const st); + void print_taskqueue_stats() const; void reset_taskqueue_stats(); #endif // TASKQUEUE_STATS @@ -738,10 +737,9 @@ protected: void post_evacuate_collection_set(EvacuationInfo& evacuation_info, G1ParScanThreadStateSet* pss); // Print the header for the per-thread termination statistics. - static void print_termination_stats_hdr(outputStream* const st); + static void print_termination_stats_hdr(); // Print actual per-thread termination statistics. - void print_termination_stats(outputStream* const st, - uint worker_id, + void print_termination_stats(uint worker_id, double elapsed_ms, double strong_roots_ms, double term_ms, @@ -968,6 +966,10 @@ public: return CollectedHeap::G1CollectedHeap; } + virtual const char* name() const { + return "G1"; + } + const G1CollectorState* collector_state() const { return &_collector_state; } G1CollectorState* collector_state() { return &_collector_state; } @@ -1365,6 +1367,10 @@ public: YoungList* young_list() const { return _young_list; } + uint old_regions_count() const { return _old_set.length(); } + + uint humongous_regions_count() const { return _humongous_set.length(); } + // debugging bool check_young_list_well_formed() { return _young_list->check_list_well_formed(); @@ -1482,10 +1488,7 @@ public: // Currently there is only one place where this is called with // vo == UseMarkWord, which is to verify the marking during a // full GC. - void verify(bool silent, VerifyOption vo); - - // Override; it uses the "prev" marking information - virtual void verify(bool silent); + void verify(VerifyOption vo); // The methods below are here for convenience and dispatch the // appropriate method depending on value of the given VerifyOption diff --git a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp index 9bccfb27fdc..d19bf2faab8 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.cpp @@ -29,9 +29,7 @@ #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectorPolicy.hpp" #include "gc/g1/g1IHOPControl.hpp" -#include "gc/g1/g1ErgoVerbose.hpp" #include "gc/g1/g1GCPhaseTimes.hpp" -#include "gc/g1/g1Log.hpp" #include "gc/g1/heapRegion.inline.hpp" #include "gc/g1/heapRegionRemSet.hpp" #include "gc/shared/gcPolicyCounters.hpp" @@ -121,6 +119,8 @@ G1CollectorPolicy::G1CollectorPolicy() : _eden_used_bytes_before_gc(0), _survivor_used_bytes_before_gc(0), + _old_used_bytes_before_gc(0), + _humongous_used_bytes_before_gc(0), _heap_used_bytes_before_gc(0), _metaspace_used_bytes_before_gc(0), _eden_capacity_bytes_before_gc(0), @@ -177,18 +177,6 @@ G1CollectorPolicy::G1CollectorPolicy() : HeapRegion::setup_heap_region_size(InitialHeapSize, MaxHeapSize); HeapRegionRemSet::setup_remset_size(); - G1ErgoVerbose::initialize(); - if (PrintAdaptiveSizePolicy) { - // Currently, we only use a single switch for all the heuristics. - G1ErgoVerbose::set_enabled(true); - // Given that we don't currently have a verboseness level - // parameter, we'll hardcode this to high. This can be easily - // changed in the future. - G1ErgoVerbose::set_level(ErgoHigh); - } else { - G1ErgoVerbose::set_enabled(false); - } - _recent_prev_end_times_for_all_gcs_sec->add(os::elapsedTime()); _prev_collection_pause_end_ms = os::elapsedTime() * 1000.0; clear_ratio_check_data(); @@ -791,7 +779,7 @@ G1CollectorPolicy::verify_young_ages(HeapRegion* head, curr = curr->get_next_young_region()) { SurvRateGroup* group = curr->surv_rate_group(); if (group == NULL && !curr->is_survivor()) { - gclog_or_tty->print_cr("## %s: encountered NULL surv_rate_group", name); + log_info(gc, verify)("## %s: encountered NULL surv_rate_group", name); ret = false; } @@ -799,13 +787,12 @@ G1CollectorPolicy::verify_young_ages(HeapRegion* head, int age = curr->age_in_surv_rate_group(); if (age < 0) { - gclog_or_tty->print_cr("## %s: encountered negative age", name); + log_info(gc, verify)("## %s: encountered negative age", name); ret = false; } if (age <= prev_age) { - gclog_or_tty->print_cr("## %s: region ages are not strictly increasing " - "(%d, %d)", name, age, prev_age); + log_info(gc, verify)("## %s: region ages are not strictly increasing (%d, %d)", name, age, prev_age); ret = false; } prev_age = age; @@ -982,38 +969,15 @@ bool G1CollectorPolicy::need_to_start_conc_mark(const char* source, size_t alloc size_t alloc_byte_size = alloc_word_size * HeapWordSize; size_t marking_request_bytes = cur_used_bytes + alloc_byte_size; + bool result = false; if (marking_request_bytes > marking_initiating_used_threshold) { - if (collector_state()->gcs_are_young() && !collector_state()->last_young_gc()) { - ergo_verbose5(ErgoConcCycles, - "request concurrent cycle initiation", - ergo_format_reason("occupancy higher than threshold") - ergo_format_byte("occupancy") - ergo_format_byte("allocation request") - ergo_format_byte_perc("threshold") - ergo_format_str("source"), - cur_used_bytes, - alloc_byte_size, - marking_initiating_used_threshold, - (double) marking_initiating_used_threshold / _g1->capacity() * 100, - source); - return true; - } else { - ergo_verbose5(ErgoConcCycles, - "do not request concurrent cycle initiation", - ergo_format_reason("still doing mixed collections") - ergo_format_byte("occupancy") - ergo_format_byte("allocation request") - ergo_format_byte_perc("threshold") - ergo_format_str("source"), - cur_used_bytes, - alloc_byte_size, - marking_initiating_used_threshold, - (double) InitiatingHeapOccupancyPercent, - source); - } + result = collector_state()->gcs_are_young() && !collector_state()->last_young_gc(); + log_debug(gc, ergo, ihop)("%s occupancy: " SIZE_FORMAT "B allocation request: " SIZE_FORMAT "B threshold: " SIZE_FORMAT "B (%1.2f) source: %s", + result ? "Request concurrent cycle initiation (occupancy higher than threshold)" : "Do not request concurrent cycle initiation (still doing mixed collections)", + cur_used_bytes, alloc_byte_size, marking_initiating_used_threshold, (double) marking_initiating_used_threshold / _g1->capacity() * 100, source); } - return false; + return result; } // Anything below that is considered to be zero @@ -1027,13 +991,7 @@ void G1CollectorPolicy::record_collection_pause_end(double pause_time_ms, size_t bool last_pause_included_initial_mark = false; bool update_stats = !_g1->evacuation_failed(); -#ifndef PRODUCT - if (G1YoungSurvRateVerbose) { - gclog_or_tty->cr(); - _short_lived_surv_rate_group->print(); - // do that for any other surv rate groups too - } -#endif // PRODUCT + NOT_PRODUCT(_short_lived_surv_rate_group->print()); record_pause(young_gc_pause_kind(), end_time_sec - pause_time_ms / 1000.0, end_time_sec); @@ -1228,13 +1186,9 @@ void G1CollectorPolicy::record_collection_pause_end(double pause_time_ms, size_t double scan_hcc_time_ms = average_time_ms(G1GCPhaseTimes::ScanHCC); if (update_rs_time_goal_ms < scan_hcc_time_ms) { - ergo_verbose2(ErgoTiming, - "adjust concurrent refinement thresholds", - ergo_format_reason("Scanning the HCC expected to take longer than Update RS time goal") - ergo_format_ms("Update RS time goal") - ergo_format_ms("Scan HCC time"), - update_rs_time_goal_ms, - scan_hcc_time_ms); + log_debug(gc, ergo, refine)("Adjust concurrent refinement thresholds (scanning the HCC expected to take longer than Update RS time goal)." + "Update RS time goal: %1.2fms Scan HCC time: %1.2fms", + update_rs_time_goal_ms, scan_hcc_time_ms); update_rs_time_goal_ms = 0; } else { @@ -1312,65 +1266,37 @@ void G1CollectorPolicy::record_heap_size_info_at_start(bool full) { _eden_used_bytes_before_gc = young_list->eden_used_bytes(); _survivor_used_bytes_before_gc = young_list->survivor_used_bytes(); _heap_capacity_bytes_before_gc = _g1->capacity(); + _old_used_bytes_before_gc = _g1->old_regions_count() * HeapRegion::GrainBytes; + _humongous_used_bytes_before_gc = _g1->humongous_regions_count() * HeapRegion::GrainBytes; _heap_used_bytes_before_gc = _g1->used(); - - _eden_capacity_bytes_before_gc = - (_young_list_target_length * HeapRegion::GrainBytes) - _survivor_used_bytes_before_gc; - - if (full) { - _metaspace_used_bytes_before_gc = MetaspaceAux::used_bytes(); - } + _eden_capacity_bytes_before_gc = (_young_list_target_length * HeapRegion::GrainBytes) - _survivor_used_bytes_before_gc; + _metaspace_used_bytes_before_gc = MetaspaceAux::used_bytes(); } -void G1CollectorPolicy::print_heap_transition(size_t bytes_before) const { - size_t bytes_after = _g1->used(); - size_t capacity = _g1->capacity(); - - gclog_or_tty->print(" " SIZE_FORMAT "%s->" SIZE_FORMAT "%s(" SIZE_FORMAT "%s)", - byte_size_in_proper_unit(bytes_before), - proper_unit_for_byte_size(bytes_before), - byte_size_in_proper_unit(bytes_after), - proper_unit_for_byte_size(bytes_after), - byte_size_in_proper_unit(capacity), - proper_unit_for_byte_size(capacity)); -} - -void G1CollectorPolicy::print_heap_transition() const { - print_heap_transition(_heap_used_bytes_before_gc); -} - -void G1CollectorPolicy::print_detailed_heap_transition(bool full) const { +void G1CollectorPolicy::print_detailed_heap_transition() const { YoungList* young_list = _g1->young_list(); size_t eden_used_bytes_after_gc = young_list->eden_used_bytes(); size_t survivor_used_bytes_after_gc = young_list->survivor_used_bytes(); size_t heap_used_bytes_after_gc = _g1->used(); + size_t old_used_bytes_after_gc = _g1->old_regions_count() * HeapRegion::GrainBytes; + size_t humongous_used_bytes_after_gc = _g1->humongous_regions_count() * HeapRegion::GrainBytes; size_t heap_capacity_bytes_after_gc = _g1->capacity(); size_t eden_capacity_bytes_after_gc = (_young_list_target_length * HeapRegion::GrainBytes) - survivor_used_bytes_after_gc; + size_t survivor_capacity_bytes_after_gc = _max_survivor_regions * HeapRegion::GrainBytes; - gclog_or_tty->print( - " [Eden: " EXT_SIZE_FORMAT "(" EXT_SIZE_FORMAT ")->" EXT_SIZE_FORMAT "(" EXT_SIZE_FORMAT ") " - "Survivors: " EXT_SIZE_FORMAT "->" EXT_SIZE_FORMAT " " - "Heap: " EXT_SIZE_FORMAT "(" EXT_SIZE_FORMAT ")->" - EXT_SIZE_FORMAT "(" EXT_SIZE_FORMAT ")]", - EXT_SIZE_PARAMS(_eden_used_bytes_before_gc), - EXT_SIZE_PARAMS(_eden_capacity_bytes_before_gc), - EXT_SIZE_PARAMS(eden_used_bytes_after_gc), - EXT_SIZE_PARAMS(eden_capacity_bytes_after_gc), - EXT_SIZE_PARAMS(_survivor_used_bytes_before_gc), - EXT_SIZE_PARAMS(survivor_used_bytes_after_gc), - EXT_SIZE_PARAMS(_heap_used_bytes_before_gc), - EXT_SIZE_PARAMS(_heap_capacity_bytes_before_gc), - EXT_SIZE_PARAMS(heap_used_bytes_after_gc), - EXT_SIZE_PARAMS(heap_capacity_bytes_after_gc)); + log_info(gc, heap)("Eden: " SIZE_FORMAT "K->" SIZE_FORMAT "K(" SIZE_FORMAT "K)", + _eden_used_bytes_before_gc / K, eden_used_bytes_after_gc /K, eden_capacity_bytes_after_gc /K); + log_info(gc, heap)("Survivor: " SIZE_FORMAT "K->" SIZE_FORMAT "K(" SIZE_FORMAT "K)", + _survivor_used_bytes_before_gc / K, survivor_used_bytes_after_gc /K, survivor_capacity_bytes_after_gc /K); + log_info(gc, heap)("Old: " SIZE_FORMAT "K->" SIZE_FORMAT "K", + _old_used_bytes_before_gc / K, old_used_bytes_after_gc /K); + log_info(gc, heap)("Humongous: " SIZE_FORMAT "K->" SIZE_FORMAT "K", + _humongous_used_bytes_before_gc / K, humongous_used_bytes_after_gc /K); - if (full) { - MetaspaceAux::print_metaspace_change(_metaspace_used_bytes_before_gc); - } - - gclog_or_tty->cr(); + MetaspaceAux::print_metaspace_change(_metaspace_used_bytes_before_gc); } void G1CollectorPolicy::print_phases(double pause_time_sec) { @@ -1690,17 +1616,9 @@ size_t G1CollectorPolicy::expansion_amount() { } } - ergo_verbose5(ErgoHeapSizing, - "attempt heap expansion", - ergo_format_reason("recent GC overhead higher than " - "threshold after GC") - ergo_format_perc("recent GC overhead") - ergo_format_perc("current threshold") - ergo_format_byte("uncommitted") - ergo_format_byte_perc("base expansion amount and scale"), - recent_gc_overhead, threshold, - uncommitted_bytes, - expand_bytes, scale_factor * 100); + log_debug(gc, ergo, heap)("Attempt heap expansion (recent GC overhead higher than threshold after GC) " + "recent GC overhead: %1.2f %% threshold: %1.2f %% uncommitted: " SIZE_FORMAT "B base expansion amount and scale: " SIZE_FORMAT "B (%1.2f%%)", + recent_gc_overhead, threshold, uncommitted_bytes, expand_bytes, scale_factor * 100); expand_bytes = static_cast(expand_bytes * scale_factor); @@ -1783,19 +1701,11 @@ bool G1CollectorPolicy::force_initial_mark_if_outside_cycle(GCCause::Cause gc_ca // even while we are still in the process of reclaiming memory. bool during_cycle = _g1->concurrent_mark()->cmThread()->during_cycle(); if (!during_cycle) { - ergo_verbose1(ErgoConcCycles, - "request concurrent cycle initiation", - ergo_format_reason("requested by GC cause") - ergo_format_str("GC cause"), - GCCause::to_string(gc_cause)); + log_debug(gc, ergo)("Request concurrent cycle initiation (requested by GC cause). GC cause: %s", GCCause::to_string(gc_cause)); collector_state()->set_initiate_conc_mark_if_possible(true); return true; } else { - ergo_verbose1(ErgoConcCycles, - "do not request concurrent cycle initiation", - ergo_format_reason("concurrent cycle already in progress") - ergo_format_str("GC cause"), - GCCause::to_string(gc_cause)); + log_debug(gc, ergo)("Do not request concurrent cycle initiation (concurrent cycle already in progress). GC cause: %s", GCCause::to_string(gc_cause)); return false; } } @@ -1823,9 +1733,7 @@ void G1CollectorPolicy::decide_on_conc_mark_initiation() { if (!about_to_start_mixed_phase() && collector_state()->gcs_are_young()) { // Initiate a new initial mark if there is no marking or reclamation going on. initiate_conc_mark(); - ergo_verbose0(ErgoConcCycles, - "initiate concurrent cycle", - ergo_format_reason("concurrent cycle initiation requested")); + log_debug(gc, ergo)("Initiate concurrent cycle (concurrent cycle initiation requested)"); } else if (_g1->is_user_requested_concurrent_full_gc(_g1->gc_cause())) { // Initiate a user requested initial mark. An initial mark must be young only // GC, so the collector state must be updated to reflect this. @@ -1834,9 +1742,7 @@ void G1CollectorPolicy::decide_on_conc_mark_initiation() { abort_time_to_mixed_tracking(); initiate_conc_mark(); - ergo_verbose0(ErgoConcCycles, - "initiate concurrent cycle", - ergo_format_reason("user requested concurrent cycle")); + log_debug(gc, ergo)("Initiate concurrent cycle (user requested concurrent cycle)"); } else { // The concurrent marking thread is still finishing up the // previous cycle. If we start one right now the two cycles @@ -1850,9 +1756,7 @@ void G1CollectorPolicy::decide_on_conc_mark_initiation() { // and, if it's in a yield point, it's waiting for us to // finish. So, at this point we will not start a cycle and we'll // let the concurrent marking thread complete the last one. - ergo_verbose0(ErgoConcCycles, - "do not initiate concurrent cycle", - ergo_format_reason("concurrent cycle already in progress")); + log_debug(gc, ergo)("Do not initiate concurrent cycle (concurrent cycle already in progress)"); } } } @@ -2197,9 +2101,7 @@ void G1CollectorPolicy::abort_time_to_mixed_tracking() { bool G1CollectorPolicy::next_gc_should_be_mixed(const char* true_action_str, const char* false_action_str) const { if (cset_chooser()->is_empty()) { - ergo_verbose0(ErgoMixedGCs, - false_action_str, - ergo_format_reason("candidate old regions not available")); + log_debug(gc, ergo)("%s (candidate old regions not available)", false_action_str); return false; } @@ -2208,27 +2110,12 @@ bool G1CollectorPolicy::next_gc_should_be_mixed(const char* true_action_str, double reclaimable_perc = reclaimable_bytes_perc(reclaimable_bytes); double threshold = (double) G1HeapWastePercent; if (reclaimable_perc <= threshold) { - ergo_verbose4(ErgoMixedGCs, - false_action_str, - ergo_format_reason("reclaimable percentage not over threshold") - ergo_format_region("candidate old regions") - ergo_format_byte_perc("reclaimable") - ergo_format_perc("threshold"), - cset_chooser()->remaining_regions(), - reclaimable_bytes, - reclaimable_perc, threshold); + log_debug(gc, ergo)("%s (reclaimable percentage not over threshold). candidate old regions: %u reclaimable: " SIZE_FORMAT " (%1.2f) threshold: " UINTX_FORMAT, + false_action_str, cset_chooser()->remaining_regions(), reclaimable_bytes, reclaimable_perc, G1HeapWastePercent); return false; } - - ergo_verbose4(ErgoMixedGCs, - true_action_str, - ergo_format_reason("candidate old regions available") - ergo_format_region("candidate old regions") - ergo_format_byte_perc("reclaimable") - ergo_format_perc("threshold"), - cset_chooser()->remaining_regions(), - reclaimable_bytes, - reclaimable_perc, threshold); + log_debug(gc, ergo)("%s (candidate old regions available). candidate old regions: %u reclaimable: " SIZE_FORMAT " (%1.2f) threshold: " UINTX_FORMAT, + true_action_str, cset_chooser()->remaining_regions(), reclaimable_bytes, reclaimable_perc, G1HeapWastePercent); return true; } @@ -2284,13 +2171,8 @@ double G1CollectorPolicy::finalize_young_cset_part(double target_pause_time_ms) double base_time_ms = predict_base_elapsed_time_ms(_pending_cards); double time_remaining_ms = MAX2(target_pause_time_ms - base_time_ms, 0.0); - ergo_verbose4(ErgoCSetConstruction | ErgoHigh, - "start choosing CSet", - ergo_format_size("_pending_cards") - ergo_format_ms("predicted base time") - ergo_format_ms("remaining time") - ergo_format_ms("target pause time"), - _pending_cards, base_time_ms, time_remaining_ms, target_pause_time_ms); + log_trace(gc, ergo, cset)("Start choosing CSet. pending cards: " SIZE_FORMAT " predicted base time: %1.2fms remaining time: %1.2fms target pause time: %1.2fms", + _pending_cards, base_time_ms, time_remaining_ms, target_pause_time_ms); collector_state()->set_last_gc_was_young(collector_state()->gcs_are_young()); @@ -2326,15 +2208,8 @@ double G1CollectorPolicy::finalize_young_cset_part(double target_pause_time_ms) _collection_set_bytes_used_before = _inc_cset_bytes_used_before; time_remaining_ms = MAX2(time_remaining_ms - _inc_cset_predicted_elapsed_time_ms, 0.0); - ergo_verbose4(ErgoCSetConstruction | ErgoHigh, - "add young regions to CSet", - ergo_format_region("eden") - ergo_format_region("survivors") - ergo_format_ms("predicted young region time") - ergo_format_ms("target pause time"), - eden_region_length, survivor_region_length, - _inc_cset_predicted_elapsed_time_ms, - target_pause_time_ms); + log_trace(gc, ergo, cset)("Add young regions to CSet. eden: %u regions, survivors: %u regions, predicted young region time: %1.2fms, target pause time: %1.2fms", + eden_region_length, survivor_region_length, _inc_cset_predicted_elapsed_time_ms, target_pause_time_ms); // The number of recorded young regions is the incremental // collection set's current size @@ -2363,12 +2238,8 @@ void G1CollectorPolicy::finalize_old_cset_part(double time_remaining_ms) { while (hr != NULL) { if (old_cset_region_length() >= max_old_cset_length) { // Added maximum number of old regions to the CSet. - ergo_verbose2(ErgoCSetConstruction, - "finish adding old regions to CSet", - ergo_format_reason("old CSet region num reached max") - ergo_format_region("old") - ergo_format_region("max"), - old_cset_region_length(), max_old_cset_length); + log_debug(gc, ergo, cset)("Finish adding old regions to CSet (old CSet region num reached max). old %u regions, max %u regions", + old_cset_region_length(), max_old_cset_length); break; } @@ -2382,17 +2253,9 @@ void G1CollectorPolicy::finalize_old_cset_part(double time_remaining_ms) { // We've added enough old regions that the amount of uncollected // reclaimable space is at or below the waste threshold. Stop // adding old regions to the CSet. - ergo_verbose5(ErgoCSetConstruction, - "finish adding old regions to CSet", - ergo_format_reason("reclaimable percentage not over threshold") - ergo_format_region("old") - ergo_format_region("max") - ergo_format_byte_perc("reclaimable") - ergo_format_perc("threshold"), - old_cset_region_length(), - max_old_cset_length, - reclaimable_bytes, - reclaimable_perc, threshold); + log_debug(gc, ergo, cset)("Finish adding old regions to CSet (reclaimable percentage not over threshold). " + "old %u regions, max %u regions, reclaimable: " SIZE_FORMAT "B (%1.2f%%) threshold: " UINTX_FORMAT "%%", + old_cset_region_length(), max_old_cset_length, reclaimable_bytes, reclaimable_perc, G1HeapWastePercent); break; } @@ -2404,15 +2267,9 @@ void G1CollectorPolicy::finalize_old_cset_part(double time_remaining_ms) { if (old_cset_region_length() >= min_old_cset_length) { // We have added the minimum number of old regions to the CSet, // we are done with this CSet. - ergo_verbose4(ErgoCSetConstruction, - "finish adding old regions to CSet", - ergo_format_reason("predicted time is too high") - ergo_format_ms("predicted time") - ergo_format_ms("remaining time") - ergo_format_region("old") - ergo_format_region("min"), - predicted_time_ms, time_remaining_ms, - old_cset_region_length(), min_old_cset_length); + log_debug(gc, ergo, cset)("Finish adding old regions to CSet (predicted time is too high). " + "predicted time: %1.2fms, remaining time: %1.2fms old %u regions, min %u regions", + predicted_time_ms, time_remaining_ms, old_cset_region_length(), min_old_cset_length); break; } @@ -2424,12 +2281,9 @@ void G1CollectorPolicy::finalize_old_cset_part(double time_remaining_ms) { if (old_cset_region_length() >= min_old_cset_length) { // In the non-auto-tuning case, we'll finish adding regions // to the CSet if we reach the minimum. - ergo_verbose2(ErgoCSetConstruction, - "finish adding old regions to CSet", - ergo_format_reason("old CSet region num reached min") - ergo_format_region("old") - ergo_format_region("min"), - old_cset_region_length(), min_old_cset_length); + + log_debug(gc, ergo, cset)("Finish adding old regions to CSet (old CSet region num reached min). old %u regions, min %u regions", + old_cset_region_length(), min_old_cset_length); break; } } @@ -2444,26 +2298,16 @@ void G1CollectorPolicy::finalize_old_cset_part(double time_remaining_ms) { hr = cset_chooser()->peek(); } if (hr == NULL) { - ergo_verbose0(ErgoCSetConstruction, - "finish adding old regions to CSet", - ergo_format_reason("candidate old regions not available")); + log_debug(gc, ergo, cset)("Finish adding old regions to CSet (candidate old regions not available)"); } if (expensive_region_num > 0) { // We print the information once here at the end, predicated on // whether we added any apparently expensive regions or not, to // avoid generating output per region. - ergo_verbose4(ErgoCSetConstruction, - "added expensive regions to CSet", - ergo_format_reason("old CSet region num not reached min") - ergo_format_region("old") - ergo_format_region("expensive") - ergo_format_region("min") - ergo_format_ms("remaining time"), - old_cset_region_length(), - expensive_region_num, - min_old_cset_length, - time_remaining_ms); + log_debug(gc, ergo, cset)("Added expensive regions to CSet (old CSet region num not reached min)." + "old %u regions, expensive: %u regions, min %u regions, remaining time: %1.2fms", + old_cset_region_length(), expensive_region_num, min_old_cset_length, time_remaining_ms); } cset_chooser()->verify(); @@ -2471,13 +2315,8 @@ void G1CollectorPolicy::finalize_old_cset_part(double time_remaining_ms) { stop_incremental_cset_building(); - ergo_verbose3(ErgoCSetConstruction, - "finish choosing CSet", - ergo_format_region("old") - ergo_format_ms("predicted old region time") - ergo_format_ms("time remaining"), - old_cset_region_length(), - predicted_old_time_ms, time_remaining_ms); + log_debug(gc, ergo, cset)("Finish choosing CSet. old %u regions, predicted old region time: %1.2fms, time remaining: %1.2f", + old_cset_region_length(), predicted_old_time_ms, time_remaining_ms); double non_young_end_time_sec = os::elapsedTime(); phase_times()->record_non_young_cset_choice_time_ms((non_young_end_time_sec - non_young_start_time_sec) * 1000.0); @@ -2536,14 +2375,14 @@ void TraceYoungGenTimeData::increment_mixed_collection_count() { void TraceYoungGenTimeData::print_summary(const char* str, const NumberSeq* seq) const { double sum = seq->sum(); - gclog_or_tty->print_cr("%-27s = %8.2lf s (avg = %8.2lf ms)", + tty->print_cr("%-27s = %8.2lf s (avg = %8.2lf ms)", str, sum / 1000.0, seq->avg()); } void TraceYoungGenTimeData::print_summary_sd(const char* str, const NumberSeq* seq) const { print_summary(str, seq); - gclog_or_tty->print_cr("%45s = %5d, std dev = %8.2lf ms, max = %8.2lf ms)", + tty->print_cr("%45s = %5d, std dev = %8.2lf ms, max = %8.2lf ms)", "(num", seq->num(), seq->sd(), seq->maximum()); } @@ -2552,18 +2391,18 @@ void TraceYoungGenTimeData::print() const { return; } - gclog_or_tty->print_cr("ALL PAUSES"); + tty->print_cr("ALL PAUSES"); print_summary_sd(" Total", &_total); - gclog_or_tty->cr(); - gclog_or_tty->cr(); - gclog_or_tty->print_cr(" Young GC Pauses: %8d", _young_pause_num); - gclog_or_tty->print_cr(" Mixed GC Pauses: %8d", _mixed_pause_num); - gclog_or_tty->cr(); + tty->cr(); + tty->cr(); + tty->print_cr(" Young GC Pauses: %8d", _young_pause_num); + tty->print_cr(" Mixed GC Pauses: %8d", _mixed_pause_num); + tty->cr(); - gclog_or_tty->print_cr("EVACUATION PAUSES"); + tty->print_cr("EVACUATION PAUSES"); if (_young_pause_num == 0 && _mixed_pause_num == 0) { - gclog_or_tty->print_cr("none"); + tty->print_cr("none"); } else { print_summary_sd(" Evacuation Pauses", &_total); print_summary(" Root Region Scan Wait", &_root_region_scan_wait); @@ -2578,9 +2417,9 @@ void TraceYoungGenTimeData::print() const { print_summary(" Clear CT", &_clear_ct); print_summary(" Other", &_other); } - gclog_or_tty->cr(); + tty->cr(); - gclog_or_tty->print_cr("MISC"); + tty->print_cr("MISC"); print_summary_sd(" Stop World", &_all_stop_world_times_ms); print_summary_sd(" Yields", &_all_yield_times_ms); } @@ -2597,11 +2436,11 @@ void TraceOldGenTimeData::print() const { } if (_all_full_gc_times.num() > 0) { - gclog_or_tty->print("\n%4d full_gcs: total time = %8.2f s", + tty->print("\n%4d full_gcs: total time = %8.2f s", _all_full_gc_times.num(), _all_full_gc_times.sum() / 1000.0); - gclog_or_tty->print_cr(" (avg = %8.2fms).", _all_full_gc_times.avg()); - gclog_or_tty->print_cr(" [std. dev = %8.2f ms, max = %8.2f ms]", + tty->print_cr(" (avg = %8.2fms).", _all_full_gc_times.avg()); + tty->print_cr(" [std. dev = %8.2f ms, max = %8.2f ms]", _all_full_gc_times.sd(), _all_full_gc_times.maximum()); } diff --git a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp index 264bab00c3d..7c7cf4d0a5e 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectorPolicy.hpp @@ -159,6 +159,7 @@ public: uint max_desired_young_length() { return _max_desired_young_length; } + bool adaptive_young_list_length() const { return _adaptive_size; } @@ -658,9 +659,7 @@ public: // Print heap sizing transition (with less and more detail). - void print_heap_transition(size_t bytes_before) const; - void print_heap_transition() const; - void print_detailed_heap_transition(bool full = false) const; + void print_detailed_heap_transition() const; virtual void print_phases(double pause_time_sec); @@ -827,6 +826,8 @@ private: size_t _eden_used_bytes_before_gc; // Eden occupancy before GC size_t _survivor_used_bytes_before_gc; // Survivor occupancy before GC + size_t _old_used_bytes_before_gc; // Old occupancy before GC + size_t _humongous_used_bytes_before_gc; // Humongous occupancy before GC size_t _heap_used_bytes_before_gc; // Heap occupancy before GC size_t _metaspace_used_bytes_before_gc; // Metaspace occupancy before GC diff --git a/hotspot/src/share/vm/gc/g1/g1ErgoVerbose.cpp b/hotspot/src/share/vm/gc/g1/g1ErgoVerbose.cpp deleted file mode 100644 index 72a2217b0d5..00000000000 --- a/hotspot/src/share/vm/gc/g1/g1ErgoVerbose.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "gc/g1/g1ErgoVerbose.hpp" -#include "utilities/ostream.hpp" - -ErgoLevel G1ErgoVerbose::_level; -bool G1ErgoVerbose::_enabled[ErgoHeuristicNum]; - -void G1ErgoVerbose::initialize() { - set_level(ErgoLow); - set_enabled(false); -} - -void G1ErgoVerbose::set_level(ErgoLevel level) { - _level = level; -} - -void G1ErgoVerbose::set_enabled(ErgoHeuristic n, bool enabled) { - assert(0 <= n && n < ErgoHeuristicNum, "pre-condition"); - _enabled[n] = enabled; -} - -void G1ErgoVerbose::set_enabled(bool enabled) { - for (int n = 0; n < ErgoHeuristicNum; n += 1) { - set_enabled((ErgoHeuristic) n, enabled); - } -} - -const char* G1ErgoVerbose::to_string(int tag) { - ErgoHeuristic n = extract_heuristic(tag); - switch (n) { - case ErgoHeapSizing: return "Heap Sizing"; - case ErgoCSetConstruction: return "CSet Construction"; - case ErgoConcCycles: return "Concurrent Cycles"; - case ErgoMixedGCs: return "Mixed GCs"; - case ErgoTiming: return "Timing"; - case ErgoIHOP: return "IHOP"; - default: - ShouldNotReachHere(); - // Keep the Windows compiler happy - return NULL; - } -} diff --git a/hotspot/src/share/vm/gc/g1/g1ErgoVerbose.hpp b/hotspot/src/share/vm/gc/g1/g1ErgoVerbose.hpp deleted file mode 100644 index 8021f46beaf..00000000000 --- a/hotspot/src/share/vm/gc/g1/g1ErgoVerbose.hpp +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef SHARE_VM_GC_G1_G1ERGOVERBOSE_HPP -#define SHARE_VM_GC_G1_G1ERGOVERBOSE_HPP - -#include "memory/allocation.hpp" -#include "utilities/debug.hpp" - -// The log of G1's heuristic decisions comprises of a series of -// records which have a similar format in order to maintain -// consistency across records and ultimately easier parsing of the -// output, if we ever choose to do that. Each record consists of: -// * A time stamp to be able to easily correlate each record with -// other events. -// * A unique string to allow us to easily identify such records. -// * The name of the heuristic the record corresponds to. -// * An action string which describes the action that G1 did or is -// about to do. -// * An optional reason string which describes the reason for the -// action. -// * An optional number of name/value pairs which contributed to the -// decision to take the action described in the record. -// -// Each record is associated with a "tag" which is the combination of -// the heuristic the record corresponds to, as well as the min level -// of verboseness at which the record should be printed. The tag is -// checked against the current settings to determine whether the record -// should be printed or not. - -// The available verboseness levels. -typedef enum { - // Determine which part of the tag is occupied by the level. - ErgoLevelShift = 8, - ErgoLevelMask = ~((1 << ErgoLevelShift) - 1), - - // ErgoLow is 0 so that we don't have to explicitly or a heuristic - // id with ErgoLow to keep its use simpler. - ErgoLow = 0, - ErgoHigh = 1 << ErgoLevelShift -} ErgoLevel; - -// The available heuristics. -typedef enum { - // Determines which part of the tag is occupied by the heuristic id. - ErgoHeuristicMask = ~ErgoLevelMask, - - ErgoHeapSizing = 0, - ErgoCSetConstruction, - ErgoConcCycles, - ErgoMixedGCs, - ErgoTiming, - ErgoIHOP, - - ErgoHeuristicNum -} ErgoHeuristic; - -class G1ErgoVerbose : AllStatic { -private: - // Determines the minimum verboseness level at which records will be - // printed. - static ErgoLevel _level; - // Determines which heuristics are currently enabled. - static bool _enabled[ErgoHeuristicNum]; - - static ErgoLevel extract_level(int tag) { - return (ErgoLevel) (tag & ErgoLevelMask); - } - - static ErgoHeuristic extract_heuristic(int tag) { - return (ErgoHeuristic) (tag & ErgoHeuristicMask); - } - -public: - // Needs to be explicitly called at GC initialization. - static void initialize(); - - static void set_level(ErgoLevel level); - static void set_enabled(ErgoHeuristic h, bool enabled); - // It is applied to all heuristics. - static void set_enabled(bool enabled); - - static bool enabled(int tag) { - ErgoLevel level = extract_level(tag); - ErgoHeuristic n = extract_heuristic(tag); - return level <= _level && _enabled[n]; - } - - // Extract the heuristic id from the tag and return a string with - // its name. - static const char* to_string(int tag); -}; - -// The macros below generate the format string for values of different -// types and/or metrics. - -// The reason for the action is optional and is handled specially: the -// reason string is concatenated here so it's not necessary to pass it -// as a parameter. -#define ergo_format_reason(_reason_) ", reason: " _reason_ - -// Single parameter format strings -#define ergo_format_str(_name_) ", " _name_ ": %s" -#define ergo_format_region(_name_) ", " _name_ ": %u regions" -#define ergo_format_byte(_name_) ", " _name_ ": " SIZE_FORMAT " bytes" -#define ergo_format_double(_name_) ", " _name_ ": %1.2f" -#define ergo_format_perc(_name_) ", " _name_ ": %1.2f %%" -#define ergo_format_ms(_name_) ", " _name_ ": %1.2f ms" -#define ergo_format_size(_name_) ", " _name_ ": " SIZE_FORMAT - -// Double parameter format strings -#define ergo_format_byte_perc(_name_) \ - ", " _name_ ": " SIZE_FORMAT " bytes (%1.2f %%)" - -// Generates the format string -#define ergo_format(_extra_format_) \ - " %1.3f: [G1Ergonomics (%s) %s" _extra_format_ "]" - -// Conditionally, prints an ergonomic decision record. _extra_format_ -// is the format string for the optional items we'd like to print -// (i.e., the decision's reason and any associated values). This -// string should be built up using the ergo_*_format macros (see -// above) to ensure consistency. -// -// Since we cannot rely on the compiler supporting variable argument -// macros, this macro accepts a fixed number of arguments and passes -// them to the print method. For convenience, we have wrapper macros -// below which take a specific number of arguments and set the rest to -// a default value. -#define ergo_verbose_common(_tag_, _action_, _extra_format_, \ - _arg0_, _arg1_, _arg2_, _arg3_, _arg4_, _arg5_) \ - do { \ - if (G1ErgoVerbose::enabled((_tag_))) { \ - gclog_or_tty->print_cr(ergo_format(_extra_format_), \ - os::elapsedTime(), \ - G1ErgoVerbose::to_string((_tag_)), \ - (_action_), \ - (_arg0_), (_arg1_), (_arg2_), \ - (_arg3_), (_arg4_), (_arg5_)); \ - } \ - } while (0) - - -#define ergo_verbose6(_tag_, _action_, _extra_format_, \ - _arg0_, _arg1_, _arg2_, _arg3_, _arg4_, _arg5_) \ - ergo_verbose_common(_tag_, _action_, _extra_format_, \ - _arg0_, _arg1_, _arg2_, _arg3_, _arg4_, _arg5_) - -#define ergo_verbose5(_tag_, _action_, _extra_format_, \ - _arg0_, _arg1_, _arg2_, _arg3_, _arg4_) \ - ergo_verbose6(_tag_, _action_, _extra_format_ "%s", \ - _arg0_, _arg1_, _arg2_, _arg3_, _arg4_, "") - -#define ergo_verbose4(_tag_, _action_, _extra_format_, \ - _arg0_, _arg1_, _arg2_, _arg3_) \ - ergo_verbose5(_tag_, _action_, _extra_format_ "%s", \ - _arg0_, _arg1_, _arg2_, _arg3_, "") - -#define ergo_verbose3(_tag_, _action_, _extra_format_, \ - _arg0_, _arg1_, _arg2_) \ - ergo_verbose4(_tag_, _action_, _extra_format_ "%s", \ - _arg0_, _arg1_, _arg2_, "") - -#define ergo_verbose2(_tag_, _action_, _extra_format_, \ - _arg0_, _arg1_) \ - ergo_verbose3(_tag_, _action_, _extra_format_ "%s", \ - _arg0_, _arg1_, "") - -#define ergo_verbose1(_tag_, _action_, _extra_format_, \ - _arg0_) \ - ergo_verbose2(_tag_, _action_, _extra_format_ "%s", \ - _arg0_, "") - - -#define ergo_verbose0(_tag_, _action_, _extra_format_) \ - ergo_verbose1(_tag_, _action_, _extra_format_ "%s", \ - "") - -#define ergo_verbose(_tag_, _action_) \ - ergo_verbose0(_tag_, _action_, "") - - -#endif // SHARE_VM_GC_G1_G1ERGOVERBOSE_HPP diff --git a/hotspot/src/share/vm/gc/g1/g1EvacStats.cpp b/hotspot/src/share/vm/gc/g1/g1EvacStats.cpp index 8a2317c59bd..a000a1e40ce 100644 --- a/hotspot/src/share/vm/gc/g1/g1EvacStats.cpp +++ b/hotspot/src/share/vm/gc/g1/g1EvacStats.cpp @@ -26,91 +26,97 @@ #include "memory/allocation.inline.hpp" #include "gc/g1/g1EvacStats.hpp" #include "gc/shared/gcId.hpp" +#include "logging/log.hpp" #include "trace/tracing.hpp" void G1EvacStats::adjust_desired_plab_sz() { - if (PrintPLAB) { - gclog_or_tty->print(" (allocated = " SIZE_FORMAT " wasted = " SIZE_FORMAT " " + if (!ResizePLAB) { + log_debug(gc, plab)(" (allocated = " SIZE_FORMAT " wasted = " SIZE_FORMAT " " "unused = " SIZE_FORMAT " used = " SIZE_FORMAT " " "undo_waste = " SIZE_FORMAT " region_end_waste = " SIZE_FORMAT " " "regions filled = %u direct_allocated = " SIZE_FORMAT " " "failure_used = " SIZE_FORMAT " failure_waste = " SIZE_FORMAT ") ", _allocated, _wasted, _unused, used(), _undo_wasted, _region_end_waste, _regions_filled, _direct_allocated, _failure_used, _failure_waste); + // Clear accumulators for next round. + reset(); + return; } - if (ResizePLAB) { + assert(is_object_aligned(max_size()) && min_size() <= max_size(), + "PLAB clipping computation may be incorrect"); - assert(is_object_aligned(max_size()) && min_size() <= max_size(), - "PLAB clipping computation may be incorrect"); - - if (_allocated == 0) { - assert((_unused == 0), - "Inconsistency in PLAB stats: " - "_allocated: " SIZE_FORMAT ", " - "_wasted: " SIZE_FORMAT ", " - "_region_end_waste: " SIZE_FORMAT ", " - "_unused: " SIZE_FORMAT ", " - "_used : " SIZE_FORMAT, - _allocated, _wasted, _region_end_waste, _unused, used()); - _allocated = 1; - } - // The size of the PLAB caps the amount of space that can be wasted at the - // end of the collection. In the worst case the last PLAB could be completely - // empty. - // This allows us to calculate the new PLAB size to achieve the - // TargetPLABWastePct given the latest memory usage and that the last buffer - // will be G1LastPLABAverageOccupancy full. - // - // E.g. assume that if in the current GC 100 words were allocated and a - // TargetPLABWastePct of 10 had been set. - // - // So we could waste up to 10 words to meet that percentage. Given that we - // also assume that that buffer is typically half-full, the new desired PLAB - // size is set to 20 words. - // - // The amount of allocation performed should be independent of the number of - // threads, so should the maximum waste we can spend in total. So if - // we used n threads to allocate, each of them can spend maximum waste/n words in - // a first rough approximation. The number of threads only comes into play later - // when actually retrieving the actual desired PLAB size. - // - // After calculating this optimal PLAB size the algorithm applies the usual - // exponential decaying average over this value to guess the next PLAB size. - // - // We account region end waste fully to PLAB allocation (in the calculation of - // what we consider as "used_for_waste_calculation" below). This is not - // completely fair, but is a conservative assumption because PLABs may be sized - // flexibly while we cannot adjust inline allocations. - // Allocation during GC will try to minimize region end waste so this impact - // should be minimal. - // - // We need to cover overflow when calculating the amount of space actually used - // by objects in PLABs when subtracting the region end waste. - // Region end waste may be higher than actual allocation. This may occur if many - // threads do not allocate anything but a few rather large objects. In this - // degenerate case the PLAB size would simply quickly tend to minimum PLAB size, - // which is an okay reaction. - size_t const used_for_waste_calculation = used() > _region_end_waste ? used() - _region_end_waste : 0; - - size_t const total_waste_allowed = used_for_waste_calculation * TargetPLABWastePct; - size_t const cur_plab_sz = (size_t)((double)total_waste_allowed / G1LastPLABAverageOccupancy); - // Take historical weighted average - _filter.sample(cur_plab_sz); - // Clip from above and below, and align to object boundary - size_t plab_sz; - plab_sz = MAX2(min_size(), (size_t)_filter.average()); - plab_sz = MIN2(max_size(), plab_sz); - plab_sz = align_object_size(plab_sz); - // Latch the result - _desired_net_plab_sz = plab_sz; - if (PrintPLAB) { - gclog_or_tty->print(" (plab_sz = " SIZE_FORMAT " desired_plab_sz = " SIZE_FORMAT ") ", cur_plab_sz, plab_sz); - } - } - if (PrintPLAB) { - gclog_or_tty->cr(); + if (_allocated == 0) { + assert((_unused == 0), + "Inconsistency in PLAB stats: " + "_allocated: " SIZE_FORMAT ", " + "_wasted: " SIZE_FORMAT ", " + "_region_end_waste: " SIZE_FORMAT ", " + "_unused: " SIZE_FORMAT ", " + "_used : " SIZE_FORMAT, + _allocated, _wasted, _region_end_waste, _unused, used()); + _allocated = 1; } + // The size of the PLAB caps the amount of space that can be wasted at the + // end of the collection. In the worst case the last PLAB could be completely + // empty. + // This allows us to calculate the new PLAB size to achieve the + // TargetPLABWastePct given the latest memory usage and that the last buffer + // will be G1LastPLABAverageOccupancy full. + // + // E.g. assume that if in the current GC 100 words were allocated and a + // TargetPLABWastePct of 10 had been set. + // + // So we could waste up to 10 words to meet that percentage. Given that we + // also assume that that buffer is typically half-full, the new desired PLAB + // size is set to 20 words. + // + // The amount of allocation performed should be independent of the number of + // threads, so should the maximum waste we can spend in total. So if + // we used n threads to allocate, each of them can spend maximum waste/n words in + // a first rough approximation. The number of threads only comes into play later + // when actually retrieving the actual desired PLAB size. + // + // After calculating this optimal PLAB size the algorithm applies the usual + // exponential decaying average over this value to guess the next PLAB size. + // + // We account region end waste fully to PLAB allocation (in the calculation of + // what we consider as "used_for_waste_calculation" below). This is not + // completely fair, but is a conservative assumption because PLABs may be sized + // flexibly while we cannot adjust inline allocations. + // Allocation during GC will try to minimize region end waste so this impact + // should be minimal. + // + // We need to cover overflow when calculating the amount of space actually used + // by objects in PLABs when subtracting the region end waste. + // Region end waste may be higher than actual allocation. This may occur if many + // threads do not allocate anything but a few rather large objects. In this + // degenerate case the PLAB size would simply quickly tend to minimum PLAB size, + // which is an okay reaction. + size_t const used_for_waste_calculation = used() > _region_end_waste ? used() - _region_end_waste : 0; + + size_t const total_waste_allowed = used_for_waste_calculation * TargetPLABWastePct; + size_t const cur_plab_sz = (size_t)((double)total_waste_allowed / G1LastPLABAverageOccupancy); + // Take historical weighted average + _filter.sample(cur_plab_sz); + // Clip from above and below, and align to object boundary + size_t plab_sz; + plab_sz = MAX2(min_size(), (size_t)_filter.average()); + plab_sz = MIN2(max_size(), plab_sz); + plab_sz = align_object_size(plab_sz); + // Latch the result + _desired_net_plab_sz = plab_sz; + + log_debug(gc, plab)(" (allocated = " SIZE_FORMAT " wasted = " SIZE_FORMAT " " + "unused = " SIZE_FORMAT " used = " SIZE_FORMAT " " + "undo_waste = " SIZE_FORMAT " region_end_waste = " SIZE_FORMAT " " + "regions filled = %u direct_allocated = " SIZE_FORMAT " " + "failure_used = " SIZE_FORMAT " failure_waste = " SIZE_FORMAT ") " + " (plab_sz = " SIZE_FORMAT " desired_plab_sz = " SIZE_FORMAT ")", + _allocated, _wasted, _unused, used(), _undo_wasted, _region_end_waste, + _regions_filled, _direct_allocated, _failure_used, _failure_waste, + cur_plab_sz, plab_sz); + // Clear accumulators for next round. reset(); } diff --git a/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp b/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp index 836ca8f09b8..84e749c2ab9 100644 --- a/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp +++ b/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.cpp @@ -26,10 +26,10 @@ #include "gc/g1/concurrentG1Refine.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1GCPhaseTimes.hpp" -#include "gc/g1/g1Log.hpp" #include "gc/g1/g1StringDedup.hpp" #include "gc/g1/workerDataArray.inline.hpp" #include "memory/allocation.hpp" +#include "logging/log.hpp" #include "runtime/os.hpp" // Helper class for avoiding interleaved logging @@ -73,66 +73,60 @@ public: va_end(ap); } - void print_cr() { - gclog_or_tty->print_cr("%s", _buffer); + const char* to_string() { _cur = _indent_level * INDENT_CHARS; - } - - void append_and_print_cr(const char* format, ...) ATTRIBUTE_PRINTF(2, 3) { - va_list ap; - va_start(ap, format); - vappend(format, ap); - va_end(ap); - print_cr(); + return _buffer; } }; +static const char* Indents[4] = {"", " ", " ", " "}; + G1GCPhaseTimes::G1GCPhaseTimes(uint max_gc_threads) : _max_gc_threads(max_gc_threads) { assert(max_gc_threads > 0, "Must have some GC threads"); - _gc_par_phases[GCWorkerStart] = new WorkerDataArray(max_gc_threads, "GC Worker Start (ms)", false, G1Log::LevelFiner, 2); - _gc_par_phases[ExtRootScan] = new WorkerDataArray(max_gc_threads, "Ext Root Scanning (ms)", true, G1Log::LevelFiner, 2); + _gc_par_phases[GCWorkerStart] = new WorkerDataArray(max_gc_threads, "GC Worker Start:", false, 2); + _gc_par_phases[ExtRootScan] = new WorkerDataArray(max_gc_threads, "Ext Root Scanning:", true, 2); // Root scanning phases - _gc_par_phases[ThreadRoots] = new WorkerDataArray(max_gc_threads, "Thread Roots (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[StringTableRoots] = new WorkerDataArray(max_gc_threads, "StringTable Roots (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[UniverseRoots] = new WorkerDataArray(max_gc_threads, "Universe Roots (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[JNIRoots] = new WorkerDataArray(max_gc_threads, "JNI Handles Roots (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[ObjectSynchronizerRoots] = new WorkerDataArray(max_gc_threads, "ObjectSynchronizer Roots (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[FlatProfilerRoots] = new WorkerDataArray(max_gc_threads, "FlatProfiler Roots (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[ManagementRoots] = new WorkerDataArray(max_gc_threads, "Management Roots (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[SystemDictionaryRoots] = new WorkerDataArray(max_gc_threads, "SystemDictionary Roots (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[CLDGRoots] = new WorkerDataArray(max_gc_threads, "CLDG Roots (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[JVMTIRoots] = new WorkerDataArray(max_gc_threads, "JVMTI Roots (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[CMRefRoots] = new WorkerDataArray(max_gc_threads, "CM RefProcessor Roots (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[WaitForStrongCLD] = new WorkerDataArray(max_gc_threads, "Wait For Strong CLD (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[WeakCLDRoots] = new WorkerDataArray(max_gc_threads, "Weak CLD Roots (ms)", true, G1Log::LevelFinest, 3); - _gc_par_phases[SATBFiltering] = new WorkerDataArray(max_gc_threads, "SATB Filtering (ms)", true, G1Log::LevelFinest, 3); + _gc_par_phases[ThreadRoots] = new WorkerDataArray(max_gc_threads, "Thread Roots:", true, 3); + _gc_par_phases[StringTableRoots] = new WorkerDataArray(max_gc_threads, "StringTable Roots:", true, 3); + _gc_par_phases[UniverseRoots] = new WorkerDataArray(max_gc_threads, "Universe Roots:", true, 3); + _gc_par_phases[JNIRoots] = new WorkerDataArray(max_gc_threads, "JNI Handles Roots:", true, 3); + _gc_par_phases[ObjectSynchronizerRoots] = new WorkerDataArray(max_gc_threads, "ObjectSynchronizer Roots:", true, 3); + _gc_par_phases[FlatProfilerRoots] = new WorkerDataArray(max_gc_threads, "FlatProfiler Roots:", true, 3); + _gc_par_phases[ManagementRoots] = new WorkerDataArray(max_gc_threads, "Management Roots:", true, 3); + _gc_par_phases[SystemDictionaryRoots] = new WorkerDataArray(max_gc_threads, "SystemDictionary Roots:", true, 3); + _gc_par_phases[CLDGRoots] = new WorkerDataArray(max_gc_threads, "CLDG Roots:", true, 3); + _gc_par_phases[JVMTIRoots] = new WorkerDataArray(max_gc_threads, "JVMTI Roots:", true, 3); + _gc_par_phases[CMRefRoots] = new WorkerDataArray(max_gc_threads, "CM RefProcessor Roots:", true, 3); + _gc_par_phases[WaitForStrongCLD] = new WorkerDataArray(max_gc_threads, "Wait For Strong CLD:", true, 3); + _gc_par_phases[WeakCLDRoots] = new WorkerDataArray(max_gc_threads, "Weak CLD Roots:", true, 3); + _gc_par_phases[SATBFiltering] = new WorkerDataArray(max_gc_threads, "SATB Filtering:", true, 3); - _gc_par_phases[UpdateRS] = new WorkerDataArray(max_gc_threads, "Update RS (ms)", true, G1Log::LevelFiner, 2); - _gc_par_phases[ScanHCC] = new WorkerDataArray(max_gc_threads, "Scan HCC (ms)", true, G1Log::LevelFiner, 3); + _gc_par_phases[UpdateRS] = new WorkerDataArray(max_gc_threads, "Update RS:", true, 2); + _gc_par_phases[ScanHCC] = new WorkerDataArray(max_gc_threads, "Scan HCC:", true, 3); _gc_par_phases[ScanHCC]->set_enabled(ConcurrentG1Refine::hot_card_cache_enabled()); - _gc_par_phases[ScanRS] = new WorkerDataArray(max_gc_threads, "Scan RS (ms)", true, G1Log::LevelFiner, 2); - _gc_par_phases[CodeRoots] = new WorkerDataArray(max_gc_threads, "Code Root Scanning (ms)", true, G1Log::LevelFiner, 2); - _gc_par_phases[ObjCopy] = new WorkerDataArray(max_gc_threads, "Object Copy (ms)", true, G1Log::LevelFiner, 2); - _gc_par_phases[Termination] = new WorkerDataArray(max_gc_threads, "Termination (ms)", true, G1Log::LevelFiner, 2); - _gc_par_phases[GCWorkerTotal] = new WorkerDataArray(max_gc_threads, "GC Worker Total (ms)", true, G1Log::LevelFiner, 2); - _gc_par_phases[GCWorkerEnd] = new WorkerDataArray(max_gc_threads, "GC Worker End (ms)", false, G1Log::LevelFiner, 2); - _gc_par_phases[Other] = new WorkerDataArray(max_gc_threads, "GC Worker Other (ms)", true, G1Log::LevelFiner, 2); + _gc_par_phases[ScanRS] = new WorkerDataArray(max_gc_threads, "Scan RS:", true, 2); + _gc_par_phases[CodeRoots] = new WorkerDataArray(max_gc_threads, "Code Root Scanning:", true, 2); + _gc_par_phases[ObjCopy] = new WorkerDataArray(max_gc_threads, "Object Copy:", true, 2); + _gc_par_phases[Termination] = new WorkerDataArray(max_gc_threads, "Termination:", true, 2); + _gc_par_phases[GCWorkerTotal] = new WorkerDataArray(max_gc_threads, "GC Worker Total:", true, 2); + _gc_par_phases[GCWorkerEnd] = new WorkerDataArray(max_gc_threads, "GC Worker End:", false, 2); + _gc_par_phases[Other] = new WorkerDataArray(max_gc_threads, "GC Worker Other:", true, 2); - _update_rs_processed_buffers = new WorkerDataArray(max_gc_threads, "Processed Buffers", true, G1Log::LevelFiner, 3); + _update_rs_processed_buffers = new WorkerDataArray(max_gc_threads, "Processed Buffers:", true, 3); _gc_par_phases[UpdateRS]->link_thread_work_items(_update_rs_processed_buffers); - _termination_attempts = new WorkerDataArray(max_gc_threads, "Termination Attempts", true, G1Log::LevelFinest, 3); + _termination_attempts = new WorkerDataArray(max_gc_threads, "Termination Attempts:", true, 3); _gc_par_phases[Termination]->link_thread_work_items(_termination_attempts); - _gc_par_phases[StringDedupQueueFixup] = new WorkerDataArray(max_gc_threads, "Queue Fixup (ms)", true, G1Log::LevelFiner, 2); - _gc_par_phases[StringDedupTableFixup] = new WorkerDataArray(max_gc_threads, "Table Fixup (ms)", true, G1Log::LevelFiner, 2); + _gc_par_phases[StringDedupQueueFixup] = new WorkerDataArray(max_gc_threads, "Queue Fixup:", true, 2); + _gc_par_phases[StringDedupTableFixup] = new WorkerDataArray(max_gc_threads, "Table Fixup:", true, 2); - _gc_par_phases[RedirtyCards] = new WorkerDataArray(max_gc_threads, "Parallel Redirty", true, G1Log::LevelFinest, 3); - _redirtied_cards = new WorkerDataArray(max_gc_threads, "Redirtied Cards", true, G1Log::LevelFinest, 3); + _gc_par_phases[RedirtyCards] = new WorkerDataArray(max_gc_threads, "Parallel Redirty", true, 3); + _redirtied_cards = new WorkerDataArray(max_gc_threads, "Redirtied Cards:", true, 3); _gc_par_phases[RedirtyCards]->link_thread_work_items(_redirtied_cards); } @@ -173,16 +167,8 @@ void G1GCPhaseTimes::note_gc_end() { } } -void G1GCPhaseTimes::print_stats(int level, const char* str, double value) { - LineBuffer(level).append_and_print_cr("[%s: %.1lf ms]", str, value); -} - -void G1GCPhaseTimes::print_stats(int level, const char* str, size_t value) { - LineBuffer(level).append_and_print_cr("[%s: " SIZE_FORMAT "]", str, value); -} - -void G1GCPhaseTimes::print_stats(int level, const char* str, double value, uint workers) { - LineBuffer(level).append_and_print_cr("[%s: %.1lf ms, GC Workers: %u]", str, value, workers); +void G1GCPhaseTimes::print_stats(const char* indent, const char* str, double value) { + log_debug(gc, phases)("%s%s: %.1lf ms", indent, str, value); } double G1GCPhaseTimes::accounted_time_ms() { @@ -284,10 +270,6 @@ class G1GCParPhasePrinter : public StackObj { void print(G1GCPhaseTimes::GCParPhases phase_id) { WorkerDataArray* phase = _phase_times->_gc_par_phases[phase_id]; - if (phase->_log_level > G1Log::level() || !phase->_enabled) { - return; - } - if (phase->_length == 1) { print_single_length(phase_id, phase); } else { @@ -295,69 +277,71 @@ class G1GCParPhasePrinter : public StackObj { } } - private: + private: void print_single_length(G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray* phase) { // No need for min, max, average and sum for only one worker - LineBuffer buf(phase->_indent_level); - buf.append_and_print_cr("[%s: %.1lf]", phase->_title, _phase_times->get_time_ms(phase_id, 0)); + log_debug(gc, phases)("%s%s: %.1lf", Indents[phase->_indent_level], phase->_title, _phase_times->get_time_ms(phase_id, 0)); - if (phase->_thread_work_items != NULL) { - LineBuffer buf2(phase->_thread_work_items->_indent_level); - buf2.append_and_print_cr("[%s: " SIZE_FORMAT "]", phase->_thread_work_items->_title, _phase_times->sum_thread_work_items(phase_id)); + WorkerDataArray* work_items = phase->_thread_work_items; + if (work_items != NULL) { + log_debug(gc, phases)("%s%s: " SIZE_FORMAT, Indents[work_items->_indent_level], work_items->_title, _phase_times->sum_thread_work_items(phase_id)); } } - void print_time_values(LineBuffer& buf, G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray* phase) { - uint active_length = _phase_times->_active_gc_threads; - for (uint i = 0; i < active_length; ++i) { - buf.append(" %.1lf", _phase_times->get_time_ms(phase_id, i)); + void print_time_values(const char* indent, G1GCPhaseTimes::GCParPhases phase_id) { + if (log_is_enabled(Trace, gc)) { + LineBuffer buf(0); + uint active_length = _phase_times->_active_gc_threads; + for (uint i = 0; i < active_length; ++i) { + buf.append(" %4.1lf", _phase_times->get_time_ms(phase_id, i)); + } + const char* line = buf.to_string(); + log_trace(gc, phases)("%s%-25s%s", indent, "", line); } - buf.print_cr(); } - void print_count_values(LineBuffer& buf, G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray* thread_work_items) { - uint active_length = _phase_times->_active_gc_threads; - for (uint i = 0; i < active_length; ++i) { - buf.append(" " SIZE_FORMAT, _phase_times->get_thread_work_item(phase_id, i)); + void print_count_values(const char* indent, G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray* thread_work_items) { + if (log_is_enabled(Trace, gc)) { + LineBuffer buf(0); + uint active_length = _phase_times->_active_gc_threads; + for (uint i = 0; i < active_length; ++i) { + buf.append(" " SIZE_FORMAT, _phase_times->get_thread_work_item(phase_id, i)); + } + const char* line = buf.to_string(); + log_trace(gc, phases)("%s%-25s%s", indent, "", line); } - buf.print_cr(); } void print_thread_work_items(G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray* thread_work_items) { - LineBuffer buf(thread_work_items->_indent_level); - buf.append("[%s:", thread_work_items->_title); - - if (G1Log::finest()) { - print_count_values(buf, phase_id, thread_work_items); - } + const char* indent = Indents[thread_work_items->_indent_level]; assert(thread_work_items->_print_sum, "%s does not have print sum true even though it is a count", thread_work_items->_title); - buf.append_and_print_cr(" Min: " SIZE_FORMAT ", Avg: %.1lf, Max: " SIZE_FORMAT ", Diff: " SIZE_FORMAT ", Sum: " SIZE_FORMAT "]", + log_debug(gc, phases)("%s%-25s Min: " SIZE_FORMAT ", Avg: %4.1lf, Max: " SIZE_FORMAT ", Diff: " SIZE_FORMAT ", Sum: " SIZE_FORMAT, + indent, thread_work_items->_title, _phase_times->min_thread_work_items(phase_id), _phase_times->average_thread_work_items(phase_id), _phase_times->max_thread_work_items(phase_id), _phase_times->max_thread_work_items(phase_id) - _phase_times->min_thread_work_items(phase_id), _phase_times->sum_thread_work_items(phase_id)); + + print_count_values(indent, phase_id, thread_work_items); } void print_multi_length(G1GCPhaseTimes::GCParPhases phase_id, WorkerDataArray* phase) { - LineBuffer buf(phase->_indent_level); - buf.append("[%s:", phase->_title); - - if (G1Log::finest()) { - print_time_values(buf, phase_id, phase); - } - - buf.append(" Min: %.1lf, Avg: %.1lf, Max: %.1lf, Diff: %.1lf", - _phase_times->min_time_ms(phase_id), _phase_times->average_time_ms(phase_id), _phase_times->max_time_ms(phase_id), - _phase_times->max_time_ms(phase_id) - _phase_times->min_time_ms(phase_id)); + const char* indent = Indents[phase->_indent_level]; if (phase->_print_sum) { - // for things like the start and end times the sum is not - // that relevant - buf.append(", Sum: %.1lf", _phase_times->sum_time_ms(phase_id)); + log_debug(gc, phases)("%s%-25s Min: %4.1lf, Avg: %4.1lf, Max: %4.1lf, Diff: %4.1lf, Sum: %4.1lf", + indent, phase->_title, + _phase_times->min_time_ms(phase_id), _phase_times->average_time_ms(phase_id), _phase_times->max_time_ms(phase_id), + _phase_times->max_time_ms(phase_id) - _phase_times->min_time_ms(phase_id), _phase_times->sum_time_ms(phase_id)); + } else { + log_debug(gc, phases)("%s%-25s Min: %4.1lf, Avg: %4.1lf, Max: %4.1lf, Diff: %4.1lf", + indent, phase->_title, + _phase_times->min_time_ms(phase_id), _phase_times->average_time_ms(phase_id), _phase_times->max_time_ms(phase_id), + _phase_times->max_time_ms(phase_id) - _phase_times->min_time_ms(phase_id)); } - buf.append_and_print_cr("]"); + print_time_values(indent, phase_id); if (phase->_thread_work_items != NULL) { print_thread_work_items(phase_id, phase->_thread_work_items); @@ -371,67 +355,59 @@ void G1GCPhaseTimes::print(double pause_time_sec) { G1GCParPhasePrinter par_phase_printer(this); if (_root_region_scan_wait_time_ms > 0.0) { - print_stats(1, "Root Region Scan Waiting", _root_region_scan_wait_time_ms); + print_stats(Indents[1], "Root Region Scan Waiting", _root_region_scan_wait_time_ms); } - print_stats(1, "Parallel Time", _cur_collection_par_time_ms, _active_gc_threads); + print_stats(Indents[1], "Parallel Time", _cur_collection_par_time_ms); for (int i = 0; i <= GCMainParPhasesLast; i++) { par_phase_printer.print((GCParPhases) i); } - print_stats(1, "Code Root Fixup", _cur_collection_code_root_fixup_time_ms); - print_stats(1, "Code Root Purge", _cur_strong_code_root_purge_time_ms); + print_stats(Indents[1], "Code Root Fixup", _cur_collection_code_root_fixup_time_ms); + print_stats(Indents[1], "Code Root Purge", _cur_strong_code_root_purge_time_ms); if (G1StringDedup::is_enabled()) { - print_stats(1, "String Dedup Fixup", _cur_string_dedup_fixup_time_ms, _active_gc_threads); + print_stats(Indents[1], "String Dedup Fixup", _cur_string_dedup_fixup_time_ms); for (int i = StringDedupPhasesFirst; i <= StringDedupPhasesLast; i++) { par_phase_printer.print((GCParPhases) i); } } - print_stats(1, "Clear CT", _cur_clear_ct_time_ms); - print_stats(1, "Expand Heap After Collection", _cur_expand_heap_time_ms); - + print_stats(Indents[1], "Clear CT", _cur_clear_ct_time_ms); + print_stats(Indents[1], "Expand Heap After Collection", _cur_expand_heap_time_ms); double misc_time_ms = pause_time_sec * MILLIUNITS - accounted_time_ms(); - print_stats(1, "Other", misc_time_ms); + print_stats(Indents[1], "Other", misc_time_ms); if (_cur_verify_before_time_ms > 0.0) { - print_stats(2, "Verify Before", _cur_verify_before_time_ms); + print_stats(Indents[2], "Verify Before", _cur_verify_before_time_ms); } if (G1CollectedHeap::heap()->evacuation_failed()) { double evac_fail_handling = _cur_evac_fail_recalc_used + _cur_evac_fail_remove_self_forwards + _cur_evac_fail_restore_remsets; - print_stats(2, "Evacuation Failure", evac_fail_handling); - if (G1Log::finest()) { - print_stats(3, "Recalculate Used", _cur_evac_fail_recalc_used); - print_stats(3, "Remove Self Forwards", _cur_evac_fail_remove_self_forwards); - print_stats(3, "Restore RemSet", _cur_evac_fail_restore_remsets); - } + print_stats(Indents[2], "Evacuation Failure", evac_fail_handling); + log_trace(gc, phases)("%sRecalculate Used: %.1lf ms", Indents[3], _cur_evac_fail_recalc_used); + log_trace(gc, phases)("%sRemove Self Forwards: %.1lf ms", Indents[3], _cur_evac_fail_remove_self_forwards); + log_trace(gc, phases)("%sRestore RemSet: %.1lf ms", Indents[3], _cur_evac_fail_restore_remsets); } - print_stats(2, "Choose CSet", + print_stats(Indents[2], "Choose CSet", (_recorded_young_cset_choice_time_ms + _recorded_non_young_cset_choice_time_ms)); - print_stats(2, "Ref Proc", _cur_ref_proc_time_ms); - print_stats(2, "Ref Enq", _cur_ref_enq_time_ms); - print_stats(2, "Redirty Cards", _recorded_redirty_logged_cards_time_ms); + print_stats(Indents[2], "Ref Proc", _cur_ref_proc_time_ms); + print_stats(Indents[2], "Ref Enq", _cur_ref_enq_time_ms); + print_stats(Indents[2], "Redirty Cards", _recorded_redirty_logged_cards_time_ms); par_phase_printer.print(RedirtyCards); if (G1EagerReclaimHumongousObjects) { - print_stats(2, "Humongous Register", _cur_fast_reclaim_humongous_register_time_ms); - if (G1Log::finest()) { - print_stats(3, "Humongous Total", _cur_fast_reclaim_humongous_total); - print_stats(3, "Humongous Candidate", _cur_fast_reclaim_humongous_candidates); - } - print_stats(2, "Humongous Reclaim", _cur_fast_reclaim_humongous_time_ms); - if (G1Log::finest()) { - print_stats(3, "Humongous Reclaimed", _cur_fast_reclaim_humongous_reclaimed); - } + print_stats(Indents[2], "Humongous Register", _cur_fast_reclaim_humongous_register_time_ms); + + log_trace(gc, phases)("%sHumongous Total: " SIZE_FORMAT, Indents[3], _cur_fast_reclaim_humongous_total); + log_trace(gc, phases)("%sHumongous Candidate: " SIZE_FORMAT, Indents[3], _cur_fast_reclaim_humongous_candidates); + print_stats(Indents[2], "Humongous Reclaim", _cur_fast_reclaim_humongous_time_ms); + log_trace(gc, phases)("%sHumongous Reclaimed: " SIZE_FORMAT, Indents[3], _cur_fast_reclaim_humongous_reclaimed); } - print_stats(2, "Free CSet", + print_stats(Indents[2], "Free CSet", (_recorded_young_free_cset_time_ms + _recorded_non_young_free_cset_time_ms)); - if (G1Log::finest()) { - print_stats(3, "Young Free CSet", _recorded_young_free_cset_time_ms); - print_stats(3, "Non-Young Free CSet", _recorded_non_young_free_cset_time_ms); - } + log_trace(gc, phases)("%sYoung Free CSet: %.1lf ms", Indents[3], _recorded_young_free_cset_time_ms); + log_trace(gc, phases)("%sNon-Young Free CSet: %.1lf ms", Indents[3], _recorded_non_young_free_cset_time_ms); if (_cur_verify_after_time_ms > 0.0) { - print_stats(2, "Verify After", _cur_verify_after_time_ms); + print_stats(Indents[2], "Verify After", _cur_verify_after_time_ms); } } diff --git a/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp b/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp index 3c84ed89ac8..9803fef0c5b 100644 --- a/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp +++ b/hotspot/src/share/vm/gc/g1/g1GCPhaseTimes.hpp @@ -119,9 +119,7 @@ class G1GCPhaseTimes : public CHeapObj { double _cur_verify_after_time_ms; // Helper methods for detailed logging - void print_stats(int level, const char* str, double value); - void print_stats(int level, const char* str, size_t value); - void print_stats(int level, const char* str, double value, uint workers); + void print_stats(const char*, const char* str, double value); void note_gc_end(); diff --git a/hotspot/src/share/vm/gc/g1/g1HRPrinter.cpp b/hotspot/src/share/vm/gc/g1/g1HRPrinter.cpp index 3e71725274d..36c060ced6f 100644 --- a/hotspot/src/share/vm/gc/g1/g1HRPrinter.cpp +++ b/hotspot/src/share/vm/gc/g1/g1HRPrinter.cpp @@ -60,18 +60,6 @@ const char* G1HRPrinter::region_type_name(RegionType type) { return NULL; } -const char* G1HRPrinter::phase_name(PhaseType phase) { - switch (phase) { - case StartGC: return "StartGC"; - case EndGC: return "EndGC"; - case StartFullGC: return "StartFullGC"; - case EndFullGC: return "EndFullGC"; - default: ShouldNotReachHere(); - } - // trying to keep the Windows compiler happy - return NULL; -} - #define G1HR_PREFIX " G1HR" void G1HRPrinter::print(ActionType action, RegionType type, @@ -82,19 +70,19 @@ void G1HRPrinter::print(ActionType action, RegionType type, if (type_str != NULL) { if (top != NULL) { - gclog_or_tty->print_cr(G1HR_PREFIX " %s(%s) " PTR_FORMAT " " PTR_FORMAT, - action_str, type_str, p2i(bottom), p2i(top)); + log_trace(gc, region)(G1HR_PREFIX " %s(%s) " PTR_FORMAT " " PTR_FORMAT, + action_str, type_str, p2i(bottom), p2i(top)); } else { - gclog_or_tty->print_cr(G1HR_PREFIX " %s(%s) " PTR_FORMAT, - action_str, type_str, p2i(bottom)); + log_trace(gc, region)(G1HR_PREFIX " %s(%s) " PTR_FORMAT, + action_str, type_str, p2i(bottom)); } } else { if (top != NULL) { - gclog_or_tty->print_cr(G1HR_PREFIX " %s " PTR_FORMAT " " PTR_FORMAT, - action_str, p2i(bottom), p2i(top)); + log_trace(gc, region)(G1HR_PREFIX " %s " PTR_FORMAT " " PTR_FORMAT, + action_str, p2i(bottom), p2i(top)); } else { - gclog_or_tty->print_cr(G1HR_PREFIX " %s " PTR_FORMAT, - action_str, p2i(bottom)); + log_trace(gc, region)(G1HR_PREFIX " %s " PTR_FORMAT, + action_str, p2i(bottom)); } } } @@ -102,11 +90,6 @@ void G1HRPrinter::print(ActionType action, RegionType type, void G1HRPrinter::print(ActionType action, HeapWord* bottom, HeapWord* end) { const char* action_str = action_name(action); - gclog_or_tty->print_cr(G1HR_PREFIX " %s [" PTR_FORMAT "," PTR_FORMAT "]", - action_str, p2i(bottom), p2i(end)); -} - -void G1HRPrinter::print(PhaseType phase, size_t phase_num) { - const char* phase_str = phase_name(phase); - gclog_or_tty->print_cr(G1HR_PREFIX " #%s " SIZE_FORMAT, phase_str, phase_num); + log_trace(gc, region)(G1HR_PREFIX " %s [" PTR_FORMAT "," PTR_FORMAT "]", + action_str, p2i(bottom), p2i(end)); } diff --git a/hotspot/src/share/vm/gc/g1/g1HRPrinter.hpp b/hotspot/src/share/vm/gc/g1/g1HRPrinter.hpp index 6bd1dc49f48..064c4956269 100644 --- a/hotspot/src/share/vm/gc/g1/g1HRPrinter.hpp +++ b/hotspot/src/share/vm/gc/g1/g1HRPrinter.hpp @@ -26,6 +26,7 @@ #define SHARE_VM_GC_G1_G1HRPRINTER_HPP #include "gc/g1/heapRegion.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" #define SKIP_RETIRED_FULL_REGIONS 1 @@ -55,19 +56,9 @@ public: Archive } RegionType; - typedef enum { - StartGC, - EndGC, - StartFullGC, - EndFullGC - } PhaseType; - private: - bool _active; - static const char* action_name(ActionType action); static const char* region_type_name(RegionType type); - static const char* phase_name(PhaseType phase); // Print an action event. This version is used in most scenarios and // only prints the region's bottom. The parameters type and top are @@ -79,18 +70,11 @@ private: // bottom and end. Used for Commit / Uncommit events. static void print(ActionType action, HeapWord* bottom, HeapWord* end); - // Print a phase event. - static void print(PhaseType phase, size_t phase_num); - public: // In some places we iterate over a list in order to generate output // for the list's elements. By exposing this we can avoid this // iteration if the printer is not active. - const bool is_active() { return _active; } - - // Have to set this explicitly as we have to do this during the - // heap's initialize() method, not in the constructor. - void set_active(bool active) { _active = active; } + const bool is_active() { return log_is_enabled(Trace, gc, region); } // The methods below are convenient wrappers for the print() methods. @@ -155,28 +139,6 @@ public: print(Uncommit, bottom, end); } } - - void start_gc(bool full, size_t gc_num) { - if (is_active()) { - if (!full) { - print(StartGC, gc_num); - } else { - print(StartFullGC, gc_num); - } - } - } - - void end_gc(bool full, size_t gc_num) { - if (is_active()) { - if (!full) { - print(EndGC, gc_num); - } else { - print(EndFullGC, gc_num); - } - } - } - - G1HRPrinter() : _active(false) { } }; #endif // SHARE_VM_GC_G1_G1HRPRINTER_HPP diff --git a/hotspot/src/share/vm/gc/g1/g1IHOPControl.cpp b/hotspot/src/share/vm/gc/g1/g1IHOPControl.cpp index 077f7b7ecf5..705d3af6fd7 100644 --- a/hotspot/src/share/vm/gc/g1/g1IHOPControl.cpp +++ b/hotspot/src/share/vm/gc/g1/g1IHOPControl.cpp @@ -24,10 +24,10 @@ #include "precompiled.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" -#include "gc/g1/g1ErgoVerbose.hpp" #include "gc/g1/g1IHOPControl.hpp" #include "gc/g1/g1Predictions.hpp" #include "gc/shared/gcTrace.hpp" +#include "logging/log.hpp" G1IHOPControl::G1IHOPControl(double initial_ihop_percent, size_t target_occupancy) : _initial_ihop_percent(initial_ihop_percent), @@ -47,20 +47,14 @@ void G1IHOPControl::update_allocation_info(double allocation_time_s, size_t allo void G1IHOPControl::print() { size_t cur_conc_mark_start_threshold = get_conc_mark_start_threshold(); - ergo_verbose6(ErgoIHOP, - "basic information", - ergo_format_reason("value update") - ergo_format_byte_perc("threshold") - ergo_format_byte("target occupancy") - ergo_format_byte("current occupancy") - ergo_format_double("recent old gen allocation rate") - ergo_format_double("recent marking phase length"), - cur_conc_mark_start_threshold, - cur_conc_mark_start_threshold * 100.0 / _target_occupancy, - _target_occupancy, - G1CollectedHeap::heap()->used(), - _last_allocation_time_s > 0.0 ? _last_allocated_bytes / _last_allocation_time_s : 0.0, - last_marking_length_s()); + log_debug(gc, ihop)("Basic information (value update), threshold: " SIZE_FORMAT "B (%1.2f), target occupancy: " SIZE_FORMAT "B, current occupancy: " SIZE_FORMAT "B," + " recent old gen allocation rate: %1.2f, recent marking phase length: %1.2f", + cur_conc_mark_start_threshold, + cur_conc_mark_start_threshold * 100.0 / _target_occupancy, + _target_occupancy, + G1CollectedHeap::heap()->used(), + _last_allocation_time_s > 0.0 ? _last_allocated_bytes / _last_allocation_time_s : 0.0, + last_marking_length_s()); } void G1IHOPControl::send_trace_event(G1NewTracer* tracer) { @@ -192,21 +186,14 @@ void G1AdaptiveIHOPControl::update_marking_length(double marking_length_s) { void G1AdaptiveIHOPControl::print() { G1IHOPControl::print(); size_t actual_target = actual_target_threshold(); - ergo_verbose6(ErgoIHOP, - "adaptive IHOP information", - ergo_format_reason("value update") - ergo_format_byte_perc("threshold") - ergo_format_byte("internal target occupancy") - ergo_format_double("predicted old gen allocation rate") - ergo_format_double("predicted marking phase length") - ergo_format_str("prediction active"), - get_conc_mark_start_threshold(), - percent_of(get_conc_mark_start_threshold(), actual_target), - actual_target, - _predictor->get_new_prediction(&_allocation_rate_s), - _predictor->get_new_prediction(&_marking_times_s), - have_enough_data_for_prediction() ? "true" : "false" - ); + log_debug(gc, ihop)("Adaptive IHOP information (value update), threshold: " SIZE_FORMAT "B (%1.2f), internal target occupancy: " SIZE_FORMAT "B," + " predicted old gen allocation rate: %1.2f, predicted marking phase length: %1.2f, prediction active: %s", + get_conc_mark_start_threshold(), + percent_of(get_conc_mark_start_threshold(), actual_target), + actual_target, + _predictor->get_new_prediction(&_allocation_rate_s), + _predictor->get_new_prediction(&_marking_times_s), + have_enough_data_for_prediction() ? "true" : "false"); } void G1AdaptiveIHOPControl::send_trace_event(G1NewTracer* tracer) { diff --git a/hotspot/src/share/vm/gc/g1/g1Log.cpp b/hotspot/src/share/vm/gc/g1/g1Log.cpp deleted file mode 100644 index 40c1da28812..00000000000 --- a/hotspot/src/share/vm/gc/g1/g1Log.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "gc/g1/g1Log.hpp" -#include "gc/g1/g1_globals.hpp" -#include "runtime/globals_extension.hpp" - -G1Log::LogLevel G1Log::_level = G1Log::LevelNone; - - -// Updates _level based on PrintGC and PrintGCDetails values (unless -// G1LogLevel is set explicitly) -// - PrintGC maps to "fine". -// - PrintGCDetails maps to "finer". -void G1Log::update_level() { - if (FLAG_IS_DEFAULT(G1LogLevel)) { - _level = LevelNone; - if (PrintGCDetails) { - _level = LevelFiner; - } else if (PrintGC) { - _level = LevelFine; - } - } -} - - -// If G1LogLevel has not been set up we will use the values of PrintGC -// and PrintGCDetails for the logging level. -void G1Log::init() { - if (!FLAG_IS_DEFAULT(G1LogLevel)) { - // PrintGC flags change won't have any affect, because G1LogLevel - // is set explicitly - if (G1LogLevel[0] == '\0' || strncmp("none", G1LogLevel, 4) == 0 && G1LogLevel[4] == '\0') { - _level = LevelNone; - } else if (strncmp("fine", G1LogLevel, 4) == 0 && G1LogLevel[4] == '\0') { - _level = LevelFine; - } else if (strncmp("finer", G1LogLevel, 5) == 0 && G1LogLevel[5] == '\0') { - _level = LevelFiner; - } else if (strncmp("finest", G1LogLevel, 6) == 0 && G1LogLevel[6] == '\0') { - _level = LevelFinest; - } else { - warning("Unknown logging level '%s', should be one of 'fine', 'finer' or 'finest'.", G1LogLevel); - } - } else { - update_level(); - } -} - diff --git a/hotspot/src/share/vm/gc/g1/g1Log.hpp b/hotspot/src/share/vm/gc/g1/g1Log.hpp deleted file mode 100644 index 7a313e360cd..00000000000 --- a/hotspot/src/share/vm/gc/g1/g1Log.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef SHARE_VM_GC_G1_G1LOG_HPP -#define SHARE_VM_GC_G1_G1LOG_HPP - -#include "memory/allocation.hpp" - -class G1Log : public AllStatic { - public: - typedef enum { - LevelNone, - LevelFine, - LevelFiner, - LevelFinest - } LogLevel; - - private: - static LogLevel _level; - - public: - inline static bool fine() { - return _level >= LevelFine; - } - - inline static bool finer() { - return _level >= LevelFiner; - } - - inline static bool finest() { - return _level == LevelFinest; - } - - static LogLevel level() { - return _level; - } - - static void init(); - - // Update to log level to reflect runtime changes to manageable flags - static void update_level(); -}; - -#endif // SHARE_VM_GC_G1_G1LOG_HPP diff --git a/hotspot/src/share/vm/gc/g1/g1MarkSweep.cpp b/hotspot/src/share/vm/gc/g1/g1MarkSweep.cpp index ca5aa98b62e..d1feefe2de5 100644 --- a/hotspot/src/share/vm/gc/g1/g1MarkSweep.cpp +++ b/hotspot/src/share/vm/gc/g1/g1MarkSweep.cpp @@ -29,7 +29,6 @@ #include "classfile/vmSymbols.hpp" #include "code/codeCache.hpp" #include "code/icBuffer.hpp" -#include "gc/g1/g1Log.hpp" #include "gc/g1/g1MarkSweep.hpp" #include "gc/g1/g1RootProcessor.hpp" #include "gc/g1/g1StringDedup.hpp" @@ -38,7 +37,7 @@ #include "gc/shared/gcLocker.hpp" #include "gc/shared/gcTimer.hpp" #include "gc/shared/gcTrace.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/modRefBarrierSet.hpp" #include "gc/shared/referencePolicy.hpp" @@ -123,7 +122,7 @@ void G1MarkSweep::allocate_stacks() { void G1MarkSweep::mark_sweep_phase1(bool& marked_for_unloading, bool clear_all_softrefs) { // Recursively traverse all live objects and mark them - GCTraceTime tm("phase 1", G1Log::fine() && Verbose, true, gc_timer()); + GCTraceTime(Trace, gc) tm("Phase 1: Mark live objects", gc_timer()); G1CollectedHeap* g1h = G1CollectedHeap::heap(); @@ -183,13 +182,8 @@ void G1MarkSweep::mark_sweep_phase1(bool& marked_for_unloading, // fail. At the end of the GC, the original mark word values // (including hash values) are restored to the appropriate // objects. - if (!VerifySilently) { - gclog_or_tty->print(" VerifyDuringGC:(full)[Verifying "); - } - g1h->verify(VerifySilently, VerifyOption_G1UseMarkWord); - if (!VerifySilently) { - gclog_or_tty->print_cr("]"); - } + GCTraceTime(Info, gc, verify)("During GC (full)"); + g1h->verify(VerifyOption_G1UseMarkWord); } gc_tracer()->report_object_count_after_gc(&GenMarkSweep::is_alive); @@ -203,7 +197,7 @@ void G1MarkSweep::mark_sweep_phase2() { // phase2, phase3 and phase4, but the ValidateMarkSweep live oops // tracking expects us to do so. See comment under phase4. - GCTraceTime tm("phase 2", G1Log::fine() && Verbose, true, gc_timer()); + GCTraceTime(Trace, gc) tm("Phase 2: Compute new object addresses", gc_timer()); prepare_compaction(); } @@ -236,7 +230,7 @@ void G1MarkSweep::mark_sweep_phase3() { G1CollectedHeap* g1h = G1CollectedHeap::heap(); // Adjust the pointers to reflect the new locations - GCTraceTime tm("phase 3", G1Log::fine() && Verbose, true, gc_timer()); + GCTraceTime(Trace, gc) tm("Phase 3: Adjust pointers", gc_timer()); // Need cleared claim bits for the roots processing ClassLoaderDataGraph::clear_claimed_marks(); @@ -297,7 +291,7 @@ void G1MarkSweep::mark_sweep_phase4() { // to use a higher index (saved from phase2) when verifying perm_gen. G1CollectedHeap* g1h = G1CollectedHeap::heap(); - GCTraceTime tm("phase 4", G1Log::fine() && Verbose, true, gc_timer()); + GCTraceTime(Trace, gc) tm("Phase 4: Move objects", gc_timer()); G1SpaceCompactClosure blk; g1h->heap_region_iterate(&blk); diff --git a/hotspot/src/share/vm/gc/g1/g1RemSet.cpp b/hotspot/src/share/vm/gc/g1/g1RemSet.cpp index ea395791423..0b812183c84 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSet.cpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSet.cpp @@ -52,7 +52,7 @@ G1RemSet::G1RemSet(G1CollectedHeap* g1, CardTableModRefBS* ct_bs) for (uint i = 0; i < n_workers(); i++) { _cset_rs_update_cl[i] = NULL; } - if (G1SummarizeRSetStats) { + if (log_is_enabled(Trace, gc, remset)) { _prev_period_summary.initialize(this); } // Initialize the card queue set used to hold cards containing @@ -109,17 +109,6 @@ void ScanRSClosure::scanCard(size_t index, HeapRegion *r) { } } -void ScanRSClosure::printCard(HeapRegion* card_region, size_t card_index, - HeapWord* card_start) { - gclog_or_tty->print_cr("T %u Region [" PTR_FORMAT ", " PTR_FORMAT ") " - "RS names card " SIZE_FORMAT_HEX ": " - "[" PTR_FORMAT ", " PTR_FORMAT ")", - _worker_i, - p2i(card_region->bottom()), p2i(card_region->end()), - card_index, - p2i(card_start), p2i(card_start + G1BlockOffsetSharedArray::N_words)); -} - void ScanRSClosure::scan_strong_code_roots(HeapRegion* r) { double scan_start = os::elapsedTime(); r->strong_code_roots_do(_code_root_cl); @@ -152,10 +141,6 @@ bool ScanRSClosure::doHeapRegion(HeapRegion* r) { } if (current_card < jump_to_card) continue; HeapWord* card_start = _g1h->bot_shared()->address_for_index(card_index); -#if 0 - gclog_or_tty->print("Rem set iteration yielded card [" PTR_FORMAT ", " PTR_FORMAT ").\n", - card_start, card_start + CardTableModRefBS::card_size_in_words); -#endif HeapRegion* card_region = _g1h->heap_region_containing(card_start); _cards++; @@ -526,31 +511,36 @@ bool G1RemSet::refine_card(jbyte* card_ptr, uint worker_i, return has_refs_into_cset; } -void G1RemSet::print_periodic_summary_info(const char* header) { - G1RemSetSummary current; - current.initialize(this); +void G1RemSet::print_periodic_summary_info(const char* header, uint period_count) { + if ((G1SummarizeRSetStatsPeriod > 0) && log_is_enabled(Trace, gc, remset) && + (period_count % G1SummarizeRSetStatsPeriod == 0)) { - _prev_period_summary.subtract_from(¤t); - print_summary_info(&_prev_period_summary, header); + if (!_prev_period_summary.initialized()) { + _prev_period_summary.initialize(this); + } - _prev_period_summary.set(¤t); + G1RemSetSummary current; + current.initialize(this); + _prev_period_summary.subtract_from(¤t); + + LogHandle(gc, remset) log; + log.trace("%s", header); + ResourceMark rm; + _prev_period_summary.print_on(log.trace_stream()); + + _prev_period_summary.set(¤t); + } } void G1RemSet::print_summary_info() { - G1RemSetSummary current; - current.initialize(this); - - print_summary_info(¤t, " Cumulative RS summary"); -} - -void G1RemSet::print_summary_info(G1RemSetSummary * summary, const char * header) { - assert(summary != NULL, "just checking"); - - if (header != NULL) { - gclog_or_tty->print_cr("%s", header); + LogHandle(gc, remset, exit) log; + if (log.is_trace()) { + log.trace(" Cumulative RS summary"); + G1RemSetSummary current; + current.initialize(this); + ResourceMark rm; + current.print_on(log.trace_stream()); } - - summary->print_on(gclog_or_tty); } void G1RemSet::prepare_for_verify() { diff --git a/hotspot/src/share/vm/gc/g1/g1RemSet.hpp b/hotspot/src/share/vm/gc/g1/g1RemSet.hpp index 72a259ef417..1fe97fb7a81 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSet.hpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSet.hpp @@ -33,6 +33,7 @@ class G1CollectedHeap; class ConcurrentG1Refine; class G1ParPushHeapRSClosure; +class outputStream; // A G1RemSet in which each heap region has a rem set that records the // external heap references into it. Uses a mod ref bs to track updates, @@ -63,8 +64,6 @@ protected: // references into the collection set. G1ParPushHeapRSClosure** _cset_rs_update_cl; - // Print the given summary info - virtual void print_summary_info(G1RemSetSummary * summary, const char * header = NULL); public: // This is called to reset dual hash tables after the gc pause // is finished and the initial hash table is no longer being @@ -135,7 +134,7 @@ public: virtual void print_summary_info(); // Print accumulated summary info from the last time called. - virtual void print_periodic_summary_info(const char* header); + virtual void print_periodic_summary_info(const char* header, uint period_count); // Prepare remembered set for verification. virtual void prepare_for_verify(); diff --git a/hotspot/src/share/vm/gc/g1/g1RemSetSummary.cpp b/hotspot/src/share/vm/gc/g1/g1RemSetSummary.cpp index 2a9c9332770..2d4e6d9d670 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSetSummary.cpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSetSummary.cpp @@ -271,7 +271,7 @@ public: void print_summary_on(outputStream* out) { RegionTypeCounter* counters[] = { &_young, &_humonguous, &_free, &_old, NULL }; - out->print_cr("\n Current rem set statistics"); + out->print_cr(" Current rem set statistics"); out->print_cr(" Total per region rem sets sizes = " SIZE_FORMAT "K." " Max = " SIZE_FORMAT "K.", round_to_K(total_rs_mem_sz()), round_to_K(max_rs_mem_sz())); @@ -323,7 +323,7 @@ public: }; void G1RemSetSummary::print_on(outputStream* out) { - out->print_cr("\n Recent concurrent refinement statistics"); + out->print_cr(" Recent concurrent refinement statistics"); out->print_cr(" Processed " SIZE_FORMAT " cards", num_concurrent_refined_cards()); out->print_cr(" Of " SIZE_FORMAT " completed buffers:", num_processed_buf_total()); diff --git a/hotspot/src/share/vm/gc/g1/g1RemSetSummary.hpp b/hotspot/src/share/vm/gc/g1/g1RemSetSummary.hpp index b18fedd98ee..19faacd2ceb 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSetSummary.hpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSetSummary.hpp @@ -85,6 +85,7 @@ public: // initialize and get the first sampling void initialize(G1RemSet* remset); + bool const initialized() { return _rs_threads_vtimes != NULL; } void print_on(outputStream* out); diff --git a/hotspot/src/share/vm/gc/g1/g1SATBCardTableModRefBS.cpp b/hotspot/src/share/vm/gc/g1/g1SATBCardTableModRefBS.cpp index 1f872134941..5cd8b594e8e 100644 --- a/hotspot/src/share/vm/gc/g1/g1SATBCardTableModRefBS.cpp +++ b/hotspot/src/share/vm/gc/g1/g1SATBCardTableModRefBS.cpp @@ -28,6 +28,7 @@ #include "gc/g1/heapRegion.hpp" #include "gc/g1/satbMarkQueue.hpp" #include "gc/shared/memset_with_concurrent_readers.hpp" +#include "logging/log.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/mutexLocker.hpp" @@ -147,17 +148,10 @@ void G1SATBCardTableLoggingModRefBS::initialize(G1RegionToSpaceMapper* mapper) { assert(byte_for(low_bound) == &_byte_map[0], "Checking start of map"); assert(byte_for(high_bound-1) <= &_byte_map[_last_valid_index], "Checking end of map"); - if (TraceCardTableModRefBS) { - gclog_or_tty->print_cr("G1SATBCardTableModRefBS::G1SATBCardTableModRefBS: "); - gclog_or_tty->print_cr(" " - " &_byte_map[0]: " INTPTR_FORMAT - " &_byte_map[_last_valid_index]: " INTPTR_FORMAT, - p2i(&_byte_map[0]), - p2i(&_byte_map[_last_valid_index])); - gclog_or_tty->print_cr(" " - " byte_map_base: " INTPTR_FORMAT, - p2i(byte_map_base)); - } + log_trace(gc, barrier)("G1SATBCardTableModRefBS::G1SATBCardTableModRefBS: "); + log_trace(gc, barrier)(" &_byte_map[0]: " INTPTR_FORMAT " &_byte_map[_last_valid_index]: " INTPTR_FORMAT, + p2i(&_byte_map[0]), p2i(&_byte_map[_last_valid_index])); + log_trace(gc, barrier)(" byte_map_base: " INTPTR_FORMAT, p2i(byte_map_base)); } void diff --git a/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.cpp b/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.cpp index b2f66630ac6..95b5bccff10 100644 --- a/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.cpp +++ b/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.cpp @@ -28,6 +28,7 @@ #include "gc/g1/g1StringDedup.hpp" #include "gc/g1/g1StringDedupQueue.hpp" #include "gc/shared/gcLocker.hpp" +#include "logging/log.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/mutexLocker.hpp" @@ -152,10 +153,9 @@ void G1StringDedupQueue::unlink_or_oops_do(G1StringDedupUnlinkOrOopsDoClosure* c } } -void G1StringDedupQueue::print_statistics(outputStream* st) { - st->print_cr( - " [Queue]\n" - " [Dropped: " UINTX_FORMAT "]", _queue->_dropped); +void G1StringDedupQueue::print_statistics() { + log_debug(gc, stringdedup)(" [Queue]"); + log_debug(gc, stringdedup)(" [Dropped: " UINTX_FORMAT "]", _queue->_dropped); } void G1StringDedupQueue::verify() { diff --git a/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.hpp b/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.hpp index 3c9bbd1360f..6bc37c2679c 100644 --- a/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.hpp +++ b/hotspot/src/share/vm/gc/g1/g1StringDedupQueue.hpp @@ -94,7 +94,7 @@ public: static void unlink_or_oops_do(G1StringDedupUnlinkOrOopsDoClosure* cl); - static void print_statistics(outputStream* st); + static void print_statistics(); static void verify(); }; diff --git a/hotspot/src/share/vm/gc/g1/g1StringDedupStat.cpp b/hotspot/src/share/vm/gc/g1/g1StringDedupStat.cpp index 7e2a3da5436..a90515e8693 100644 --- a/hotspot/src/share/vm/gc/g1/g1StringDedupStat.cpp +++ b/hotspot/src/share/vm/gc/g1/g1StringDedupStat.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "gc/g1/g1StringDedupStat.hpp" +#include "logging/log.hpp" G1StringDedupStat::G1StringDedupStat() : _inspected(0), @@ -68,7 +69,7 @@ void G1StringDedupStat::add(const G1StringDedupStat& stat) { _block_elapsed += stat._block_elapsed; } -void G1StringDedupStat::print_summary(outputStream* st, const G1StringDedupStat& last_stat, const G1StringDedupStat& total_stat) { +void G1StringDedupStat::print_summary(const G1StringDedupStat& last_stat, const G1StringDedupStat& total_stat) { double total_deduped_bytes_percent = 0.0; if (total_stat._new_bytes > 0) { @@ -76,10 +77,8 @@ void G1StringDedupStat::print_summary(outputStream* st, const G1StringDedupStat& total_deduped_bytes_percent = (double)total_stat._deduped_bytes / (double)total_stat._new_bytes * 100.0; } - st->date_stamp(PrintGCDateStamps); - st->stamp(PrintGCTimeStamps); - st->print_cr( - "[GC concurrent-string-deduplication, " + log_info(gc, stringdedup)( + "Concurrent String Deduplication " G1_STRDEDUP_BYTES_FORMAT_NS "->" G1_STRDEDUP_BYTES_FORMAT_NS "(" G1_STRDEDUP_BYTES_FORMAT_NS "), avg " G1_STRDEDUP_PERCENT_FORMAT_NS ", " G1_STRDEDUP_TIME_FORMAT "]", G1_STRDEDUP_BYTES_PARAM(last_stat._new_bytes), @@ -89,7 +88,7 @@ void G1StringDedupStat::print_summary(outputStream* st, const G1StringDedupStat& last_stat._exec_elapsed); } -void G1StringDedupStat::print_statistics(outputStream* st, const G1StringDedupStat& stat, bool total) { +void G1StringDedupStat::print_statistics(const G1StringDedupStat& stat, bool total) { double young_percent = 0.0; double old_percent = 0.0; double skipped_percent = 0.0; @@ -134,29 +133,24 @@ void G1StringDedupStat::print_statistics(outputStream* st, const G1StringDedupSt } if (total) { - st->print_cr( + log_debug(gc, stringdedup)( " [Total Exec: " UINTX_FORMAT "/" G1_STRDEDUP_TIME_FORMAT ", Idle: " UINTX_FORMAT "/" G1_STRDEDUP_TIME_FORMAT ", Blocked: " UINTX_FORMAT "/" G1_STRDEDUP_TIME_FORMAT "]", stat._exec, stat._exec_elapsed, stat._idle, stat._idle_elapsed, stat._block, stat._block_elapsed); } else { - st->print_cr( + log_debug(gc, stringdedup)( " [Last Exec: " G1_STRDEDUP_TIME_FORMAT ", Idle: " G1_STRDEDUP_TIME_FORMAT ", Blocked: " UINTX_FORMAT "/" G1_STRDEDUP_TIME_FORMAT "]", stat._exec_elapsed, stat._idle_elapsed, stat._block, stat._block_elapsed); } - st->print_cr( - " [Inspected: " G1_STRDEDUP_OBJECTS_FORMAT "]\n" - " [Skipped: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ")]\n" - " [Hashed: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ")]\n" - " [Known: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ")]\n" - " [New: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ") " G1_STRDEDUP_BYTES_FORMAT "]\n" - " [Deduplicated: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ") " G1_STRDEDUP_BYTES_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ")]\n" - " [Young: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ") " G1_STRDEDUP_BYTES_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ")]\n" - " [Old: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ") " G1_STRDEDUP_BYTES_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ")]", - stat._inspected, - stat._skipped, skipped_percent, - stat._hashed, hashed_percent, - stat._known, known_percent, - stat._new, new_percent, G1_STRDEDUP_BYTES_PARAM(stat._new_bytes), - stat._deduped, deduped_percent, G1_STRDEDUP_BYTES_PARAM(stat._deduped_bytes), deduped_bytes_percent, - stat._deduped_young, deduped_young_percent, G1_STRDEDUP_BYTES_PARAM(stat._deduped_young_bytes), deduped_young_bytes_percent, - stat._deduped_old, deduped_old_percent, G1_STRDEDUP_BYTES_PARAM(stat._deduped_old_bytes), deduped_old_bytes_percent); + log_debug(gc, stringdedup)(" [Inspected: " G1_STRDEDUP_OBJECTS_FORMAT "]", stat._inspected); + log_debug(gc, stringdedup)(" [Skipped: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ")]", stat._skipped, skipped_percent); + log_debug(gc, stringdedup)(" [Hashed: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ")]", stat._hashed, hashed_percent); + log_debug(gc, stringdedup)(" [Known: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ")]", stat._known, known_percent); + log_debug(gc, stringdedup)(" [New: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ") " G1_STRDEDUP_BYTES_FORMAT "]", + stat._new, new_percent, G1_STRDEDUP_BYTES_PARAM(stat._new_bytes)); + log_debug(gc, stringdedup)(" [Deduplicated: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ") " G1_STRDEDUP_BYTES_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ")]", + stat._deduped, deduped_percent, G1_STRDEDUP_BYTES_PARAM(stat._deduped_bytes), deduped_bytes_percent); + log_debug(gc, stringdedup)(" [Young: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ") " G1_STRDEDUP_BYTES_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ")]", + stat._deduped_young, deduped_young_percent, G1_STRDEDUP_BYTES_PARAM(stat._deduped_young_bytes), deduped_young_bytes_percent); + log_debug(gc, stringdedup)(" [Old: " G1_STRDEDUP_OBJECTS_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ") " G1_STRDEDUP_BYTES_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT ")]", + stat._deduped_old, deduped_old_percent, G1_STRDEDUP_BYTES_PARAM(stat._deduped_old_bytes), deduped_old_bytes_percent); } diff --git a/hotspot/src/share/vm/gc/g1/g1StringDedupStat.hpp b/hotspot/src/share/vm/gc/g1/g1StringDedupStat.hpp index 1e0367c013b..ff0dbb51ad7 100644 --- a/hotspot/src/share/vm/gc/g1/g1StringDedupStat.hpp +++ b/hotspot/src/share/vm/gc/g1/g1StringDedupStat.hpp @@ -135,8 +135,8 @@ public: void add(const G1StringDedupStat& stat); - static void print_summary(outputStream* st, const G1StringDedupStat& last_stat, const G1StringDedupStat& total_stat); - static void print_statistics(outputStream* st, const G1StringDedupStat& stat, bool total); + static void print_summary(const G1StringDedupStat& last_stat, const G1StringDedupStat& total_stat); + static void print_statistics(const G1StringDedupStat& stat, bool total); }; #endif // SHARE_VM_GC_G1_G1STRINGDEDUPSTAT_HPP diff --git a/hotspot/src/share/vm/gc/g1/g1StringDedupTable.cpp b/hotspot/src/share/vm/gc/g1/g1StringDedupTable.cpp index 276cbabeca7..16519b4a3e5 100644 --- a/hotspot/src/share/vm/gc/g1/g1StringDedupTable.cpp +++ b/hotspot/src/share/vm/gc/g1/g1StringDedupTable.cpp @@ -30,6 +30,7 @@ #include "gc/g1/g1StringDedup.hpp" #include "gc/g1/g1StringDedupTable.hpp" #include "gc/shared/gcLocker.hpp" +#include "logging/log.hpp" #include "memory/padded.inline.hpp" #include "oops/oop.inline.hpp" #include "oops/typeArrayOop.hpp" @@ -568,19 +569,16 @@ void G1StringDedupTable::trim_entry_cache() { _entry_cache->trim(max_cache_size); } -void G1StringDedupTable::print_statistics(outputStream* st) { - st->print_cr( - " [Table]\n" - " [Memory Usage: " G1_STRDEDUP_BYTES_FORMAT_NS "]\n" - " [Size: " SIZE_FORMAT ", Min: " SIZE_FORMAT ", Max: " SIZE_FORMAT "]\n" - " [Entries: " UINTX_FORMAT ", Load: " G1_STRDEDUP_PERCENT_FORMAT_NS ", Cached: " UINTX_FORMAT ", Added: " UINTX_FORMAT ", Removed: " UINTX_FORMAT "]\n" - " [Resize Count: " UINTX_FORMAT ", Shrink Threshold: " UINTX_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT_NS "), Grow Threshold: " UINTX_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT_NS ")]\n" - " [Rehash Count: " UINTX_FORMAT ", Rehash Threshold: " UINTX_FORMAT ", Hash Seed: 0x%x]\n" - " [Age Threshold: " UINTX_FORMAT "]", - G1_STRDEDUP_BYTES_PARAM(_table->_size * sizeof(G1StringDedupEntry*) + (_table->_entries + _entry_cache->size()) * sizeof(G1StringDedupEntry)), - _table->_size, _min_size, _max_size, - _table->_entries, (double)_table->_entries / (double)_table->_size * 100.0, _entry_cache->size(), _entries_added, _entries_removed, - _resize_count, _table->_shrink_threshold, _shrink_load_factor * 100.0, _table->_grow_threshold, _grow_load_factor * 100.0, - _rehash_count, _rehash_threshold, _table->_hash_seed, - StringDeduplicationAgeThreshold); +void G1StringDedupTable::print_statistics() { + LogHandle(gc, stringdedup) log; + log.debug(" [Table]"); + log.debug(" [Memory Usage: " G1_STRDEDUP_BYTES_FORMAT_NS "]", + G1_STRDEDUP_BYTES_PARAM(_table->_size * sizeof(G1StringDedupEntry*) + (_table->_entries + _entry_cache->size()) * sizeof(G1StringDedupEntry))); + log.debug(" [Size: " SIZE_FORMAT ", Min: " SIZE_FORMAT ", Max: " SIZE_FORMAT "]", _table->_size, _min_size, _max_size); + log.debug(" [Entries: " UINTX_FORMAT ", Load: " G1_STRDEDUP_PERCENT_FORMAT_NS ", Cached: " UINTX_FORMAT ", Added: " UINTX_FORMAT ", Removed: " UINTX_FORMAT "]", + _table->_entries, (double)_table->_entries / (double)_table->_size * 100.0, _entry_cache->size(), _entries_added, _entries_removed); + log.debug(" [Resize Count: " UINTX_FORMAT ", Shrink Threshold: " UINTX_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT_NS "), Grow Threshold: " UINTX_FORMAT "(" G1_STRDEDUP_PERCENT_FORMAT_NS ")]", + _resize_count, _table->_shrink_threshold, _shrink_load_factor * 100.0, _table->_grow_threshold, _grow_load_factor * 100.0); + log.debug(" [Rehash Count: " UINTX_FORMAT ", Rehash Threshold: " UINTX_FORMAT ", Hash Seed: 0x%x]", _rehash_count, _rehash_threshold, _table->_hash_seed); + log.debug(" [Age Threshold: " UINTX_FORMAT "]", StringDeduplicationAgeThreshold); } diff --git a/hotspot/src/share/vm/gc/g1/g1StringDedupTable.hpp b/hotspot/src/share/vm/gc/g1/g1StringDedupTable.hpp index 1aff126f813..4375f4dafb3 100644 --- a/hotspot/src/share/vm/gc/g1/g1StringDedupTable.hpp +++ b/hotspot/src/share/vm/gc/g1/g1StringDedupTable.hpp @@ -234,7 +234,7 @@ public: static void unlink_or_oops_do(G1StringDedupUnlinkOrOopsDoClosure* cl, uint worker_id); - static void print_statistics(outputStream* st); + static void print_statistics(); static void verify(); }; diff --git a/hotspot/src/share/vm/gc/g1/g1StringDedupThread.cpp b/hotspot/src/share/vm/gc/g1/g1StringDedupThread.cpp index d6c2a30ee6b..bd4d9b89648 100644 --- a/hotspot/src/share/vm/gc/g1/g1StringDedupThread.cpp +++ b/hotspot/src/share/vm/gc/g1/g1StringDedupThread.cpp @@ -24,12 +24,12 @@ #include "precompiled.hpp" #include "classfile/stringTable.hpp" -#include "gc/g1/g1Log.hpp" #include "gc/g1/g1StringDedup.hpp" #include "gc/g1/g1StringDedupQueue.hpp" #include "gc/g1/g1StringDedupTable.hpp" #include "gc/g1/g1StringDedupThread.hpp" #include "gc/g1/suspendibleThreadSet.hpp" +#include "logging/log.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.inline.hpp" @@ -129,7 +129,7 @@ void G1StringDedupThread::run() { // Print statistics total_stat.add(stat); - print(gclog_or_tty, stat, total_stat); + print(stat, total_stat); } } @@ -152,14 +152,14 @@ void G1StringDedupThread::stop() { } } -void G1StringDedupThread::print(outputStream* st, const G1StringDedupStat& last_stat, const G1StringDedupStat& total_stat) { - if (G1Log::fine() || PrintStringDeduplicationStatistics) { - G1StringDedupStat::print_summary(st, last_stat, total_stat); - if (PrintStringDeduplicationStatistics) { - G1StringDedupStat::print_statistics(st, last_stat, false); - G1StringDedupStat::print_statistics(st, total_stat, true); - G1StringDedupTable::print_statistics(st); - G1StringDedupQueue::print_statistics(st); +void G1StringDedupThread::print(const G1StringDedupStat& last_stat, const G1StringDedupStat& total_stat) { + if (log_is_enabled(Info, gc, stringdedup)) { + G1StringDedupStat::print_summary(last_stat, total_stat); + if (log_is_enabled(Debug, gc, stringdedup)) { + G1StringDedupStat::print_statistics(last_stat, false); + G1StringDedupStat::print_statistics(total_stat, true); + G1StringDedupTable::print_statistics(); + G1StringDedupQueue::print_statistics(); } } } diff --git a/hotspot/src/share/vm/gc/g1/g1StringDedupThread.hpp b/hotspot/src/share/vm/gc/g1/g1StringDedupThread.hpp index 2e87b737c80..6c8a275f666 100644 --- a/hotspot/src/share/vm/gc/g1/g1StringDedupThread.hpp +++ b/hotspot/src/share/vm/gc/g1/g1StringDedupThread.hpp @@ -43,7 +43,7 @@ private: G1StringDedupThread(); ~G1StringDedupThread(); - void print(outputStream* st, const G1StringDedupStat& last_stat, const G1StringDedupStat& total_stat); + void print(const G1StringDedupStat& last_stat, const G1StringDedupStat& total_stat); public: static void create(); diff --git a/hotspot/src/share/vm/gc/g1/g1_globals.hpp b/hotspot/src/share/vm/gc/g1/g1_globals.hpp index 5d2d9da0a23..086e27bd589 100644 --- a/hotspot/src/share/vm/gc/g1/g1_globals.hpp +++ b/hotspot/src/share/vm/gc/g1/g1_globals.hpp @@ -53,32 +53,14 @@ "Overhead of concurrent marking") \ range(0, 100) \ \ - develop(intx, G1MarkingVerboseLevel, 0, \ - "Level (0-4) of verboseness of the marking code") \ - range(0, 4) \ - \ - develop(bool, G1TraceMarkStackOverflow, false, \ - "If true, extra debugging code for CM restart for ovflw.") \ - \ - diagnostic(bool, G1SummarizeConcMark, false, \ - "Summarize concurrent mark info") \ - \ - diagnostic(bool, G1SummarizeRSetStats, false, \ - "Summarize remembered set processing info") \ - \ diagnostic(intx, G1SummarizeRSetStatsPeriod, 0, \ "The period (in number of GCs) at which we will generate " \ "update buffer processing info " \ "(0 means do not periodically generate this info); " \ - "it also requires -XX:+G1SummarizeRSetStats") \ + "it also requires that logging is enabled on the trace" \ + "level for gc+remset") \ range(0, max_intx) \ \ - diagnostic(bool, G1TraceConcRefinement, false, \ - "Trace G1 concurrent refinement") \ - \ - experimental(bool, G1TraceStringSymbolTableScrubbing, false, \ - "Trace information string and symbol table scrubbing.") \ - \ product(double, G1ConcMarkStepDurationMillis, 10.0, \ "Target duration of individual concurrent marking steps " \ "in milliseconds.") \ @@ -121,10 +103,6 @@ develop(bool, G1RSBarrierRegionFilter, true, \ "If true, generate region filtering code in RS barrier") \ \ - diagnostic(bool, G1PrintRegionLivenessInfo, false, \ - "Prints the liveness information for all regions in the heap " \ - "at the end of a marking cycle.") \ - \ product(size_t, G1UpdateBufferSize, 256, \ "Size of an update buffer") \ range(1, NOT_LP64(32*M) LP64_ONLY(1*G)) \ @@ -205,12 +183,6 @@ develop(bool, G1ScrubRemSets, true, \ "When true, do RS scrubbing after cleanup.") \ \ - develop(bool, G1RSScrubVerbose, false, \ - "When true, do RS scrubbing with verbose output.") \ - \ - develop(bool, G1YoungSurvRateVerbose, false, \ - "print out the survival rate of young regions according to age.") \ - \ develop(intx, G1YoungSurvRateNumRegionsSummary, 0, \ "the number of regions for which we'll print a surv rate " \ "summary.") \ @@ -222,10 +194,6 @@ "to minimize the probability of promotion failure.") \ range(0, 50) \ \ - diagnostic(bool, G1PrintHeapRegions, false, \ - "If set G1 will print information on which regions are being " \ - "allocated and which are reclaimed.") \ - \ develop(bool, G1HRRSUseSparseTable, true, \ "When true, use sparse table to save space.") \ \ @@ -254,9 +222,6 @@ "The number of regions we will add to the secondary free list " \ "at every append operation") \ \ - develop(bool, G1ConcRegionFreeingVerbose, false, \ - "Enables verboseness during concurrent region freeing") \ - \ develop(bool, G1StressConcRegionFreeing, false, \ "It stresses the concurrent region freeing operation") \ \ @@ -310,18 +275,11 @@ "Try to reclaim dead large objects that have a few stale " \ "references at every young GC.") \ \ - experimental(bool, G1TraceEagerReclaimHumongousObjects, false, \ - "Print some information about large object liveness " \ - "at every young GC.") \ - \ experimental(uintx, G1OldCSetRegionThresholdPercent, 10, \ "An upper bound for the number of old CSet regions expressed " \ "as a percentage of the heap size.") \ range(0, 100) \ \ - experimental(ccstr, G1LogLevel, NULL, \ - "Log level for G1 logging: fine, finer, finest") \ - \ notproduct(bool, G1EvacuationFailureALot, false, \ "Force use of evacuation failure handling during certain " \ "evacuation pauses") \ diff --git a/hotspot/src/share/vm/gc/g1/heapRegion.cpp b/hotspot/src/share/vm/gc/g1/heapRegion.cpp index f212b9ddeec..a393f22be9e 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegion.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegion.cpp @@ -34,6 +34,7 @@ #include "gc/shared/genOopClosures.inline.hpp" #include "gc/shared/liveRange.hpp" #include "gc/shared/space.inline.hpp" +#include "logging/log.hpp" #include "memory/iterator.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.inline.hpp" @@ -479,10 +480,8 @@ class VerifyStrongCodeRootOopClosure: public OopClosure { // Object is in the region. Check that its less than top if (_hr->top() <= (HeapWord*)obj) { // Object is above top - gclog_or_tty->print_cr("Object " PTR_FORMAT " in region " - "[" PTR_FORMAT ", " PTR_FORMAT ") is above " - "top " PTR_FORMAT, - p2i(obj), p2i(_hr->bottom()), p2i(_hr->end()), p2i(_hr->top())); + log_info(gc, verify)("Object " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ") is above top " PTR_FORMAT, + p2i(obj), p2i(_hr->bottom()), p2i(_hr->end()), p2i(_hr->top())); _failures = true; return; } @@ -515,23 +514,19 @@ public: if (nm != NULL) { // Verify that the nemthod is live if (!nm->is_alive()) { - gclog_or_tty->print_cr("region [" PTR_FORMAT "," PTR_FORMAT "] has dead nmethod " - PTR_FORMAT " in its strong code roots", - p2i(_hr->bottom()), p2i(_hr->end()), p2i(nm)); + log_info(gc, verify)("region [" PTR_FORMAT "," PTR_FORMAT "] has dead nmethod " PTR_FORMAT " in its strong code roots", + p2i(_hr->bottom()), p2i(_hr->end()), p2i(nm)); _failures = true; } else { VerifyStrongCodeRootOopClosure oop_cl(_hr, nm); nm->oops_do(&oop_cl); if (!oop_cl.has_oops_in_region()) { - gclog_or_tty->print_cr("region [" PTR_FORMAT "," PTR_FORMAT "] has nmethod " - PTR_FORMAT " in its strong code roots " - "with no pointers into region", - p2i(_hr->bottom()), p2i(_hr->end()), p2i(nm)); + log_info(gc, verify)("region [" PTR_FORMAT "," PTR_FORMAT "] has nmethod " PTR_FORMAT " in its strong code roots with no pointers into region", + p2i(_hr->bottom()), p2i(_hr->end()), p2i(nm)); _failures = true; } else if (oop_cl.failures()) { - gclog_or_tty->print_cr("region [" PTR_FORMAT "," PTR_FORMAT "] has other " - "failures for nmethod " PTR_FORMAT, - p2i(_hr->bottom()), p2i(_hr->end()), p2i(nm)); + log_info(gc, verify)("region [" PTR_FORMAT "," PTR_FORMAT "] has other failures for nmethod " PTR_FORMAT, + p2i(_hr->bottom()), p2i(_hr->end()), p2i(nm)); _failures = true; } } @@ -564,9 +559,8 @@ void HeapRegion::verify_strong_code_roots(VerifyOption vo, bool* failures) const // on its strong code root list if (is_empty()) { if (strong_code_roots_length > 0) { - gclog_or_tty->print_cr("region [" PTR_FORMAT "," PTR_FORMAT "] is empty " - "but has " SIZE_FORMAT " code root entries", - p2i(bottom()), p2i(end()), strong_code_roots_length); + log_info(gc, verify)("region [" PTR_FORMAT "," PTR_FORMAT "] is empty but has " SIZE_FORMAT " code root entries", + p2i(bottom()), p2i(end()), strong_code_roots_length); *failures = true; } return; @@ -574,9 +568,8 @@ void HeapRegion::verify_strong_code_roots(VerifyOption vo, bool* failures) const if (is_continues_humongous()) { if (strong_code_roots_length > 0) { - gclog_or_tty->print_cr("region " HR_FORMAT " is a continuation of a humongous " - "region but has " SIZE_FORMAT " code root entries", - HR_FORMAT_PARAMS(this), strong_code_roots_length); + log_info(gc, verify)("region " HR_FORMAT " is a continuation of a humongous region but has " SIZE_FORMAT " code root entries", + HR_FORMAT_PARAMS(this), strong_code_roots_length); *failures = true; } return; @@ -590,7 +583,7 @@ void HeapRegion::verify_strong_code_roots(VerifyOption vo, bool* failures) const } } -void HeapRegion::print() const { print_on(gclog_or_tty); } +void HeapRegion::print() const { print_on(tty); } void HeapRegion::print_on(outputStream* st) const { st->print("|%4u", this->_hrm_index); st->print("|" PTR_FORMAT ", " PTR_FORMAT ", " PTR_FORMAT, @@ -651,6 +644,7 @@ public: assert(!_g1h->is_obj_dead_cond(_containing_obj, _vo), "Precondition"); T heap_oop = oopDesc::load_heap_oop(p); + LogHandle(gc, verify) log; if (!oopDesc::is_null(heap_oop)) { oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); bool failed = false; @@ -659,35 +653,26 @@ public: Mutex::_no_safepoint_check_flag); if (!_failures) { - gclog_or_tty->cr(); - gclog_or_tty->print_cr("----------"); + log.info("----------"); } + ResourceMark rm; if (!_g1h->is_in_closed_subset(obj)) { HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p); - gclog_or_tty->print_cr("Field " PTR_FORMAT - " of live obj " PTR_FORMAT " in region " - "[" PTR_FORMAT ", " PTR_FORMAT ")", - p2i(p), p2i(_containing_obj), - p2i(from->bottom()), p2i(from->end())); - print_object(gclog_or_tty, _containing_obj); - gclog_or_tty->print_cr("points to obj " PTR_FORMAT " not in the heap", - p2i(obj)); + log.info("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")", + p2i(p), p2i(_containing_obj), p2i(from->bottom()), p2i(from->end())); + print_object(log.info_stream(), _containing_obj); + log.info("points to obj " PTR_FORMAT " not in the heap", p2i(obj)); } else { HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p); HeapRegion* to = _g1h->heap_region_containing((HeapWord*)obj); - gclog_or_tty->print_cr("Field " PTR_FORMAT - " of live obj " PTR_FORMAT " in region " - "[" PTR_FORMAT ", " PTR_FORMAT ")", - p2i(p), p2i(_containing_obj), - p2i(from->bottom()), p2i(from->end())); - print_object(gclog_or_tty, _containing_obj); - gclog_or_tty->print_cr("points to dead obj " PTR_FORMAT " in region " - "[" PTR_FORMAT ", " PTR_FORMAT ")", - p2i(obj), p2i(to->bottom()), p2i(to->end())); - print_object(gclog_or_tty, obj); + log.info("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")", + p2i(p), p2i(_containing_obj), p2i(from->bottom()), p2i(from->end())); + print_object(log.info_stream(), _containing_obj); + log.info("points to dead obj " PTR_FORMAT " in region [" PTR_FORMAT ", " PTR_FORMAT ")", + p2i(obj), p2i(to->bottom()), p2i(to->end())); + print_object(log.info_stream(), obj); } - gclog_or_tty->print_cr("----------"); - gclog_or_tty->flush(); + log.info("----------"); _failures = true; failed = true; _n_failures++; @@ -714,25 +699,17 @@ public: Mutex::_no_safepoint_check_flag); if (!_failures) { - gclog_or_tty->cr(); - gclog_or_tty->print_cr("----------"); + log.info("----------"); } - gclog_or_tty->print_cr("Missing rem set entry:"); - gclog_or_tty->print_cr("Field " PTR_FORMAT " " - "of obj " PTR_FORMAT ", " - "in region " HR_FORMAT, - p2i(p), p2i(_containing_obj), - HR_FORMAT_PARAMS(from)); - _containing_obj->print_on(gclog_or_tty); - gclog_or_tty->print_cr("points to obj " PTR_FORMAT " " - "in region " HR_FORMAT, - p2i(obj), - HR_FORMAT_PARAMS(to)); - obj->print_on(gclog_or_tty); - gclog_or_tty->print_cr("Obj head CTE = %d, field CTE = %d.", - cv_obj, cv_field); - gclog_or_tty->print_cr("----------"); - gclog_or_tty->flush(); + log.info("Missing rem set entry:"); + log.info("Field " PTR_FORMAT " of obj " PTR_FORMAT ", in region " HR_FORMAT, + p2i(p), p2i(_containing_obj), HR_FORMAT_PARAMS(from)); + ResourceMark rm; + _containing_obj->print_on(log.info_stream()); + log.info("points to obj " PTR_FORMAT " in region " HR_FORMAT, p2i(obj), HR_FORMAT_PARAMS(to)); + obj->print_on(log.info_stream()); + log.info("Obj head CTE = %d, field CTE = %d.", cv_obj, cv_field); + log.info("----------"); _failures = true; if (!failed) _n_failures++; } @@ -766,13 +743,13 @@ void HeapRegion::verify(VerifyOption vo, (vo == VerifyOption_G1UsePrevMarking && ClassLoaderDataGraph::unload_list_contains(klass)); if (!is_metaspace_object) { - gclog_or_tty->print_cr("klass " PTR_FORMAT " of object " PTR_FORMAT " " - "not metadata", p2i(klass), p2i(obj)); + log_info(gc, verify)("klass " PTR_FORMAT " of object " PTR_FORMAT " " + "not metadata", p2i(klass), p2i(obj)); *failures = true; return; } else if (!klass->is_klass()) { - gclog_or_tty->print_cr("klass " PTR_FORMAT " of object " PTR_FORMAT " " - "not a klass", p2i(klass), p2i(obj)); + log_info(gc, verify)("klass " PTR_FORMAT " of object " PTR_FORMAT " " + "not a klass", p2i(klass), p2i(obj)); *failures = true; return; } else { @@ -787,7 +764,7 @@ void HeapRegion::verify(VerifyOption vo, } } } else { - gclog_or_tty->print_cr(PTR_FORMAT " no an oop", p2i(obj)); + log_info(gc, verify)(PTR_FORMAT " no an oop", p2i(obj)); *failures = true; return; } @@ -803,13 +780,13 @@ void HeapRegion::verify(VerifyOption vo, if (is_region_humongous) { oop obj = oop(this->humongous_start_region()->bottom()); if ((HeapWord*)obj > bottom() || (HeapWord*)obj + obj->size() < bottom()) { - gclog_or_tty->print_cr("this humongous region is not part of its' humongous object " PTR_FORMAT, p2i(obj)); + log_info(gc, verify)("this humongous region is not part of its' humongous object " PTR_FORMAT, p2i(obj)); } } if (!is_region_humongous && p != top()) { - gclog_or_tty->print_cr("end of last object " PTR_FORMAT " " - "does not match top " PTR_FORMAT, p2i(p), p2i(top())); + log_info(gc, verify)("end of last object " PTR_FORMAT " " + "does not match top " PTR_FORMAT, p2i(p), p2i(top())); *failures = true; return; } @@ -823,9 +800,9 @@ void HeapRegion::verify(VerifyOption vo, HeapWord* addr_1 = p; HeapWord* b_start_1 = _offsets.block_start_const(addr_1); if (b_start_1 != p) { - gclog_or_tty->print_cr("BOT look up for top: " PTR_FORMAT " " - " yielded " PTR_FORMAT ", expecting " PTR_FORMAT, - p2i(addr_1), p2i(b_start_1), p2i(p)); + log_info(gc, verify)("BOT look up for top: " PTR_FORMAT " " + " yielded " PTR_FORMAT ", expecting " PTR_FORMAT, + p2i(addr_1), p2i(b_start_1), p2i(p)); *failures = true; return; } @@ -835,9 +812,9 @@ void HeapRegion::verify(VerifyOption vo, if (addr_2 < the_end) { HeapWord* b_start_2 = _offsets.block_start_const(addr_2); if (b_start_2 != p) { - gclog_or_tty->print_cr("BOT look up for top + 1: " PTR_FORMAT " " - " yielded " PTR_FORMAT ", expecting " PTR_FORMAT, - p2i(addr_2), p2i(b_start_2), p2i(p)); + log_info(gc, verify)("BOT look up for top + 1: " PTR_FORMAT " " + " yielded " PTR_FORMAT ", expecting " PTR_FORMAT, + p2i(addr_2), p2i(b_start_2), p2i(p)); *failures = true; return; } @@ -849,9 +826,9 @@ void HeapRegion::verify(VerifyOption vo, if (addr_3 < the_end) { HeapWord* b_start_3 = _offsets.block_start_const(addr_3); if (b_start_3 != p) { - gclog_or_tty->print_cr("BOT look up for top + diff: " PTR_FORMAT " " - " yielded " PTR_FORMAT ", expecting " PTR_FORMAT, - p2i(addr_3), p2i(b_start_3), p2i(p)); + log_info(gc, verify)("BOT look up for top + diff: " PTR_FORMAT " " + " yielded " PTR_FORMAT ", expecting " PTR_FORMAT, + p2i(addr_3), p2i(b_start_3), p2i(p)); *failures = true; return; } @@ -861,9 +838,9 @@ void HeapRegion::verify(VerifyOption vo, HeapWord* addr_4 = the_end - 1; HeapWord* b_start_4 = _offsets.block_start_const(addr_4); if (b_start_4 != p) { - gclog_or_tty->print_cr("BOT look up for end - 1: " PTR_FORMAT " " - " yielded " PTR_FORMAT ", expecting " PTR_FORMAT, - p2i(addr_4), p2i(b_start_4), p2i(p)); + log_info(gc, verify)("BOT look up for end - 1: " PTR_FORMAT " " + " yielded " PTR_FORMAT ", expecting " PTR_FORMAT, + p2i(addr_4), p2i(b_start_4), p2i(p)); *failures = true; return; } @@ -914,7 +891,7 @@ void G1OffsetTableContigSpace::mangle_unused_area_complete() { void G1OffsetTableContigSpace::print() const { print_short(); - gclog_or_tty->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " + tty->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")", p2i(bottom()), p2i(top()), p2i(_offsets.threshold()), p2i(end())); } diff --git a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp index c732e2a5614..74aaaf569f0 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp @@ -560,20 +560,13 @@ PerRegionTable* OtherRegionsTable::delete_region_table() { void OtherRegionsTable::scrub(CardTableModRefBS* ctbs, BitMap* region_bm, BitMap* card_bm) { // First eliminated garbage regions from the coarse map. - if (G1RSScrubVerbose) { - gclog_or_tty->print_cr("Scrubbing region %u:", _hr->hrm_index()); - } + log_develop_trace(gc, remset, scrub)("Scrubbing region %u:", _hr->hrm_index()); assert(_coarse_map.size() == region_bm->size(), "Precondition"); - if (G1RSScrubVerbose) { - gclog_or_tty->print(" Coarse map: before = " SIZE_FORMAT "...", - _n_coarse_entries); - } + log_develop_trace(gc, remset, scrub)(" Coarse map: before = " SIZE_FORMAT "...", _n_coarse_entries); _coarse_map.set_intersection(*region_bm); _n_coarse_entries = _coarse_map.count_one_bits(); - if (G1RSScrubVerbose) { - gclog_or_tty->print_cr(" after = " SIZE_FORMAT ".", _n_coarse_entries); - } + log_develop_trace(gc, remset, scrub)(" after = " SIZE_FORMAT ".", _n_coarse_entries); // Now do the fine-grained maps. for (size_t i = 0; i < _max_fine_entries; i++) { @@ -582,28 +575,19 @@ void OtherRegionsTable::scrub(CardTableModRefBS* ctbs, while (cur != NULL) { PerRegionTable* nxt = cur->collision_list_next(); // If the entire region is dead, eliminate. - if (G1RSScrubVerbose) { - gclog_or_tty->print_cr(" For other region %u:", - cur->hr()->hrm_index()); - } + log_develop_trace(gc, remset, scrub)(" For other region %u:", cur->hr()->hrm_index()); if (!region_bm->at((size_t) cur->hr()->hrm_index())) { *prev = nxt; cur->set_collision_list_next(NULL); _n_fine_entries--; - if (G1RSScrubVerbose) { - gclog_or_tty->print_cr(" deleted via region map."); - } + log_develop_trace(gc, remset, scrub)(" deleted via region map."); unlink_from_all(cur); PerRegionTable::free(cur); } else { // Do fine-grain elimination. - if (G1RSScrubVerbose) { - gclog_or_tty->print(" occ: before = %4d.", cur->occupied()); - } + log_develop_trace(gc, remset, scrub)(" occ: before = %4d.", cur->occupied()); cur->scrub(ctbs, card_bm); - if (G1RSScrubVerbose) { - gclog_or_tty->print_cr(" after = %4d.", cur->occupied()); - } + log_develop_trace(gc, remset, scrub)(" after = %4d.", cur->occupied()); // Did that empty the table completely? if (cur->occupied() == 0) { *prev = nxt; @@ -799,15 +783,15 @@ void HeapRegionRemSet::print() { while (iter.has_next(card_index)) { HeapWord* card_start = G1CollectedHeap::heap()->bot_shared()->address_for_index(card_index); - gclog_or_tty->print_cr(" Card " PTR_FORMAT, p2i(card_start)); + tty->print_cr(" Card " PTR_FORMAT, p2i(card_start)); } if (iter.n_yielded() != occupied()) { - gclog_or_tty->print_cr("Yielded disagrees with occupied:"); - gclog_or_tty->print_cr(" " SIZE_FORMAT_W(6) " yielded (" SIZE_FORMAT_W(6) + tty->print_cr("Yielded disagrees with occupied:"); + tty->print_cr(" " SIZE_FORMAT_W(6) " yielded (" SIZE_FORMAT_W(6) " coarse, " SIZE_FORMAT_W(6) " fine).", iter.n_yielded(), iter.n_yielded_coarse(), iter.n_yielded_fine()); - gclog_or_tty->print_cr(" " SIZE_FORMAT_W(6) " occ (" SIZE_FORMAT_W(6) + tty->print_cr(" " SIZE_FORMAT_W(6) " occ (" SIZE_FORMAT_W(6) " coarse, " SIZE_FORMAT_W(6) " fine).", occupied(), occ_coarse(), occ_fine()); } @@ -1071,7 +1055,7 @@ void HeapRegionRemSet::test() { while (iter.has_next(card_index)) { HeapWord* card_start = G1CollectedHeap::heap()->bot_shared()->address_for_index(card_index); - gclog_or_tty->print_cr(" Card " PTR_FORMAT ".", p2i(card_start)); + tty->print_cr(" Card " PTR_FORMAT ".", p2i(card_start)); sum++; } guarantee(sum == 11 - 3 + 2048, "Failure"); diff --git a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp index 324f2a8cef8..02f346313ae 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp @@ -86,7 +86,7 @@ class FromCardCache : public AllStatic { static void invalidate(uint start_idx, size_t num_regions); - static void print(outputStream* out = gclog_or_tty) PRODUCT_RETURN; + static void print(outputStream* out = tty) PRODUCT_RETURN; static size_t static_mem_size() { return _static_mem_size; diff --git a/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp b/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp index fc18e92c9cb..e0dc38be982 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp @@ -261,24 +261,6 @@ void FreeRegionList::clear() { _last = NULL; } -void FreeRegionList::print_on(outputStream* out, bool print_contents) { - HeapRegionSetBase::print_on(out, print_contents); - out->print_cr(" Linking"); - out->print_cr(" head : " PTR_FORMAT, p2i(_head)); - out->print_cr(" tail : " PTR_FORMAT, p2i(_tail)); - - if (print_contents) { - out->print_cr(" Contents"); - FreeRegionListIterator iter(this); - while (iter.more_available()) { - HeapRegion* hr = iter.get_next(); - hr->print_on(out); - } - } - - out->cr(); -} - void FreeRegionList::verify_list() { HeapRegion* curr = _head; HeapRegion* prev1 = NULL; diff --git a/hotspot/src/share/vm/gc/g1/heapRegionSet.hpp b/hotspot/src/share/vm/gc/g1/heapRegionSet.hpp index c291a119e2a..1fb4c53330f 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionSet.hpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionSet.hpp @@ -250,8 +250,6 @@ public: void remove_starting_at(HeapRegion* first, uint num_regions); virtual void verify(); - - virtual void print_on(outputStream* out, bool print_contents = false); }; // Iterator class that provides a convenient way to iterate over the diff --git a/hotspot/src/share/vm/gc/g1/satbMarkQueue.cpp b/hotspot/src/share/vm/gc/g1/satbMarkQueue.cpp index c10dcff1301..900e45ebf25 100644 --- a/hotspot/src/share/vm/gc/g1/satbMarkQueue.cpp +++ b/hotspot/src/share/vm/gc/g1/satbMarkQueue.cpp @@ -199,9 +199,8 @@ void SATBMarkQueue::print(const char* name) { void SATBMarkQueue::print(const char* name, void** buf, size_t index, size_t sz) { - gclog_or_tty->print_cr(" SATB BUFFER [%s] buf: " PTR_FORMAT " " - "index: " SIZE_FORMAT " sz: " SIZE_FORMAT, - name, p2i(buf), index, sz); + tty->print_cr(" SATB BUFFER [%s] buf: " PTR_FORMAT " index: " SIZE_FORMAT " sz: " SIZE_FORMAT, + name, p2i(buf), index, sz); } #endif // PRODUCT @@ -222,16 +221,13 @@ void SATBMarkQueueSet::handle_zero_index_for_thread(JavaThread* t) { #ifdef ASSERT void SATBMarkQueueSet::dump_active_states(bool expected_active) { - gclog_or_tty->print_cr("Expected SATB active state: %s", - expected_active ? "ACTIVE" : "INACTIVE"); - gclog_or_tty->print_cr("Actual SATB active states:"); - gclog_or_tty->print_cr(" Queue set: %s", is_active() ? "ACTIVE" : "INACTIVE"); + log_info(gc, verify)("Expected SATB active state: %s", expected_active ? "ACTIVE" : "INACTIVE"); + log_info(gc, verify)("Actual SATB active states:"); + log_info(gc, verify)(" Queue set: %s", is_active() ? "ACTIVE" : "INACTIVE"); for (JavaThread* t = Threads::first(); t; t = t->next()) { - gclog_or_tty->print_cr(" Thread \"%s\" queue: %s", t->name(), - t->satb_mark_queue().is_active() ? "ACTIVE" : "INACTIVE"); + log_info(gc, verify)(" Thread \"%s\" queue: %s", t->name(), t->satb_mark_queue().is_active() ? "ACTIVE" : "INACTIVE"); } - gclog_or_tty->print_cr(" Shared queue: %s", - shared_satb_queue()->is_active() ? "ACTIVE" : "INACTIVE"); + log_info(gc, verify)(" Shared queue: %s", shared_satb_queue()->is_active() ? "ACTIVE" : "INACTIVE"); } void SATBMarkQueueSet::verify_active_states(bool expected_active) { @@ -318,8 +314,8 @@ void SATBMarkQueueSet::print_all(const char* msg) { char buffer[SATB_PRINTER_BUFFER_SIZE]; assert(SafepointSynchronize::is_at_safepoint(), "Must be at safepoint."); - gclog_or_tty->cr(); - gclog_or_tty->print_cr("SATB BUFFERS [%s]", msg); + tty->cr(); + tty->print_cr("SATB BUFFERS [%s]", msg); BufferNode* nd = _completed_buffers_head; int i = 0; @@ -338,7 +334,7 @@ void SATBMarkQueueSet::print_all(const char* msg) { shared_satb_queue()->print("Shared"); - gclog_or_tty->cr(); + tty->cr(); } #endif // PRODUCT diff --git a/hotspot/src/share/vm/gc/g1/survRateGroup.cpp b/hotspot/src/share/vm/gc/g1/survRateGroup.cpp index 653efa7148d..e201d259491 100644 --- a/hotspot/src/share/vm/gc/g1/survRateGroup.cpp +++ b/hotspot/src/share/vm/gc/g1/survRateGroup.cpp @@ -27,6 +27,7 @@ #include "gc/g1/g1Predictions.hpp" #include "gc/g1/heapRegion.hpp" #include "gc/g1/survRateGroup.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" SurvRateGroup::SurvRateGroup(G1Predictions* predictor, @@ -163,12 +164,11 @@ void SurvRateGroup::all_surviving_words_recorded(bool update_predictors) { #ifndef PRODUCT void SurvRateGroup::print() { - gclog_or_tty->print_cr("Surv Rate Group: %s (" SIZE_FORMAT " entries)", - _name, _region_num); + log_develop_trace(gc, survivor)("Surv Rate Group: %s (" SIZE_FORMAT " entries)", _name, _region_num); for (size_t i = 0; i < _region_num; ++i) { - gclog_or_tty->print_cr(" age " SIZE_FORMAT_W(4) " surv rate %6.2lf %% pred %6.2lf %%", - i, _surv_rate[i] * 100.0, - _predictor->get_new_prediction(_surv_rate_pred[i]) * 100.0); + log_develop_trace(gc, survivor)(" age " SIZE_FORMAT_W(4) " surv rate %6.2lf %% pred %6.2lf %%", + i, _surv_rate[i] * 100.0, + _predictor->get_new_prediction(_surv_rate_pred[i]) * 100.0); } } @@ -178,22 +178,20 @@ SurvRateGroup::print_surv_rate_summary() { if (length == 0) return; - gclog_or_tty->cr(); - gclog_or_tty->print_cr("%s Rate Summary (for up to age " SIZE_FORMAT ")", _name, length-1); - gclog_or_tty->print_cr(" age range survival rate (avg) samples (avg)"); - gclog_or_tty->print_cr(" ---------------------------------------------------------"); + log_trace(gc, survivor)("%s Rate Summary (for up to age " SIZE_FORMAT ")", _name, length-1); + log_trace(gc, survivor)(" age range survival rate (avg) samples (avg)"); + log_trace(gc, survivor)(" ---------------------------------------------------------"); size_t index = 0; size_t limit = MIN2((int) length, 10); while (index < limit) { - gclog_or_tty->print_cr(" " SIZE_FORMAT_W(4) - " %6.2lf%% %6.2lf", - index, _summary_surv_rates[index]->avg() * 100.0, - (double) _summary_surv_rates[index]->num()); + log_trace(gc, survivor)(" " SIZE_FORMAT_W(4) " %6.2lf%% %6.2lf", + index, _summary_surv_rates[index]->avg() * 100.0, + (double) _summary_surv_rates[index]->num()); ++index; } - gclog_or_tty->print_cr(" ---------------------------------------------------------"); + log_trace(gc, survivor)(" ---------------------------------------------------------"); int num = 0; double sum = 0.0; @@ -205,16 +203,15 @@ SurvRateGroup::print_surv_rate_summary() { ++index; if (index == length || num % 10 == 0) { - gclog_or_tty->print_cr(" " SIZE_FORMAT_W(4) " .. " SIZE_FORMAT_W(4) - " %6.2lf%% %6.2lf", - (index-1) / 10 * 10, index-1, sum / (double) num, - (double) samples / (double) num); + log_trace(gc, survivor)(" " SIZE_FORMAT_W(4) " .. " SIZE_FORMAT_W(4) " %6.2lf%% %6.2lf", + (index-1) / 10 * 10, index-1, sum / (double) num, + (double) samples / (double) num); sum = 0.0; num = 0; samples = 0; } } - gclog_or_tty->print_cr(" ---------------------------------------------------------"); + log_trace(gc, survivor)(" ---------------------------------------------------------"); } #endif // PRODUCT diff --git a/hotspot/src/share/vm/gc/g1/vm_operations_g1.cpp b/hotspot/src/share/vm/gc/g1/vm_operations_g1.cpp index 0040a4f1422..8d7300854de 100644 --- a/hotspot/src/share/vm/gc/g1/vm_operations_g1.cpp +++ b/hotspot/src/share/vm/gc/g1/vm_operations_g1.cpp @@ -27,10 +27,9 @@ #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectorPolicy.hpp" #include "gc/shared/gcId.hpp" -#include "gc/g1/g1Log.hpp" #include "gc/g1/vm_operations_g1.hpp" #include "gc/shared/gcTimer.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/isGCActiveMark.hpp" #include "runtime/interfaceSupport.hpp" @@ -226,10 +225,10 @@ void VM_CGC_Operation::release_and_notify_pending_list_lock() { } void VM_CGC_Operation::doit() { - TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty); - G1CollectedHeap* g1h = G1CollectedHeap::heap(); GCIdMark gc_id_mark(_gc_id); - GCTraceTime t(_printGCMessage, G1Log::fine(), true, g1h->gc_timer_cm()); + GCTraceCPUTime tcpu; + G1CollectedHeap* g1h = G1CollectedHeap::heap(); + GCTraceTime(Info, gc) t(_printGCMessage, g1h->gc_timer_cm(), GCCause::_no_gc, true); IsGCActiveMark x; _cl->do_void(); } diff --git a/hotspot/src/share/vm/gc/g1/workerDataArray.cpp b/hotspot/src/share/vm/gc/g1/workerDataArray.cpp index 420fc9c6ef8..0e3305d5c2a 100644 --- a/hotspot/src/share/vm/gc/g1/workerDataArray.cpp +++ b/hotspot/src/share/vm/gc/g1/workerDataArray.cpp @@ -30,13 +30,11 @@ void WorkerDataArray_test() { const uint length = 3; const char* title = "Test array"; const bool print_sum = false; - const int log_level = 3; const uint indent_level = 2; - WorkerDataArray array(length, title, print_sum, log_level, indent_level); + WorkerDataArray array(length, title, print_sum, indent_level); assert(strncmp(array.title(), title, strlen(title)) == 0 , "Expected titles to match"); assert(array.should_print_sum() == print_sum, "Expected should_print_sum to match print_sum"); - assert(array.log_level() == log_level, "Expected log levels to match"); assert(array.indentation() == indent_level, "Expected indentation to match"); const size_t expected[length] = {5, 3, 7}; diff --git a/hotspot/src/share/vm/gc/g1/workerDataArray.hpp b/hotspot/src/share/vm/gc/g1/workerDataArray.hpp index c96c4f9e65d..09f0b61a5f7 100644 --- a/hotspot/src/share/vm/gc/g1/workerDataArray.hpp +++ b/hotspot/src/share/vm/gc/g1/workerDataArray.hpp @@ -32,7 +32,6 @@ class WorkerDataArray : public CHeapObj { uint _length; const char* _title; bool _print_sum; - int _log_level; uint _indent_level; bool _enabled; @@ -46,7 +45,6 @@ class WorkerDataArray : public CHeapObj { WorkerDataArray(uint length, const char* title, bool print_sum, - int log_level, uint indent_level); ~WorkerDataArray(); @@ -80,10 +78,6 @@ class WorkerDataArray : public CHeapObj { return _print_sum; } - int log_level() const { - return _log_level; - } - void clear(); void set_enabled(bool enabled) { _enabled = enabled; diff --git a/hotspot/src/share/vm/gc/g1/workerDataArray.inline.hpp b/hotspot/src/share/vm/gc/g1/workerDataArray.inline.hpp index a228dc2309f..713eb125cff 100644 --- a/hotspot/src/share/vm/gc/g1/workerDataArray.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/workerDataArray.inline.hpp @@ -29,12 +29,10 @@ template WorkerDataArray::WorkerDataArray(uint length, const char* title, bool print_sum, - int log_level, uint indent_level) : _title(title), _length(0), _print_sum(print_sum), - _log_level(log_level), _indent_level(indent_level), _thread_work_items(NULL), _enabled(true) { diff --git a/hotspot/src/share/vm/gc/g1/youngList.cpp b/hotspot/src/share/vm/gc/g1/youngList.cpp index 4224541a72d..f975f1142be 100644 --- a/hotspot/src/share/vm/gc/g1/youngList.cpp +++ b/hotspot/src/share/vm/gc/g1/youngList.cpp @@ -29,6 +29,7 @@ #include "gc/g1/heapRegion.inline.hpp" #include "gc/g1/heapRegionRemSet.hpp" #include "gc/g1/youngList.hpp" +#include "logging/log.hpp" #include "utilities/ostream.hpp" YoungList::YoungList(G1CollectedHeap* g1h) : @@ -98,10 +99,10 @@ bool YoungList::check_list_well_formed() { HeapRegion* last = NULL; while (curr != NULL) { if (!curr->is_young()) { - gclog_or_tty->print_cr("### YOUNG REGION " PTR_FORMAT "-" PTR_FORMAT " " - "incorrectly tagged (y: %d, surv: %d)", - p2i(curr->bottom()), p2i(curr->end()), - curr->is_young(), curr->is_survivor()); + log_info(gc, verify)("### YOUNG REGION " PTR_FORMAT "-" PTR_FORMAT " " + "incorrectly tagged (y: %d, surv: %d)", + p2i(curr->bottom()), p2i(curr->end()), + curr->is_young(), curr->is_survivor()); ret = false; } ++length; @@ -111,9 +112,8 @@ bool YoungList::check_list_well_formed() { ret = ret && (length == _length); if (!ret) { - gclog_or_tty->print_cr("### YOUNG LIST seems not well formed!"); - gclog_or_tty->print_cr("### list has %u entries, _length is %u", - length, _length); + log_info(gc, verify)("### YOUNG LIST seems not well formed!"); + log_info(gc, verify)("### list has %u entries, _length is %u", length, _length); } return ret; @@ -123,20 +123,19 @@ bool YoungList::check_list_empty(bool check_sample) { bool ret = true; if (_length != 0) { - gclog_or_tty->print_cr("### YOUNG LIST should have 0 length, not %u", - _length); + log_info(gc, verify)("### YOUNG LIST should have 0 length, not %u", _length); ret = false; } if (check_sample && _last_sampled_rs_lengths != 0) { - gclog_or_tty->print_cr("### YOUNG LIST has non-zero last sampled RS lengths"); + log_info(gc, verify)("### YOUNG LIST has non-zero last sampled RS lengths"); ret = false; } if (_head != NULL) { - gclog_or_tty->print_cr("### YOUNG LIST does not have a NULL head"); + log_info(gc, verify)("### YOUNG LIST does not have a NULL head"); ret = false; } if (!ret) { - gclog_or_tty->print_cr("### YOUNG LIST does not seem empty"); + log_info(gc, verify)("### YOUNG LIST does not seem empty"); } return ret; @@ -171,7 +170,6 @@ YoungList::rs_length_sampling_next() { _curr = _curr->get_next_young_region(); if (_curr == NULL) { _last_sampled_rs_lengths = _sampled_rs_lengths; - // gclog_or_tty->print_cr("last sampled RS lengths = %d", _last_sampled_rs_lengths); } } @@ -222,13 +220,13 @@ void YoungList::print() { const char* names[] = {"YOUNG", "SURVIVOR"}; for (uint list = 0; list < ARRAY_SIZE(lists); ++list) { - gclog_or_tty->print_cr("%s LIST CONTENTS", names[list]); + tty->print_cr("%s LIST CONTENTS", names[list]); HeapRegion *curr = lists[list]; if (curr == NULL) { - gclog_or_tty->print_cr(" empty"); + tty->print_cr(" empty"); } while (curr != NULL) { - gclog_or_tty->print_cr(" " HR_FORMAT ", P: " PTR_FORMAT ", N: " PTR_FORMAT ", age: %4d", + tty->print_cr(" " HR_FORMAT ", P: " PTR_FORMAT ", N: " PTR_FORMAT ", age: %4d", HR_FORMAT_PARAMS(curr), p2i(curr->prev_top_at_mark_start()), p2i(curr->next_top_at_mark_start()), @@ -237,5 +235,5 @@ void YoungList::print() { } } - gclog_or_tty->cr(); + tty->cr(); } diff --git a/hotspot/src/share/vm/gc/parallel/adjoiningGenerations.cpp b/hotspot/src/share/vm/gc/parallel/adjoiningGenerations.cpp index 9f9361afcad..f5c591775ba 100644 --- a/hotspot/src/share/vm/gc/parallel/adjoiningGenerations.cpp +++ b/hotspot/src/share/vm/gc/parallel/adjoiningGenerations.cpp @@ -27,6 +27,9 @@ #include "gc/parallel/adjoiningVirtualSpaces.hpp" #include "gc/parallel/generationSizer.hpp" #include "gc/parallel/parallelScavengeHeap.hpp" +#include "logging/log.hpp" +#include "memory/resourceArea.hpp" +#include "utilities/ostream.hpp" // If boundary moving is being used, create the young gen and old // gen with ASPSYoungGen and ASPSOldGen, respectively. Revert to @@ -116,6 +119,29 @@ size_t AdjoiningGenerations::reserved_byte_size() { return virtual_spaces()->reserved_space().size(); } +void log_before_expansion(bool old, size_t expand_in_bytes, size_t change_in_bytes, size_t max_size) { + LogHandle(heap, ergo) log; + if (!log.is_debug()) { + return; + } + log.debug("Before expansion of %s gen with boundary move", old ? "old" : "young"); + log.debug(" Requested change: " SIZE_FORMAT_HEX " Attempted change: " SIZE_FORMAT_HEX, + expand_in_bytes, change_in_bytes); + ResourceMark rm; + ParallelScavengeHeap::heap()->print_on(log.debug_stream()); + log.debug(" PS%sGen max size: " SIZE_FORMAT "K", old ? "Old" : "Young", max_size/K); +} + +void log_after_expansion(bool old, size_t max_size) { + LogHandle(heap, ergo) log; + if (!log.is_debug()) { + return; + } + log.debug("After expansion of %s gen with boundary move", old ? "old" : "young"); + ResourceMark rm; + ParallelScavengeHeap::heap()->print_on(log.debug_stream()); + log.debug(" PS%sGen max size: " SIZE_FORMAT "K", old ? "Old" : "Young", max_size/K); +} // Make checks on the current sizes of the generations and // the constraints on the sizes of the generations. Push @@ -141,17 +167,7 @@ void AdjoiningGenerations::request_old_gen_expansion(size_t expand_in_bytes) { return; } - if (TraceAdaptiveGCBoundary) { - gclog_or_tty->print_cr("Before expansion of old gen with boundary move"); - gclog_or_tty->print_cr(" Requested change: " SIZE_FORMAT_HEX - " Attempted change: " SIZE_FORMAT_HEX, - expand_in_bytes, change_in_bytes); - if (!PrintHeapAtGC) { - Universe::print_on(gclog_or_tty); - } - gclog_or_tty->print_cr(" PSOldGen max size: " SIZE_FORMAT "K", - old_gen()->max_gen_size()/K); - } + log_before_expansion(true, expand_in_bytes, change_in_bytes, old_gen()->max_gen_size()); // Move the boundary between the generations up (smaller young gen). if (virtual_spaces()->adjust_boundary_up(change_in_bytes)) { @@ -167,14 +183,7 @@ void AdjoiningGenerations::request_old_gen_expansion(size_t expand_in_bytes) { young_gen()->space_invariants(); old_gen()->space_invariants(); - if (TraceAdaptiveGCBoundary) { - gclog_or_tty->print_cr("After expansion of old gen with boundary move"); - if (!PrintHeapAtGC) { - Universe::print_on(gclog_or_tty); - } - gclog_or_tty->print_cr(" PSOldGen max size: " SIZE_FORMAT "K", - old_gen()->max_gen_size()/K); - } + log_after_expansion(true, old_gen()->max_gen_size()); } // See comments on request_old_gen_expansion() @@ -200,16 +209,7 @@ bool AdjoiningGenerations::request_young_gen_expansion(size_t expand_in_bytes) { return false; } - if (TraceAdaptiveGCBoundary) { - gclog_or_tty->print_cr("Before expansion of young gen with boundary move"); - gclog_or_tty->print_cr(" Requested change: " SIZE_FORMAT_HEX " Attempted change: " SIZE_FORMAT_HEX, - expand_in_bytes, change_in_bytes); - if (!PrintHeapAtGC) { - Universe::print_on(gclog_or_tty); - } - gclog_or_tty->print_cr(" PSYoungGen max size: " SIZE_FORMAT "K", - young_gen()->max_size()/K); - } + log_before_expansion(false, expand_in_bytes, change_in_bytes, young_gen()->max_size()); // Move the boundary between the generations down (smaller old gen). MutexLocker x(ExpandHeap_lock); @@ -227,14 +227,7 @@ bool AdjoiningGenerations::request_young_gen_expansion(size_t expand_in_bytes) { young_gen()->space_invariants(); old_gen()->space_invariants(); - if (TraceAdaptiveGCBoundary) { - gclog_or_tty->print_cr("After expansion of young gen with boundary move"); - if (!PrintHeapAtGC) { - Universe::print_on(gclog_or_tty); - } - gclog_or_tty->print_cr(" PSYoungGen max size: " SIZE_FORMAT "K", - young_gen()->max_size()/K); - } + log_after_expansion(false, young_gen()->max_size()); return result; } diff --git a/hotspot/src/share/vm/gc/parallel/asPSOldGen.cpp b/hotspot/src/share/vm/gc/parallel/asPSOldGen.cpp index fa5837bcbf6..3adbe0c24ad 100644 --- a/hotspot/src/share/vm/gc/parallel/asPSOldGen.cpp +++ b/hotspot/src/share/vm/gc/parallel/asPSOldGen.cpp @@ -125,25 +125,21 @@ size_t ASPSOldGen::available_for_contraction() { size_t result = policy->promo_increment_aligned_down(max_contraction); // Also adjust for inter-generational alignment size_t result_aligned = align_size_down(result, gen_alignment); - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr("\nASPSOldGen::available_for_contraction:" - " " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, result_aligned/K, result_aligned); - gclog_or_tty->print_cr(" reserved().byte_size() " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, - reserved().byte_size()/K, reserved().byte_size()); + + LogHandle(gc, ergo) log; + if (log.is_trace()) { size_t working_promoted = (size_t) policy->avg_promoted()->padded_average(); - gclog_or_tty->print_cr(" padded promoted " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, - working_promoted/K, working_promoted); - gclog_or_tty->print_cr(" used " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, - used_in_bytes()/K, used_in_bytes()); - gclog_or_tty->print_cr(" min_gen_size() " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, - min_gen_size()/K, min_gen_size()); - gclog_or_tty->print_cr(" max_contraction " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, - max_contraction/K, max_contraction); - gclog_or_tty->print_cr(" without alignment " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, - policy->promo_increment(max_contraction)/K, - policy->promo_increment(max_contraction)); - gclog_or_tty->print_cr(" alignment " SIZE_FORMAT_HEX, gen_alignment); + size_t promo_increment = policy->promo_increment(max_contraction); + log.trace("ASPSOldGen::available_for_contraction: " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, result_aligned/K, result_aligned); + log.trace(" reserved().byte_size() " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, reserved().byte_size()/K, reserved().byte_size()); + log.trace(" padded promoted " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, working_promoted/K, working_promoted); + log.trace(" used " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, used_in_bytes()/K, used_in_bytes()); + log.trace(" min_gen_size() " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, min_gen_size()/K, min_gen_size()); + log.trace(" max_contraction " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, max_contraction/K, max_contraction); + log.trace(" without alignment " SIZE_FORMAT " K / " SIZE_FORMAT_HEX, promo_increment/K, promo_increment); + log.trace(" alignment " SIZE_FORMAT_HEX, gen_alignment); } + assert(result_aligned <= max_contraction, "arithmetic is wrong"); return result_aligned; } diff --git a/hotspot/src/share/vm/gc/parallel/asPSYoungGen.cpp b/hotspot/src/share/vm/gc/parallel/asPSYoungGen.cpp index b3e1d83e41f..130e51ab5d5 100644 --- a/hotspot/src/share/vm/gc/parallel/asPSYoungGen.cpp +++ b/hotspot/src/share/vm/gc/parallel/asPSYoungGen.cpp @@ -111,13 +111,12 @@ size_t ASPSYoungGen::available_for_contraction() { PSAdaptiveSizePolicy* policy = heap->size_policy(); size_t result = policy->eden_increment_aligned_down(max_contraction); size_t result_aligned = align_size_down(result, gen_alignment); - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr("ASPSYoungGen::available_for_contraction: " SIZE_FORMAT " K", - result_aligned/K); - gclog_or_tty->print_cr(" max_contraction " SIZE_FORMAT " K", max_contraction/K); - gclog_or_tty->print_cr(" eden_avail " SIZE_FORMAT " K", eden_avail/K); - gclog_or_tty->print_cr(" gen_avail " SIZE_FORMAT " K", gen_avail/K); - } + + log_trace(gc, ergo)("ASPSYoungGen::available_for_contraction: " SIZE_FORMAT " K", result_aligned/K); + log_trace(gc, ergo)(" max_contraction " SIZE_FORMAT " K", max_contraction/K); + log_trace(gc, ergo)(" eden_avail " SIZE_FORMAT " K", eden_avail/K); + log_trace(gc, ergo)(" gen_avail " SIZE_FORMAT " K", gen_avail/K); + return result_aligned; } @@ -199,25 +198,17 @@ bool ASPSYoungGen::resize_generation(size_t eden_size, size_t survivor_size) { virtual_space()->shrink_by(change); size_changed = true; } else { - if (Verbose && PrintGC) { - if (orig_size == gen_size_limit()) { - gclog_or_tty->print_cr("ASPSYoung generation size at maximum: " - SIZE_FORMAT "K", orig_size/K); - } else if (orig_size == min_gen_size()) { - gclog_or_tty->print_cr("ASPSYoung generation size at minium: " - SIZE_FORMAT "K", orig_size/K); - } + if (orig_size == gen_size_limit()) { + log_trace(gc)("ASPSYoung generation size at maximum: " SIZE_FORMAT "K", orig_size/K); + } else if (orig_size == min_gen_size()) { + log_trace(gc)("ASPSYoung generation size at minium: " SIZE_FORMAT "K", orig_size/K); } } if (size_changed) { reset_after_change(); - if (Verbose && PrintGC) { - size_t current_size = virtual_space()->committed_size(); - gclog_or_tty->print_cr("ASPSYoung generation size changed: " - SIZE_FORMAT "K->" SIZE_FORMAT "K", - orig_size/K, current_size/K); - } + log_trace(gc)("ASPSYoung generation size changed: " SIZE_FORMAT "K->" SIZE_FORMAT "K", + orig_size/K, virtual_space()->committed_size()/K); } guarantee(eden_plus_survivors <= virtual_space()->committed_size() || @@ -245,41 +236,31 @@ void ASPSYoungGen::resize_spaces(size_t requested_eden_size, return; } - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr("PSYoungGen::resize_spaces(requested_eden_size: " - SIZE_FORMAT - ", requested_survivor_size: " SIZE_FORMAT ")", - requested_eden_size, requested_survivor_size); - gclog_or_tty->print_cr(" eden: [" PTR_FORMAT ".." PTR_FORMAT ") " - SIZE_FORMAT, - p2i(eden_space()->bottom()), - p2i(eden_space()->end()), - pointer_delta(eden_space()->end(), - eden_space()->bottom(), - sizeof(char))); - gclog_or_tty->print_cr(" from: [" PTR_FORMAT ".." PTR_FORMAT ") " - SIZE_FORMAT, - p2i(from_space()->bottom()), - p2i(from_space()->end()), - pointer_delta(from_space()->end(), - from_space()->bottom(), - sizeof(char))); - gclog_or_tty->print_cr(" to: [" PTR_FORMAT ".." PTR_FORMAT ") " - SIZE_FORMAT, - p2i(to_space()->bottom()), - p2i(to_space()->end()), - pointer_delta( to_space()->end(), - to_space()->bottom(), - sizeof(char))); - } + log_trace(gc, ergo)("PSYoungGen::resize_spaces(requested_eden_size: " + SIZE_FORMAT + ", requested_survivor_size: " SIZE_FORMAT ")", + requested_eden_size, requested_survivor_size); + log_trace(gc, ergo)(" eden: [" PTR_FORMAT ".." PTR_FORMAT ") " + SIZE_FORMAT, + p2i(eden_space()->bottom()), + p2i(eden_space()->end()), + pointer_delta(eden_space()->end(), eden_space()->bottom(), sizeof(char))); + log_trace(gc, ergo)(" from: [" PTR_FORMAT ".." PTR_FORMAT ") " + SIZE_FORMAT, + p2i(from_space()->bottom()), + p2i(from_space()->end()), + pointer_delta(from_space()->end(), from_space()->bottom(), sizeof(char))); + log_trace(gc, ergo)(" to: [" PTR_FORMAT ".." PTR_FORMAT ") " + SIZE_FORMAT, + p2i(to_space()->bottom()), + p2i(to_space()->end()), + pointer_delta( to_space()->end(), to_space()->bottom(), sizeof(char))); // There's nothing to do if the new sizes are the same as the current if (requested_survivor_size == to_space()->capacity_in_bytes() && requested_survivor_size == from_space()->capacity_in_bytes() && requested_eden_size == eden_space()->capacity_in_bytes()) { - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr(" capacities are the right sizes, returning"); - } + log_trace(gc, ergo)(" capacities are the right sizes, returning"); return; } @@ -302,9 +283,7 @@ void ASPSYoungGen::resize_spaces(size_t requested_eden_size, if (eden_from_to_order) { // Eden, from, to - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr(" Eden, from, to:"); - } + log_trace(gc, ergo)(" Eden, from, to:"); // Set eden // "requested_eden_size" is a goal for the size of eden @@ -368,28 +347,24 @@ void ASPSYoungGen::resize_spaces(size_t requested_eden_size, guarantee(to_start != to_end, "to space is zero sized"); - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr(" [eden_start .. eden_end): " - "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - p2i(eden_start), - p2i(eden_end), - pointer_delta(eden_end, eden_start, sizeof(char))); - gclog_or_tty->print_cr(" [from_start .. from_end): " - "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - p2i(from_start), - p2i(from_end), - pointer_delta(from_end, from_start, sizeof(char))); - gclog_or_tty->print_cr(" [ to_start .. to_end): " - "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - p2i(to_start), - p2i(to_end), - pointer_delta( to_end, to_start, sizeof(char))); - } + log_trace(gc, ergo)(" [eden_start .. eden_end): " + "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, + p2i(eden_start), + p2i(eden_end), + pointer_delta(eden_end, eden_start, sizeof(char))); + log_trace(gc, ergo)(" [from_start .. from_end): " + "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, + p2i(from_start), + p2i(from_end), + pointer_delta(from_end, from_start, sizeof(char))); + log_trace(gc, ergo)(" [ to_start .. to_end): " + "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, + p2i(to_start), + p2i(to_end), + pointer_delta( to_end, to_start, sizeof(char))); } else { // Eden, to, from - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr(" Eden, to, from:"); - } + log_trace(gc, ergo)(" Eden, to, from:"); // To space gets priority over eden resizing. Note that we position // to space as if we were able to resize from space, even though from @@ -422,23 +397,21 @@ void ASPSYoungGen::resize_spaces(size_t requested_eden_size, eden_end = MAX2(eden_end, eden_start + alignment); to_start = MAX2(to_start, eden_end); - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr(" [eden_start .. eden_end): " - "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - p2i(eden_start), - p2i(eden_end), - pointer_delta(eden_end, eden_start, sizeof(char))); - gclog_or_tty->print_cr(" [ to_start .. to_end): " - "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - p2i(to_start), - p2i(to_end), - pointer_delta( to_end, to_start, sizeof(char))); - gclog_or_tty->print_cr(" [from_start .. from_end): " - "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - p2i(from_start), - p2i(from_end), - pointer_delta(from_end, from_start, sizeof(char))); - } + log_trace(gc, ergo)(" [eden_start .. eden_end): " + "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, + p2i(eden_start), + p2i(eden_end), + pointer_delta(eden_end, eden_start, sizeof(char))); + log_trace(gc, ergo)(" [ to_start .. to_end): " + "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, + p2i(to_start), + p2i(to_end), + pointer_delta( to_end, to_start, sizeof(char))); + log_trace(gc, ergo)(" [from_start .. from_end): " + "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, + p2i(from_start), + p2i(from_end), + pointer_delta(from_end, from_start, sizeof(char))); } @@ -457,7 +430,7 @@ void ASPSYoungGen::resize_spaces(size_t requested_eden_size, // Let's make sure the call to initialize doesn't reset "top"! DEBUG_ONLY(HeapWord* old_from_top = from_space()->top();) - // For PrintAdaptiveSizePolicy block below + // For logging block below size_t old_from = from_space()->capacity_in_bytes(); size_t old_to = to_space()->capacity_in_bytes(); @@ -506,19 +479,16 @@ void ASPSYoungGen::resize_spaces(size_t requested_eden_size, assert(from_space()->top() == old_from_top, "from top changed!"); - if (PrintAdaptiveSizePolicy) { - ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); - gclog_or_tty->print("AdaptiveSizePolicy::survivor space sizes: " - "collection: %d " - "(" SIZE_FORMAT ", " SIZE_FORMAT ") -> " - "(" SIZE_FORMAT ", " SIZE_FORMAT ") ", - heap->total_collections(), - old_from, old_to, - from_space()->capacity_in_bytes(), - to_space()->capacity_in_bytes()); - gclog_or_tty->cr(); - } - space_invariants(); + log_trace(gc, ergo)("AdaptiveSizePolicy::survivor space sizes: " + "collection: %d " + "(" SIZE_FORMAT ", " SIZE_FORMAT ") -> " + "(" SIZE_FORMAT ", " SIZE_FORMAT ") ", + ParallelScavengeHeap::heap()->total_collections(), + old_from, old_to, + from_space()->capacity_in_bytes(), + to_space()->capacity_in_bytes()); + + space_invariants(); } void ASPSYoungGen::reset_after_change() { assert_locked_or_safepoint(Heap_lock); diff --git a/hotspot/src/share/vm/gc/parallel/cardTableExtension.cpp b/hotspot/src/share/vm/gc/parallel/cardTableExtension.cpp index a2ce06fd768..083fb2a2fb0 100644 --- a/hotspot/src/share/vm/gc/parallel/cardTableExtension.cpp +++ b/hotspot/src/share/vm/gc/parallel/cardTableExtension.cpp @@ -468,30 +468,17 @@ void CardTableExtension::resize_covered_region_by_end(int changed_region, // Update the covered region resize_update_covered_table(changed_region, new_region); - if (TraceCardTableModRefBS) { - int ind = changed_region; - gclog_or_tty->print_cr("CardTableModRefBS::resize_covered_region: "); - gclog_or_tty->print_cr(" " - " _covered[%d].start(): " INTPTR_FORMAT - " _covered[%d].last(): " INTPTR_FORMAT, - ind, p2i(_covered[ind].start()), - ind, p2i(_covered[ind].last())); - gclog_or_tty->print_cr(" " - " _committed[%d].start(): " INTPTR_FORMAT - " _committed[%d].last(): " INTPTR_FORMAT, - ind, p2i(_committed[ind].start()), - ind, p2i(_committed[ind].last())); - gclog_or_tty->print_cr(" " - " byte_for(start): " INTPTR_FORMAT - " byte_for(last): " INTPTR_FORMAT, - p2i(byte_for(_covered[ind].start())), - p2i(byte_for(_covered[ind].last()))); - gclog_or_tty->print_cr(" " - " addr_for(start): " INTPTR_FORMAT - " addr_for(last): " INTPTR_FORMAT, - p2i(addr_for((jbyte*) _committed[ind].start())), - p2i(addr_for((jbyte*) _committed[ind].last()))); - } + int ind = changed_region; + log_trace(gc, barrier)("CardTableModRefBS::resize_covered_region: "); + log_trace(gc, barrier)(" _covered[%d].start(): " INTPTR_FORMAT " _covered[%d].last(): " INTPTR_FORMAT, + ind, p2i(_covered[ind].start()), ind, p2i(_covered[ind].last())); + log_trace(gc, barrier)(" _committed[%d].start(): " INTPTR_FORMAT " _committed[%d].last(): " INTPTR_FORMAT, + ind, p2i(_committed[ind].start()), ind, p2i(_committed[ind].last())); + log_trace(gc, barrier)(" byte_for(start): " INTPTR_FORMAT " byte_for(last): " INTPTR_FORMAT, + p2i(byte_for(_covered[ind].start())), p2i(byte_for(_covered[ind].last()))); + log_trace(gc, barrier)(" addr_for(start): " INTPTR_FORMAT " addr_for(last): " INTPTR_FORMAT, + p2i(addr_for((jbyte*) _committed[ind].start())), p2i(addr_for((jbyte*) _committed[ind].last()))); + debug_only(verify_guard();) } diff --git a/hotspot/src/share/vm/gc/parallel/gcTaskManager.cpp b/hotspot/src/share/vm/gc/parallel/gcTaskManager.cpp index 85a908ed794..4cd339886c2 100644 --- a/hotspot/src/share/vm/gc/parallel/gcTaskManager.cpp +++ b/hotspot/src/share/vm/gc/parallel/gcTaskManager.cpp @@ -27,6 +27,7 @@ #include "gc/parallel/gcTaskThread.hpp" #include "gc/shared/adaptiveSizePolicy.hpp" #include "gc/shared/gcId.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" #include "memory/allocation.inline.hpp" #include "runtime/mutex.hpp" @@ -465,13 +466,11 @@ void GCTaskManager::set_active_gang() { "all_workers_active() is incorrect: " "active %d ParallelGCThreads %u", active_workers(), ParallelGCThreads); - if (TraceDynamicGCThreads) { - gclog_or_tty->print_cr("GCTaskManager::set_active_gang(): " - "all_workers_active() %d workers %d " - "active %d ParallelGCThreads %u", - all_workers_active(), workers(), active_workers(), - ParallelGCThreads); - } + log_trace(gc, task)("GCTaskManager::set_active_gang(): " + "all_workers_active() %d workers %d " + "active %d ParallelGCThreads %u", + all_workers_active(), workers(), active_workers(), + ParallelGCThreads); } // Create IdleGCTasks for inactive workers. @@ -502,15 +501,12 @@ void GCTaskManager::task_idle_workers() { set_active_workers(reduced_active_workers); more_inactive_workers = 0; } - if (TraceDynamicGCThreads) { - gclog_or_tty->print_cr("JT: %d workers %d active %d " - "idle %d more %d", - Threads::number_of_non_daemon_threads(), - workers(), - active_workers(), - idle_workers(), - more_inactive_workers); - } + log_trace(gc, task)("JT: %d workers %d active %d idle %d more %d", + Threads::number_of_non_daemon_threads(), + workers(), + active_workers(), + idle_workers(), + more_inactive_workers); } GCTaskQueue* q = GCTaskQueue::create(); for(uint i = 0; i < (uint) more_inactive_workers; i++) { @@ -536,6 +532,9 @@ void GCTaskManager::release_idle_workers() { } void GCTaskManager::print_task_time_stamps() { + if (!log_is_enabled(Debug, gc, task, time)) { + return; + } for(uint i=0; iprint_task_time_stamps(); @@ -828,38 +827,24 @@ IdleGCTask* IdleGCTask::create_on_c_heap() { void IdleGCTask::do_it(GCTaskManager* manager, uint which) { WaitHelper* wait_helper = manager->wait_helper(); - if (TraceGCTaskManager) { - tty->print_cr("[" INTPTR_FORMAT "]" - " IdleGCTask:::do_it()" - " should_wait: %s", + log_trace(gc, task)("[" INTPTR_FORMAT "] IdleGCTask:::do_it() should_wait: %s", p2i(this), wait_helper->should_wait() ? "true" : "false"); - } + MutexLockerEx ml(manager->monitor(), Mutex::_no_safepoint_check_flag); - if (TraceDynamicGCThreads) { - gclog_or_tty->print_cr("--- idle %d", which); - } + log_trace(gc, task)("--- idle %d", which); // Increment has to be done when the idle tasks are created. // manager->increment_idle_workers(); manager->monitor()->notify_all(); while (wait_helper->should_wait()) { - if (TraceGCTaskManager) { - tty->print_cr("[" INTPTR_FORMAT "]" - " IdleGCTask::do_it()" - " [" INTPTR_FORMAT "] (%s)->wait()", - p2i(this), p2i(manager->monitor()), manager->monitor()->name()); - } + log_trace(gc, task)("[" INTPTR_FORMAT "] IdleGCTask::do_it() [" INTPTR_FORMAT "] (%s)->wait()", + p2i(this), p2i(manager->monitor()), manager->monitor()->name()); manager->monitor()->wait(Mutex::_no_safepoint_check_flag, 0); } manager->decrement_idle_workers(); - if (TraceDynamicGCThreads) { - gclog_or_tty->print_cr("--- release %d", which); - } - if (TraceGCTaskManager) { - tty->print_cr("[" INTPTR_FORMAT "]" - " IdleGCTask::do_it() returns" - " should_wait: %s", - p2i(this), wait_helper->should_wait() ? "true" : "false"); - } + + log_trace(gc, task)("--- release %d", which); + log_trace(gc, task)("[" INTPTR_FORMAT "] IdleGCTask::do_it() returns should_wait: %s", + p2i(this), wait_helper->should_wait() ? "true" : "false"); // Release monitor(). } diff --git a/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp b/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp index c8ce9969b38..752ef109f2d 100644 --- a/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp +++ b/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp @@ -26,9 +26,11 @@ #include "gc/parallel/gcTaskManager.hpp" #include "gc/parallel/gcTaskThread.hpp" #include "gc/shared/gcId.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" +#include "runtime/atomic.inline.hpp" #include "runtime/handles.hpp" #include "runtime/handles.inline.hpp" #include "runtime/os.hpp" @@ -45,11 +47,6 @@ GCTaskThread::GCTaskThread(GCTaskManager* manager, if (!os::create_thread(this, os::pgc_thread)) vm_exit_out_of_memory(0, OOM_MALLOC_ERROR, "Cannot create GC thread. Out of system resources."); - if (PrintGCTaskTimeStamps) { - _time_stamps = NEW_C_HEAP_ARRAY(GCTaskTimeStamp, GCTaskTimeStampEntries, mtGC); - - guarantee(_time_stamps != NULL, "Sanity"); - } set_id(which); set_name("ParGC Thread#%d", which); } @@ -66,21 +63,30 @@ void GCTaskThread::start() { GCTaskTimeStamp* GCTaskThread::time_stamp_at(uint index) { guarantee(index < GCTaskTimeStampEntries, "increase GCTaskTimeStampEntries"); + if (_time_stamps == NULL) { + // We allocate the _time_stamps array lazily since logging can be enabled dynamically + GCTaskTimeStamp* time_stamps = NEW_C_HEAP_ARRAY(GCTaskTimeStamp, GCTaskTimeStampEntries, mtGC); + void* old = Atomic::cmpxchg_ptr(time_stamps, &_time_stamps, NULL); + if (old != NULL) { + // Someone already setup the time stamps + FREE_C_HEAP_ARRAY(GCTaskTimeStamp, time_stamps); + } + } return &(_time_stamps[index]); } void GCTaskThread::print_task_time_stamps() { - assert(PrintGCTaskTimeStamps, "Sanity"); - assert(_time_stamps != NULL, "Sanity (Probably set PrintGCTaskTimeStamps late)"); + assert(log_is_enabled(Debug, gc, task, time), "Sanity"); + assert(_time_stamps != NULL, "Sanity"); - tty->print_cr("GC-Thread %u entries: %d", id(), _time_stamp_index); + log_debug(gc, task, time)("GC-Thread %u entries: %d", id(), _time_stamp_index); for(uint i=0; i<_time_stamp_index; i++) { GCTaskTimeStamp* time_stamp = time_stamp_at(i); - tty->print_cr("\t[ %s " JLONG_FORMAT " " JLONG_FORMAT " ]", - time_stamp->name(), - time_stamp->entry_time(), - time_stamp->exit_time()); + log_debug(gc, task, time)("\t[ %s " JLONG_FORMAT " " JLONG_FORMAT " ]", + time_stamp->name(), + time_stamp->entry_time(), + time_stamp->exit_time()); } // Reset after dumping the data @@ -127,7 +133,7 @@ void GCTaskThread::run() { // Record if this is an idle task for later use. bool is_idle_task = task->is_idle_task(); // In case the update is costly - if (PrintGCTaskTimeStamps) { + if (log_is_enabled(Debug, gc, task, time)) { timer.update(); } @@ -143,10 +149,7 @@ void GCTaskThread::run() { if (!is_idle_task) { manager()->note_completion(which()); - if (PrintGCTaskTimeStamps) { - assert(_time_stamps != NULL, - "Sanity (PrintGCTaskTimeStamps set late?)"); - + if (log_is_enabled(Debug, gc, task, time)) { timer.update(); GCTaskTimeStamp* time_stamp = time_stamp_at(_time_stamp_index++); diff --git a/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.cpp b/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.cpp index a1c94ad4b86..f14aefa7943 100644 --- a/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.cpp +++ b/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.cpp @@ -38,6 +38,7 @@ #include "gc/shared/gcHeapSummary.hpp" #include "gc/shared/gcLocker.inline.hpp" #include "gc/shared/gcWhen.hpp" +#include "logging/log.hpp" #include "oops/oop.inline.hpp" #include "runtime/handles.inline.hpp" #include "runtime/java.hpp" @@ -307,10 +308,7 @@ HeapWord* ParallelScavengeHeap::mem_allocate( if (limit_exceeded && softrefs_clear) { *gc_overhead_limit_was_exceeded = true; size_policy()->set_gc_overhead_limit_exceeded(false); - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr("ParallelScavengeHeap::mem_allocate: " - "return NULL because gc_overhead_limit_exceeded is set"); - } + log_trace(gc)("ParallelScavengeHeap::mem_allocate: return NULL because gc_overhead_limit_exceeded is set"); if (op.result() != NULL) { CollectedHeap::fill_with_object(op.result(), size); } @@ -584,35 +582,17 @@ void ParallelScavengeHeap::print_tracing_info() const { } -void ParallelScavengeHeap::verify(bool silent, VerifyOption option /* ignored */) { +void ParallelScavengeHeap::verify(VerifyOption option /* ignored */) { // Why do we need the total_collections()-filter below? if (total_collections() > 0) { - if (!silent) { - gclog_or_tty->print("tenured "); - } + log_debug(gc, verify)("Tenured"); old_gen()->verify(); - if (!silent) { - gclog_or_tty->print("eden "); - } + log_debug(gc, verify)("Eden"); young_gen()->verify(); } } -void ParallelScavengeHeap::print_heap_change(size_t prev_used) { - if (PrintGCDetails && Verbose) { - gclog_or_tty->print(" " SIZE_FORMAT - "->" SIZE_FORMAT - "(" SIZE_FORMAT ")", - prev_used, used(), capacity()); - } else { - gclog_or_tty->print(" " SIZE_FORMAT "K" - "->" SIZE_FORMAT "K" - "(" SIZE_FORMAT "K)", - prev_used / K, used() / K, capacity() / K); - } -} - void ParallelScavengeHeap::trace_heap(GCWhen::Type when, const GCTracer* gc_tracer) { const PSHeapSummary& heap_summary = create_ps_heap_summary(); gc_tracer->report_gc_heap_summary(when, heap_summary); diff --git a/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.hpp b/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.hpp index 86953f7572d..e2794db1478 100644 --- a/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.hpp +++ b/hotspot/src/share/vm/gc/parallel/parallelScavengeHeap.hpp @@ -35,6 +35,7 @@ #include "gc/shared/gcPolicyCounters.hpp" #include "gc/shared/gcWhen.hpp" #include "gc/shared/strongRootsScope.hpp" +#include "memory/metaspace.hpp" #include "utilities/ostream.hpp" class AdjoiningGenerations; @@ -87,6 +88,10 @@ class ParallelScavengeHeap : public CollectedHeap { return CollectedHeap::ParallelScavengeHeap; } + virtual const char* name() const { + return "Parallel"; + } + virtual CollectorPolicy* collector_policy() const { return _collector_policy; } static PSYoungGen* young_gen() { return _young_gen; } @@ -215,9 +220,7 @@ class ParallelScavengeHeap : public CollectedHeap { virtual void gc_threads_do(ThreadClosure* tc) const; virtual void print_tracing_info() const; - void verify(bool silent, VerifyOption option /* ignored */); - - void print_heap_change(size_t prev_used); + void verify(VerifyOption option /* ignored */); // Resize the young generation. The reserved space for the // generation may be expanded in preparation for the resize. @@ -241,4 +244,26 @@ class ParallelScavengeHeap : public CollectedHeap { }; }; +// Simple class for storing info about the heap at the start of GC, to be used +// after GC for comparison/printing. +class PreGCValues { +public: + PreGCValues(ParallelScavengeHeap* heap) : + _heap_used(heap->used()), + _young_gen_used(heap->young_gen()->used_in_bytes()), + _old_gen_used(heap->old_gen()->used_in_bytes()), + _metadata_used(MetaspaceAux::used_bytes()) { }; + + size_t heap_used() const { return _heap_used; } + size_t young_gen_used() const { return _young_gen_used; } + size_t old_gen_used() const { return _old_gen_used; } + size_t metadata_used() const { return _metadata_used; } + +private: + size_t _heap_used; + size_t _young_gen_used; + size_t _old_gen_used; + size_t _metadata_used; +}; + #endif // SHARE_VM_GC_PARALLEL_PARALLELSCAVENGEHEAP_HPP diff --git a/hotspot/src/share/vm/gc/parallel/pcTasks.cpp b/hotspot/src/share/vm/gc/parallel/pcTasks.cpp index 54d75e73aab..8d0768556d6 100644 --- a/hotspot/src/share/vm/gc/parallel/pcTasks.cpp +++ b/hotspot/src/share/vm/gc/parallel/pcTasks.cpp @@ -31,7 +31,8 @@ #include "gc/parallel/psParallelCompact.hpp" #include "gc/shared/collectedHeap.hpp" #include "gc/shared/gcTimer.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" +#include "logging/log.hpp" #include "memory/universe.hpp" #include "oops/objArrayKlass.inline.hpp" #include "oops/oop.inline.hpp" @@ -251,14 +252,6 @@ void StealRegionCompactionTask::do_it(GCTaskManager* manager, uint which) { cm->set_region_stack_index(which_stack_index); cm->set_region_stack(ParCompactionManager::region_list(which_stack_index)); - if (TraceDynamicGCThreads) { - gclog_or_tty->print_cr("StealRegionCompactionTask::do_it " - "region_stack_index %d region_stack = " PTR_FORMAT " " - " empty (%d) use all workers %d", - which_stack_index, p2i(ParCompactionManager::region_list(which_stack_index)), - cm->region_stack()->is_empty(), - use_all_workers); - } // Has to drain stacks first because there may be regions on // preloaded onto the stack and this thread may never have @@ -323,14 +316,6 @@ void DrainStacksCompactionTask::do_it(GCTaskManager* manager, uint which) { } cm->set_region_stack(ParCompactionManager::region_list(which_stack_index)); - if (TraceDynamicGCThreads) { - gclog_or_tty->print_cr("DrainStacksCompactionTask::do_it which = %d " - "which_stack_index = %d/empty(%d) " - "use all workers %d", - which, which_stack_index, - cm->region_stack()->is_empty(), - use_all_workers); - } cm->set_region_stack_index(which_stack_index); @@ -346,13 +331,6 @@ void DrainStacksCompactionTask::do_it(GCTaskManager* manager, uint which) { "region_stack and region_stack_index are inconsistent"); ParCompactionManager::push_recycled_stack_index(cm->region_stack_index()); - if (TraceDynamicGCThreads) { - void* old_region_stack = (void*) cm->region_stack(); - int old_region_stack_index = cm->region_stack_index(); - gclog_or_tty->print_cr("Pushing region stack " PTR_FORMAT "/%d", - p2i(old_region_stack), old_region_stack_index); - } - cm->set_region_stack(NULL); cm->set_region_stack_index((uint)max_uintx); } diff --git a/hotspot/src/share/vm/gc/parallel/psAdaptiveSizePolicy.cpp b/hotspot/src/share/vm/gc/parallel/psAdaptiveSizePolicy.cpp index 69720fb3e4e..4506ed67ee3 100644 --- a/hotspot/src/share/vm/gc/parallel/psAdaptiveSizePolicy.cpp +++ b/hotspot/src/share/vm/gc/parallel/psAdaptiveSizePolicy.cpp @@ -30,6 +30,7 @@ #include "gc/shared/collectorPolicy.hpp" #include "gc/shared/gcCause.hpp" #include "gc/shared/gcPolicyCounters.hpp" +#include "logging/log.hpp" #include "runtime/timer.hpp" #include "utilities/top.hpp" @@ -159,14 +160,10 @@ void PSAdaptiveSizePolicy::major_collection_end(size_t amount_live, _major_pause_young_estimator->update(eden_size_in_mbytes, major_pause_in_ms); - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print("psAdaptiveSizePolicy::major_collection_end: " - "major gc cost: %f average: %f", collection_cost, - avg_major_gc_cost()->average()); - gclog_or_tty->print_cr(" major pause: %f major period %f", - major_pause_in_ms, - _latest_major_mutator_interval_seconds * MILLIUNITS); - } + log_trace(gc, ergo)("psAdaptiveSizePolicy::major_collection_end: major gc cost: %f average: %f", + collection_cost,avg_major_gc_cost()->average()); + log_trace(gc, ergo)(" major pause: %f major period %f", + major_pause_in_ms, _latest_major_mutator_interval_seconds * MILLIUNITS); // Calculate variable used to estimate collection cost vs. gen sizes assert(collection_cost >= 0.0, "Expected to be non-negative"); @@ -197,19 +194,11 @@ bool PSAdaptiveSizePolicy::should_full_GC(size_t old_free_in_bytes) { // A similar test is done in the scavenge's should_attempt_scavenge(). If // this is changed, decide if that test should also be changed. bool result = padded_average_promoted_in_bytes() > (float) old_free_in_bytes; - if (PrintGCDetails && Verbose) { - if (result) { - gclog_or_tty->print(" full after scavenge: "); - } else { - gclog_or_tty->print(" no full after scavenge: "); - } - gclog_or_tty->print_cr(" average_promoted " SIZE_FORMAT - " padded_average_promoted " SIZE_FORMAT - " free in old gen " SIZE_FORMAT, - (size_t) average_promoted_in_bytes(), - (size_t) padded_average_promoted_in_bytes(), - old_free_in_bytes); - } + log_trace(gc, ergo)("%s after scavenge average_promoted " SIZE_FORMAT " padded_average_promoted " SIZE_FORMAT " free in old gen " SIZE_FORMAT, + result ? "Full" : "No full", + (size_t) average_promoted_in_bytes(), + (size_t) padded_average_promoted_in_bytes(), + old_free_in_bytes); return result; } @@ -361,26 +350,24 @@ void PSAdaptiveSizePolicy::compute_eden_space_size( // Note we make the same tests as in the code block below; the code // seems a little easier to read with the printing in another block. - if (PrintAdaptiveSizePolicy) { - if (desired_eden_size > eden_limit) { - gclog_or_tty->print_cr( - "PSAdaptiveSizePolicy::compute_eden_space_size limits:" - " desired_eden_size: " SIZE_FORMAT - " old_eden_size: " SIZE_FORMAT - " eden_limit: " SIZE_FORMAT - " cur_eden: " SIZE_FORMAT - " max_eden_size: " SIZE_FORMAT - " avg_young_live: " SIZE_FORMAT, - desired_eden_size, _eden_size, eden_limit, cur_eden, - max_eden_size, (size_t)avg_young_live()->average()); - } - if (gc_cost() > gc_cost_limit) { - gclog_or_tty->print_cr( - "PSAdaptiveSizePolicy::compute_eden_space_size: gc time limit" - " gc_cost: %f " - " GCTimeLimit: " UINTX_FORMAT, - gc_cost(), GCTimeLimit); - } + if (desired_eden_size > eden_limit) { + log_debug(gc, ergo)( + "PSAdaptiveSizePolicy::compute_eden_space_size limits:" + " desired_eden_size: " SIZE_FORMAT + " old_eden_size: " SIZE_FORMAT + " eden_limit: " SIZE_FORMAT + " cur_eden: " SIZE_FORMAT + " max_eden_size: " SIZE_FORMAT + " avg_young_live: " SIZE_FORMAT, + desired_eden_size, _eden_size, eden_limit, cur_eden, + max_eden_size, (size_t)avg_young_live()->average()); + } + if (gc_cost() > gc_cost_limit) { + log_debug(gc, ergo)( + "PSAdaptiveSizePolicy::compute_eden_space_size: gc time limit" + " gc_cost: %f " + " GCTimeLimit: " UINTX_FORMAT, + gc_cost(), GCTimeLimit); } // Align everything and make a final limit check @@ -399,51 +386,26 @@ void PSAdaptiveSizePolicy::compute_eden_space_size( desired_eden_size = MAX2(eden_limit, cur_eden); } - if (PrintAdaptiveSizePolicy) { - // Timing stats - gclog_or_tty->print( - "PSAdaptiveSizePolicy::compute_eden_space_size: costs" - " minor_time: %f" - " major_cost: %f" - " mutator_cost: %f" - " throughput_goal: %f", - minor_gc_cost(), major_gc_cost(), mutator_cost(), - _throughput_goal); + log_debug(gc, ergo)("PSAdaptiveSizePolicy::compute_eden_space_size: costs minor_time: %f major_cost: %f mutator_cost: %f throughput_goal: %f", + minor_gc_cost(), major_gc_cost(), mutator_cost(), _throughput_goal); - // We give more details if Verbose is set - if (Verbose) { - gclog_or_tty->print( " minor_pause: %f" - " major_pause: %f" - " minor_interval: %f" - " major_interval: %f" - " pause_goal: %f", - _avg_minor_pause->padded_average(), - _avg_major_pause->padded_average(), - _avg_minor_interval->average(), - _avg_major_interval->average(), - gc_pause_goal_sec()); - } + log_trace(gc, ergo)("Minor_pause: %f major_pause: %f minor_interval: %f major_interval: %fpause_goal: %f", + _avg_minor_pause->padded_average(), + _avg_major_pause->padded_average(), + _avg_minor_interval->average(), + _avg_major_interval->average(), + gc_pause_goal_sec()); - // Footprint stats - gclog_or_tty->print( " live_space: " SIZE_FORMAT - " free_space: " SIZE_FORMAT, - live_space(), free_space()); - // More detail - if (Verbose) { - gclog_or_tty->print( " base_footprint: " SIZE_FORMAT - " avg_young_live: " SIZE_FORMAT - " avg_old_live: " SIZE_FORMAT, - (size_t)_avg_base_footprint->average(), - (size_t)avg_young_live()->average(), - (size_t)avg_old_live()->average()); - } + log_debug(gc, ergo)("Live_space: " SIZE_FORMAT " free_space: " SIZE_FORMAT, + live_space(), free_space()); - // And finally, our old and new sizes. - gclog_or_tty->print(" old_eden_size: " SIZE_FORMAT - " desired_eden_size: " SIZE_FORMAT, - _eden_size, desired_eden_size); - gclog_or_tty->cr(); - } + log_trace(gc, ergo)("Base_footprint: " SIZE_FORMAT " avg_young_live: " SIZE_FORMAT " avg_old_live: " SIZE_FORMAT, + (size_t)_avg_base_footprint->average(), + (size_t)avg_young_live()->average(), + (size_t)avg_old_live()->average()); + + log_debug(gc, ergo)("Old eden_size: " SIZE_FORMAT " desired_eden_size: " SIZE_FORMAT, + _eden_size, desired_eden_size); set_eden_size(desired_eden_size); } @@ -564,27 +526,25 @@ void PSAdaptiveSizePolicy::compute_old_gen_free_space( // Note we make the same tests as in the code block below; the code // seems a little easier to read with the printing in another block. - if (PrintAdaptiveSizePolicy) { - if (desired_promo_size > promo_limit) { - // "free_in_old_gen" was the original value for used for promo_limit - size_t free_in_old_gen = (size_t)(max_old_gen_size - avg_old_live()->average()); - gclog_or_tty->print_cr( - "PSAdaptiveSizePolicy::compute_old_gen_free_space limits:" - " desired_promo_size: " SIZE_FORMAT - " promo_limit: " SIZE_FORMAT - " free_in_old_gen: " SIZE_FORMAT - " max_old_gen_size: " SIZE_FORMAT - " avg_old_live: " SIZE_FORMAT, - desired_promo_size, promo_limit, free_in_old_gen, - max_old_gen_size, (size_t) avg_old_live()->average()); - } - if (gc_cost() > gc_cost_limit) { - gclog_or_tty->print_cr( - "PSAdaptiveSizePolicy::compute_old_gen_free_space: gc time limit" - " gc_cost: %f " - " GCTimeLimit: " UINTX_FORMAT, - gc_cost(), GCTimeLimit); - } + if (desired_promo_size > promo_limit) { + // "free_in_old_gen" was the original value for used for promo_limit + size_t free_in_old_gen = (size_t)(max_old_gen_size - avg_old_live()->average()); + log_debug(gc, ergo)( + "PSAdaptiveSizePolicy::compute_old_gen_free_space limits:" + " desired_promo_size: " SIZE_FORMAT + " promo_limit: " SIZE_FORMAT + " free_in_old_gen: " SIZE_FORMAT + " max_old_gen_size: " SIZE_FORMAT + " avg_old_live: " SIZE_FORMAT, + desired_promo_size, promo_limit, free_in_old_gen, + max_old_gen_size, (size_t) avg_old_live()->average()); + } + if (gc_cost() > gc_cost_limit) { + log_debug(gc, ergo)( + "PSAdaptiveSizePolicy::compute_old_gen_free_space: gc time limit" + " gc_cost: %f " + " GCTimeLimit: " UINTX_FORMAT, + gc_cost(), GCTimeLimit); } // Align everything and make a final limit check @@ -596,51 +556,28 @@ void PSAdaptiveSizePolicy::compute_old_gen_free_space( // And one last limit check, now that we've aligned things. desired_promo_size = MIN2(desired_promo_size, promo_limit); - if (PrintAdaptiveSizePolicy) { - // Timing stats - gclog_or_tty->print( - "PSAdaptiveSizePolicy::compute_old_gen_free_space: costs" - " minor_time: %f" - " major_cost: %f" - " mutator_cost: %f" - " throughput_goal: %f", - minor_gc_cost(), major_gc_cost(), mutator_cost(), - _throughput_goal); + // Timing stats + log_debug(gc, ergo)("PSAdaptiveSizePolicy::compute_old_gen_free_space: costs minor_time: %f major_cost: %f mutator_cost: %f throughput_goal: %f", + minor_gc_cost(), major_gc_cost(), mutator_cost(), _throughput_goal); - // We give more details if Verbose is set - if (Verbose) { - gclog_or_tty->print( " minor_pause: %f" - " major_pause: %f" - " minor_interval: %f" - " major_interval: %f" - " pause_goal: %f", - _avg_minor_pause->padded_average(), - _avg_major_pause->padded_average(), - _avg_minor_interval->average(), - _avg_major_interval->average(), - gc_pause_goal_sec()); - } + log_trace(gc, ergo)("Minor_pause: %f major_pause: %f minor_interval: %f major_interval: %f pause_goal: %f", + _avg_minor_pause->padded_average(), + _avg_major_pause->padded_average(), + _avg_minor_interval->average(), + _avg_major_interval->average(), + gc_pause_goal_sec()); - // Footprint stats - gclog_or_tty->print( " live_space: " SIZE_FORMAT - " free_space: " SIZE_FORMAT, - live_space(), free_space()); - // More detail - if (Verbose) { - gclog_or_tty->print( " base_footprint: " SIZE_FORMAT - " avg_young_live: " SIZE_FORMAT - " avg_old_live: " SIZE_FORMAT, - (size_t)_avg_base_footprint->average(), - (size_t)avg_young_live()->average(), - (size_t)avg_old_live()->average()); - } + // Footprint stats + log_debug(gc, ergo)("Live_space: " SIZE_FORMAT " free_space: " SIZE_FORMAT, + live_space(), free_space()); - // And finally, our old and new sizes. - gclog_or_tty->print(" old_promo_size: " SIZE_FORMAT - " desired_promo_size: " SIZE_FORMAT, - _promo_size, desired_promo_size); - gclog_or_tty->cr(); - } + log_trace(gc, ergo)("Base_footprint: " SIZE_FORMAT " avg_young_live: " SIZE_FORMAT " avg_old_live: " SIZE_FORMAT, + (size_t)_avg_base_footprint->average(), + (size_t)avg_young_live()->average(), + (size_t)avg_old_live()->average()); + + log_debug(gc, ergo)("Old promo_size: " SIZE_FORMAT " desired_promo_size: " SIZE_FORMAT, + _promo_size, desired_promo_size); set_promo_size(desired_promo_size); } @@ -719,14 +656,12 @@ void PSAdaptiveSizePolicy::adjust_promo_for_pause_time(bool is_full_gc, } } - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr( - "PSAdaptiveSizePolicy::adjust_promo_for_pause_time " - "adjusting gen sizes for major pause (avg %f goal %f). " - "desired_promo_size " SIZE_FORMAT " promo delta " SIZE_FORMAT, - _avg_major_pause->average(), gc_pause_goal_sec(), - *desired_promo_size_ptr, promo_heap_delta); - } + log_trace(gc, ergo)( + "PSAdaptiveSizePolicy::adjust_promo_for_pause_time " + "adjusting gen sizes for major pause (avg %f goal %f). " + "desired_promo_size " SIZE_FORMAT " promo delta " SIZE_FORMAT, + _avg_major_pause->average(), gc_pause_goal_sec(), + *desired_promo_size_ptr, promo_heap_delta); } void PSAdaptiveSizePolicy::adjust_eden_for_pause_time(bool is_full_gc, @@ -740,14 +675,12 @@ void PSAdaptiveSizePolicy::adjust_eden_for_pause_time(bool is_full_gc, if (_avg_minor_pause->padded_average() > _avg_major_pause->padded_average()) { adjust_eden_for_minor_pause_time(is_full_gc, desired_eden_size_ptr); } - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr( - "PSAdaptiveSizePolicy::adjust_eden_for_pause_time " - "adjusting gen sizes for major pause (avg %f goal %f). " - "desired_eden_size " SIZE_FORMAT " eden delta " SIZE_FORMAT, - _avg_major_pause->average(), gc_pause_goal_sec(), - *desired_eden_size_ptr, eden_heap_delta); - } + log_trace(gc, ergo)( + "PSAdaptiveSizePolicy::adjust_eden_for_pause_time " + "adjusting gen sizes for major pause (avg %f goal %f). " + "desired_eden_size " SIZE_FORMAT " eden delta " SIZE_FORMAT, + _avg_major_pause->average(), gc_pause_goal_sec(), + *desired_eden_size_ptr, eden_heap_delta); } void PSAdaptiveSizePolicy::adjust_promo_for_throughput(bool is_full_gc, @@ -761,13 +694,8 @@ void PSAdaptiveSizePolicy::adjust_promo_for_throughput(bool is_full_gc, return; } - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print("\nPSAdaptiveSizePolicy::adjust_promo_for_throughput(" - "is_full: %d, promo: " SIZE_FORMAT "): ", - is_full_gc, *desired_promo_size_ptr); - gclog_or_tty->print_cr("mutator_cost %f major_gc_cost %f " - "minor_gc_cost %f", mutator_cost(), major_gc_cost(), minor_gc_cost()); - } + log_trace(gc, ergo)("PSAdaptiveSizePolicy::adjust_promo_for_throughput(is_full: %d, promo: " SIZE_FORMAT "): mutator_cost %f major_gc_cost %f minor_gc_cost %f", + is_full_gc, *desired_promo_size_ptr, mutator_cost(), major_gc_cost(), minor_gc_cost()); // Tenured generation if (is_full_gc) { @@ -780,12 +708,8 @@ void PSAdaptiveSizePolicy::adjust_promo_for_throughput(bool is_full_gc, double scale_by_ratio = major_gc_cost() / gc_cost(); scaled_promo_heap_delta = (size_t) (scale_by_ratio * (double) promo_heap_delta); - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr( - "Scaled tenured increment: " SIZE_FORMAT " by %f down to " - SIZE_FORMAT, - promo_heap_delta, scale_by_ratio, scaled_promo_heap_delta); - } + log_trace(gc, ergo)("Scaled tenured increment: " SIZE_FORMAT " by %f down to " SIZE_FORMAT, + promo_heap_delta, scale_by_ratio, scaled_promo_heap_delta); } else if (major_gc_cost() >= 0.0) { // Scaling is not going to work. If the major gc time is the // larger, give it a full increment. @@ -839,13 +763,10 @@ void PSAdaptiveSizePolicy::adjust_promo_for_throughput(bool is_full_gc, _old_gen_change_for_major_throughput++; } - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr( - "adjusting tenured gen for throughput (avg %f goal %f). " - "desired_promo_size " SIZE_FORMAT " promo_delta " SIZE_FORMAT , - mutator_cost(), _throughput_goal, - *desired_promo_size_ptr, scaled_promo_heap_delta); - } + log_trace(gc, ergo)("Adjusting tenured gen for throughput (avg %f goal %f). desired_promo_size " SIZE_FORMAT " promo_delta " SIZE_FORMAT , + mutator_cost(), + _throughput_goal, + *desired_promo_size_ptr, scaled_promo_heap_delta); } } @@ -860,13 +781,8 @@ void PSAdaptiveSizePolicy::adjust_eden_for_throughput(bool is_full_gc, return; } - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print("\nPSAdaptiveSizePolicy::adjust_eden_for_throughput(" - "is_full: %d, cur_eden: " SIZE_FORMAT "): ", - is_full_gc, *desired_eden_size_ptr); - gclog_or_tty->print_cr("mutator_cost %f major_gc_cost %f " - "minor_gc_cost %f", mutator_cost(), major_gc_cost(), minor_gc_cost()); - } + log_trace(gc, ergo)("PSAdaptiveSizePolicy::adjust_eden_for_throughput(is_full: %d, cur_eden: " SIZE_FORMAT "): mutator_cost %f major_gc_cost %f minor_gc_cost %f", + is_full_gc, *desired_eden_size_ptr, mutator_cost(), major_gc_cost(), minor_gc_cost()); // Young generation size_t scaled_eden_heap_delta = 0; @@ -878,12 +794,8 @@ void PSAdaptiveSizePolicy::adjust_eden_for_throughput(bool is_full_gc, assert(scale_by_ratio <= 1.0 && scale_by_ratio >= 0.0, "Scaling is wrong"); scaled_eden_heap_delta = (size_t) (scale_by_ratio * (double) eden_heap_delta); - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr( - "Scaled eden increment: " SIZE_FORMAT " by %f down to " - SIZE_FORMAT, - eden_heap_delta, scale_by_ratio, scaled_eden_heap_delta); - } + log_trace(gc, ergo)("Scaled eden increment: " SIZE_FORMAT " by %f down to " SIZE_FORMAT, + eden_heap_delta, scale_by_ratio, scaled_eden_heap_delta); } else if (minor_gc_cost() >= 0.0) { // Scaling is not going to work. If the minor gc time is the // larger, give it a full increment. @@ -936,13 +848,8 @@ void PSAdaptiveSizePolicy::adjust_eden_for_throughput(bool is_full_gc, _young_gen_change_for_minor_throughput++; } - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr( - "adjusting eden for throughput (avg %f goal %f). desired_eden_size " - SIZE_FORMAT " eden delta " SIZE_FORMAT "\n", - mutator_cost(), _throughput_goal, - *desired_eden_size_ptr, scaled_eden_heap_delta); - } + log_trace(gc, ergo)("Adjusting eden for throughput (avg %f goal %f). desired_eden_size " SIZE_FORMAT " eden delta " SIZE_FORMAT, + mutator_cost(), _throughput_goal, *desired_eden_size_ptr, scaled_eden_heap_delta); } size_t PSAdaptiveSizePolicy::adjust_promo_for_footprint( @@ -955,15 +862,13 @@ size_t PSAdaptiveSizePolicy::adjust_promo_for_footprint( size_t reduced_size = desired_promo_size - change; - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr( - "AdaptiveSizePolicy::adjust_promo_for_footprint " - "adjusting tenured gen for footprint. " - "starting promo size " SIZE_FORMAT - " reduced promo size " SIZE_FORMAT - " promo delta " SIZE_FORMAT, - desired_promo_size, reduced_size, change ); - } + log_trace(gc, ergo)( + "AdaptiveSizePolicy::adjust_promo_for_footprint " + "adjusting tenured gen for footprint. " + "starting promo size " SIZE_FORMAT + " reduced promo size " SIZE_FORMAT + " promo delta " SIZE_FORMAT, + desired_promo_size, reduced_size, change ); assert(reduced_size <= desired_promo_size, "Inconsistent result"); return reduced_size; @@ -979,15 +884,13 @@ size_t PSAdaptiveSizePolicy::adjust_eden_for_footprint( size_t reduced_size = desired_eden_size - change; - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr( - "AdaptiveSizePolicy::adjust_eden_for_footprint " - "adjusting eden for footprint. " - " starting eden size " SIZE_FORMAT - " reduced eden size " SIZE_FORMAT - " eden delta " SIZE_FORMAT, - desired_eden_size, reduced_size, change); - } + log_trace(gc, ergo)( + "AdaptiveSizePolicy::adjust_eden_for_footprint " + "adjusting eden for footprint. " + " starting eden size " SIZE_FORMAT + " reduced eden size " SIZE_FORMAT + " eden delta " SIZE_FORMAT, + desired_eden_size, reduced_size, change); assert(reduced_size <= desired_eden_size, "Inconsistent result"); return reduced_size; @@ -1187,33 +1090,14 @@ uint PSAdaptiveSizePolicy::compute_survivor_space_size_and_threshold( // the amount of old gen free space is less than what we expect to // promote). - if (PrintAdaptiveSizePolicy) { - // A little more detail if Verbose is on - if (Verbose) { - gclog_or_tty->print( " avg_survived: %f" - " avg_deviation: %f", - _avg_survived->average(), - _avg_survived->deviation()); - } + log_trace(gc, ergo)("avg_survived: %f avg_deviation: %f", _avg_survived->average(), _avg_survived->deviation()); + log_debug(gc, ergo)("avg_survived_padded_avg: %f", _avg_survived->padded_average()); - gclog_or_tty->print( " avg_survived_padded_avg: %f", - _avg_survived->padded_average()); - - if (Verbose) { - gclog_or_tty->print( " avg_promoted_avg: %f" - " avg_promoted_dev: %f", - avg_promoted()->average(), - avg_promoted()->deviation()); - } - - gclog_or_tty->print_cr( " avg_promoted_padded_avg: %f" - " avg_pretenured_padded_avg: %f" - " tenuring_thresh: %d" - " target_size: " SIZE_FORMAT, - avg_promoted()->padded_average(), - _avg_pretenured->padded_average(), - tenuring_threshold, target_size); - } + log_trace(gc, ergo)("avg_promoted_avg: %f avg_promoted_dev: %f", avg_promoted()->average(), avg_promoted()->deviation()); + log_debug(gc, ergo)("avg_promoted_padded_avg: %f avg_pretenured_padded_avg: %f tenuring_thresh: %d target_size: " SIZE_FORMAT, + avg_promoted()->padded_average(), + _avg_pretenured->padded_average(), + tenuring_threshold, target_size); set_survivor_size(target_size); @@ -1233,24 +1117,22 @@ void PSAdaptiveSizePolicy::update_averages(bool is_survivor_overflow, } avg_promoted()->sample(promoted); - if (PrintAdaptiveSizePolicy) { - gclog_or_tty->print_cr( - "AdaptiveSizePolicy::update_averages:" - " survived: " SIZE_FORMAT - " promoted: " SIZE_FORMAT - " overflow: %s", - survived, promoted, is_survivor_overflow ? "true" : "false"); - } + log_trace(gc, ergo)("AdaptiveSizePolicy::update_averages: survived: " SIZE_FORMAT " promoted: " SIZE_FORMAT " overflow: %s", + survived, promoted, is_survivor_overflow ? "true" : "false"); } -bool PSAdaptiveSizePolicy::print_adaptive_size_policy_on(outputStream* st) - const { +bool PSAdaptiveSizePolicy::print() const { - if (!UseAdaptiveSizePolicy) return false; + if (!UseAdaptiveSizePolicy) { + return false; + } - return AdaptiveSizePolicy::print_adaptive_size_policy_on( - st, - PSScavenge::tenuring_threshold()); + if (AdaptiveSizePolicy::print()) { + AdaptiveSizePolicy::print_tenuring_threshold(PSScavenge::tenuring_threshold()); + return true; + } + + return false; } #ifndef PRODUCT diff --git a/hotspot/src/share/vm/gc/parallel/psAdaptiveSizePolicy.hpp b/hotspot/src/share/vm/gc/parallel/psAdaptiveSizePolicy.hpp index 2d3899c878c..5f5306e1da7 100644 --- a/hotspot/src/share/vm/gc/parallel/psAdaptiveSizePolicy.hpp +++ b/hotspot/src/share/vm/gc/parallel/psAdaptiveSizePolicy.hpp @@ -395,7 +395,7 @@ class PSAdaptiveSizePolicy : public AdaptiveSizePolicy { size_t promoted); // Printing support - virtual bool print_adaptive_size_policy_on(outputStream* st) const; + virtual bool print() const; // Decay the supplemental growth additive. void decay_supplemental_growth(bool is_full_gc); diff --git a/hotspot/src/share/vm/gc/parallel/psCompactionManager.cpp b/hotspot/src/share/vm/gc/parallel/psCompactionManager.cpp index 1047e0bbc7f..261098b0c49 100644 --- a/hotspot/src/share/vm/gc/parallel/psCompactionManager.cpp +++ b/hotspot/src/share/vm/gc/parallel/psCompactionManager.cpp @@ -32,6 +32,7 @@ #include "gc/parallel/psOldGen.hpp" #include "gc/parallel/psParallelCompact.inline.hpp" #include "gc/shared/taskqueue.inline.hpp" +#include "logging/log.hpp" #include "memory/iterator.inline.hpp" #include "oops/instanceKlass.inline.hpp" #include "oops/instanceMirrorKlass.inline.hpp" @@ -229,30 +230,18 @@ template static void oop_pc_follow_contents_specialized(InstanceRefKlass* klass, oop obj, ParCompactionManager* cm) { T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj); T heap_oop = oopDesc::load_heap_oop(referent_addr); - debug_only( - if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr("InstanceRefKlass::oop_pc_follow_contents " PTR_FORMAT, p2i(obj)); - } - ) + log_develop_trace(gc, ref)("InstanceRefKlass::oop_pc_follow_contents " PTR_FORMAT, p2i(obj)); if (!oopDesc::is_null(heap_oop)) { oop referent = oopDesc::decode_heap_oop_not_null(heap_oop); if (PSParallelCompact::mark_bitmap()->is_unmarked(referent) && PSParallelCompact::ref_processor()->discover_reference(obj, klass->reference_type())) { // reference already enqueued, referent will be traversed later klass->InstanceKlass::oop_pc_follow_contents(obj, cm); - debug_only( - if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" Non NULL enqueued " PTR_FORMAT, p2i(obj)); - } - ) + log_develop_trace(gc, ref)(" Non NULL enqueued " PTR_FORMAT, p2i(obj)); return; } else { // treat referent as normal oop - debug_only( - if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" Non NULL normal " PTR_FORMAT, p2i(obj)); - } - ) + log_develop_trace(gc, ref)(" Non NULL normal " PTR_FORMAT, p2i(obj)); cm->mark_and_push(referent_addr); } } @@ -262,12 +251,7 @@ static void oop_pc_follow_contents_specialized(InstanceRefKlass* klass, oop obj, T next_oop = oopDesc::load_heap_oop(next_addr); if (!oopDesc::is_null(next_oop)) { // i.e. ref is not "active" T* discovered_addr = (T*)java_lang_ref_Reference::discovered_addr(obj); - debug_only( - if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" Process discovered as normal " - PTR_FORMAT, p2i(discovered_addr)); - } - ) + log_develop_trace(gc, ref)(" Process discovered as normal " PTR_FORMAT, p2i(discovered_addr)); cm->mark_and_push(discovered_addr); } cm->mark_and_push(next_addr); diff --git a/hotspot/src/share/vm/gc/parallel/psMarkSweep.cpp b/hotspot/src/share/vm/gc/parallel/psMarkSweep.cpp index d860fe9b728..75fed6c0c40 100644 --- a/hotspot/src/share/vm/gc/parallel/psMarkSweep.cpp +++ b/hotspot/src/share/vm/gc/parallel/psMarkSweep.cpp @@ -41,11 +41,12 @@ #include "gc/shared/gcLocker.inline.hpp" #include "gc/shared/gcTimer.hpp" #include "gc/shared/gcTrace.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/isGCActiveMark.hpp" #include "gc/shared/referencePolicy.hpp" #include "gc/shared/referenceProcessor.hpp" #include "gc/shared/spaceDecorator.hpp" +#include "logging/log.hpp" #include "oops/oop.inline.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/fprofiler.hpp" @@ -137,8 +138,6 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { // We need to track unique mark sweep invocations as well. _total_invocations++; - AdaptiveSizePolicyOutput(size_policy, heap->total_collections()); - heap->print_heap_before_gc(); heap->trace_heap_before_gc(_gc_tracer); @@ -148,7 +147,7 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { if (VerifyBeforeGC && heap->total_collections() >= VerifyGCStartAt) { HandleMark hm; // Discard invalid handles created during verification - Universe::verify(" VerifyBeforeGC:"); + Universe::verify("Before GC"); } // Verify object start arrays @@ -167,8 +166,8 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { { HandleMark hm; - TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); - GCTraceTime t1(GCCauseString("Full GC", gc_cause), PrintGC, !PrintGCDetails, NULL); + GCTraceCPUTime tcpu; + GCTraceTime(Info, gc) t("Pause Full", NULL, gc_cause, true); TraceCollectorStats tcs(counters()); TraceMemoryManagerStats tms(true /* Full GC */,gc_cause); @@ -180,13 +179,9 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { CodeCache::gc_prologue(); BiasedLocking::preserve_marks(); - // Capture heap size before collection for printing. - size_t prev_used = heap->used(); - // Capture metadata size before collection for sizing. size_t metadata_prev_used = MetaspaceAux::used_bytes(); - // For PrintGCDetails size_t old_gen_prev_used = old_gen->used_in_bytes(); size_t young_gen_prev_used = young_gen->used_in_bytes(); @@ -266,17 +261,9 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { if (UseAdaptiveSizePolicy) { - if (PrintAdaptiveSizePolicy) { - gclog_or_tty->print("AdaptiveSizeStart: "); - gclog_or_tty->stamp(); - gclog_or_tty->print_cr(" collection: %d ", - heap->total_collections()); - if (Verbose) { - gclog_or_tty->print("old_gen_capacity: " SIZE_FORMAT - " young_gen_capacity: " SIZE_FORMAT, - old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes()); - } - } + log_debug(gc, ergo)("AdaptiveSizeStart: collection: %d ", heap->total_collections()); + log_trace(gc, ergo)("old_gen_capacity: " SIZE_FORMAT " young_gen_capacity: " SIZE_FORMAT, + old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes()); // Don't check if the size_policy is ready here. Let // the size_policy check that internally. @@ -333,10 +320,7 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { heap->resize_young_gen(size_policy->calculated_eden_size_in_bytes(), size_policy->calculated_survivor_size_in_bytes()); } - if (PrintAdaptiveSizePolicy) { - gclog_or_tty->print_cr("AdaptiveSizeStop: collection: %d ", - heap->total_collections()); - } + log_debug(gc, ergo)("AdaptiveSizeStop: collection: %d ", heap->total_collections()); } if (UsePerfData) { @@ -354,18 +338,9 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { if (TraceOldGenTime) accumulated_time()->stop(); - if (PrintGC) { - if (PrintGCDetails) { - // Don't print a GC timestamp here. This is after the GC so - // would be confusing. - young_gen->print_used_change(young_gen_prev_used); - old_gen->print_used_change(old_gen_prev_used); - } - heap->print_heap_change(prev_used); - if (PrintGCDetails) { - MetaspaceAux::print_metaspace_change(metadata_prev_used); - } - } + young_gen->print_used_change(young_gen_prev_used); + old_gen->print_used_change(old_gen_prev_used); + MetaspaceAux::print_metaspace_change(metadata_prev_used); // Track memory usage and detect low memory MemoryService::track_memory_usage(); @@ -374,7 +349,7 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { if (VerifyAfterGC && heap->total_collections() >= VerifyGCStartAt) { HandleMark hm; // Discard invalid handles created during verification - Universe::verify(" VerifyAfterGC:"); + Universe::verify("After GC"); } // Re-verify object start arrays @@ -398,6 +373,8 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) { ParallelTaskTerminator::print_termination_counts(); #endif + AdaptiveSizePolicyOutput::print(size_policy, heap->total_collections()); + _gc_timer->register_gc_end(); _gc_tracer->report_gc_end(_gc_timer->gc_end(), _gc_timer->time_partitions()); @@ -443,8 +420,7 @@ bool PSMarkSweep::absorb_live_data_from_eden(PSAdaptiveSizePolicy* size_policy, return false; // Respect young gen minimum size. } - if (TraceAdaptiveGCBoundary && Verbose) { - gclog_or_tty->print(" absorbing " SIZE_FORMAT "K: " + log_trace(heap, ergo)(" absorbing " SIZE_FORMAT "K: " "eden " SIZE_FORMAT "K->" SIZE_FORMAT "K " "from " SIZE_FORMAT "K, to " SIZE_FORMAT "K " "young_gen " SIZE_FORMAT "K->" SIZE_FORMAT "K ", @@ -453,7 +429,6 @@ bool PSMarkSweep::absorb_live_data_from_eden(PSAdaptiveSizePolicy* size_policy, young_gen->from_space()->used_in_bytes() / K, young_gen->to_space()->used_in_bytes() / K, young_gen->capacity_in_bytes() / K, new_young_size / K); - } // Fill the unused part of the old gen. MutableSpace* const old_space = old_gen->object_space(); @@ -517,7 +492,7 @@ void PSMarkSweep::deallocate_stacks() { void PSMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) { // Recursively traverse all live objects and mark them - GCTraceTime tm("phase 1", PrintGCDetails && Verbose, true, _gc_timer); + GCTraceTime(Trace, gc) tm("Phase 1: Mark live objects", _gc_timer); ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); @@ -576,7 +551,7 @@ void PSMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) { void PSMarkSweep::mark_sweep_phase2() { - GCTraceTime tm("phase 2", PrintGCDetails && Verbose, true, _gc_timer); + GCTraceTime(Trace, gc) tm("Phase 2: Compute new object addresses", _gc_timer); // Now all live objects are marked, compute the new object addresses. @@ -603,7 +578,7 @@ static PSAlwaysTrueClosure always_true; void PSMarkSweep::mark_sweep_phase3() { // Adjust the pointers to reflect the new locations - GCTraceTime tm("phase 3", PrintGCDetails && Verbose, true, _gc_timer); + GCTraceTime(Trace, gc) tm("Phase 3: Adjust pointers", _gc_timer); ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); PSYoungGen* young_gen = heap->young_gen(); @@ -643,7 +618,7 @@ void PSMarkSweep::mark_sweep_phase3() { void PSMarkSweep::mark_sweep_phase4() { EventMark m("4 compact heap"); - GCTraceTime tm("phase 4", PrintGCDetails && Verbose, true, _gc_timer); + GCTraceTime(Trace, gc) tm("Phase 4: Move objects", _gc_timer); // All pointers are now adjusted, move objects accordingly diff --git a/hotspot/src/share/vm/gc/parallel/psOldGen.cpp b/hotspot/src/share/vm/gc/parallel/psOldGen.cpp index ee47f5e43d8..42160922637 100644 --- a/hotspot/src/share/vm/gc/parallel/psOldGen.cpp +++ b/hotspot/src/share/vm/gc/parallel/psOldGen.cpp @@ -30,6 +30,7 @@ #include "gc/shared/cardTableModRefBS.hpp" #include "gc/shared/gcLocker.inline.hpp" #include "gc/shared/spaceDecorator.hpp" +#include "logging/log.hpp" #include "oops/oop.inline.hpp" #include "runtime/java.hpp" @@ -256,10 +257,8 @@ void PSOldGen::expand(size_t bytes) { success = expand_to_reserved(); } - if (PrintGC && Verbose) { - if (success && GC_locker::is_active_and_needs_gc()) { - gclog_or_tty->print_cr("Garbage collection disabled, expanded heap instead"); - } + if (success && GC_locker::is_active_and_needs_gc()) { + log_debug(gc)("Garbage collection disabled, expanded heap instead"); } } @@ -291,13 +290,11 @@ bool PSOldGen::expand_by(size_t bytes) { } } - if (result && Verbose && PrintGC) { + if (result) { size_t new_mem_size = virtual_space()->committed_size(); size_t old_mem_size = new_mem_size - bytes; - gclog_or_tty->print_cr("Expanding %s from " SIZE_FORMAT "K by " - SIZE_FORMAT "K to " - SIZE_FORMAT "K", - name(), old_mem_size/K, bytes/K, new_mem_size/K); + log_debug(gc)("Expanding %s from " SIZE_FORMAT "K by " SIZE_FORMAT "K to " SIZE_FORMAT "K", + name(), old_mem_size/K, bytes/K, new_mem_size/K); } return result; @@ -326,14 +323,10 @@ void PSOldGen::shrink(size_t bytes) { virtual_space()->shrink_by(bytes); post_resize(); - if (Verbose && PrintGC) { - size_t new_mem_size = virtual_space()->committed_size(); - size_t old_mem_size = new_mem_size + bytes; - gclog_or_tty->print_cr("Shrinking %s from " SIZE_FORMAT "K by " - SIZE_FORMAT "K to " - SIZE_FORMAT "K", - name(), old_mem_size/K, bytes/K, new_mem_size/K); - } + size_t new_mem_size = virtual_space()->committed_size(); + size_t old_mem_size = new_mem_size + bytes; + log_debug(gc)("Shrinking %s from " SIZE_FORMAT "K by " SIZE_FORMAT "K to " SIZE_FORMAT "K", + name(), old_mem_size/K, bytes/K, new_mem_size/K); } } @@ -353,14 +346,12 @@ void PSOldGen::resize(size_t desired_free_space) { const size_t current_size = capacity_in_bytes(); - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr("AdaptiveSizePolicy::old generation size: " - "desired free: " SIZE_FORMAT " used: " SIZE_FORMAT - " new size: " SIZE_FORMAT " current size " SIZE_FORMAT - " gen limits: " SIZE_FORMAT " / " SIZE_FORMAT, - desired_free_space, used_in_bytes(), new_size, current_size, - gen_size_limit(), min_gen_size()); - } + log_trace(gc, ergo)("AdaptiveSizePolicy::old generation size: " + "desired free: " SIZE_FORMAT " used: " SIZE_FORMAT + " new size: " SIZE_FORMAT " current size " SIZE_FORMAT + " gen limits: " SIZE_FORMAT " / " SIZE_FORMAT, + desired_free_space, used_in_bytes(), new_size, current_size, + gen_size_limit(), min_gen_size()); if (new_size == current_size) { // No change requested @@ -376,14 +367,10 @@ void PSOldGen::resize(size_t desired_free_space) { shrink(change_bytes); } - if (PrintAdaptiveSizePolicy) { - ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); - gclog_or_tty->print_cr("AdaptiveSizePolicy::old generation size: " - "collection: %d " - "(" SIZE_FORMAT ") -> (" SIZE_FORMAT ") ", - heap->total_collections(), - size_before, virtual_space()->committed_size()); - } + log_trace(gc, ergo)("AdaptiveSizePolicy::old generation size: collection: %d (" SIZE_FORMAT ") -> (" SIZE_FORMAT ") ", + ParallelScavengeHeap::heap()->total_collections(), + size_before, + virtual_space()->committed_size()); } // NOTE! We need to be careful about resizing. During a GC, multiple @@ -430,13 +417,8 @@ size_t PSOldGen::available_for_contraction() { void PSOldGen::print() const { print_on(tty);} void PSOldGen::print_on(outputStream* st) const { st->print(" %-15s", name()); - if (PrintGCDetails && Verbose) { - st->print(" total " SIZE_FORMAT ", used " SIZE_FORMAT, - capacity_in_bytes(), used_in_bytes()); - } else { - st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K", - capacity_in_bytes()/K, used_in_bytes()/K); - } + st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K", + capacity_in_bytes()/K, used_in_bytes()/K); st->print_cr(" [" INTPTR_FORMAT ", " INTPTR_FORMAT ", " INTPTR_FORMAT ")", p2i(virtual_space()->low_boundary()), p2i(virtual_space()->high()), @@ -446,13 +428,8 @@ void PSOldGen::print_on(outputStream* st) const { } void PSOldGen::print_used_change(size_t prev_used) const { - gclog_or_tty->print(" [%s:", name()); - gclog_or_tty->print(" " SIZE_FORMAT "K" - "->" SIZE_FORMAT "K" - "(" SIZE_FORMAT "K)", - prev_used / K, used_in_bytes() / K, - capacity_in_bytes() / K); - gclog_or_tty->print("]"); + log_info(gc, heap)("%s: " SIZE_FORMAT "K->" SIZE_FORMAT "K(" SIZE_FORMAT "K)", + name(), prev_used / K, used_in_bytes() / K, capacity_in_bytes() / K); } void PSOldGen::update_counters() { diff --git a/hotspot/src/share/vm/gc/parallel/psParallelCompact.cpp b/hotspot/src/share/vm/gc/parallel/psParallelCompact.cpp index 35de7fc5909..2e5e266a4fd 100644 --- a/hotspot/src/share/vm/gc/parallel/psParallelCompact.cpp +++ b/hotspot/src/share/vm/gc/parallel/psParallelCompact.cpp @@ -45,11 +45,12 @@ #include "gc/shared/gcLocker.inline.hpp" #include "gc/shared/gcTimer.hpp" #include "gc/shared/gcTrace.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/isGCActiveMark.hpp" #include "gc/shared/referencePolicy.hpp" #include "gc/shared/referenceProcessor.hpp" #include "gc/shared/spaceDecorator.hpp" +#include "logging/log.hpp" #include "oops/instanceKlass.inline.hpp" #include "oops/instanceMirrorKlass.inline.hpp" #include "oops/methodData.hpp" @@ -107,7 +108,6 @@ const ParallelCompactData::RegionData::region_sz_t ParallelCompactData::RegionData::dc_completed = 0xcU << dc_shift; SpaceInfo PSParallelCompact::_space_info[PSParallelCompact::last_space_id]; -bool PSParallelCompact::_print_phases = false; ReferenceProcessor* PSParallelCompact::_ref_processor = NULL; @@ -194,21 +194,26 @@ const char* PSParallelCompact::space_names[] = { "old ", "eden", "from", "to " }; -void PSParallelCompact::print_region_ranges() -{ - tty->print_cr("space bottom top end new_top"); - tty->print_cr("------ ---------- ---------- ---------- ----------"); +void PSParallelCompact::print_region_ranges() { + if (!develop_log_is_enabled(Trace, gc, compaction, phases)) { + return; + } + LogHandle(gc, compaction, phases) log; + ResourceMark rm; + Universe::print_on(log.trace_stream()); + log.trace("space bottom top end new_top"); + log.trace("------ ---------- ---------- ---------- ----------"); for (unsigned int id = 0; id < last_space_id; ++id) { const MutableSpace* space = _space_info[id].space(); - tty->print_cr("%u %s " - SIZE_FORMAT_W(10) " " SIZE_FORMAT_W(10) " " - SIZE_FORMAT_W(10) " " SIZE_FORMAT_W(10) " ", - id, space_names[id], - summary_data().addr_to_region_idx(space->bottom()), - summary_data().addr_to_region_idx(space->top()), - summary_data().addr_to_region_idx(space->end()), - summary_data().addr_to_region_idx(_space_info[id].new_top())); + log.trace("%u %s " + SIZE_FORMAT_W(10) " " SIZE_FORMAT_W(10) " " + SIZE_FORMAT_W(10) " " SIZE_FORMAT_W(10) " ", + id, space_names[id], + summary_data().addr_to_region_idx(space->bottom()), + summary_data().addr_to_region_idx(space->top()), + summary_data().addr_to_region_idx(space->end()), + summary_data().addr_to_region_idx(_space_info[id].new_top())); } } @@ -220,13 +225,14 @@ print_generic_summary_region(size_t i, const ParallelCompactData::RegionData* c) ParallelCompactData& sd = PSParallelCompact::summary_data(); size_t dci = c->destination() ? sd.addr_to_region_idx(c->destination()) : 0; - tty->print_cr(REGION_IDX_FORMAT " " PTR_FORMAT " " - REGION_IDX_FORMAT " " PTR_FORMAT " " - REGION_DATA_FORMAT " " REGION_DATA_FORMAT " " - REGION_DATA_FORMAT " " REGION_IDX_FORMAT " %d", - i, p2i(c->data_location()), dci, p2i(c->destination()), - c->partial_obj_size(), c->live_obj_size(), - c->data_size(), c->source_region(), c->destination_count()); + log_develop_trace(gc, compaction, phases)( + REGION_IDX_FORMAT " " PTR_FORMAT " " + REGION_IDX_FORMAT " " PTR_FORMAT " " + REGION_DATA_FORMAT " " REGION_DATA_FORMAT " " + REGION_DATA_FORMAT " " REGION_IDX_FORMAT " %d", + i, p2i(c->data_location()), dci, p2i(c->destination()), + c->partial_obj_size(), c->live_obj_size(), + c->data_size(), c->source_region(), c->destination_count()); #undef REGION_IDX_FORMAT #undef REGION_DATA_FORMAT @@ -252,13 +258,17 @@ print_generic_summary_data(ParallelCompactData& summary_data, ++i; } - tty->print_cr("summary_data_bytes=" SIZE_FORMAT, total_words * HeapWordSize); + log_develop_trace(gc, compaction, phases)("summary_data_bytes=" SIZE_FORMAT, total_words * HeapWordSize); } void print_generic_summary_data(ParallelCompactData& summary_data, SpaceInfo* space_info) { + if (!develop_log_is_enabled(Trace, gc, compaction, phases)) { + return; + } + for (unsigned int id = 0; id < PSParallelCompact::last_space_id; ++id) { const MutableSpace* space = space_info[id].space(); print_generic_summary_data(summary_data, space->bottom(), @@ -266,20 +276,6 @@ print_generic_summary_data(ParallelCompactData& summary_data, } } -void -print_initial_summary_region(size_t i, - const ParallelCompactData::RegionData* c, - bool newline = true) -{ - tty->print(SIZE_FORMAT_W(5) " " PTR_FORMAT " " - SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " " - SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " %d", - i, p2i(c->destination()), - c->partial_obj_size(), c->live_obj_size(), - c->data_size(), c->source_region(), c->destination_count()); - if (newline) tty->cr(); -} - void print_initial_summary_data(ParallelCompactData& summary_data, const MutableSpace* space) { @@ -299,7 +295,12 @@ print_initial_summary_data(ParallelCompactData& summary_data, size_t full_region_count = 0; size_t i = summary_data.addr_to_region_idx(space->bottom()); while (i < end_region && summary_data.region(i)->data_size() == region_size) { - print_initial_summary_region(i, summary_data.region(i)); + ParallelCompactData::RegionData* c = summary_data.region(i); + log_develop_trace(gc, compaction, phases)( + SIZE_FORMAT_W(5) " " PTR_FORMAT " " SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " %d", + i, p2i(c->destination()), + c->partial_obj_size(), c->live_obj_size(), + c->data_size(), c->source_region(), c->destination_count()); ++full_region_count; ++i; } @@ -328,9 +329,15 @@ print_initial_summary_data(ParallelCompactData& summary_data, max_live_to_right = live_to_right; } - print_initial_summary_region(i, c, false); - tty->print_cr(" %12.10f " SIZE_FORMAT_W(10) " " SIZE_FORMAT_W(10), - reclaimed_ratio, dead_to_right, live_to_right); + ParallelCompactData::RegionData* c = summary_data.region(i); + log_develop_trace(gc, compaction, phases)( + SIZE_FORMAT_W(5) " " PTR_FORMAT " " SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " %d" + "%12.10f " SIZE_FORMAT_W(10) " " SIZE_FORMAT_W(10), + i, p2i(c->destination()), + c->partial_obj_size(), c->live_obj_size(), + c->data_size(), c->source_region(), c->destination_count(), + reclaimed_ratio, dead_to_right, live_to_right); + live_to_right -= c->data_size(); ++i; @@ -338,18 +345,25 @@ print_initial_summary_data(ParallelCompactData& summary_data, // Any remaining regions are empty. Print one more if there is one. if (i < end_region) { - print_initial_summary_region(i, summary_data.region(i)); + ParallelCompactData::RegionData* c = summary_data.region(i); + log_develop_trace(gc, compaction, phases)( + SIZE_FORMAT_W(5) " " PTR_FORMAT " " SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " " SIZE_FORMAT_W(5) " %d", + i, p2i(c->destination()), + c->partial_obj_size(), c->live_obj_size(), + c->data_size(), c->source_region(), c->destination_count()); } - tty->print_cr("max: " SIZE_FORMAT_W(4) " d2r=" SIZE_FORMAT_W(10) " " - "l2r=" SIZE_FORMAT_W(10) " max_ratio=%14.12f", - max_reclaimed_ratio_region, max_dead_to_right, - max_live_to_right, max_reclaimed_ratio); + log_develop_trace(gc, compaction, phases)("max: " SIZE_FORMAT_W(4) " d2r=" SIZE_FORMAT_W(10) " l2r=" SIZE_FORMAT_W(10) " max_ratio=%14.12f", + max_reclaimed_ratio_region, max_dead_to_right, max_live_to_right, max_reclaimed_ratio); } void print_initial_summary_data(ParallelCompactData& summary_data, SpaceInfo* space_info) { + if (!develop_log_is_enabled(Trace, gc, compaction, phases)) { + return; + } + unsigned int id = PSParallelCompact::old_space_id; const MutableSpace* space; do { @@ -607,11 +621,7 @@ ParallelCompactData::summarize_split_space(size_t src_region, sr->partial_obj_size())); const size_t end_idx = addr_to_region_idx(target_end); - if (TraceParallelOldGCSummaryPhase) { - gclog_or_tty->print_cr("split: clearing source_region field in [" - SIZE_FORMAT ", " SIZE_FORMAT ")", - beg_idx, end_idx); - } + log_develop_trace(gc, compaction, phases)("split: clearing source_region field in [" SIZE_FORMAT ", " SIZE_FORMAT ")", beg_idx, end_idx); for (size_t idx = beg_idx; idx < end_idx; ++idx) { _region_data[idx].set_source_region(0); } @@ -631,27 +641,22 @@ ParallelCompactData::summarize_split_space(size_t src_region, *target_next = split_destination + partial_obj_size; HeapWord* const source_next = region_to_addr(split_region) + partial_obj_size; - if (TraceParallelOldGCSummaryPhase) { + if (develop_log_is_enabled(Trace, gc, compaction, phases)) { const char * split_type = partial_obj_size == 0 ? "easy" : "hard"; - gclog_or_tty->print_cr("%s split: src=" PTR_FORMAT " src_c=" SIZE_FORMAT - " pos=" SIZE_FORMAT, - split_type, p2i(source_next), split_region, - partial_obj_size); - gclog_or_tty->print_cr("%s split: dst=" PTR_FORMAT " dst_c=" SIZE_FORMAT - " tn=" PTR_FORMAT, - split_type, p2i(split_destination), - addr_to_region_idx(split_destination), - p2i(*target_next)); + log_develop_trace(gc, compaction, phases)("%s split: src=" PTR_FORMAT " src_c=" SIZE_FORMAT " pos=" SIZE_FORMAT, + split_type, p2i(source_next), split_region, partial_obj_size); + log_develop_trace(gc, compaction, phases)("%s split: dst=" PTR_FORMAT " dst_c=" SIZE_FORMAT " tn=" PTR_FORMAT, + split_type, p2i(split_destination), + addr_to_region_idx(split_destination), + p2i(*target_next)); if (partial_obj_size != 0) { HeapWord* const po_beg = split_info.destination(); HeapWord* const po_end = po_beg + split_info.partial_obj_size(); - gclog_or_tty->print_cr("%s split: " - "po_beg=" PTR_FORMAT " " SIZE_FORMAT " " - "po_end=" PTR_FORMAT " " SIZE_FORMAT, - split_type, - p2i(po_beg), addr_to_region_idx(po_beg), - p2i(po_end), addr_to_region_idx(po_end)); + log_develop_trace(gc, compaction, phases)("%s split: po_beg=" PTR_FORMAT " " SIZE_FORMAT " po_end=" PTR_FORMAT " " SIZE_FORMAT, + split_type, + p2i(po_beg), addr_to_region_idx(po_beg), + p2i(po_end), addr_to_region_idx(po_end)); } } @@ -664,13 +669,12 @@ bool ParallelCompactData::summarize(SplitInfo& split_info, HeapWord* target_beg, HeapWord* target_end, HeapWord** target_next) { - if (TraceParallelOldGCSummaryPhase) { - HeapWord* const source_next_val = source_next == NULL ? NULL : *source_next; - tty->print_cr("sb=" PTR_FORMAT " se=" PTR_FORMAT " sn=" PTR_FORMAT - "tb=" PTR_FORMAT " te=" PTR_FORMAT " tn=" PTR_FORMAT, - p2i(source_beg), p2i(source_end), p2i(source_next_val), - p2i(target_beg), p2i(target_end), p2i(*target_next)); - } + HeapWord* const source_next_val = source_next == NULL ? NULL : *source_next; + log_develop_trace(gc, compaction, phases)( + "sb=" PTR_FORMAT " se=" PTR_FORMAT " sn=" PTR_FORMAT + "tb=" PTR_FORMAT " te=" PTR_FORMAT " tn=" PTR_FORMAT, + p2i(source_beg), p2i(source_end), p2i(source_next_val), + p2i(target_beg), p2i(target_end), p2i(*target_next)); size_t cur_region = addr_to_region_idx(source_beg); const size_t end_region = addr_to_region_idx(region_align_up(source_end)); @@ -901,32 +905,6 @@ void PSParallelCompact::initialize_dead_wood_limiter() _dwl_adjustment = normal_distribution(1.0); } -// Simple class for storing info about the heap at the start of GC, to be used -// after GC for comparison/printing. -class PreGCValues { -public: - PreGCValues() { } - PreGCValues(ParallelScavengeHeap* heap) { fill(heap); } - - void fill(ParallelScavengeHeap* heap) { - _heap_used = heap->used(); - _young_gen_used = heap->young_gen()->used_in_bytes(); - _old_gen_used = heap->old_gen()->used_in_bytes(); - _metadata_used = MetaspaceAux::used_bytes(); - }; - - size_t heap_used() const { return _heap_used; } - size_t young_gen_used() const { return _young_gen_used; } - size_t old_gen_used() const { return _old_gen_used; } - size_t metadata_used() const { return _metadata_used; } - -private: - size_t _heap_used; - size_t _young_gen_used; - size_t _old_gen_used; - size_t _metadata_used; -}; - void PSParallelCompact::clear_data_covering_space(SpaceId id) { @@ -956,19 +934,17 @@ PSParallelCompact::clear_data_covering_space(SpaceId id) DEBUG_ONLY(split_info.verify_clear();) } -void PSParallelCompact::pre_compact(PreGCValues* pre_gc_values) +void PSParallelCompact::pre_compact() { // Update the from & to space pointers in space_info, since they are swapped // at each young gen gc. Do the update unconditionally (even though a // promotion failure does not swap spaces) because an unknown number of young // collections will have swapped the spaces an unknown number of times. - GCTraceTime tm("pre compact", print_phases(), true, &_gc_timer); + GCTraceTime(Trace, gc, phases) tm("Pre Compact", &_gc_timer); ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); _space_info[from_space_id].set_space(heap->young_gen()->from_space()); _space_info[to_space_id].set_space(heap->young_gen()->to_space()); - pre_gc_values->fill(heap); - DEBUG_ONLY(add_obj_count = add_obj_size = 0;) DEBUG_ONLY(mark_bitmap_count = mark_bitmap_size = 0;) @@ -987,7 +963,7 @@ void PSParallelCompact::pre_compact(PreGCValues* pre_gc_values) if (VerifyBeforeGC && heap->total_collections() >= VerifyGCStartAt) { HandleMark hm; // Discard invalid handles created during verification - Universe::verify(" VerifyBeforeGC:"); + Universe::verify("Before GC"); } // Verify object start arrays @@ -1005,7 +981,7 @@ void PSParallelCompact::pre_compact(PreGCValues* pre_gc_values) void PSParallelCompact::post_compact() { - GCTraceTime tm("post compact", print_phases(), true, &_gc_timer); + GCTraceTime(Trace, gc, phases) tm("Post Compact", &_gc_timer); for (unsigned int id = old_space_id; id < last_space_id; ++id) { // Clear the marking bitmap, summary data and split info. @@ -1559,7 +1535,7 @@ PSParallelCompact::summarize_space(SpaceId id, bool maximum_compaction) } } - if (TraceParallelOldGCSummaryPhase) { + if (develop_log_is_enabled(Trace, gc, compaction, phases)) { const size_t region_size = ParallelCompactData::RegionSize; HeapWord* const dense_prefix_end = _space_info[id].dense_prefix(); const size_t dp_region = _summary_data.addr_to_region_idx(dense_prefix_end); @@ -1567,12 +1543,13 @@ PSParallelCompact::summarize_space(SpaceId id, bool maximum_compaction) HeapWord* const new_top = _space_info[id].new_top(); const HeapWord* nt_aligned_up = _summary_data.region_align_up(new_top); const size_t cr_words = pointer_delta(nt_aligned_up, dense_prefix_end); - tty->print_cr("id=%d cap=" SIZE_FORMAT " dp=" PTR_FORMAT " " - "dp_region=" SIZE_FORMAT " " "dp_count=" SIZE_FORMAT " " - "cr_count=" SIZE_FORMAT " " "nt=" PTR_FORMAT, - id, space->capacity_in_words(), p2i(dense_prefix_end), - dp_region, dp_words / region_size, - cr_words / region_size, p2i(new_top)); + log_develop_trace(gc, compaction, phases)( + "id=%d cap=" SIZE_FORMAT " dp=" PTR_FORMAT " " + "dp_region=" SIZE_FORMAT " " "dp_count=" SIZE_FORMAT " " + "cr_count=" SIZE_FORMAT " " "nt=" PTR_FORMAT, + id, space->capacity_in_words(), p2i(dense_prefix_end), + dp_region, dp_words / region_size, + cr_words / region_size, p2i(new_top)); } } @@ -1582,29 +1559,27 @@ void PSParallelCompact::summary_phase_msg(SpaceId dst_space_id, SpaceId src_space_id, HeapWord* src_beg, HeapWord* src_end) { - if (TraceParallelOldGCSummaryPhase) { - tty->print_cr("summarizing %d [%s] into %d [%s]: " - "src=" PTR_FORMAT "-" PTR_FORMAT " " - SIZE_FORMAT "-" SIZE_FORMAT " " - "dst=" PTR_FORMAT "-" PTR_FORMAT " " - SIZE_FORMAT "-" SIZE_FORMAT, - src_space_id, space_names[src_space_id], - dst_space_id, space_names[dst_space_id], - p2i(src_beg), p2i(src_end), - _summary_data.addr_to_region_idx(src_beg), - _summary_data.addr_to_region_idx(src_end), - p2i(dst_beg), p2i(dst_end), - _summary_data.addr_to_region_idx(dst_beg), - _summary_data.addr_to_region_idx(dst_end)); - } + log_develop_trace(gc, compaction, phases)( + "Summarizing %d [%s] into %d [%s]: " + "src=" PTR_FORMAT "-" PTR_FORMAT " " + SIZE_FORMAT "-" SIZE_FORMAT " " + "dst=" PTR_FORMAT "-" PTR_FORMAT " " + SIZE_FORMAT "-" SIZE_FORMAT, + src_space_id, space_names[src_space_id], + dst_space_id, space_names[dst_space_id], + p2i(src_beg), p2i(src_end), + _summary_data.addr_to_region_idx(src_beg), + _summary_data.addr_to_region_idx(src_end), + p2i(dst_beg), p2i(dst_end), + _summary_data.addr_to_region_idx(dst_beg), + _summary_data.addr_to_region_idx(dst_end)); } #endif // #ifndef PRODUCT void PSParallelCompact::summary_phase(ParCompactionManager* cm, bool maximum_compaction) { - GCTraceTime tm("summary phase", print_phases(), true, &_gc_timer); - // trace("2"); + GCTraceTime(Trace, gc, phases) tm("Summary Phase", &_gc_timer); #ifdef ASSERT if (TraceParallelOldGCMarkingPhase) { @@ -1620,14 +1595,9 @@ void PSParallelCompact::summary_phase(ParCompactionManager* cm, // Quick summarization of each space into itself, to see how much is live. summarize_spaces_quick(); - if (TraceParallelOldGCSummaryPhase) { - tty->print_cr("summary_phase: after summarizing each space to self"); - Universe::print(); - NOT_PRODUCT(print_region_ranges()); - if (Verbose) { - NOT_PRODUCT(print_initial_summary_data(_summary_data, _space_info)); - } - } + log_develop_trace(gc, compaction, phases)("summary phase: after summarizing each space to self"); + NOT_PRODUCT(print_region_ranges()); + NOT_PRODUCT(print_initial_summary_data(_summary_data, _space_info)); // The amount of live data that will end up in old space (assuming it fits). size_t old_space_total_live = 0; @@ -1701,14 +1671,9 @@ void PSParallelCompact::summary_phase(ParCompactionManager* cm, } } - if (TraceParallelOldGCSummaryPhase) { - tty->print_cr("summary_phase: after final summarization"); - Universe::print(); - NOT_PRODUCT(print_region_ranges()); - if (Verbose) { - NOT_PRODUCT(print_generic_summary_data(_summary_data, _space_info)); - } - } + log_develop_trace(gc, compaction, phases)("Summary_phase: after final summarization"); + NOT_PRODUCT(print_region_ranges()); + NOT_PRODUCT(print_initial_summary_data(_summary_data, _space_info)); } // This method should contain all heap-specific policy for invoking a full @@ -1783,20 +1748,16 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { heap->pre_full_gc_dump(&_gc_timer); - _print_phases = PrintGCDetails && PrintParallelOldGCPhaseTimes; - // Make sure data structures are sane, make the heap parsable, and do other // miscellaneous bookkeeping. - PreGCValues pre_gc_values; - pre_compact(&pre_gc_values); + pre_compact(); + + PreGCValues pre_gc_values(heap); // Get the compaction manager reserved for the VM thread. ParCompactionManager* const vmthread_cm = ParCompactionManager::manager_array(gc_task_manager()->workers()); - // Place after pre_compact() where the number of invocations is incremented. - AdaptiveSizePolicyOutput(size_policy, heap->total_collections()); - { ResourceMark rm; HandleMark hm; @@ -1805,8 +1766,8 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { gc_task_manager()->set_active_gang(); gc_task_manager()->task_idle_workers(); - TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); - GCTraceTime t1(GCCauseString("Full GC", gc_cause), PrintGC, !PrintGCDetails, NULL); + GCTraceCPUTime tcpu; + GCTraceTime(Info, gc) tm("Pause Full", NULL, gc_cause, true); TraceCollectorStats tcs(counters()); TraceMemoryManagerStats tms(true /* Full GC */,gc_cause); @@ -1853,17 +1814,9 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { size_policy->major_collection_end(old_gen->used_in_bytes(), gc_cause); if (UseAdaptiveSizePolicy) { - if (PrintAdaptiveSizePolicy) { - gclog_or_tty->print("AdaptiveSizeStart: "); - gclog_or_tty->stamp(); - gclog_or_tty->print_cr(" collection: %d ", - heap->total_collections()); - if (Verbose) { - gclog_or_tty->print("old_gen_capacity: " SIZE_FORMAT - " young_gen_capacity: " SIZE_FORMAT, - old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes()); - } - } + log_debug(gc, ergo)("AdaptiveSizeStart: collection: %d ", heap->total_collections()); + log_trace(gc, ergo)("old_gen_capacity: " SIZE_FORMAT " young_gen_capacity: " SIZE_FORMAT, + old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes()); // Don't check if the size_policy is ready here. Let // the size_policy check that internally. @@ -1921,10 +1874,8 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { heap->resize_young_gen(size_policy->calculated_eden_size_in_bytes(), size_policy->calculated_survivor_size_in_bytes()); } - if (PrintAdaptiveSizePolicy) { - gclog_or_tty->print_cr("AdaptiveSizeStop: collection: %d ", - heap->total_collections()); - } + + log_debug(gc, ergo)("AdaptiveSizeStop: collection: %d ", heap->total_collections()); } if (UsePerfData) { @@ -1939,20 +1890,14 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { // Resize the metaspace capacity after a collection MetaspaceGC::compute_new_size(); - if (TraceOldGenTime) accumulated_time()->stop(); - - if (PrintGC) { - if (PrintGCDetails) { - // No GC timestamp here. This is after GC so it would be confusing. - young_gen->print_used_change(pre_gc_values.young_gen_used()); - old_gen->print_used_change(pre_gc_values.old_gen_used()); - heap->print_heap_change(pre_gc_values.heap_used()); - MetaspaceAux::print_metaspace_change(pre_gc_values.metadata_used()); - } else { - heap->print_heap_change(pre_gc_values.heap_used()); - } + if (TraceOldGenTime) { + accumulated_time()->stop(); } + young_gen->print_used_change(pre_gc_values.young_gen_used()); + old_gen->print_used_change(pre_gc_values.old_gen_used()); + MetaspaceAux::print_metaspace_change(pre_gc_values.metadata_used()); + // Track memory usage and detect low memory MemoryService::track_memory_usage(); heap->update_counters(); @@ -1970,7 +1915,7 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { if (VerifyAfterGC && heap->total_collections() >= VerifyGCStartAt) { HandleMark hm; // Discard invalid handles created during verification - Universe::verify(" VerifyAfterGC:"); + Universe::verify("After GC"); } // Re-verify object start arrays @@ -1990,13 +1935,10 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { heap->print_heap_after_gc(); heap->trace_heap_after_gc(&_gc_tracer); - if (PrintGCTaskTimeStamps) { - gclog_or_tty->print_cr("VM-Thread " JLONG_FORMAT " " JLONG_FORMAT " " - JLONG_FORMAT, - marking_start.ticks(), compaction_start.ticks(), - collection_exit.ticks()); - gc_task_manager()->print_task_time_stamps(); - } + log_debug(gc, task, time)("VM-Thread " JLONG_FORMAT " " JLONG_FORMAT " " JLONG_FORMAT, + marking_start.ticks(), compaction_start.ticks(), + collection_exit.ticks()); + gc_task_manager()->print_task_time_stamps(); heap->post_full_gc_dump(&_gc_timer); @@ -2004,6 +1946,8 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) { ParallelTaskTerminator::print_termination_counts(); #endif + AdaptiveSizePolicyOutput::print(size_policy, heap->total_collections()); + _gc_timer.register_gc_end(); _gc_tracer.report_dense_prefix(dense_prefix(old_space_id)); @@ -2050,8 +1994,7 @@ bool PSParallelCompact::absorb_live_data_from_eden(PSAdaptiveSizePolicy* size_po return false; // Respect young gen minimum size. } - if (TraceAdaptiveGCBoundary && Verbose) { - gclog_or_tty->print(" absorbing " SIZE_FORMAT "K: " + log_trace(heap, ergo)(" absorbing " SIZE_FORMAT "K: " "eden " SIZE_FORMAT "K->" SIZE_FORMAT "K " "from " SIZE_FORMAT "K, to " SIZE_FORMAT "K " "young_gen " SIZE_FORMAT "K->" SIZE_FORMAT "K ", @@ -2060,7 +2003,6 @@ bool PSParallelCompact::absorb_live_data_from_eden(PSAdaptiveSizePolicy* size_po young_gen->from_space()->used_in_bytes() / K, young_gen->to_space()->used_in_bytes() / K, young_gen->capacity_in_bytes() / K, new_young_size / K); - } // Fill the unused part of the old gen. MutableSpace* const old_space = old_gen->object_space(); @@ -2110,7 +2052,7 @@ void PSParallelCompact::marking_phase(ParCompactionManager* cm, bool maximum_heap_compaction, ParallelOldTracer *gc_tracer) { // Recursively traverse all live objects and mark them - GCTraceTime tm("marking phase", print_phases(), true, &_gc_timer); + GCTraceTime(Trace, gc, phases) tm("Marking Phase", &_gc_timer); ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); uint parallel_gc_threads = heap->gc_task_manager()->workers(); @@ -2125,7 +2067,7 @@ void PSParallelCompact::marking_phase(ParCompactionManager* cm, ClassLoaderDataGraph::clear_claimed_marks(); { - GCTraceTime tm_m("par mark", print_phases(), true, &_gc_timer); + GCTraceTime(Trace, gc, phases) tm("Par Mark", &_gc_timer); ParallelScavengeHeap::ParStrongRootsScope psrs; @@ -2154,7 +2096,7 @@ void PSParallelCompact::marking_phase(ParCompactionManager* cm, // Process reference objects found during marking { - GCTraceTime tm_r("reference processing", print_phases(), true, &_gc_timer); + GCTraceTime(Trace, gc, phases) tm("Reference Processing", &_gc_timer); ReferenceProcessorStats stats; if (ref_processor()->processing_is_mt()) { @@ -2171,7 +2113,7 @@ void PSParallelCompact::marking_phase(ParCompactionManager* cm, gc_tracer->report_gc_reference_stats(stats); } - GCTraceTime tm_c("class unloading", print_phases(), true, &_gc_timer); + GCTraceTime(Trace, gc) tm_m("Class Unloading", &_gc_timer); // This is the point where the entire marking should have completed. assert(cm->marking_stacks_empty(), "Marking should have completed"); @@ -2202,7 +2144,7 @@ static PSAlwaysTrueClosure always_true; void PSParallelCompact::adjust_roots() { // Adjust the pointers to reflect the new locations - GCTraceTime tm("adjust roots", print_phases(), true, &_gc_timer); + GCTraceTime(Trace, gc, phases) tm("Adjust Roots", &_gc_timer); // Need new claim bits when tracing through and adjusting pointers. ClassLoaderDataGraph::clear_claimed_marks(); @@ -2235,10 +2177,49 @@ void PSParallelCompact::adjust_roots() { PSScavenge::reference_processor()->weak_oops_do(adjust_pointer_closure()); } +// Helper class to print 8 region numbers per line and then print the total at the end. +class FillableRegionLogger : public StackObj { +private: + LogHandle(gc, compaction) log; + static const int LineLength = 8; + size_t _regions[LineLength]; + int _next_index; + bool _enabled; + size_t _total_regions; +public: + FillableRegionLogger() : _next_index(0), _total_regions(0), _enabled(develop_log_is_enabled(Trace, gc, compaction)) { } + ~FillableRegionLogger() { + log.trace(SIZE_FORMAT " initially fillable regions", _total_regions); + } + + void print_line() { + if (!_enabled || _next_index == 0) { + return; + } + FormatBuffer<> line("Fillable: "); + for (int i = 0; i < _next_index; i++) { + line.append(" " SIZE_FORMAT_W(7), _regions[i]); + } + log.trace("%s", line.buffer()); + _next_index = 0; + } + + void handle(size_t region) { + if (!_enabled) { + return; + } + _regions[_next_index++] = region; + if (_next_index == LineLength) { + print_line(); + } + _total_regions++; + } +}; + void PSParallelCompact::enqueue_region_draining_tasks(GCTaskQueue* q, uint parallel_gc_threads) { - GCTraceTime tm("drain task setup", print_phases(), true, &_gc_timer); + GCTraceTime(Trace, gc, phases) tm("Drain Task Setup", &_gc_timer); // Find the threads that are active unsigned int which = 0; @@ -2263,13 +2244,13 @@ void PSParallelCompact::enqueue_region_draining_tasks(GCTaskQueue* q, const ParallelCompactData& sd = PSParallelCompact::summary_data(); - size_t fillable_regions = 0; // A count for diagnostic purposes. // A region index which corresponds to the tasks created above. // "which" must be 0 <= which < task_count which = 0; // id + 1 is used to test termination so unsigned can // be used with an old_space_id == 0. + FillableRegionLogger region_logger; for (unsigned int id = to_space_id; id + 1 > old_space_id; --id) { SpaceInfo* const space_info = _space_info + id; MutableSpace* const space = space_info->space(); @@ -2282,16 +2263,7 @@ void PSParallelCompact::enqueue_region_draining_tasks(GCTaskQueue* q, for (size_t cur = end_region - 1; cur + 1 > beg_region; --cur) { if (sd.region(cur)->claim_unsafe()) { ParCompactionManager::region_list_push(which, cur); - - if (TraceParallelOldGCCompactionPhase && Verbose) { - const size_t count_mod_8 = fillable_regions & 7; - if (count_mod_8 == 0) gclog_or_tty->print("fillable: "); - gclog_or_tty->print(" " SIZE_FORMAT_W(7), cur); - if (count_mod_8 == 7) gclog_or_tty->cr(); - } - - NOT_PRODUCT(++fillable_regions;) - + region_logger.handle(cur); // Assign regions to tasks in round-robin fashion. if (++which == task_count) { assert(which <= parallel_gc_threads, @@ -2300,11 +2272,7 @@ void PSParallelCompact::enqueue_region_draining_tasks(GCTaskQueue* q, } } } - } - - if (TraceParallelOldGCCompactionPhase) { - if (Verbose && (fillable_regions & 7) != 0) gclog_or_tty->cr(); - gclog_or_tty->print_cr(SIZE_FORMAT " initially fillable regions", fillable_regions); + region_logger.print_line(); } } @@ -2312,7 +2280,7 @@ void PSParallelCompact::enqueue_region_draining_tasks(GCTaskQueue* q, void PSParallelCompact::enqueue_dense_prefix_tasks(GCTaskQueue* q, uint parallel_gc_threads) { - GCTraceTime tm("dense prefix task setup", print_phases(), true, &_gc_timer); + GCTraceTime(Trace, gc, phases) tm("Dense Prefix Task Setup", &_gc_timer); ParallelCompactData& sd = PSParallelCompact::summary_data(); @@ -2394,7 +2362,7 @@ void PSParallelCompact::enqueue_region_stealing_tasks( GCTaskQueue* q, ParallelTaskTerminator* terminator_ptr, uint parallel_gc_threads) { - GCTraceTime tm("steal task setup", print_phases(), true, &_gc_timer); + GCTraceTime(Trace, gc, phases) tm("Steal Task Setup", &_gc_timer); // Once a thread has drained it's stack, it should try to steal regions from // other threads. @@ -2408,9 +2376,15 @@ void PSParallelCompact::enqueue_region_stealing_tasks( #ifdef ASSERT // Write a histogram of the number of times the block table was filled for a // region. -void PSParallelCompact::write_block_fill_histogram(outputStream* const out) +void PSParallelCompact::write_block_fill_histogram() { - if (!TraceParallelOldGCCompactionPhase) return; + if (!develop_log_is_enabled(Trace, gc, compaction)) { + return; + } + + LogHandle(gc, compaction) log; + ResourceMark rm; + outputStream* out = log.trace_stream(); typedef ParallelCompactData::RegionData rd_t; ParallelCompactData& sd = summary_data(); @@ -2429,7 +2403,7 @@ void PSParallelCompact::write_block_fill_histogram(outputStream* const out) for (const rd_t* cur = beg; cur < end; ++cur) { ++histo[MIN2(cur->blocks_filled_count(), histo_len - 1)]; } - out->print("%u %-4s" SIZE_FORMAT_W(5), id, space_names[id], region_cnt); + out->print("Block fill histogram: %u %-4s" SIZE_FORMAT_W(5), id, space_names[id], region_cnt); for (size_t i = 0; i < histo_len; ++i) { out->print(" " SIZE_FORMAT_W(5) " %5.1f%%", histo[i], 100.0 * histo[i] / region_cnt); @@ -2441,8 +2415,7 @@ void PSParallelCompact::write_block_fill_histogram(outputStream* const out) #endif // #ifdef ASSERT void PSParallelCompact::compact() { - // trace("5"); - GCTraceTime tm("compaction phase", print_phases(), true, &_gc_timer); + GCTraceTime(Trace, gc, phases) tm("Compaction Phase", &_gc_timer); ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); PSOldGen* old_gen = heap->old_gen(); @@ -2458,7 +2431,7 @@ void PSParallelCompact::compact() { enqueue_region_stealing_tasks(q, &terminator, active_gc_threads); { - GCTraceTime tm_pc("par compact", print_phases(), true, &_gc_timer); + GCTraceTime(Trace, gc, phases) tm("Par Compact", &_gc_timer); gc_task_manager()->execute_and_wait(q); @@ -2472,14 +2445,14 @@ void PSParallelCompact::compact() { { // Update the deferred objects, if any. Any compaction manager can be used. - GCTraceTime tm_du("deferred updates", print_phases(), true, &_gc_timer); + GCTraceTime(Trace, gc, phases) tm("Deferred Updates", &_gc_timer); ParCompactionManager* cm = ParCompactionManager::manager_array(0); for (unsigned int id = old_space_id; id < last_space_id; ++id) { update_deferred_objects(cm, SpaceId(id)); } } - DEBUG_ONLY(write_block_fill_histogram(gclog_or_tty)); + DEBUG_ONLY(write_block_fill_histogram()); } #ifdef ASSERT @@ -3108,18 +3081,13 @@ template static void trace_reference_gc(const char *s, oop obj, T* referent_addr, T* next_addr, T* discovered_addr) { - if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr("%s obj " PTR_FORMAT, s, p2i(obj)); - gclog_or_tty->print_cr(" referent_addr/* " PTR_FORMAT " / " - PTR_FORMAT, p2i(referent_addr), - referent_addr ? p2i(oopDesc::load_decode_heap_oop(referent_addr)) : NULL); - gclog_or_tty->print_cr(" next_addr/* " PTR_FORMAT " / " - PTR_FORMAT, p2i(next_addr), - next_addr ? p2i(oopDesc::load_decode_heap_oop(next_addr)) : NULL); - gclog_or_tty->print_cr(" discovered_addr/* " PTR_FORMAT " / " - PTR_FORMAT, p2i(discovered_addr), - discovered_addr ? p2i(oopDesc::load_decode_heap_oop(discovered_addr)) : NULL); - } + log_develop_trace(gc, ref)("%s obj " PTR_FORMAT, s, p2i(obj)); + log_develop_trace(gc, ref)(" referent_addr/* " PTR_FORMAT " / " PTR_FORMAT, + p2i(referent_addr), referent_addr ? p2i(oopDesc::load_decode_heap_oop(referent_addr)) : NULL); + log_develop_trace(gc, ref)(" next_addr/* " PTR_FORMAT " / " PTR_FORMAT, + p2i(next_addr), next_addr ? p2i(oopDesc::load_decode_heap_oop(next_addr)) : NULL); + log_develop_trace(gc, ref)(" discovered_addr/* " PTR_FORMAT " / " PTR_FORMAT, + p2i(discovered_addr), discovered_addr ? p2i(oopDesc::load_decode_heap_oop(discovered_addr)) : NULL); } #endif diff --git a/hotspot/src/share/vm/gc/parallel/psParallelCompact.hpp b/hotspot/src/share/vm/gc/parallel/psParallelCompact.hpp index 0adf7ae4202..76e55666d34 100644 --- a/hotspot/src/share/vm/gc/parallel/psParallelCompact.hpp +++ b/hotspot/src/share/vm/gc/parallel/psParallelCompact.hpp @@ -966,7 +966,6 @@ class PSParallelCompact : AllStatic { static ParallelCompactData _summary_data; static IsAliveClosure _is_alive_closure; static SpaceInfo _space_info[last_space_id]; - static bool _print_phases; static AdjustPointerClosure _adjust_pointer_closure; static AdjustKlassClosure _adjust_klass_closure; @@ -989,13 +988,10 @@ class PSParallelCompact : AllStatic { static void initialize_space_info(); - // Return true if details about individual phases should be printed. - static inline bool print_phases(); - // Clear the marking bitmap and summary data that cover the specified space. static void clear_data_covering_space(SpaceId id); - static void pre_compact(PreGCValues* pre_gc_values); + static void pre_compact(); static void post_compact(); // Mark live objects @@ -1069,7 +1065,7 @@ class PSParallelCompact : AllStatic { // Adjust addresses in roots. Does not adjust addresses in heap. static void adjust_roots(); - DEBUG_ONLY(static void write_block_fill_histogram(outputStream* const out);) + DEBUG_ONLY(static void write_block_fill_histogram();) // Move objects to new locations. static void compact_perm(ParCompactionManager* cm); @@ -1260,10 +1256,6 @@ inline bool PSParallelCompact::is_marked(oop obj) { return mark_bitmap()->is_marked(obj); } -inline bool PSParallelCompact::print_phases() { - return _print_phases; -} - inline double PSParallelCompact::normal_distribution(double density) { assert(_dwl_initialized, "uninitialized"); const double squared_term = (density - _dwl_mean) / _dwl_std_dev; diff --git a/hotspot/src/share/vm/gc/parallel/psPromotionManager.cpp b/hotspot/src/share/vm/gc/parallel/psPromotionManager.cpp index 6e54c638f22..fce698b6ee1 100644 --- a/hotspot/src/share/vm/gc/parallel/psPromotionManager.cpp +++ b/hotspot/src/share/vm/gc/parallel/psPromotionManager.cpp @@ -30,6 +30,7 @@ #include "gc/parallel/psScavenge.inline.hpp" #include "gc/shared/gcTrace.hpp" #include "gc/shared/taskqueue.inline.hpp" +#include "logging/log.hpp" #include "memory/allocation.inline.hpp" #include "memory/memRegion.hpp" #include "memory/padded.inline.hpp" @@ -99,7 +100,7 @@ void PSPromotionManager::pre_scavenge() { bool PSPromotionManager::post_scavenge(YoungGCTracer& gc_tracer) { bool promotion_failure_occurred = false; - TASKQUEUE_STATS_ONLY(if (PrintTaskqueue) print_taskqueue_stats()); + TASKQUEUE_STATS_ONLY(print_taskqueue_stats()); for (uint i = 0; i < ParallelGCThreads + 1; i++) { PSPromotionManager* manager = manager_array(i); assert(manager->claimed_stack_depth()->is_empty(), "should be empty"); @@ -128,7 +129,13 @@ static const char* const pm_stats_hdr[] = { }; void -PSPromotionManager::print_taskqueue_stats(outputStream* const out) { +PSPromotionManager::print_taskqueue_stats() { + if (!develop_log_is_enabled(Trace, gc, task, stats)) { + return; + } + LogHandle(gc, task, stats) log; + ResourceMark rm; + outputStream* out = log.trace_stream(); out->print_cr("== GC Tasks Stats, GC %3d", ParallelScavengeHeap::heap()->total_collections()); @@ -368,12 +375,7 @@ static void oop_ps_push_contents_specialized(oop obj, InstanceRefKlass *klass, P T next_oop = oopDesc::load_heap_oop(next_addr); if (!oopDesc::is_null(next_oop)) { // i.e. ref is not "active" T* discovered_addr = (T*)java_lang_ref_Reference::discovered_addr(obj); - debug_only( - if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" Process discovered as normal " - PTR_FORMAT, p2i(discovered_addr)); - } - ) + log_develop_trace(gc, ref)(" Process discovered as normal " PTR_FORMAT, p2i(discovered_addr)); if (PSScavenge::should_scavenge(discovered_addr)) { pm->claim_or_forward_depth(discovered_addr); } @@ -430,13 +432,7 @@ oop PSPromotionManager::oop_promotion_failed(oop obj, markOop obj_mark) { obj = obj->forwardee(); } - if (TraceScavenge) { - gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " (%d)}", - "promotion-failure", - obj->klass()->internal_name(), - p2i(obj), obj->size()); - - } + log_develop_trace(gc, scavenge)("{promotion-failure %s " PTR_FORMAT " (%d)}", obj->klass()->internal_name(), p2i(obj), obj->size()); return obj; } diff --git a/hotspot/src/share/vm/gc/parallel/psPromotionManager.hpp b/hotspot/src/share/vm/gc/parallel/psPromotionManager.hpp index de86263fc56..ba51850550d 100644 --- a/hotspot/src/share/vm/gc/parallel/psPromotionManager.hpp +++ b/hotspot/src/share/vm/gc/parallel/psPromotionManager.hpp @@ -65,7 +65,7 @@ class PSPromotionManager VALUE_OBJ_CLASS_SPEC { size_t _array_chunks_processed; void print_local_stats(outputStream* const out, uint i) const; - static void print_taskqueue_stats(outputStream* const out = gclog_or_tty); + static void print_taskqueue_stats(); void reset_stats(); #endif // TASKQUEUE_STATS diff --git a/hotspot/src/share/vm/gc/parallel/psPromotionManager.inline.hpp b/hotspot/src/share/vm/gc/parallel/psPromotionManager.inline.hpp index ef3aa4732e0..2b6ac4a595c 100644 --- a/hotspot/src/share/vm/gc/parallel/psPromotionManager.inline.hpp +++ b/hotspot/src/share/vm/gc/parallel/psPromotionManager.inline.hpp @@ -31,6 +31,7 @@ #include "gc/parallel/psPromotionManager.hpp" #include "gc/parallel/psScavenge.hpp" #include "gc/shared/taskqueue.inline.hpp" +#include "logging/log.hpp" #include "oops/oop.inline.hpp" inline PSPromotionManager* PSPromotionManager::manager_array(uint index) { @@ -262,11 +263,9 @@ inline oop PSPromotionManager::copy_to_survivor_space(oop o) { // This code must come after the CAS test, or it will print incorrect // information. - if (TraceScavenge) { - gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", - should_scavenge(&new_obj) ? "copying" : "tenuring", - new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size()); - } + log_develop_trace(gc, scavenge)("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", + should_scavenge(&new_obj) ? "copying" : "tenuring", + new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size()); return new_obj; } @@ -285,10 +284,10 @@ inline void PSPromotionManager::copy_and_push_safe_barrier(T* p) { // This code must come after the CAS test, or it will print incorrect // information. - if (TraceScavenge && o->is_forwarded()) { - gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", - "forwarding", - new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size()); + if (develop_log_is_enabled(Trace, gc, scavenge) && o->is_forwarded()) { + log_develop_trace(gc, scavenge)("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", + "forwarding", + new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size()); } oopDesc::encode_store_heap_oop_not_null(p, new_obj); diff --git a/hotspot/src/share/vm/gc/parallel/psScavenge.cpp b/hotspot/src/share/vm/gc/parallel/psScavenge.cpp index 0d4a6dad31d..648db23dab7 100644 --- a/hotspot/src/share/vm/gc/parallel/psScavenge.cpp +++ b/hotspot/src/share/vm/gc/parallel/psScavenge.cpp @@ -40,12 +40,13 @@ #include "gc/shared/gcLocker.inline.hpp" #include "gc/shared/gcTimer.hpp" #include "gc/shared/gcTrace.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/isGCActiveMark.hpp" #include "gc/shared/referencePolicy.hpp" #include "gc/shared/referenceProcessor.hpp" #include "gc/shared/spaceDecorator.hpp" #include "memory/resourceArea.hpp" +#include "logging/log.hpp" #include "oops/oop.inline.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/fprofiler.hpp" @@ -290,8 +291,6 @@ bool PSScavenge::invoke_no_policy() { heap->increment_total_collections(); - AdaptiveSizePolicyOutput(size_policy, heap->total_collections()); - if (AdaptiveSizePolicy::should_update_eden_stats(gc_cause)) { // Gather the feedback data for eden occupancy. young_gen->eden_space()->accumulate_statistics(); @@ -303,23 +302,21 @@ bool PSScavenge::invoke_no_policy() { assert(!NeverTenure || _tenuring_threshold == markOopDesc::max_age + 1, "Sanity"); assert(!AlwaysTenure || _tenuring_threshold == 0, "Sanity"); - size_t prev_used = heap->used(); - // Fill in TLABs heap->accumulate_statistics_all_tlabs(); heap->ensure_parsability(true); // retire TLABs if (VerifyBeforeGC && heap->total_collections() >= VerifyGCStartAt) { HandleMark hm; // Discard invalid handles created during verification - Universe::verify(" VerifyBeforeGC:"); + Universe::verify("Before GC"); } { ResourceMark rm; HandleMark hm; - TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); - GCTraceTime t1(GCCauseString("GC", gc_cause), PrintGC, !PrintGCDetails, NULL); + GCTraceCPUTime tcpu; + GCTraceTime(Info, gc) tm("Pause Young", NULL, gc_cause, true); TraceCollectorStats tcs(counters()); TraceMemoryManagerStats tms(false /* not full GC */,gc_cause); @@ -352,12 +349,7 @@ bool PSScavenge::invoke_no_policy() { reference_processor()->enable_discovery(); reference_processor()->setup_policy(false); - // We track how much was promoted to the next generation for - // the AdaptiveSizePolicy. - size_t old_gen_used_before = old_gen->used_in_bytes(); - - // For PrintGCDetails - size_t young_gen_used_before = young_gen->used_in_bytes(); + PreGCValues pre_gc_values(heap); // Reset our survivor overflow. set_survivor_overflow(false); @@ -383,7 +375,7 @@ bool PSScavenge::invoke_no_policy() { // We'll use the promotion manager again later. PSPromotionManager* promotion_manager = PSPromotionManager::vm_thread_promotion_manager(); { - GCTraceTime tm("Scavenge", false, false, &_gc_timer); + GCTraceTime(Debug, gc, phases) tm("Scavenge", &_gc_timer); ParallelScavengeHeap::ParStrongRootsScope psrs; GCTaskQueue* q = GCTaskQueue::create(); @@ -425,7 +417,7 @@ bool PSScavenge::invoke_no_policy() { // Process reference objects discovered during scavenge { - GCTraceTime tm("References", false, false, &_gc_timer); + GCTraceTime(Debug, gc, phases) tm("References", &_gc_timer); reference_processor()->setup_policy(false); // not always_clear reference_processor()->set_active_mt_degree(active_workers); @@ -454,7 +446,7 @@ bool PSScavenge::invoke_no_policy() { } { - GCTraceTime tm("StringTable", false, false, &_gc_timer); + GCTraceTime(Debug, gc, phases) tm("StringTable", &_gc_timer); // Unlink any dead interned Strings and process the remaining live ones. PSScavengeRootsClosure root_closure(promotion_manager); StringTable::unlink_or_oops_do(&_is_alive_closure, &root_closure); @@ -464,9 +456,7 @@ bool PSScavenge::invoke_no_policy() { promotion_failure_occurred = PSPromotionManager::post_scavenge(_gc_tracer); if (promotion_failure_occurred) { clean_up_failed_promotion(); - if (PrintGC) { - gclog_or_tty->print("--"); - } + log_info(gc)("Promotion failed"); } _gc_tracer.report_tenuring_threshold(tenuring_threshold()); @@ -483,7 +473,7 @@ bool PSScavenge::invoke_no_policy() { young_gen->swap_spaces(); size_t survived = young_gen->from_space()->used_in_bytes(); - size_t promoted = old_gen->used_in_bytes() - old_gen_used_before; + size_t promoted = old_gen->used_in_bytes() - pre_gc_values.old_gen_used(); size_policy->update_averages(_survivor_overflow, survived, promoted); // A successful scavenge should restart the GC time limit count which is @@ -492,19 +482,9 @@ bool PSScavenge::invoke_no_policy() { if (UseAdaptiveSizePolicy) { // Calculate the new survivor size and tenuring threshold - if (PrintAdaptiveSizePolicy) { - gclog_or_tty->print("AdaptiveSizeStart: "); - gclog_or_tty->stamp(); - gclog_or_tty->print_cr(" collection: %d ", - heap->total_collections()); - - if (Verbose) { - gclog_or_tty->print("old_gen_capacity: " SIZE_FORMAT - " young_gen_capacity: " SIZE_FORMAT, - old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes()); - } - } - + log_debug(gc, ergo)("AdaptiveSizeStart: collection: %d ", heap->total_collections()); + log_trace(gc, ergo)("old_gen_capacity: " SIZE_FORMAT " young_gen_capacity: " SIZE_FORMAT, + old_gen->capacity_in_bytes(), young_gen->capacity_in_bytes()); if (UsePerfData) { PSGCAdaptivePolicyCounters* counters = heap->gc_policy_counters(); @@ -538,13 +518,9 @@ bool PSScavenge::invoke_no_policy() { _tenuring_threshold, survivor_limit); - if (PrintTenuringDistribution) { - gclog_or_tty->cr(); - gclog_or_tty->print_cr("Desired survivor size " SIZE_FORMAT " bytes, new threshold %u" - " (max threshold " UINTX_FORMAT ")", - size_policy->calculated_survivor_size_in_bytes(), - _tenuring_threshold, MaxTenuringThreshold); - } + log_debug(gc, age)("Desired survivor size " SIZE_FORMAT " bytes, new threshold %u (max threshold " UINTX_FORMAT ")", + size_policy->calculated_survivor_size_in_bytes(), + _tenuring_threshold, MaxTenuringThreshold); if (UsePerfData) { PSGCAdaptivePolicyCounters* counters = heap->gc_policy_counters(); @@ -602,10 +578,7 @@ bool PSScavenge::invoke_no_policy() { heap->resize_young_gen(size_policy->calculated_eden_size_in_bytes(), size_policy->calculated_survivor_size_in_bytes()); - if (PrintAdaptiveSizePolicy) { - gclog_or_tty->print_cr("AdaptiveSizeStop: collection: %d ", - heap->total_collections()); - } + log_debug(gc, ergo)("AdaptiveSizeStop: collection: %d ", heap->total_collections()); } // Update the structure of the eden. With NUMA-eden CPU hotplugging or offlining can @@ -628,7 +601,7 @@ bool PSScavenge::invoke_no_policy() { NOT_PRODUCT(reference_processor()->verify_no_references_recorded()); { - GCTraceTime tm("Prune Scavenge Root Methods", false, false, &_gc_timer); + GCTraceTime(Debug, gc, phases) tm("Prune Scavenge Root Methods", &_gc_timer); CodeCache::prune_scavenge_root_nmethods(); } @@ -649,14 +622,9 @@ bool PSScavenge::invoke_no_policy() { if (TraceYoungGenTime) accumulated_time()->stop(); - if (PrintGC) { - if (PrintGCDetails) { - // Don't print a GC timestamp here. This is after the GC so - // would be confusing. - young_gen->print_used_change(young_gen_used_before); - } - heap->print_heap_change(prev_used); - } + young_gen->print_used_change(pre_gc_values.young_gen_used()); + old_gen->print_used_change(pre_gc_values.old_gen_used()); + MetaspaceAux::print_metaspace_change(pre_gc_values.metadata_used()); // Track memory usage and detect low memory MemoryService::track_memory_usage(); @@ -667,7 +635,7 @@ bool PSScavenge::invoke_no_policy() { if (VerifyAfterGC && heap->total_collections() >= VerifyGCStartAt) { HandleMark hm; // Discard invalid handles created during verification - Universe::verify(" VerifyAfterGC:"); + Universe::verify("After GC"); } heap->print_heap_after_gc(); @@ -675,17 +643,16 @@ bool PSScavenge::invoke_no_policy() { scavenge_exit.update(); - if (PrintGCTaskTimeStamps) { - tty->print_cr("VM-Thread " JLONG_FORMAT " " JLONG_FORMAT " " JLONG_FORMAT, - scavenge_entry.ticks(), scavenge_midpoint.ticks(), - scavenge_exit.ticks()); - gc_task_manager()->print_task_time_stamps(); - } + log_debug(gc, task, time)("VM-Thread " JLONG_FORMAT " " JLONG_FORMAT " " JLONG_FORMAT, + scavenge_entry.ticks(), scavenge_midpoint.ticks(), + scavenge_exit.ticks()); + gc_task_manager()->print_task_time_stamps(); #ifdef TRACESPINNING ParallelTaskTerminator::print_termination_counts(); #endif + AdaptiveSizePolicyOutput::print(size_policy, heap->total_collections()); _gc_timer.register_gc_end(); @@ -708,9 +675,7 @@ void PSScavenge::clean_up_failed_promotion() { PSPromotionFailedClosure unforward_closure; young_gen->object_iterate(&unforward_closure); - if (PrintGC && Verbose) { - gclog_or_tty->print_cr("Restoring " SIZE_FORMAT " marks", _preserved_oop_stack.size()); - } + log_trace(gc, ergo)("Restoring " SIZE_FORMAT " marks", _preserved_oop_stack.size()); // Restore any saved marks. while (!_preserved_oop_stack.is_empty()) { @@ -772,19 +737,12 @@ bool PSScavenge::should_attempt_scavenge() { size_t promotion_estimate = MIN2(avg_promoted, young_gen->used_in_bytes()); bool result = promotion_estimate < old_gen->free_in_bytes(); - if (PrintGCDetails && Verbose) { - gclog_or_tty->print(result ? " do scavenge: " : " skip scavenge: "); - gclog_or_tty->print_cr(" average_promoted " SIZE_FORMAT - " padded_average_promoted " SIZE_FORMAT - " free in old gen " SIZE_FORMAT, - (size_t) policy->average_promoted_in_bytes(), - (size_t) policy->padded_average_promoted_in_bytes(), - old_gen->free_in_bytes()); - if (young_gen->used_in_bytes() < - (size_t) policy->padded_average_promoted_in_bytes()) { - gclog_or_tty->print_cr(" padded_promoted_average is greater" - " than maximum promotion = " SIZE_FORMAT, young_gen->used_in_bytes()); - } + log_trace(ergo)("%s scavenge: average_promoted " SIZE_FORMAT " padded_average_promoted " SIZE_FORMAT " free in old gen " SIZE_FORMAT, + result ? "Do" : "Skip", (size_t) policy->average_promoted_in_bytes(), + (size_t) policy->padded_average_promoted_in_bytes(), + old_gen->free_in_bytes()); + if (young_gen->used_in_bytes() < (size_t) policy->padded_average_promoted_in_bytes()) { + log_trace(ergo)(" padded_promoted_average is greater than maximum promotion = " SIZE_FORMAT, young_gen->used_in_bytes()); } if (result) { diff --git a/hotspot/src/share/vm/gc/parallel/psScavenge.inline.hpp b/hotspot/src/share/vm/gc/parallel/psScavenge.inline.hpp index 0a4d2ef94ed..5dab7373a72 100644 --- a/hotspot/src/share/vm/gc/parallel/psScavenge.inline.hpp +++ b/hotspot/src/share/vm/gc/parallel/psScavenge.inline.hpp @@ -29,6 +29,7 @@ #include "gc/parallel/parallelScavengeHeap.hpp" #include "gc/parallel/psPromotionManager.inline.hpp" #include "gc/parallel/psScavenge.hpp" +#include "logging/log.hpp" #include "memory/iterator.hpp" #include "utilities/globalDefinitions.hpp" @@ -138,13 +139,11 @@ class PSScavengeKlassClosure: public KlassClosure { // If the klass has not been dirtied we know that there's // no references into the young gen and we can skip it. - if (TraceScavenge) { - ResourceMark rm; - gclog_or_tty->print_cr("PSScavengeKlassClosure::do_klass " PTR_FORMAT ", %s, dirty: %s", - p2i(klass), - klass->external_name(), - klass->has_modified_oops() ? "true" : "false"); - } + NOT_PRODUCT(ResourceMark rm); + log_develop_trace(gc, scavenge)("PSScavengeKlassClosure::do_klass " PTR_FORMAT ", %s, dirty: %s", + p2i(klass), + klass->external_name(), + klass->has_modified_oops() ? "true" : "false"); if (klass->has_modified_oops()) { // Clean the klass since we're going to scavenge all the metadata. diff --git a/hotspot/src/share/vm/gc/parallel/psVirtualspace.cpp b/hotspot/src/share/vm/gc/parallel/psVirtualspace.cpp index a74eb32d2d7..3572c722af1 100644 --- a/hotspot/src/share/vm/gc/parallel/psVirtualspace.cpp +++ b/hotspot/src/share/vm/gc/parallel/psVirtualspace.cpp @@ -213,20 +213,6 @@ void PSVirtualSpace::verify() const { } } -void PSVirtualSpace::print() const { - gclog_or_tty->print_cr("virtual space [" PTR_FORMAT "]: alignment=" - SIZE_FORMAT "K grows %s%s", - p2i(this), alignment() / K, grows_up() ? "up" : "down", - special() ? " (pinned in memory)" : ""); - gclog_or_tty->print_cr(" reserved=" SIZE_FORMAT "K" - " [" PTR_FORMAT "," PTR_FORMAT "]" - " committed=" SIZE_FORMAT "K" - " [" PTR_FORMAT "," PTR_FORMAT "]", - reserved_size() / K, - p2i(reserved_low_addr()), p2i(reserved_high_addr()), - committed_size() / K, - p2i(committed_low_addr()), p2i(committed_high_addr())); -} #endif // #ifndef PRODUCT void PSVirtualSpace::print_space_boundaries_on(outputStream* st) const { diff --git a/hotspot/src/share/vm/gc/parallel/psVirtualspace.hpp b/hotspot/src/share/vm/gc/parallel/psVirtualspace.hpp index d39e59ee8c5..f6ece810206 100644 --- a/hotspot/src/share/vm/gc/parallel/psVirtualspace.hpp +++ b/hotspot/src/share/vm/gc/parallel/psVirtualspace.hpp @@ -96,7 +96,6 @@ class PSVirtualSpace : public CHeapObj { bool is_aligned(size_t val) const; bool is_aligned(char* val) const; void verify() const; - void print() const; virtual bool grows_up() const { return true; } bool grows_down() const { return !grows_up(); } diff --git a/hotspot/src/share/vm/gc/parallel/psYoungGen.cpp b/hotspot/src/share/vm/gc/parallel/psYoungGen.cpp index 047443ff054..51e85900012 100644 --- a/hotspot/src/share/vm/gc/parallel/psYoungGen.cpp +++ b/hotspot/src/share/vm/gc/parallel/psYoungGen.cpp @@ -30,6 +30,7 @@ #include "gc/parallel/psYoungGen.hpp" #include "gc/shared/gcUtil.hpp" #include "gc/shared/spaceDecorator.hpp" +#include "logging/log.hpp" #include "oops/oop.inline.hpp" #include "runtime/java.hpp" @@ -268,14 +269,12 @@ void PSYoungGen::resize(size_t eden_size, size_t survivor_size) { space_invariants(); - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr("Young generation size: " - "desired eden: " SIZE_FORMAT " survivor: " SIZE_FORMAT - " used: " SIZE_FORMAT " capacity: " SIZE_FORMAT - " gen limits: " SIZE_FORMAT " / " SIZE_FORMAT, - eden_size, survivor_size, used_in_bytes(), capacity_in_bytes(), - _max_gen_size, min_gen_size()); - } + log_trace(gc, ergo)("Young generation size: " + "desired eden: " SIZE_FORMAT " survivor: " SIZE_FORMAT + " used: " SIZE_FORMAT " capacity: " SIZE_FORMAT + " gen limits: " SIZE_FORMAT " / " SIZE_FORMAT, + eden_size, survivor_size, used_in_bytes(), capacity_in_bytes(), + _max_gen_size, min_gen_size()); } } @@ -330,26 +329,17 @@ bool PSYoungGen::resize_generation(size_t eden_size, size_t survivor_size) { size_changed = true; } } else { - if (Verbose && PrintGC) { - if (orig_size == gen_size_limit()) { - gclog_or_tty->print_cr("PSYoung generation size at maximum: " - SIZE_FORMAT "K", orig_size/K); - } else if (orig_size == min_gen_size()) { - gclog_or_tty->print_cr("PSYoung generation size at minium: " - SIZE_FORMAT "K", orig_size/K); - } + if (orig_size == gen_size_limit()) { + log_trace(gc)("PSYoung generation size at maximum: " SIZE_FORMAT "K", orig_size/K); + } else if (orig_size == min_gen_size()) { + log_trace(gc)("PSYoung generation size at minium: " SIZE_FORMAT "K", orig_size/K); } } if (size_changed) { post_resize(); - - if (Verbose && PrintGC) { - size_t current_size = virtual_space()->committed_size(); - gclog_or_tty->print_cr("PSYoung generation size changed: " - SIZE_FORMAT "K->" SIZE_FORMAT "K", - orig_size/K, current_size/K); - } + log_trace(gc)("PSYoung generation size changed: " SIZE_FORMAT "K->" SIZE_FORMAT "K", + orig_size/K, virtual_space()->committed_size()/K); } guarantee(eden_plus_survivors <= virtual_space()->committed_size() || @@ -412,28 +402,25 @@ void PSYoungGen::mangle_survivors(MutableSpace* s1, s2->mangle_region(delta2_right); } - if (TraceZapUnusedHeapArea) { - // s1 - gclog_or_tty->print_cr("Current region: [" PTR_FORMAT ", " PTR_FORMAT ") " - "New region: [" PTR_FORMAT ", " PTR_FORMAT ")", - p2i(s1->bottom()), p2i(s1->end()), - p2i(s1MR.start()), p2i(s1MR.end())); - gclog_or_tty->print_cr(" Mangle before: [" PTR_FORMAT ", " - PTR_FORMAT ") Mangle after: [" PTR_FORMAT ", " PTR_FORMAT ")", - p2i(delta1_left.start()), p2i(delta1_left.end()), - p2i(delta1_right.start()), p2i(delta1_right.end())); - - // s2 - gclog_or_tty->print_cr("Current region: [" PTR_FORMAT ", " PTR_FORMAT ") " - "New region: [" PTR_FORMAT ", " PTR_FORMAT ")", - p2i(s2->bottom()), p2i(s2->end()), - p2i(s2MR.start()), p2i(s2MR.end())); - gclog_or_tty->print_cr(" Mangle before: [" PTR_FORMAT ", " - PTR_FORMAT ") Mangle after: [" PTR_FORMAT ", " PTR_FORMAT ")", - p2i(delta2_left.start()), p2i(delta2_left.end()), - p2i(delta2_right.start()), p2i(delta2_right.end())); - } + // s1 + log_develop_trace(gc)("Current region: [" PTR_FORMAT ", " PTR_FORMAT ") " + "New region: [" PTR_FORMAT ", " PTR_FORMAT ")", + p2i(s1->bottom()), p2i(s1->end()), + p2i(s1MR.start()), p2i(s1MR.end())); + log_develop_trace(gc)(" Mangle before: [" PTR_FORMAT ", " + PTR_FORMAT ") Mangle after: [" PTR_FORMAT ", " PTR_FORMAT ")", + p2i(delta1_left.start()), p2i(delta1_left.end()), + p2i(delta1_right.start()), p2i(delta1_right.end())); + // s2 + log_develop_trace(gc)("Current region: [" PTR_FORMAT ", " PTR_FORMAT ") " + "New region: [" PTR_FORMAT ", " PTR_FORMAT ")", + p2i(s2->bottom()), p2i(s2->end()), + p2i(s2MR.start()), p2i(s2MR.end())); + log_develop_trace(gc)(" Mangle before: [" PTR_FORMAT ", " + PTR_FORMAT ") Mangle after: [" PTR_FORMAT ", " PTR_FORMAT ")", + p2i(delta2_left.start()), p2i(delta2_left.end()), + p2i(delta2_right.start()), p2i(delta2_right.end())); } #endif // NOT PRODUCT @@ -448,41 +435,32 @@ void PSYoungGen::resize_spaces(size_t requested_eden_size, return; } - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr("PSYoungGen::resize_spaces(requested_eden_size: " - SIZE_FORMAT - ", requested_survivor_size: " SIZE_FORMAT ")", - requested_eden_size, requested_survivor_size); - gclog_or_tty->print_cr(" eden: [" PTR_FORMAT ".." PTR_FORMAT ") " - SIZE_FORMAT, - p2i(eden_space()->bottom()), - p2i(eden_space()->end()), - pointer_delta(eden_space()->end(), - eden_space()->bottom(), - sizeof(char))); - gclog_or_tty->print_cr(" from: [" PTR_FORMAT ".." PTR_FORMAT ") " - SIZE_FORMAT, - p2i(from_space()->bottom()), - p2i(from_space()->end()), - pointer_delta(from_space()->end(), - from_space()->bottom(), - sizeof(char))); - gclog_or_tty->print_cr(" to: [" PTR_FORMAT ".." PTR_FORMAT ") " - SIZE_FORMAT, - p2i(to_space()->bottom()), - p2i(to_space()->end()), - pointer_delta( to_space()->end(), - to_space()->bottom(), - sizeof(char))); - } + log_trace(gc, ergo)("PSYoungGen::resize_spaces(requested_eden_size: " SIZE_FORMAT ", requested_survivor_size: " SIZE_FORMAT ")", + requested_eden_size, requested_survivor_size); + log_trace(gc, ergo)(" eden: [" PTR_FORMAT ".." PTR_FORMAT ") " SIZE_FORMAT, + p2i(eden_space()->bottom()), + p2i(eden_space()->end()), + pointer_delta(eden_space()->end(), + eden_space()->bottom(), + sizeof(char))); + log_trace(gc, ergo)(" from: [" PTR_FORMAT ".." PTR_FORMAT ") " SIZE_FORMAT, + p2i(from_space()->bottom()), + p2i(from_space()->end()), + pointer_delta(from_space()->end(), + from_space()->bottom(), + sizeof(char))); + log_trace(gc, ergo)(" to: [" PTR_FORMAT ".." PTR_FORMAT ") " SIZE_FORMAT, + p2i(to_space()->bottom()), + p2i(to_space()->end()), + pointer_delta( to_space()->end(), + to_space()->bottom(), + sizeof(char))); // There's nothing to do if the new sizes are the same as the current if (requested_survivor_size == to_space()->capacity_in_bytes() && requested_survivor_size == from_space()->capacity_in_bytes() && requested_eden_size == eden_space()->capacity_in_bytes()) { - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr(" capacities are the right sizes, returning"); - } + log_trace(gc, ergo)(" capacities are the right sizes, returning"); return; } @@ -503,9 +481,7 @@ void PSYoungGen::resize_spaces(size_t requested_eden_size, if (eden_from_to_order) { // Eden, from, to eden_from_to_order = true; - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr(" Eden, from, to:"); - } + log_trace(gc, ergo)(" Eden, from, to:"); // Set eden // "requested_eden_size" is a goal for the size of eden @@ -566,28 +542,21 @@ void PSYoungGen::resize_spaces(size_t requested_eden_size, guarantee(to_start != to_end, "to space is zero sized"); - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr(" [eden_start .. eden_end): " - "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - p2i(eden_start), - p2i(eden_end), - pointer_delta(eden_end, eden_start, sizeof(char))); - gclog_or_tty->print_cr(" [from_start .. from_end): " - "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - p2i(from_start), - p2i(from_end), - pointer_delta(from_end, from_start, sizeof(char))); - gclog_or_tty->print_cr(" [ to_start .. to_end): " - "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - p2i(to_start), - p2i(to_end), - pointer_delta( to_end, to_start, sizeof(char))); - } + log_trace(gc, ergo)(" [eden_start .. eden_end): [" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, + p2i(eden_start), + p2i(eden_end), + pointer_delta(eden_end, eden_start, sizeof(char))); + log_trace(gc, ergo)(" [from_start .. from_end): [" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, + p2i(from_start), + p2i(from_end), + pointer_delta(from_end, from_start, sizeof(char))); + log_trace(gc, ergo)(" [ to_start .. to_end): [" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, + p2i(to_start), + p2i(to_end), + pointer_delta( to_end, to_start, sizeof(char))); } else { // Eden, to, from - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr(" Eden, to, from:"); - } + log_trace(gc, ergo)(" Eden, to, from:"); // To space gets priority over eden resizing. Note that we position // to space as if we were able to resize from space, even though from @@ -623,23 +592,18 @@ void PSYoungGen::resize_spaces(size_t requested_eden_size, eden_end = MAX2(eden_end, eden_start + alignment); to_start = MAX2(to_start, eden_end); - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr(" [eden_start .. eden_end): " - "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - p2i(eden_start), - p2i(eden_end), - pointer_delta(eden_end, eden_start, sizeof(char))); - gclog_or_tty->print_cr(" [ to_start .. to_end): " - "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - p2i(to_start), - p2i(to_end), - pointer_delta( to_end, to_start, sizeof(char))); - gclog_or_tty->print_cr(" [from_start .. from_end): " - "[" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, - p2i(from_start), - p2i(from_end), - pointer_delta(from_end, from_start, sizeof(char))); - } + log_trace(gc, ergo)(" [eden_start .. eden_end): [" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, + p2i(eden_start), + p2i(eden_end), + pointer_delta(eden_end, eden_start, sizeof(char))); + log_trace(gc, ergo)(" [ to_start .. to_end): [" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, + p2i(to_start), + p2i(to_end), + pointer_delta( to_end, to_start, sizeof(char))); + log_trace(gc, ergo)(" [from_start .. from_end): [" PTR_FORMAT " .. " PTR_FORMAT ") " SIZE_FORMAT, + p2i(from_start), + p2i(from_end), + pointer_delta(from_end, from_start, sizeof(char))); } @@ -658,7 +622,7 @@ void PSYoungGen::resize_spaces(size_t requested_eden_size, // Let's make sure the call to initialize doesn't reset "top"! HeapWord* old_from_top = from_space()->top(); - // For PrintAdaptiveSizePolicy block below + // For logging block below size_t old_from = from_space()->capacity_in_bytes(); size_t old_to = to_space()->capacity_in_bytes(); @@ -704,18 +668,11 @@ void PSYoungGen::resize_spaces(size_t requested_eden_size, assert(from_space()->top() == old_from_top, "from top changed!"); - if (PrintAdaptiveSizePolicy) { - ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); - gclog_or_tty->print("AdaptiveSizePolicy::survivor space sizes: " - "collection: %d " - "(" SIZE_FORMAT ", " SIZE_FORMAT ") -> " - "(" SIZE_FORMAT ", " SIZE_FORMAT ") ", - heap->total_collections(), - old_from, old_to, - from_space()->capacity_in_bytes(), - to_space()->capacity_in_bytes()); - gclog_or_tty->cr(); - } + log_trace(gc, ergo)("AdaptiveSizePolicy::survivor space sizes: collection: %d (" SIZE_FORMAT ", " SIZE_FORMAT ") -> (" SIZE_FORMAT ", " SIZE_FORMAT ") ", + ParallelScavengeHeap::heap()->total_collections(), + old_from, old_to, + from_space()->capacity_in_bytes(), + to_space()->capacity_in_bytes()); } void PSYoungGen::swap_spaces() { @@ -794,13 +751,8 @@ void PSYoungGen::compact() { void PSYoungGen::print() const { print_on(tty); } void PSYoungGen::print_on(outputStream* st) const { st->print(" %-15s", "PSYoungGen"); - if (PrintGCDetails && Verbose) { - st->print(" total " SIZE_FORMAT ", used " SIZE_FORMAT, - capacity_in_bytes(), used_in_bytes()); - } else { - st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K", - capacity_in_bytes()/K, used_in_bytes()/K); - } + st->print(" total " SIZE_FORMAT "K, used " SIZE_FORMAT "K", + capacity_in_bytes()/K, used_in_bytes()/K); virtual_space()->print_space_boundaries_on(st); st->print(" eden"); eden_space()->print_on(st); st->print(" from"); from_space()->print_on(st); @@ -809,13 +761,8 @@ void PSYoungGen::print_on(outputStream* st) const { // Note that a space is not printed before the [NAME: void PSYoungGen::print_used_change(size_t prev_used) const { - gclog_or_tty->print("[%s:", name()); - gclog_or_tty->print(" " SIZE_FORMAT "K" - "->" SIZE_FORMAT "K" - "(" SIZE_FORMAT "K)", - prev_used / K, used_in_bytes() / K, - capacity_in_bytes() / K); - gclog_or_tty->print("]"); + log_info(gc, heap)("%s: " SIZE_FORMAT "K->" SIZE_FORMAT "K(" SIZE_FORMAT "K)", + name(), prev_used / K, used_in_bytes() / K, capacity_in_bytes() / K); } size_t PSYoungGen::available_for_expansion() { diff --git a/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp b/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp index 54243df64f9..eaaf9a213e5 100644 --- a/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp +++ b/hotspot/src/share/vm/gc/serial/defNewGeneration.cpp @@ -31,7 +31,7 @@ #include "gc/shared/gcPolicyCounters.hpp" #include "gc/shared/gcTimer.hpp" #include "gc/shared/gcTrace.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/genOopClosures.inline.hpp" #include "gc/shared/generationSpec.hpp" @@ -39,6 +39,7 @@ #include "gc/shared/space.inline.hpp" #include "gc/shared/spaceDecorator.hpp" #include "gc/shared/strongRootsScope.hpp" +#include "logging/log.hpp" #include "memory/iterator.hpp" #include "oops/instanceRefKlass.hpp" #include "oops/oop.inline.hpp" @@ -134,13 +135,11 @@ void FastScanClosure::do_oop(oop* p) { FastScanClosure::do_oop_work(p); } void FastScanClosure::do_oop(narrowOop* p) { FastScanClosure::do_oop_work(p); } void KlassScanClosure::do_klass(Klass* klass) { - if (TraceScavenge) { - ResourceMark rm; - gclog_or_tty->print_cr("KlassScanClosure::do_klass " PTR_FORMAT ", %s, dirty: %s", - p2i(klass), - klass->external_name(), - klass->has_modified_oops() ? "true" : "false"); - } + NOT_PRODUCT(ResourceMark rm); + log_develop_trace(gc, scavenge)("KlassScanClosure::do_klass " PTR_FORMAT ", %s, dirty: %s", + p2i(klass), + klass->external_name(), + klass->has_modified_oops() ? "true" : "false"); // If the klass has not been dirtied we know that there's // no references into the young gen and we can skip it. @@ -359,10 +358,7 @@ bool DefNewGeneration::expand(size_t bytes) { // but the second succeeds and expands the heap to its maximum // value. if (GC_locker::is_active()) { - if (PrintGC && Verbose) { - gclog_or_tty->print_cr("Garbage collection disabled, " - "expanded heap instead"); - } + log_debug(gc)("Garbage collection disabled, expanded heap instead"); } return success; @@ -429,22 +425,15 @@ void DefNewGeneration::compute_new_size() { MemRegion cmr((HeapWord*)_virtual_space.low(), (HeapWord*)_virtual_space.high()); gch->barrier_set()->resize_covered_region(cmr); - if (Verbose && PrintGC) { - size_t new_size_after = _virtual_space.committed_size(); - size_t eden_size_after = eden()->capacity(); - size_t survivor_size_after = from()->capacity(); - gclog_or_tty->print("New generation size " SIZE_FORMAT "K->" - SIZE_FORMAT "K [eden=" - SIZE_FORMAT "K,survivor=" SIZE_FORMAT "K]", - new_size_before/K, new_size_after/K, - eden_size_after/K, survivor_size_after/K); - if (WizardMode) { - gclog_or_tty->print("[allowed " SIZE_FORMAT "K extra for %d threads]", + + log_debug(gc, heap, ergo)( + "New generation size " SIZE_FORMAT "K->" SIZE_FORMAT "K [eden=" SIZE_FORMAT "K,survivor=" SIZE_FORMAT "K]", + new_size_before/K, _virtual_space.committed_size()/K, + eden()->capacity()/K, from()->capacity()/K); + log_trace(gc, heap, ergo)( + " [allowed " SIZE_FORMAT "K extra for %d threads]", thread_increase_size/K, threads_count); } - gclog_or_tty->cr(); - } - } } void DefNewGeneration::younger_refs_iterate(OopsInGenClosure* cl, uint n_threads) { @@ -507,34 +496,27 @@ void DefNewGeneration::space_iterate(SpaceClosure* blk, // The last collection bailed out, we are running out of heap space, // so we try to allocate the from-space, too. HeapWord* DefNewGeneration::allocate_from_space(size_t size) { + bool should_try_alloc = should_allocate_from_space() || GC_locker::is_active_and_needs_gc(); + + // If the Heap_lock is not locked by this thread, this will be called + // again later with the Heap_lock held. + bool do_alloc = should_try_alloc && (Heap_lock->owned_by_self() || (SafepointSynchronize::is_at_safepoint() && Thread::current()->is_VM_thread())); + HeapWord* result = NULL; - if (Verbose && PrintGCDetails) { - gclog_or_tty->print("DefNewGeneration::allocate_from_space(" SIZE_FORMAT "):" - " will_fail: %s" - " heap_lock: %s" - " free: " SIZE_FORMAT, + if (do_alloc) { + result = from()->allocate(size); + } + + log_trace(gc, alloc)("DefNewGeneration::allocate_from_space(" SIZE_FORMAT "): will_fail: %s heap_lock: %s free: " SIZE_FORMAT "%s%s returns %s", size, GenCollectedHeap::heap()->incremental_collection_will_fail(false /* don't consult_young */) ? "true" : "false", Heap_lock->is_locked() ? "locked" : "unlocked", - from()->free()); - } - if (should_allocate_from_space() || GC_locker::is_active_and_needs_gc()) { - if (Heap_lock->owned_by_self() || - (SafepointSynchronize::is_at_safepoint() && - Thread::current()->is_VM_thread())) { - // If the Heap_lock is not locked by this thread, this will be called - // again later with the Heap_lock held. - result = from()->allocate(size); - } else if (PrintGC && Verbose) { - gclog_or_tty->print_cr(" Heap_lock is not owned by self"); - } - } else if (PrintGC && Verbose) { - gclog_or_tty->print_cr(" should_allocate_from_space: NOT"); - } - if (PrintGC && Verbose) { - gclog_or_tty->print_cr(" returns %s", result == NULL ? "NULL" : "object"); - } + from()->free(), + should_try_alloc ? "" : " should_allocate_from_space: NOT", + do_alloc ? " Heap_lock is not owned by self" : "", + result == NULL ? "NULL" : "object"); + return result; } @@ -570,9 +552,7 @@ void DefNewGeneration::collect(bool full, // from this generation, pass on collection; let the next generation // do it. if (!collection_attempt_is_safe()) { - if (Verbose && PrintGCDetails) { - gclog_or_tty->print(" :: Collection attempt not safe :: "); - } + log_trace(gc)(":: Collection attempt not safe ::"); gch->set_incremental_collection_failed(); // Slight lie: we did not even attempt one return; } @@ -580,9 +560,7 @@ void DefNewGeneration::collect(bool full, init_assuming_no_promotion_failure(); - GCTraceTime t1(GCCauseString("GC", gch->gc_cause()), PrintGC && !PrintGCDetails, true, NULL); - // Capture heap used before collection (for printing). - size_t gch_prev_used = gch->used(); + GCTraceTime(Trace, gc) tm("DefNew", NULL, gch->gc_cause()); gch->trace_heap_before_gc(&gc_tracer); @@ -677,9 +655,7 @@ void DefNewGeneration::collect(bool full, _promo_failure_scan_stack.clear(true); // Clear cached segments. remove_forwarding_pointers(); - if (PrintGCDetails) { - gclog_or_tty->print(" (promotion failed) "); - } + log_debug(gc)("Promotion failed"); // Add to-space to the list of space to compact // when a promotion failure has occurred. In that // case there can be live objects in to-space @@ -696,9 +672,6 @@ void DefNewGeneration::collect(bool full, // Reset the PromotionFailureALot counters. NOT_PRODUCT(gch->reset_promotion_should_fail();) } - if (PrintGC && !PrintGCDetails) { - gch->print_heap_change(gch_prev_used); - } // set new iteration safe limit for the survivor spaces from()->set_concurrent_iteration_safe_limit(from()->top()); to()->set_concurrent_iteration_safe_limit(to()->top()); @@ -760,10 +733,8 @@ void DefNewGeneration::preserve_mark_if_necessary(oop obj, markOop m) { } void DefNewGeneration::handle_promotion_failure(oop old) { - if (PrintPromotionFailure && !_promotion_failed) { - gclog_or_tty->print(" (promotion failure size = %d) ", - old->size()); - } + log_debug(gc, promotion)("Promotion failure size = %d) ", old->size()); + _promotion_failed = true; _promotion_failed_info.register_copy_failure(old->size()); preserve_mark_if_necessary(old, old->mark()); @@ -895,9 +866,7 @@ void DefNewGeneration::reset_scratch() { bool DefNewGeneration::collection_attempt_is_safe() { if (!to()->is_empty()) { - if (Verbose && PrintGCDetails) { - gclog_or_tty->print(" :: to is not empty :: "); - } + log_trace(gc)(":: to is not empty ::"); return false; } if (_old_gen == NULL) { @@ -919,17 +888,13 @@ void DefNewGeneration::gc_epilogue(bool full) { if (full) { DEBUG_ONLY(seen_incremental_collection_failed = false;) if (!collection_attempt_is_safe() && !_eden_space->is_empty()) { - if (Verbose && PrintGCDetails) { - gclog_or_tty->print("DefNewEpilogue: cause(%s), full, not safe, set_failed, set_alloc_from, clear_seen", + log_trace(gc)("DefNewEpilogue: cause(%s), full, not safe, set_failed, set_alloc_from, clear_seen", GCCause::to_string(gch->gc_cause())); - } gch->set_incremental_collection_failed(); // Slight lie: a full gc left us in that state set_should_allocate_from_space(); // we seem to be running out of space } else { - if (Verbose && PrintGCDetails) { - gclog_or_tty->print("DefNewEpilogue: cause(%s), full, safe, clear_failed, clear_alloc_from, clear_seen", + log_trace(gc)("DefNewEpilogue: cause(%s), full, safe, clear_failed, clear_alloc_from, clear_seen", GCCause::to_string(gch->gc_cause())); - } gch->clear_incremental_collection_failed(); // We just did a full collection clear_should_allocate_from_space(); // if set } @@ -943,16 +908,12 @@ void DefNewGeneration::gc_epilogue(bool full) { // a full collection in between. if (!seen_incremental_collection_failed && gch->incremental_collection_failed()) { - if (Verbose && PrintGCDetails) { - gclog_or_tty->print("DefNewEpilogue: cause(%s), not full, not_seen_failed, failed, set_seen_failed", + log_trace(gc)("DefNewEpilogue: cause(%s), not full, not_seen_failed, failed, set_seen_failed", GCCause::to_string(gch->gc_cause())); - } seen_incremental_collection_failed = true; } else if (seen_incremental_collection_failed) { - if (Verbose && PrintGCDetails) { - gclog_or_tty->print("DefNewEpilogue: cause(%s), not full, seen_failed, will_clear_seen_failed", + log_trace(gc)("DefNewEpilogue: cause(%s), not full, seen_failed, will_clear_seen_failed", GCCause::to_string(gch->gc_cause())); - } assert(gch->gc_cause() == GCCause::_scavenge_alot || (GCCause::is_user_requested_gc(gch->gc_cause()) && UseConcMarkSweepGC && ExplicitGCInvokesConcurrent) || !gch->incremental_collection_failed(), diff --git a/hotspot/src/share/vm/gc/serial/defNewGeneration.hpp b/hotspot/src/share/vm/gc/serial/defNewGeneration.hpp index c62b8606ba8..f537a6d6a4f 100644 --- a/hotspot/src/share/vm/gc/serial/defNewGeneration.hpp +++ b/hotspot/src/share/vm/gc/serial/defNewGeneration.hpp @@ -339,7 +339,6 @@ protected: virtual const char* name() const; virtual const char* short_name() const { return "DefNew"; } - // PrintHeapAtGC support. void print_on(outputStream* st) const; void verify(); diff --git a/hotspot/src/share/vm/gc/serial/genMarkSweep.cpp b/hotspot/src/share/vm/gc/serial/genMarkSweep.cpp index 20fd3d02ae8..8bb4c203a16 100644 --- a/hotspot/src/share/vm/gc/serial/genMarkSweep.cpp +++ b/hotspot/src/share/vm/gc/serial/genMarkSweep.cpp @@ -35,7 +35,7 @@ #include "gc/shared/gcHeapSummary.hpp" #include "gc/shared/gcTimer.hpp" #include "gc/shared/gcTrace.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/generation.hpp" #include "gc/shared/genOopClosures.inline.hpp" @@ -71,8 +71,6 @@ void GenMarkSweep::invoke_at_safepoint(ReferenceProcessor* rp, bool clear_all_so set_ref_processor(rp); rp->setup_policy(clear_all_softrefs); - GCTraceTime t1(GCCauseString("Full GC", gch->gc_cause()), PrintGC && !PrintGCDetails, true, NULL); - gch->trace_heap_before_gc(_gc_tracer); // When collecting the permanent generation Method*s may be moving, @@ -82,9 +80,6 @@ void GenMarkSweep::invoke_at_safepoint(ReferenceProcessor* rp, bool clear_all_so // Increment the invocation count _total_invocations++; - // Capture heap size before collection for printing. - size_t gch_prev_used = gch->used(); - // Capture used regions for each generation that will be // subject to collection, so that card table adjustments can // be made intelligently (see clear / invalidate further below). @@ -134,10 +129,6 @@ void GenMarkSweep::invoke_at_safepoint(ReferenceProcessor* rp, bool clear_all_so CodeCache::gc_epilogue(); JvmtiExport::gc_epilogue(); - if (PrintGC && !PrintGCDetails) { - gch->print_heap_change(gch_prev_used); - } - // refs processing: clean slate set_ref_processor(NULL); @@ -189,7 +180,7 @@ void GenMarkSweep::deallocate_stacks() { void GenMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) { // Recursively traverse all live objects and mark them - GCTraceTime tm("phase 1", PrintGC && Verbose, true, _gc_timer); + GCTraceTime(Trace, gc) tm("Phase 1: Mark live objects", _gc_timer); GenCollectedHeap* gch = GenCollectedHeap::heap(); @@ -262,7 +253,7 @@ void GenMarkSweep::mark_sweep_phase2() { GenCollectedHeap* gch = GenCollectedHeap::heap(); - GCTraceTime tm("phase 2", PrintGC && Verbose, true, _gc_timer); + GCTraceTime(Trace, gc) tm("Phase 2: Compute new object addresses", _gc_timer); gch->prepare_for_compaction(); } @@ -278,7 +269,7 @@ void GenMarkSweep::mark_sweep_phase3() { GenCollectedHeap* gch = GenCollectedHeap::heap(); // Adjust the pointers to reflect the new locations - GCTraceTime tm("phase 3", PrintGC && Verbose, true, _gc_timer); + GCTraceTime(Trace, gc) tm("Phase 3: Adjust pointers", _gc_timer); // Need new claim bits for the pointer adjustment tracing. ClassLoaderDataGraph::clear_claimed_marks(); @@ -330,7 +321,7 @@ void GenMarkSweep::mark_sweep_phase4() { // to use a higher index (saved from phase2) when verifying perm_gen. GenCollectedHeap* gch = GenCollectedHeap::heap(); - GCTraceTime tm("phase 4", PrintGC && Verbose, true, _gc_timer); + GCTraceTime(Trace, gc) tm("Phase 4: Move objects", _gc_timer); GenCompactClosure blk; gch->generation_iterate(&blk, true); diff --git a/hotspot/src/share/vm/gc/serial/markSweep.cpp b/hotspot/src/share/vm/gc/serial/markSweep.cpp index 52f284624f9..489fe2a0cd0 100644 --- a/hotspot/src/share/vm/gc/serial/markSweep.cpp +++ b/hotspot/src/share/vm/gc/serial/markSweep.cpp @@ -250,10 +250,7 @@ void MarkSweep::adjust_marks() { void MarkSweep::restore_marks() { assert(_preserved_oop_stack.size() == _preserved_mark_stack.size(), "inconsistent preserved oop stacks"); - if (PrintGC && Verbose) { - gclog_or_tty->print_cr("Restoring " SIZE_FORMAT " marks", - _preserved_count + _preserved_oop_stack.size()); - } + log_trace(gc)("Restoring " SIZE_FORMAT " marks", _preserved_count + _preserved_oop_stack.size()); // restore the marks we saved earlier for (size_t i = 0; i < _preserved_count; i++) { @@ -305,20 +302,13 @@ template static void trace_reference_gc(const char *s, oop obj, T* referent_addr, T* next_addr, T* discovered_addr) { - if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr("%s obj " PTR_FORMAT, s, p2i(obj)); - gclog_or_tty->print_cr(" referent_addr/* " PTR_FORMAT " / " - PTR_FORMAT, p2i(referent_addr), - p2i(referent_addr ? - (address)oopDesc::load_decode_heap_oop(referent_addr) : NULL)); - gclog_or_tty->print_cr(" next_addr/* " PTR_FORMAT " / " - PTR_FORMAT, p2i(next_addr), - p2i(next_addr ? (address)oopDesc::load_decode_heap_oop(next_addr) : NULL)); - gclog_or_tty->print_cr(" discovered_addr/* " PTR_FORMAT " / " - PTR_FORMAT, p2i(discovered_addr), - p2i(discovered_addr ? - (address)oopDesc::load_decode_heap_oop(discovered_addr) : NULL)); - } + log_develop_trace(gc, ref)("%s obj " PTR_FORMAT, s, p2i(obj)); + log_develop_trace(gc, ref)(" referent_addr/* " PTR_FORMAT " / " PTR_FORMAT, + p2i(referent_addr), p2i(referent_addr ? (address)oopDesc::load_decode_heap_oop(referent_addr) : NULL)); + log_develop_trace(gc, ref)(" next_addr/* " PTR_FORMAT " / " PTR_FORMAT, + p2i(next_addr), p2i(next_addr ? (address)oopDesc::load_decode_heap_oop(next_addr) : NULL)); + log_develop_trace(gc, ref)(" discovered_addr/* " PTR_FORMAT " / " PTR_FORMAT, + p2i(discovered_addr), p2i(discovered_addr ? (address)oopDesc::load_decode_heap_oop(discovered_addr) : NULL)); } #endif diff --git a/hotspot/src/share/vm/gc/serial/tenuredGeneration.cpp b/hotspot/src/share/vm/gc/serial/tenuredGeneration.cpp index 8a526938e10..a4958b71d3a 100644 --- a/hotspot/src/share/vm/gc/serial/tenuredGeneration.cpp +++ b/hotspot/src/share/vm/gc/serial/tenuredGeneration.cpp @@ -32,6 +32,7 @@ #include "gc/shared/genOopClosures.inline.hpp" #include "gc/shared/generationSpec.hpp" #include "gc/shared/space.hpp" +#include "logging/log.hpp" #include "memory/allocation.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/java.hpp" @@ -81,42 +82,28 @@ bool TenuredGeneration::should_collect(bool full, // why it returns what it returns (without re-evaluating the conditionals // in case they aren't idempotent), so I'm doing it this way. // DeMorgan says it's okay. - bool result = false; - if (!result && full) { - result = true; - if (PrintGC && Verbose) { - gclog_or_tty->print_cr("TenuredGeneration::should_collect: because" - " full"); - } + if (full) { + log_trace(gc)("TenuredGeneration::should_collect: because full"); + return true; } - if (!result && should_allocate(size, is_tlab)) { - result = true; - if (PrintGC && Verbose) { - gclog_or_tty->print_cr("TenuredGeneration::should_collect: because" - " should_allocate(" SIZE_FORMAT ")", - size); - } + if (should_allocate(size, is_tlab)) { + log_trace(gc)("TenuredGeneration::should_collect: because should_allocate(" SIZE_FORMAT ")", size); + return true; } // If we don't have very much free space. // XXX: 10000 should be a percentage of the capacity!!! - if (!result && free() < 10000) { - result = true; - if (PrintGC && Verbose) { - gclog_or_tty->print_cr("TenuredGeneration::should_collect: because" - " free(): " SIZE_FORMAT, - free()); - } + if (free() < 10000) { + log_trace(gc)("TenuredGeneration::should_collect: because free(): " SIZE_FORMAT, free()); + return true; } // If we had to expand to accommodate promotions from the young generation - if (!result && _capacity_at_prologue < capacity()) { - result = true; - if (PrintGC && Verbose) { - gclog_or_tty->print_cr("TenuredGeneration::should_collect: because" - "_capacity_at_prologue: " SIZE_FORMAT " < capacity(): " SIZE_FORMAT, - _capacity_at_prologue, capacity()); - } + if (_capacity_at_prologue < capacity()) { + log_trace(gc)("TenuredGeneration::should_collect: because_capacity_at_prologue: " SIZE_FORMAT " < capacity(): " SIZE_FORMAT, + _capacity_at_prologue, capacity()); + return true; } - return result; + + return false; } void TenuredGeneration::compute_new_size() { @@ -165,13 +152,10 @@ bool TenuredGeneration::promotion_attempt_is_safe(size_t max_promotion_in_bytes) size_t available = max_contiguous_available(); size_t av_promo = (size_t)gc_stats()->avg_promoted()->padded_average(); bool res = (available >= av_promo) || (available >= max_promotion_in_bytes); - if (PrintGC && Verbose) { - gclog_or_tty->print_cr( - "Tenured: promo attempt is%s safe: available(" SIZE_FORMAT ") %s av_promo(" SIZE_FORMAT ")," - "max_promo(" SIZE_FORMAT ")", - res? "":" not", available, res? ">=":"<", - av_promo, max_promotion_in_bytes); - } + + log_trace(gc)("Tenured: promo attempt is%s safe: available(" SIZE_FORMAT ") %s av_promo(" SIZE_FORMAT "), max_promo(" SIZE_FORMAT ")", + res? "":" not", available, res? ">=":"<", av_promo, max_promotion_in_bytes); + return res; } diff --git a/hotspot/src/share/vm/gc/shared/adaptiveSizePolicy.cpp b/hotspot/src/share/vm/gc/shared/adaptiveSizePolicy.cpp index 2b7f3f747c2..8365c62766f 100644 --- a/hotspot/src/share/vm/gc/shared/adaptiveSizePolicy.cpp +++ b/hotspot/src/share/vm/gc/shared/adaptiveSizePolicy.cpp @@ -27,6 +27,7 @@ #include "gc/shared/collectorPolicy.hpp" #include "gc/shared/gcCause.hpp" #include "gc/shared/workgroup.hpp" +#include "logging/log.hpp" #include "runtime/timer.hpp" #include "utilities/ostream.hpp" elapsedTimer AdaptiveSizePolicy::_minor_timer; @@ -166,14 +167,12 @@ uint AdaptiveSizePolicy::calc_default_active_workers(uintx total_workers, "Jiggled active workers too much"); } - if (TraceDynamicGCThreads) { - gclog_or_tty->print_cr("GCTaskManager::calc_default_active_workers() : " - "active_workers(): " UINTX_FORMAT " new_active_workers: " UINTX_FORMAT " " - "prev_active_workers: " UINTX_FORMAT "\n" - " active_workers_by_JT: " UINTX_FORMAT " active_workers_by_heap_size: " UINTX_FORMAT, - active_workers, new_active_workers, prev_active_workers, - active_workers_by_JT, active_workers_by_heap_size); - } + log_trace(gc, task)("GCTaskManager::calc_default_active_workers() : " + "active_workers(): " UINTX_FORMAT " new_active_workers: " UINTX_FORMAT " " + "prev_active_workers: " UINTX_FORMAT "\n" + " active_workers_by_JT: " UINTX_FORMAT " active_workers_by_heap_size: " UINTX_FORMAT, + active_workers, new_active_workers, prev_active_workers, + active_workers_by_JT, active_workers_by_heap_size); assert(new_active_workers > 0, "Always need at least 1"); return new_active_workers; } @@ -275,14 +274,10 @@ void AdaptiveSizePolicy::minor_collection_end(GCCause::Cause gc_cause) { update_minor_pause_young_estimator(minor_pause_in_ms); update_minor_pause_old_estimator(minor_pause_in_ms); - if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print("AdaptiveSizePolicy::minor_collection_end: " - "minor gc cost: %f average: %f", collection_cost, - _avg_minor_gc_cost->average()); - gclog_or_tty->print_cr(" minor pause: %f minor period %f", - minor_pause_in_ms, - _latest_minor_mutator_interval_seconds * MILLIUNITS); - } + log_trace(gc, ergo)("AdaptiveSizePolicy::minor_collection_end: minor gc cost: %f average: %f", + collection_cost, _avg_minor_gc_cost->average()); + log_trace(gc, ergo)(" minor pause: %f minor period %f", + minor_pause_in_ms, _latest_minor_mutator_interval_seconds * MILLIUNITS); // Calculate variable used to estimate collection cost vs. gen sizes assert(collection_cost >= 0.0, "Expected to be non-negative"); @@ -388,13 +383,10 @@ double AdaptiveSizePolicy::decaying_gc_cost() const { // Decay using the time-since-last-major-gc decayed_major_gc_cost = decaying_major_gc_cost(); - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr("\ndecaying_gc_cost: major interval average:" - " %f time since last major gc: %f", - avg_major_interval, time_since_last_major_gc); - gclog_or_tty->print_cr(" major gc cost: %f decayed major gc cost: %f", - major_gc_cost(), decayed_major_gc_cost); - } + log_trace(gc, ergo)("decaying_gc_cost: major interval average: %f time since last major gc: %f", + avg_major_interval, time_since_last_major_gc); + log_trace(gc, ergo)(" major gc cost: %f decayed major gc cost: %f", + major_gc_cost(), decayed_major_gc_cost); } } double result = MIN2(1.0, decayed_major_gc_cost + minor_gc_cost()); @@ -461,21 +453,17 @@ void AdaptiveSizePolicy::check_gc_overhead_limit( promo_limit = MAX2(promo_limit, _promo_size); - if (PrintAdaptiveSizePolicy && (Verbose || - (free_in_old_gen < (size_t) mem_free_old_limit && - free_in_eden < (size_t) mem_free_eden_limit))) { - gclog_or_tty->print_cr( - "PSAdaptiveSizePolicy::check_gc_overhead_limit:" - " promo_limit: " SIZE_FORMAT - " max_eden_size: " SIZE_FORMAT - " total_free_limit: " SIZE_FORMAT - " max_old_gen_size: " SIZE_FORMAT - " max_eden_size: " SIZE_FORMAT - " mem_free_limit: " SIZE_FORMAT, - promo_limit, max_eden_size, total_free_limit, - max_old_gen_size, max_eden_size, - (size_t) mem_free_limit); - } + log_trace(gc, ergo)( + "PSAdaptiveSizePolicy::check_gc_overhead_limit:" + " promo_limit: " SIZE_FORMAT + " max_eden_size: " SIZE_FORMAT + " total_free_limit: " SIZE_FORMAT + " max_old_gen_size: " SIZE_FORMAT + " max_eden_size: " SIZE_FORMAT + " mem_free_limit: " SIZE_FORMAT, + promo_limit, max_eden_size, total_free_limit, + max_old_gen_size, max_eden_size, + (size_t) mem_free_limit); bool print_gc_overhead_limit_would_be_exceeded = false; if (is_full_gc) { @@ -521,10 +509,7 @@ void AdaptiveSizePolicy::check_gc_overhead_limit( bool near_limit = gc_overhead_limit_near(); if (near_limit) { collector_policy->set_should_clear_all_soft_refs(true); - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr(" Nearing GC overhead limit, " - "will be clearing all SoftReference"); - } + log_trace(gc, ergo)("Nearing GC overhead limit, will be clearing all SoftReference"); } } } @@ -540,26 +525,25 @@ void AdaptiveSizePolicy::check_gc_overhead_limit( } } - if (UseGCOverheadLimit && PrintGCDetails && Verbose) { + if (UseGCOverheadLimit) { if (gc_overhead_limit_exceeded()) { - gclog_or_tty->print_cr(" GC is exceeding overhead limit " - "of " UINTX_FORMAT "%%", GCTimeLimit); + log_trace(gc, ergo)("GC is exceeding overhead limit of " UINTX_FORMAT "%%", GCTimeLimit); reset_gc_overhead_limit_count(); } else if (print_gc_overhead_limit_would_be_exceeded) { assert(gc_overhead_limit_count() > 0, "Should not be printing"); - gclog_or_tty->print_cr(" GC would exceed overhead limit " - "of " UINTX_FORMAT "%% %d consecutive time(s)", - GCTimeLimit, gc_overhead_limit_count()); + log_trace(gc, ergo)("GC would exceed overhead limit of " UINTX_FORMAT "%% %d consecutive time(s)", + GCTimeLimit, gc_overhead_limit_count()); } } } // Printing -bool AdaptiveSizePolicy::print_adaptive_size_policy_on(outputStream* st) const { +bool AdaptiveSizePolicy::print() const { + assert(UseAdaptiveSizePolicy, "UseAdaptiveSizePolicy need to be enabled."); - // Should only be used with adaptive size policy turned on. - // Otherwise, there may be variables that are undefined. - if (!UseAdaptiveSizePolicy) return false; + if (!log_is_enabled(Debug, gc, ergo)) { + return false; + } // Print goal for which action is needed. char* action = NULL; @@ -627,41 +611,24 @@ bool AdaptiveSizePolicy::print_adaptive_size_policy_on(outputStream* st) const { tenured_gen_action = shrink_msg; } - st->print_cr(" UseAdaptiveSizePolicy actions to meet %s", action); - st->print_cr(" GC overhead (%%)"); - st->print_cr(" Young generation: %7.2f\t %s", - 100.0 * avg_minor_gc_cost()->average(), - young_gen_action); - st->print_cr(" Tenured generation: %7.2f\t %s", - 100.0 * avg_major_gc_cost()->average(), - tenured_gen_action); + log_debug(gc, ergo)("UseAdaptiveSizePolicy actions to meet %s", action); + log_debug(gc, ergo)(" GC overhead (%%)"); + log_debug(gc, ergo)(" Young generation: %7.2f\t %s", + 100.0 * avg_minor_gc_cost()->average(), young_gen_action); + log_debug(gc, ergo)(" Tenured generation: %7.2f\t %s", + 100.0 * avg_major_gc_cost()->average(), tenured_gen_action); return true; } -bool AdaptiveSizePolicy::print_adaptive_size_policy_on( - outputStream* st, - uint tenuring_threshold_arg) const { - if (!AdaptiveSizePolicy::print_adaptive_size_policy_on(st)) { - return false; - } - +void AdaptiveSizePolicy::print_tenuring_threshold( uint new_tenuring_threshold_arg) const { // Tenuring threshold - bool tenuring_threshold_changed = true; if (decrement_tenuring_threshold_for_survivor_limit()) { - st->print(" Tenuring threshold: (attempted to decrease to avoid" - " survivor space overflow) = "); + log_debug(gc, ergo)("Tenuring threshold: (attempted to decrease to avoid survivor space overflow) = %u", new_tenuring_threshold_arg); } else if (decrement_tenuring_threshold_for_gc_cost()) { - st->print(" Tenuring threshold: (attempted to decrease to balance" - " GC costs) = "); + log_debug(gc, ergo)("Tenuring threshold: (attempted to decrease to balance GC costs) = %u", new_tenuring_threshold_arg); } else if (increment_tenuring_threshold_for_gc_cost()) { - st->print(" Tenuring threshold: (attempted to increase to balance" - " GC costs) = "); + log_debug(gc, ergo)("Tenuring threshold: (attempted to increase to balance GC costs) = %u", new_tenuring_threshold_arg); } else { - tenuring_threshold_changed = false; assert(!tenuring_threshold_change(), "(no change was attempted)"); } - if (tenuring_threshold_changed) { - st->print_cr("%u", tenuring_threshold_arg); - } - return true; } diff --git a/hotspot/src/share/vm/gc/shared/adaptiveSizePolicy.hpp b/hotspot/src/share/vm/gc/shared/adaptiveSizePolicy.hpp index 49c2b945fc9..eb483623d20 100644 --- a/hotspot/src/share/vm/gc/shared/adaptiveSizePolicy.hpp +++ b/hotspot/src/share/vm/gc/shared/adaptiveSizePolicy.hpp @@ -28,6 +28,7 @@ #include "gc/shared/collectedHeap.hpp" #include "gc/shared/gcCause.hpp" #include "gc/shared/gcUtil.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" #include "memory/universe.hpp" @@ -500,9 +501,8 @@ class AdaptiveSizePolicy : public CHeapObj { } // Printing support - virtual bool print_adaptive_size_policy_on(outputStream* st) const; - bool print_adaptive_size_policy_on(outputStream* st, - uint tenuring_threshold) const; + virtual bool print() const; + void print_tenuring_threshold(uint new_tenuring_threshold) const; }; // Class that can be used to print information about the @@ -510,46 +510,26 @@ class AdaptiveSizePolicy : public CHeapObj { // AdaptiveSizePolicyOutputInterval. Only print information // if an adaptive size policy is in use. class AdaptiveSizePolicyOutput : StackObj { - AdaptiveSizePolicy* _size_policy; - bool _do_print; - bool print_test(uint count) { - // A count of zero is a special value that indicates that the - // interval test should be ignored. An interval is of zero is - // a special value that indicates that the interval test should - // always fail (never do the print based on the interval test). - return PrintGCDetails && + static bool enabled() { + return UseParallelGC && UseAdaptiveSizePolicy && - UseParallelGC && - (AdaptiveSizePolicyOutputInterval > 0) && - ((count == 0) || - ((count % AdaptiveSizePolicyOutputInterval) == 0)); + log_is_enabled(Debug, gc, ergo); } public: - // The special value of a zero count can be used to ignore - // the count test. - AdaptiveSizePolicyOutput(uint count) { - if (UseAdaptiveSizePolicy && (AdaptiveSizePolicyOutputInterval > 0)) { - CollectedHeap* heap = Universe::heap(); - _size_policy = heap->size_policy(); - _do_print = print_test(count); - } else { - _size_policy = NULL; - _do_print = false; + static void print() { + if (enabled()) { + Universe::heap()->size_policy()->print(); } } - AdaptiveSizePolicyOutput(AdaptiveSizePolicy* size_policy, - uint count) : - _size_policy(size_policy) { - if (UseAdaptiveSizePolicy && (AdaptiveSizePolicyOutputInterval > 0)) { - _do_print = print_test(count); - } else { - _do_print = false; - } - } - ~AdaptiveSizePolicyOutput() { - if (_do_print) { - assert(UseAdaptiveSizePolicy, "Should not be in use"); - _size_policy->print_adaptive_size_policy_on(gclog_or_tty); + + static void print(AdaptiveSizePolicy* size_policy, uint count) { + bool do_print = + enabled() && + (AdaptiveSizePolicyOutputInterval > 0) && + (count % AdaptiveSizePolicyOutputInterval) == 0; + + if (do_print) { + size_policy->print(); } } }; diff --git a/hotspot/src/share/vm/gc/shared/ageTable.cpp b/hotspot/src/share/vm/gc/shared/ageTable.cpp index 638ce40c7ec..2b9b46321c2 100644 --- a/hotspot/src/share/vm/gc/shared/ageTable.cpp +++ b/hotspot/src/share/vm/gc/shared/ageTable.cpp @@ -28,6 +28,7 @@ #include "gc/shared/collectorPolicy.hpp" #include "gc/shared/gcPolicyCounters.hpp" #include "memory/resourceArea.hpp" +#include "logging/log.hpp" #include "utilities/copy.hpp" /* Copyright (c) 1992, 2015, Oracle and/or its affiliates, and Stanford University. @@ -94,24 +95,18 @@ uint ageTable::compute_tenuring_threshold(size_t survivor_capacity, GCPolicyCoun result = age < MaxTenuringThreshold ? age : MaxTenuringThreshold; } - if (PrintTenuringDistribution || UsePerfData) { - if (PrintTenuringDistribution) { - gclog_or_tty->cr(); - gclog_or_tty->print_cr("Desired survivor size " SIZE_FORMAT " bytes, new threshold " - UINTX_FORMAT " (max threshold " UINTX_FORMAT ")", - desired_survivor_size*oopSize, (uintx) result, MaxTenuringThreshold); - } + log_debug(gc, age)("Desired survivor size " SIZE_FORMAT " bytes, new threshold " UINTX_FORMAT " (max threshold " UINTX_FORMAT ")", + desired_survivor_size*oopSize, (uintx) result, MaxTenuringThreshold); + if (log_is_enabled(Trace, gc, age) || UsePerfData) { size_t total = 0; uint age = 1; while (age < table_size) { total += sizes[age]; if (sizes[age] > 0) { - if (PrintTenuringDistribution) { - gclog_or_tty->print_cr("- age %3u: " SIZE_FORMAT_W(10) " bytes, " SIZE_FORMAT_W(10) " total", - age, sizes[age]*oopSize, total*oopSize); - } + log_trace(gc, age)("- age %3u: " SIZE_FORMAT_W(10) " bytes, " SIZE_FORMAT_W(10) " total", + age, sizes[age]*oopSize, total*oopSize); } if (UsePerfData) { _perf_sizes[age]->set_value(sizes[age]*oopSize); diff --git a/hotspot/src/share/vm/gc/shared/blockOffsetTable.cpp b/hotspot/src/share/vm/gc/shared/blockOffsetTable.cpp index 9bf2eb5bdb1..9588d223bba 100644 --- a/hotspot/src/share/vm/gc/shared/blockOffsetTable.cpp +++ b/hotspot/src/share/vm/gc/shared/blockOffsetTable.cpp @@ -28,6 +28,7 @@ #include "gc/shared/space.inline.hpp" #include "memory/iterator.hpp" #include "memory/universe.hpp" +#include "logging/log.hpp" #include "oops/oop.inline.hpp" #include "runtime/java.hpp" #include "services/memTracker.hpp" @@ -53,19 +54,11 @@ BlockOffsetSharedArray::BlockOffsetSharedArray(MemRegion reserved, } _offset_array = (u_char*)_vs.low_boundary(); resize(init_word_size); - if (TraceBlockOffsetTable) { - gclog_or_tty->print_cr("BlockOffsetSharedArray::BlockOffsetSharedArray: "); - gclog_or_tty->print_cr(" " - " rs.base(): " INTPTR_FORMAT - " rs.size(): " INTPTR_FORMAT - " rs end(): " INTPTR_FORMAT, - p2i(rs.base()), rs.size(), p2i(rs.base() + rs.size())); - gclog_or_tty->print_cr(" " - " _vs.low_boundary(): " INTPTR_FORMAT - " _vs.high_boundary(): " INTPTR_FORMAT, - p2i(_vs.low_boundary()), - p2i(_vs.high_boundary())); - } + log_trace(gc, bot)("BlockOffsetSharedArray::BlockOffsetSharedArray: "); + log_trace(gc, bot)(" rs.base(): " INTPTR_FORMAT " rs.size(): " INTPTR_FORMAT " rs end(): " INTPTR_FORMAT, + p2i(rs.base()), rs.size(), p2i(rs.base() + rs.size())); + log_trace(gc, bot)(" _vs.low_boundary(): " INTPTR_FORMAT " _vs.high_boundary(): " INTPTR_FORMAT, + p2i(_vs.low_boundary()), p2i(_vs.high_boundary())); } void BlockOffsetSharedArray::resize(size_t new_word_size) { diff --git a/hotspot/src/share/vm/gc/shared/cardGeneration.cpp b/hotspot/src/share/vm/gc/shared/cardGeneration.cpp index 1eff9c9fa3a..c43f0822358 100644 --- a/hotspot/src/share/vm/gc/shared/cardGeneration.cpp +++ b/hotspot/src/share/vm/gc/shared/cardGeneration.cpp @@ -33,6 +33,7 @@ #include "gc/shared/space.inline.hpp" #include "memory/iterator.hpp" #include "memory/memRegion.hpp" +#include "logging/log.hpp" #include "runtime/java.hpp" CardGeneration::CardGeneration(ReservedSpace rs, @@ -96,13 +97,10 @@ bool CardGeneration::grow_by(size_t bytes) { // update the space and generation capacity counters update_counters(); - if (Verbose && PrintGC) { - size_t new_mem_size = _virtual_space.committed_size(); - size_t old_mem_size = new_mem_size - bytes; - gclog_or_tty->print_cr("Expanding %s from " SIZE_FORMAT "K by " - SIZE_FORMAT "K to " SIZE_FORMAT "K", - name(), old_mem_size/K, bytes/K, new_mem_size/K); - } + size_t new_mem_size = _virtual_space.committed_size(); + size_t old_mem_size = new_mem_size - bytes; + log_trace(gc, heap)("Expanding %s from " SIZE_FORMAT "K by " SIZE_FORMAT "K to " SIZE_FORMAT "K", + name(), old_mem_size/K, bytes/K, new_mem_size/K); } return result; } @@ -133,10 +131,8 @@ bool CardGeneration::expand(size_t bytes, size_t expand_bytes) { if (!success) { success = grow_to_reserved(); } - if (PrintGC && Verbose) { - if (success && GC_locker::is_active_and_needs_gc()) { - gclog_or_tty->print_cr("Garbage collection disabled, expanded heap instead"); - } + if (success && GC_locker::is_active_and_needs_gc()) { + log_trace(gc, heap)("Garbage collection disabled, expanded heap instead"); } return success; @@ -172,12 +168,10 @@ void CardGeneration::shrink(size_t bytes) { // Shrink the card table GenCollectedHeap::heap()->barrier_set()->resize_covered_region(mr); - if (Verbose && PrintGC) { - size_t new_mem_size = _virtual_space.committed_size(); - size_t old_mem_size = new_mem_size + size; - gclog_or_tty->print_cr("Shrinking %s from " SIZE_FORMAT "K to " SIZE_FORMAT "K", - name(), old_mem_size/K, new_mem_size/K); - } + size_t new_mem_size = _virtual_space.committed_size(); + size_t old_mem_size = new_mem_size + size; + log_trace(gc, heap)("Shrinking %s from " SIZE_FORMAT "K to " SIZE_FORMAT "K", + name(), old_mem_size/K, new_mem_size/K); } // No young generation references, clear this generation's cards. @@ -211,26 +205,17 @@ void CardGeneration::compute_new_size() { minimum_desired_capacity = MAX2(minimum_desired_capacity, initial_size()); assert(used_after_gc <= minimum_desired_capacity, "sanity check"); - if (PrintGC && Verbose) { const size_t free_after_gc = free(); const double free_percentage = ((double)free_after_gc) / capacity_after_gc; - gclog_or_tty->print_cr("TenuredGeneration::compute_new_size: "); - gclog_or_tty->print_cr(" " - " minimum_free_percentage: %6.2f" - " maximum_used_percentage: %6.2f", + log_trace(gc, heap)("TenuredGeneration::compute_new_size:"); + log_trace(gc, heap)(" minimum_free_percentage: %6.2f maximum_used_percentage: %6.2f", minimum_free_percentage, maximum_used_percentage); - gclog_or_tty->print_cr(" " - " free_after_gc : %6.1fK" - " used_after_gc : %6.1fK" - " capacity_after_gc : %6.1fK", + log_trace(gc, heap)(" free_after_gc : %6.1fK used_after_gc : %6.1fK capacity_after_gc : %6.1fK", free_after_gc / (double) K, used_after_gc / (double) K, capacity_after_gc / (double) K); - gclog_or_tty->print_cr(" " - " free_percentage: %6.2f", - free_percentage); - } + log_trace(gc, heap)(" free_percentage: %6.2f", free_percentage); if (capacity_after_gc < minimum_desired_capacity) { // If we have less free space than we want then expand @@ -239,15 +224,10 @@ void CardGeneration::compute_new_size() { if (expand_bytes >= _min_heap_delta_bytes) { expand(expand_bytes, 0); // safe if expansion fails } - if (PrintGC && Verbose) { - gclog_or_tty->print_cr(" expanding:" - " minimum_desired_capacity: %6.1fK" - " expand_bytes: %6.1fK" - " _min_heap_delta_bytes: %6.1fK", - minimum_desired_capacity / (double) K, - expand_bytes / (double) K, - _min_heap_delta_bytes / (double) K); - } + log_trace(gc, heap)(" expanding: minimum_desired_capacity: %6.1fK expand_bytes: %6.1fK _min_heap_delta_bytes: %6.1fK", + minimum_desired_capacity / (double) K, + expand_bytes / (double) K, + _min_heap_delta_bytes / (double) K); return; } @@ -262,20 +242,12 @@ void CardGeneration::compute_new_size() { const double max_tmp = used_after_gc / minimum_used_percentage; size_t maximum_desired_capacity = (size_t)MIN2(max_tmp, double(max_uintx)); maximum_desired_capacity = MAX2(maximum_desired_capacity, initial_size()); - if (PrintGC && Verbose) { - gclog_or_tty->print_cr(" " - " maximum_free_percentage: %6.2f" - " minimum_used_percentage: %6.2f", - maximum_free_percentage, - minimum_used_percentage); - gclog_or_tty->print_cr(" " - " _capacity_at_prologue: %6.1fK" - " minimum_desired_capacity: %6.1fK" - " maximum_desired_capacity: %6.1fK", + log_trace(gc, heap)(" maximum_free_percentage: %6.2f minimum_used_percentage: %6.2f", + maximum_free_percentage, minimum_used_percentage); + log_trace(gc, heap)(" _capacity_at_prologue: %6.1fK minimum_desired_capacity: %6.1fK maximum_desired_capacity: %6.1fK", _capacity_at_prologue / (double) K, minimum_desired_capacity / (double) K, maximum_desired_capacity / (double) K); - } assert(minimum_desired_capacity <= maximum_desired_capacity, "sanity check"); @@ -295,23 +267,13 @@ void CardGeneration::compute_new_size() { } else { _shrink_factor = MIN2(current_shrink_factor * 4, (size_t) 100); } - if (PrintGC && Verbose) { - gclog_or_tty->print_cr(" " - " shrinking:" - " initSize: %.1fK" - " maximum_desired_capacity: %.1fK", - initial_size() / (double) K, - maximum_desired_capacity / (double) K); - gclog_or_tty->print_cr(" " - " shrink_bytes: %.1fK" - " current_shrink_factor: " SIZE_FORMAT - " new shrink factor: " SIZE_FORMAT - " _min_heap_delta_bytes: %.1fK", + log_trace(gc, heap)(" shrinking: initSize: %.1fK maximum_desired_capacity: %.1fK", + initial_size() / (double) K, maximum_desired_capacity / (double) K); + log_trace(gc, heap)(" shrink_bytes: %.1fK current_shrink_factor: " SIZE_FORMAT " new shrink factor: " SIZE_FORMAT " _min_heap_delta_bytes: %.1fK", shrink_bytes / (double) K, current_shrink_factor, _shrink_factor, _min_heap_delta_bytes / (double) K); - } } } @@ -324,18 +286,11 @@ void CardGeneration::compute_new_size() { // We have two shrinking computations, take the largest shrink_bytes = MAX2(shrink_bytes, expansion_for_promotion); assert(shrink_bytes <= max_shrink_bytes, "invalid shrink size"); - if (PrintGC && Verbose) { - gclog_or_tty->print_cr(" " - " aggressive shrinking:" - " _capacity_at_prologue: %.1fK" - " capacity_after_gc: %.1fK" - " expansion_for_promotion: %.1fK" - " shrink_bytes: %.1fK", - capacity_after_gc / (double) K, - _capacity_at_prologue / (double) K, - expansion_for_promotion / (double) K, - shrink_bytes / (double) K); - } + log_trace(gc, heap)(" aggressive shrinking: _capacity_at_prologue: %.1fK capacity_after_gc: %.1fK expansion_for_promotion: %.1fK shrink_bytes: %.1fK", + capacity_after_gc / (double) K, + _capacity_at_prologue / (double) K, + expansion_for_promotion / (double) K, + shrink_bytes / (double) K); } // Don't shrink unless it's significant if (shrink_bytes >= _min_heap_delta_bytes) { diff --git a/hotspot/src/share/vm/gc/shared/cardTableModRefBS.cpp b/hotspot/src/share/vm/gc/shared/cardTableModRefBS.cpp index 45ad7777201..ec37fb7cd9f 100644 --- a/hotspot/src/share/vm/gc/shared/cardTableModRefBS.cpp +++ b/hotspot/src/share/vm/gc/shared/cardTableModRefBS.cpp @@ -28,6 +28,7 @@ #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/space.inline.hpp" #include "memory/virtualspace.hpp" +#include "logging/log.hpp" #include "services/memTracker.hpp" #include "utilities/macros.hpp" @@ -115,17 +116,10 @@ void CardTableModRefBS::initialize() { !ExecMem, "card table last card"); *guard_card = last_card; - if (TraceCardTableModRefBS) { - gclog_or_tty->print_cr("CardTableModRefBS::CardTableModRefBS: "); - gclog_or_tty->print_cr(" " - " &_byte_map[0]: " INTPTR_FORMAT - " &_byte_map[_last_valid_index]: " INTPTR_FORMAT, - p2i(&_byte_map[0]), - p2i(&_byte_map[_last_valid_index])); - gclog_or_tty->print_cr(" " - " byte_map_base: " INTPTR_FORMAT, - p2i(byte_map_base)); - } + log_trace(gc, barrier)("CardTableModRefBS::CardTableModRefBS: "); + log_trace(gc, barrier)(" &_byte_map[0]: " INTPTR_FORMAT " &_byte_map[_last_valid_index]: " INTPTR_FORMAT, + p2i(&_byte_map[0]), p2i(&_byte_map[_last_valid_index])); + log_trace(gc, barrier)(" byte_map_base: " INTPTR_FORMAT, p2i(byte_map_base)); } CardTableModRefBS::~CardTableModRefBS() { @@ -350,29 +344,17 @@ void CardTableModRefBS::resize_covered_region(MemRegion new_region) { } // In any case, the covered size changes. _covered[ind].set_word_size(new_region.word_size()); - if (TraceCardTableModRefBS) { - gclog_or_tty->print_cr("CardTableModRefBS::resize_covered_region: "); - gclog_or_tty->print_cr(" " - " _covered[%d].start(): " INTPTR_FORMAT - " _covered[%d].last(): " INTPTR_FORMAT, - ind, p2i(_covered[ind].start()), - ind, p2i(_covered[ind].last())); - gclog_or_tty->print_cr(" " - " _committed[%d].start(): " INTPTR_FORMAT - " _committed[%d].last(): " INTPTR_FORMAT, - ind, p2i(_committed[ind].start()), - ind, p2i(_committed[ind].last())); - gclog_or_tty->print_cr(" " - " byte_for(start): " INTPTR_FORMAT - " byte_for(last): " INTPTR_FORMAT, - p2i(byte_for(_covered[ind].start())), - p2i(byte_for(_covered[ind].last()))); - gclog_or_tty->print_cr(" " - " addr_for(start): " INTPTR_FORMAT - " addr_for(last): " INTPTR_FORMAT, - p2i(addr_for((jbyte*) _committed[ind].start())), - p2i(addr_for((jbyte*) _committed[ind].last()))); - } + + log_trace(gc, barrier)("CardTableModRefBS::resize_covered_region: "); + log_trace(gc, barrier)(" _covered[%d].start(): " INTPTR_FORMAT " _covered[%d].last(): " INTPTR_FORMAT, + ind, p2i(_covered[ind].start()), ind, p2i(_covered[ind].last())); + log_trace(gc, barrier)(" _committed[%d].start(): " INTPTR_FORMAT " _committed[%d].last(): " INTPTR_FORMAT, + ind, p2i(_committed[ind].start()), ind, p2i(_committed[ind].last())); + log_trace(gc, barrier)(" byte_for(start): " INTPTR_FORMAT " byte_for(last): " INTPTR_FORMAT, + p2i(byte_for(_covered[ind].start())), p2i(byte_for(_covered[ind].last()))); + log_trace(gc, barrier)(" addr_for(start): " INTPTR_FORMAT " addr_for(last): " INTPTR_FORMAT, + p2i(addr_for((jbyte*) _committed[ind].start())), p2i(addr_for((jbyte*) _committed[ind].last()))); + // Touch the last card of the covered region to show that it // is committed (or SEGV). debug_only((void) (*byte_for(_covered[ind].last()));) diff --git a/hotspot/src/share/vm/gc/shared/collectedHeap.cpp b/hotspot/src/share/vm/gc/shared/collectedHeap.cpp index e581bbb47c2..d0fb006d2ed 100644 --- a/hotspot/src/share/vm/gc/shared/collectedHeap.cpp +++ b/hotspot/src/share/vm/gc/shared/collectedHeap.cpp @@ -30,9 +30,10 @@ #include "gc/shared/collectedHeap.inline.hpp" #include "gc/shared/gcHeapSummary.hpp" #include "gc/shared/gcTrace.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/gcWhen.hpp" #include "gc/shared/vmGCOperations.hpp" +#include "logging/log.hpp" #include "memory/metaspace.hpp" #include "oops/instanceMirrorKlass.hpp" #include "oops/oop.inline.hpp" @@ -53,7 +54,7 @@ void EventLogBase::print(outputStream* st, GCMessage& m) { st->print_raw(m); } -void GCHeapLog::log_heap(bool before) { +void GCHeapLog::log_heap(CollectedHeap* heap, bool before) { if (!should_log()) { return; } @@ -65,11 +66,14 @@ void GCHeapLog::log_heap(bool before) { _records[index].timestamp = timestamp; _records[index].data.is_before = before; stringStream st(_records[index].data.buffer(), _records[index].data.size()); - if (before) { - Universe::print_heap_before_gc(&st, true); - } else { - Universe::print_heap_after_gc(&st, true); - } + + st.print_cr("{Heap %s GC invocations=%u (full %u):", + before ? "before" : "after", + heap->total_collections(), + heap->total_full_collections()); + + heap->print_on(&st); + st.print_cr("}"); } VirtualSpaceSummary CollectedHeap::create_heap_space_summary() { @@ -108,20 +112,16 @@ MetaspaceSummary CollectedHeap::create_metaspace_summary() { } void CollectedHeap::print_heap_before_gc() { - if (PrintHeapAtGC) { - Universe::print_heap_before_gc(); - } + Universe::print_heap_before_gc(); if (_gc_heap_log != NULL) { - _gc_heap_log->log_heap_before(); + _gc_heap_log->log_heap_before(this); } } void CollectedHeap::print_heap_after_gc() { - if (PrintHeapAtGC) { - Universe::print_heap_after_gc(); - } + Universe::print_heap_after_gc(); if (_gc_heap_log != NULL) { - _gc_heap_log->log_heap_after(); + _gc_heap_log->log_heap_after(this); } } @@ -571,34 +571,30 @@ void CollectedHeap::resize_all_tlabs() { } } -void CollectedHeap::pre_full_gc_dump(GCTimer* timer) { - if (HeapDumpBeforeFullGC) { +void CollectedHeap::full_gc_dump(GCTimer* timer, const char* when) { + if (HeapDumpBeforeFullGC || HeapDumpAfterFullGC) { GCIdMarkAndRestore gc_id_mark; - GCTraceTime tt("Heap Dump (before full gc): ", PrintGCDetails, false, timer); - // We are doing a full collection and a heap dump before - // full collection has been requested. + FormatBuffer<> title("Heap Dump (%s full gc)", when); + GCTraceTime(Info, gc) tm(title.buffer(), timer); HeapDumper::dump_heap(); } - if (PrintClassHistogramBeforeFullGC) { + LogHandle(gc, classhisto) log; + if (log.is_trace()) { + ResourceMark rm; GCIdMarkAndRestore gc_id_mark; - GCTraceTime tt("Class Histogram (before full gc): ", PrintGCDetails, true, timer); - VM_GC_HeapInspection inspector(gclog_or_tty, false /* ! full gc */); + FormatBuffer<> title("Class Histogram (%s full gc)", when); + GCTraceTime(Trace, gc, classhisto) tm(title.buffer(), timer); + VM_GC_HeapInspection inspector(log.trace_stream(), false /* ! full gc */); inspector.doit(); } } +void CollectedHeap::pre_full_gc_dump(GCTimer* timer) { + full_gc_dump(timer, "before"); +} + void CollectedHeap::post_full_gc_dump(GCTimer* timer) { - if (HeapDumpAfterFullGC) { - GCIdMarkAndRestore gc_id_mark; - GCTraceTime tt("Heap Dump (after full gc): ", PrintGCDetails, false, timer); - HeapDumper::dump_heap(); - } - if (PrintClassHistogramAfterFullGC) { - GCIdMarkAndRestore gc_id_mark; - GCTraceTime tt("Class Histogram (after full gc): ", PrintGCDetails, true, timer); - VM_GC_HeapInspection inspector(gclog_or_tty, false /* ! full gc */); - inspector.doit(); - } + full_gc_dump(timer, "after"); } void CollectedHeap::initialize_reserved_region(HeapWord *start, HeapWord *end) { diff --git a/hotspot/src/share/vm/gc/shared/collectedHeap.hpp b/hotspot/src/share/vm/gc/shared/collectedHeap.hpp index d12941b14fe..b0da1f7a1f1 100644 --- a/hotspot/src/share/vm/gc/shared/collectedHeap.hpp +++ b/hotspot/src/share/vm/gc/shared/collectedHeap.hpp @@ -58,18 +58,20 @@ class GCMessage : public FormatBuffer<1024> { GCMessage() {} }; +class CollectedHeap; + class GCHeapLog : public EventLogBase { private: - void log_heap(bool before); + void log_heap(CollectedHeap* heap, bool before); public: GCHeapLog() : EventLogBase("GC Heap History") {} - void log_heap_before() { - log_heap(true); + void log_heap_before(CollectedHeap* heap) { + log_heap(heap, true); } - void log_heap_after() { - log_heap(false); + void log_heap_after(CollectedHeap* heap) { + log_heap(heap, false); } }; @@ -195,6 +197,8 @@ class CollectedHeap : public CHeapObj { virtual Name kind() const = 0; + virtual const char* name() const = 0; + /** * Returns JNI error code JNI_ENOMEM if memory could not be allocated, * and JNI_OK on success. @@ -519,6 +523,9 @@ class CollectedHeap : public CHeapObj { virtual void prepare_for_verify() = 0; // Generate any dumps preceding or following a full gc + private: + void full_gc_dump(GCTimer* timer, const char* when); + public: void pre_full_gc_dump(GCTimer* timer); void post_full_gc_dump(GCTimer* timer); @@ -569,7 +576,7 @@ class CollectedHeap : public CHeapObj { void trace_heap_after_gc(const GCTracer* gc_tracer); // Heap verification - virtual void verify(bool silent, VerifyOption option) = 0; + virtual void verify(VerifyOption option) = 0; // Non product verification and debugging. #ifndef PRODUCT diff --git a/hotspot/src/share/vm/gc/shared/collectorPolicy.cpp b/hotspot/src/share/vm/gc/shared/collectorPolicy.cpp index 568de2d0ef8..223c9063b12 100644 --- a/hotspot/src/share/vm/gc/shared/collectorPolicy.cpp +++ b/hotspot/src/share/vm/gc/shared/collectorPolicy.cpp @@ -32,6 +32,7 @@ #include "gc/shared/generationSpec.hpp" #include "gc/shared/space.hpp" #include "gc/shared/vmGCOperations.hpp" +#include "logging/log.hpp" #include "memory/universe.hpp" #include "runtime/arguments.hpp" #include "runtime/globals_extension.hpp" @@ -137,11 +138,8 @@ void CollectorPolicy::initialize_flags() { } void CollectorPolicy::initialize_size_info() { - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr("Minimum heap " SIZE_FORMAT " Initial heap " - SIZE_FORMAT " Maximum heap " SIZE_FORMAT, - _min_heap_byte_size, _initial_heap_byte_size, _max_heap_byte_size); - } + log_debug(gc, heap)("Minimum heap " SIZE_FORMAT " Initial heap " SIZE_FORMAT " Maximum heap " SIZE_FORMAT, + _min_heap_byte_size, _initial_heap_byte_size, _max_heap_byte_size); DEBUG_ONLY(CollectorPolicy::assert_size_info();) } @@ -488,11 +486,8 @@ void GenCollectorPolicy::initialize_size_info() { } } - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr("1: Minimum young " SIZE_FORMAT " Initial young " - SIZE_FORMAT " Maximum young " SIZE_FORMAT, - _min_young_size, _initial_young_size, _max_young_size); - } + log_trace(gc, heap)("1: Minimum young " SIZE_FORMAT " Initial young " SIZE_FORMAT " Maximum young " SIZE_FORMAT, + _min_young_size, _initial_young_size, _max_young_size); // At this point the minimum, initial and maximum sizes // of the overall heap and of the young generation have been determined. @@ -558,11 +553,8 @@ void GenCollectorPolicy::initialize_size_info() { _initial_young_size = desired_young_size; } - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr("2: Minimum young " SIZE_FORMAT " Initial young " - SIZE_FORMAT " Maximum young " SIZE_FORMAT, - _min_young_size, _initial_young_size, _max_young_size); - } + log_trace(gc, heap)("2: Minimum young " SIZE_FORMAT " Initial young " SIZE_FORMAT " Maximum young " SIZE_FORMAT, + _min_young_size, _initial_young_size, _max_young_size); } // Write back to flags if necessary. @@ -578,11 +570,8 @@ void GenCollectorPolicy::initialize_size_info() { FLAG_SET_ERGO(size_t, OldSize, _initial_old_size); } - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr("Minimum old " SIZE_FORMAT " Initial old " - SIZE_FORMAT " Maximum old " SIZE_FORMAT, - _min_old_size, _initial_old_size, _max_old_size); - } + log_trace(gc, heap)("Minimum old " SIZE_FORMAT " Initial old " SIZE_FORMAT " Maximum old " SIZE_FORMAT, + _min_old_size, _initial_old_size, _max_old_size); DEBUG_ONLY(GenCollectorPolicy::assert_size_info();) } @@ -620,10 +609,7 @@ HeapWord* GenCollectorPolicy::mem_allocate_work(size_t size, uint gc_count_before; // Read inside the Heap_lock locked region. { MutexLocker ml(Heap_lock); - if (PrintGC && Verbose) { - gclog_or_tty->print_cr("GenCollectorPolicy::mem_allocate_work:" - " attempting locked slow path allocation"); - } + log_trace(gc, alloc)("GenCollectorPolicy::mem_allocate_work: attempting locked slow path allocation"); // Note that only large objects get a shot at being // allocated in later generations. bool first_only = ! should_try_older_generation_allocation(size); @@ -757,9 +743,7 @@ HeapWord* GenCollectorPolicy::satisfy_failed_allocation(size_t size, is_tlab, // is_tlab GenCollectedHeap::OldGen); // max_generation } else { - if (Verbose && PrintGCDetails) { - gclog_or_tty->print(" :: Trying full because partial may fail :: "); - } + log_trace(gc)(" :: Trying full because partial may fail :: "); // Try a full collection; see delta for bug id 6266275 // for the original code and why this has been simplified // with from-space allocation criteria modified and diff --git a/hotspot/src/share/vm/gc/shared/gcCause.hpp b/hotspot/src/share/vm/gc/shared/gcCause.hpp index 39cee93ed9c..bc9e83c62e8 100644 --- a/hotspot/src/share/vm/gc/shared/gcCause.hpp +++ b/hotspot/src/share/vm/gc/shared/gcCause.hpp @@ -125,36 +125,4 @@ class GCCause : public AllStatic { static const char* to_string(GCCause::Cause cause); }; -// Helper class for doing logging that includes the GC Cause -// as a string. -class GCCauseString : StackObj { - private: - static const int _length = 128; - char _buffer[_length]; - int _position; - - public: - GCCauseString(const char* prefix, GCCause::Cause cause) { - if (PrintGCCause) { - _position = jio_snprintf(_buffer, _length, "%s (%s) ", prefix, GCCause::to_string(cause)); - } else { - _position = jio_snprintf(_buffer, _length, "%s ", prefix); - } - assert(_position >= 0 && _position <= _length, - "Need to increase the buffer size in GCCauseString? %d", _position); - } - - GCCauseString& append(const char* str) { - int res = jio_snprintf(_buffer + _position, _length - _position, "%s", str); - _position += res; - assert(res >= 0 && _position <= _length, - "Need to increase the buffer size in GCCauseString? %d", res); - return *this; - } - - operator const char*() { - return _buffer; - } -}; - #endif // SHARE_VM_GC_SHARED_GCCAUSE_HPP diff --git a/hotspot/src/share/vm/gc/shared/gcId.cpp b/hotspot/src/share/vm/gc/shared/gcId.cpp index a87bbe9d31e..f6ef9bce386 100644 --- a/hotspot/src/share/vm/gc/shared/gcId.cpp +++ b/hotspot/src/share/vm/gc/shared/gcId.cpp @@ -26,6 +26,7 @@ #include "gc/shared/gcId.hpp" #include "runtime/safepoint.hpp" #include "runtime/thread.inline.hpp" +#include "runtime/threadLocalStorage.hpp" uint GCId::_next_id = 0; @@ -47,6 +48,18 @@ const uint GCId::current_raw() { return currentNamedthread()->gc_id(); } +size_t GCId::print_prefix(char* buf, size_t len) { + if (ThreadLocalStorage::is_initialized() && ThreadLocalStorage::thread()->is_Named_thread()) { + uint gc_id = current_raw(); + if (gc_id != undefined()) { + int ret = jio_snprintf(buf, len, "GC(%u) ", gc_id); + assert(ret > 0, "Failed to print prefix. Log buffer too small?"); + return (size_t)ret; + } + } + return 0; +} + GCIdMark::GCIdMark() : _gc_id(GCId::create()) { currentNamedthread()->set_gc_id(_gc_id); } diff --git a/hotspot/src/share/vm/gc/shared/gcId.hpp b/hotspot/src/share/vm/gc/shared/gcId.hpp index 2e09fd84a67..8fc525a31de 100644 --- a/hotspot/src/share/vm/gc/shared/gcId.hpp +++ b/hotspot/src/share/vm/gc/shared/gcId.hpp @@ -40,6 +40,7 @@ class GCId : public AllStatic { // Same as current() but can return undefined() if no GC id is currently active static const uint current_raw(); static const uint undefined() { return UNDEFINED; } + static size_t print_prefix(char* buf, size_t len); }; class GCIdMark : public StackObj { diff --git a/hotspot/src/share/vm/gc/shared/gcLocker.cpp b/hotspot/src/share/vm/gc/shared/gcLocker.cpp index 7935ded6ec7..3b3b8448f7d 100644 --- a/hotspot/src/share/vm/gc/shared/gcLocker.cpp +++ b/hotspot/src/share/vm/gc/shared/gcLocker.cpp @@ -26,6 +26,7 @@ #include "gc/shared/collectedHeap.hpp" #include "gc/shared/gcLocker.inline.hpp" #include "memory/resourceArea.hpp" +#include "logging/log.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/thread.inline.hpp" @@ -73,17 +74,20 @@ void GC_locker::decrement_debug_jni_lock_count() { } #endif +void GC_locker::log_debug_jni(const char* msg) { + LogHandle(gc, jni) log; + if (log.is_debug()) { + ResourceMark rm; // JavaThread::name() allocates to convert to UTF8 + log.debug("%s Thread \"%s\" %d locked.", msg, Thread::current()->name(), _jni_lock_count); + } +} + bool GC_locker::check_active_before_gc() { assert(SafepointSynchronize::is_at_safepoint(), "only read at safepoint"); if (is_active() && !_needs_gc) { verify_critical_count(); _needs_gc = true; - if (PrintJNIGCStalls && PrintGCDetails) { - ResourceMark rm; // JavaThread::name() allocates to convert to UTF8 - gclog_or_tty->print_cr("%.3f: Setting _needs_gc. Thread \"%s\" %d locked.", - gclog_or_tty->time_stamp().seconds(), Thread::current()->name(), _jni_lock_count); - } - + log_debug_jni("Setting _needs_gc."); } return is_active(); } @@ -93,11 +97,7 @@ void GC_locker::stall_until_clear() { MutexLocker ml(JNICritical_lock); if (needs_gc()) { - if (PrintJNIGCStalls && PrintGCDetails) { - ResourceMark rm; // JavaThread::name() allocates to convert to UTF8 - gclog_or_tty->print_cr("%.3f: Allocation failed. Thread \"%s\" is stalled by JNI critical section, %d locked.", - gclog_or_tty->time_stamp().seconds(), Thread::current()->name(), _jni_lock_count); - } + log_debug_jni("Allocation failed. Thread stalled by JNI critical section."); } // Wait for _needs_gc to be cleared @@ -134,11 +134,7 @@ void GC_locker::jni_unlock(JavaThread* thread) { { // Must give up the lock while at a safepoint MutexUnlocker munlock(JNICritical_lock); - if (PrintJNIGCStalls && PrintGCDetails) { - ResourceMark rm; // JavaThread::name() allocates to convert to UTF8 - gclog_or_tty->print_cr("%.3f: Thread \"%s\" is performing GC after exiting critical section, %d locked", - gclog_or_tty->time_stamp().seconds(), Thread::current()->name(), _jni_lock_count); - } + log_debug_jni("Performing GC after exiting critical section."); Universe::heap()->collect(GCCause::_gc_locker); } _doing_gc = false; diff --git a/hotspot/src/share/vm/gc/shared/gcLocker.hpp b/hotspot/src/share/vm/gc/shared/gcLocker.hpp index 41ad0aec738..d4134dc2fb6 100644 --- a/hotspot/src/share/vm/gc/shared/gcLocker.hpp +++ b/hotspot/src/share/vm/gc/shared/gcLocker.hpp @@ -64,6 +64,7 @@ class GC_locker: public AllStatic { return _jni_lock_count > 0; } + static void log_debug_jni(const char* msg); public: // Accessors static bool is_active() { diff --git a/hotspot/src/share/vm/gc/shared/gcTraceTime.cpp b/hotspot/src/share/vm/gc/shared/gcTraceTime.cpp index dc63333b955..fd4c25281c5 100644 --- a/hotspot/src/share/vm/gc/shared/gcTraceTime.cpp +++ b/hotspot/src/share/vm/gc/shared/gcTraceTime.cpp @@ -23,57 +23,38 @@ */ #include "precompiled.hpp" -#include "gc/shared/gcTimer.hpp" -#include "gc/shared/gcTrace.hpp" -#include "gc/shared/gcTraceTime.hpp" -#include "runtime/globals.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" +#include "logging/log.hpp" #include "runtime/os.hpp" -#include "runtime/safepoint.hpp" -#include "runtime/thread.inline.hpp" -#include "runtime/timer.hpp" -#include "utilities/ostream.hpp" -#include "utilities/ticks.inline.hpp" - -GCTraceTimeImpl::GCTraceTimeImpl(const char* title, bool doit, bool print_cr, GCTimer* timer) : - _title(title), _doit(doit), _print_cr(print_cr), _timer(timer), _start_counter() { - if (_doit || _timer != NULL) { - _start_counter.stamp(); - } - - if (_timer != NULL) { - assert(SafepointSynchronize::is_at_safepoint(), "Tracing currently only supported at safepoints"); - assert(Thread::current()->is_VM_thread(), "Tracing currently only supported from the VM thread"); - - _timer->register_gc_phase_start(title, _start_counter); - } - - if (_doit) { - gclog_or_tty->gclog_stamp(); - gclog_or_tty->print("[%s", title); - gclog_or_tty->flush(); - } -} - -GCTraceTimeImpl::~GCTraceTimeImpl() { - Ticks stop_counter; - - if (_doit || _timer != NULL) { - stop_counter.stamp(); - } - - if (_timer != NULL) { - _timer->register_gc_phase_end(stop_counter); - } - - if (_doit) { - const Tickspan duration = stop_counter - _start_counter; - double duration_in_seconds = TicksToTimeHelper::seconds(duration); - if (_print_cr) { - gclog_or_tty->print_cr(", %3.7f secs]", duration_in_seconds); - } else { - gclog_or_tty->print(", %3.7f secs]", duration_in_seconds); +GCTraceCPUTime::GCTraceCPUTime() : + _active(log_is_enabled(Info, gc, cpu)), + _starting_user_time(0.0), + _starting_system_time(0.0), + _starting_real_time(0.0) +{ + if (_active) { + bool valid = os::getTimesSecs(&_starting_real_time, + &_starting_user_time, + &_starting_system_time); + if (!valid) { + log_warning(gc, cpu)("TraceCPUTime: os::getTimesSecs() returned invalid result"); + _active = false; + } + } +} + +GCTraceCPUTime::~GCTraceCPUTime() { + if (_active) { + double real_time, user_time, system_time; + bool valid = os::getTimesSecs(&real_time, &user_time, &system_time); + if (valid) { + log_info(gc, cpu)("User=%3.2fs Sys=%3.2fs Real=%3.2fs", + user_time - _starting_user_time, + system_time - _starting_system_time, + real_time - _starting_real_time); + } else { + log_warning(gc, cpu)("TraceCPUTime: os::getTimesSecs() returned invalid result"); } - gclog_or_tty->flush(); } } diff --git a/hotspot/src/share/vm/gc/shared/gcTraceTime.hpp b/hotspot/src/share/vm/gc/shared/gcTraceTime.hpp index 19fb32f9db6..b6555dff2ce 100644 --- a/hotspot/src/share/vm/gc/shared/gcTraceTime.hpp +++ b/hotspot/src/share/vm/gc/shared/gcTraceTime.hpp @@ -25,31 +25,55 @@ #ifndef SHARE_VM_GC_SHARED_GCTRACETIME_HPP #define SHARE_VM_GC_SHARED_GCTRACETIME_HPP -#include "gc/shared/gcTrace.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" -#include "prims/jni_md.h" #include "utilities/ticks.hpp" +class GCTraceCPUTime : public StackObj { + bool _active; // true if times will be measured and printed + double _starting_user_time; // user time at start of measurement + double _starting_system_time; // system time at start of measurement + double _starting_real_time; // real time at start of measurement + public: + GCTraceCPUTime(); + ~GCTraceCPUTime(); +}; + class GCTimer; -class GCTraceTimeImpl VALUE_OBJ_CLASS_SPEC { +template +class GCTraceTimeImpl : public StackObj { + private: + bool _enabled; + Ticks _start_ticks; const char* _title; - bool _doit; - bool _print_cr; + GCCause::Cause _gc_cause; GCTimer* _timer; - Ticks _start_counter; + size_t _heap_usage_before; + + void log_start(jlong start_counter); + void log_stop(jlong start_counter, jlong stop_counter); + void time_stamp(Ticks& ticks); public: - GCTraceTimeImpl(const char* title, bool doit, bool print_cr, GCTimer* timer); + GCTraceTimeImpl(const char* title, GCTimer* timer = NULL, GCCause::Cause gc_cause = GCCause::_no_gc, bool log_heap_usage = false); ~GCTraceTimeImpl(); }; -class GCTraceTime : public StackObj { - GCTraceTimeImpl _gc_trace_time_impl; - +// Similar to GCTraceTimeImpl but is intended for concurrent phase logging, +// which is a bit simpler and should always print the start line, i.e. not add the "start" tag. +template +class GCTraceConcTimeImpl : public StackObj { + private: + bool _enabled; + jlong _start_time; + const char* _title; public: - GCTraceTime(const char* title, bool doit, bool print_cr, GCTimer* timer) : - _gc_trace_time_impl(title, doit, print_cr, timer) {}; + GCTraceConcTimeImpl(const char* title); + ~GCTraceConcTimeImpl(); + jlong start_time() { return _start_time; } }; #endif // SHARE_VM_GC_SHARED_GCTRACETIME_HPP diff --git a/hotspot/src/share/vm/gc/shared/gcTraceTime.inline.hpp b/hotspot/src/share/vm/gc/shared/gcTraceTime.inline.hpp new file mode 100644 index 00000000000..e6ea94ecf5f --- /dev/null +++ b/hotspot/src/share/vm/gc/shared/gcTraceTime.inline.hpp @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef SHARE_VM_GC_SHARED_GCTRACETIME_INLINE_HPP +#define SHARE_VM_GC_SHARED_GCTRACETIME_INLINE_HPP + +#include "gc/shared/collectedHeap.hpp" +#include "gc/shared/gcTimer.hpp" +#include "gc/shared/gcTrace.hpp" +#include "gc/shared/gcTraceTime.hpp" +#include "logging/log.hpp" +#include "memory/universe.hpp" +#include "prims/jni_md.h" +#include "utilities/ticks.hpp" +#include "runtime/timer.hpp" + +#define LOG_STOP_TIME_FORMAT "(%.3fs, %.3fs) %.3fms" +#define LOG_STOP_HEAP_FORMAT SIZE_FORMAT "M->" SIZE_FORMAT "M(" SIZE_FORMAT "M)" + +template +void GCTraceTimeImpl::log_start(jlong start_counter) { + if (Log::is_level(Level)) { + FormatBuffer<> start_msg("%s", _title); + if (_gc_cause != GCCause::_no_gc) { + start_msg.append(" (%s)", GCCause::to_string(_gc_cause)); + } + start_msg.append(" (%.3fs)", TimeHelper::counter_to_seconds(start_counter)); + // Make sure to put the "start" tag last in the tag set + STATIC_ASSERT(T0 != LogTag::__NO_TAG); // Need some tag to log on. + STATIC_ASSERT(T4 == LogTag::__NO_TAG); // Need to leave at least the last tag for the "start" tag in log_start() + if (T1 == LogTag::__NO_TAG) { + Log::template write("%s", start_msg.buffer()); + } else if (T2 == LogTag::__NO_TAG) { + Log::template write("%s", start_msg.buffer()); + } else if (T3 == LogTag::__NO_TAG) { + Log::template write("%s", start_msg.buffer()); + } else { + Log::template write("%s", start_msg.buffer()); + } + } +} + +template +void GCTraceTimeImpl::log_stop(jlong start_counter, jlong stop_counter) { + double duration_in_ms = TimeHelper::counter_to_millis(stop_counter - start_counter); + double start_time_in_secs = TimeHelper::counter_to_seconds(start_counter); + double stop_time_in_secs = TimeHelper::counter_to_seconds(stop_counter); + FormatBuffer<> stop_msg("%s", _title); + if (_gc_cause != GCCause::_no_gc) { + stop_msg.append(" (%s)", GCCause::to_string(_gc_cause)); + } + if (_heap_usage_before == SIZE_MAX) { + Log::template write("%s " LOG_STOP_TIME_FORMAT, + stop_msg.buffer(), start_time_in_secs, stop_time_in_secs, duration_in_ms); + } else { + CollectedHeap* heap = Universe::heap(); + size_t used_before_m = _heap_usage_before / M; + size_t used_m = heap->used() / M; + size_t capacity_m = heap->capacity() / M; + Log::template write("%s " LOG_STOP_HEAP_FORMAT " " LOG_STOP_TIME_FORMAT, + stop_msg.buffer(), used_before_m, used_m, capacity_m, start_time_in_secs, stop_time_in_secs, duration_in_ms); + } +} + +template +void GCTraceTimeImpl::time_stamp(Ticks& ticks) { + if (_enabled || _timer != NULL) { + ticks.stamp(); + } +} + +template +GCTraceTimeImpl::GCTraceTimeImpl(const char* title, GCTimer* timer, GCCause::Cause gc_cause, bool log_heap_usage) : + _enabled(Log::is_level(Level)), + _start_ticks(), + _heap_usage_before(SIZE_MAX), + _title(title), + _gc_cause(gc_cause), + _timer(timer) { + + time_stamp(_start_ticks); + if (_enabled) { + if (log_heap_usage) { + _heap_usage_before = Universe::heap()->used(); + } + log_start(_start_ticks.value()); + } + if (_timer != NULL) { + _timer->register_gc_phase_start(_title, _start_ticks); + } +} + +template +GCTraceTimeImpl::~GCTraceTimeImpl() { + Ticks stop_ticks; + time_stamp(stop_ticks); + if (_enabled) { + log_stop(_start_ticks.value(), stop_ticks.value()); + } + if (_timer != NULL) { + _timer->register_gc_phase_end(stop_ticks); + } +} + +template +GCTraceConcTimeImpl::GCTraceConcTimeImpl(const char* title) : + _enabled(Log::is_level(Level)), _start_time(os::elapsed_counter()), _title(title) { + if (_enabled) { + Log::template write("%s (%.3fs)", _title, TimeHelper::counter_to_seconds(_start_time)); + } +} + +template +GCTraceConcTimeImpl::~GCTraceConcTimeImpl() { + if (_enabled) { + jlong stop_time = os::elapsed_counter(); + Log::template write("%s " LOG_STOP_TIME_FORMAT, + _title, + TimeHelper::counter_to_seconds(_start_time), + TimeHelper::counter_to_seconds(stop_time), + TimeHelper::counter_to_millis(stop_time - _start_time)); + } +} + +#define GCTraceTime(Level, ...) GCTraceTimeImpl +#define GCTraceConcTime(Level, ...) GCTraceConcTimeImpl + +#endif // SHARE_VM_GC_SHARED_GCTRACETIME_INLINE_HPP diff --git a/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp b/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp index bfa47a3734a..5c732a15ced 100644 --- a/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp +++ b/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp @@ -33,7 +33,7 @@ #include "gc/shared/gcId.hpp" #include "gc/shared/gcLocker.inline.hpp" #include "gc/shared/gcTrace.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/genOopClosures.inline.hpp" #include "gc/shared/generationSpec.hpp" @@ -314,13 +314,11 @@ bool GenCollectedHeap::should_do_concurrent_full_gc(GCCause::Cause cause) { void GenCollectedHeap::collect_generation(Generation* gen, bool full, size_t size, bool is_tlab, bool run_verification, bool clear_soft_refs, bool restore_marks_for_biased_locking) { - // Timer for individual generations. Last argument is false: no CR - // FIXME: We should try to start the timing earlier to cover more of the GC pause - GCTraceTime t1(gen->short_name(), PrintGCDetails, false, NULL); + FormatBuffer<> title("Collect gen: %s", gen->short_name()); + GCTraceTime(Debug, gc) t1(title); TraceCollectorStats tcs(gen->counters()); TraceMemoryManagerStats tmms(gen->kind(),gc_cause()); - size_t prev_used = gen->used(); gen->stat_record()->invocations++; gen->stat_record()->accumulated_time.start(); @@ -329,24 +327,11 @@ void GenCollectedHeap::collect_generation(Generation* gen, bool full, size_t siz // change top of some spaces. record_gen_tops_before_GC(); - if (PrintGC && Verbose) { - // I didn't want to change the logging when removing the level concept, - // but I guess this logging could say young/old or something instead of 0/1. - uint level; - if (heap()->is_young_gen(gen)) { - level = 0; - } else { - level = 1; - } - gclog_or_tty->print("level=%u invoke=%d size=" SIZE_FORMAT, - level, - gen->stat_record()->invocations, - size * HeapWordSize); - } + log_trace(gc)("%s invoke=%d size=" SIZE_FORMAT, heap()->is_young_gen(gen) ? "Young" : "Old", gen->stat_record()->invocations, size * HeapWordSize); if (run_verification && VerifyBeforeGC) { HandleMark hm; // Discard invalid handles created during verification - Universe::verify(" VerifyBeforeGC:"); + Universe::verify("Before GC"); } COMPILER2_PRESENT(DerivedPointerTable::clear()); @@ -404,12 +389,7 @@ void GenCollectedHeap::collect_generation(Generation* gen, bool full, size_t siz if (run_verification && VerifyAfterGC) { HandleMark hm; // Discard invalid handles created during verification - Universe::verify(" VerifyAfterGC:"); - } - - if (PrintGCDetails) { - gclog_or_tty->print(":"); - gen->print_heap_change(prev_used); + Universe::verify("After GC"); } } @@ -448,21 +428,31 @@ void GenCollectedHeap::do_collection(bool full, FlagSetting fl(_is_gc_active, true); bool complete = full && (max_generation == OldGen); - const char* gc_cause_prefix = complete ? "Full GC" : "GC"; - TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); - GCTraceTime t(GCCauseString(gc_cause_prefix, gc_cause()), PrintGCDetails, false, NULL); + bool old_collects_young = complete && !ScavengeBeforeFullGC; + bool do_young_collection = !old_collects_young && _young_gen->should_collect(full, size, is_tlab); + + FormatBuffer<> gc_string("%s", "Pause "); + if (do_young_collection) { + gc_string.append("Young"); + } else { + gc_string.append("Full"); + } + + GCTraceCPUTime tcpu; + GCTraceTime(Info, gc) t(gc_string, NULL, gc_cause(), true); gc_prologue(complete); increment_total_collections(complete); - size_t gch_prev_used = used(); + size_t young_prev_used = _young_gen->used(); + size_t old_prev_used = _old_gen->used(); + bool run_verification = total_collections() >= VerifyGCStartAt; bool prepared_for_verification = false; bool collected_old = false; - bool old_collects_young = complete && !ScavengeBeforeFullGC; - if (!old_collects_young && _young_gen->should_collect(full, size, is_tlab)) { + if (do_young_collection) { if (run_verification && VerifyGCLevel <= 0 && VerifyBeforeGC) { prepare_for_verify(); prepared_for_verification = true; @@ -487,7 +477,6 @@ void GenCollectedHeap::do_collection(bool full, bool must_restore_marks_for_biased_locking = false; if (max_generation == OldGen && _old_gen->should_collect(full, size, is_tlab)) { - GCIdMarkAndRestore gc_id_mark; if (!complete) { // The full_collections increment was missed above. increment_total_full_collections(); @@ -501,13 +490,16 @@ void GenCollectedHeap::do_collection(bool full, } assert(_old_gen->performs_in_place_marking(), "All old generations do in place marking"); - collect_generation(_old_gen, - full, - size, - is_tlab, - run_verification && VerifyGCLevel <= 1, - do_clear_all_soft_refs, - true); + + if (do_young_collection) { + // We did a young GC. Need a new GC id for the old GC. + GCIdMarkAndRestore gc_id_mark; + GCTraceTime(Info, gc) t("Pause Full", NULL, gc_cause(), true); + collect_generation(_old_gen, full, size, is_tlab, run_verification && VerifyGCLevel <= 1, do_clear_all_soft_refs, true); + } else { + // No young GC done. Use the same GC id as was set up earlier in this method. + collect_generation(_old_gen, full, size, is_tlab, run_verification && VerifyGCLevel <= 1, do_clear_all_soft_refs, true); + } must_restore_marks_for_biased_locking = true; collected_old = true; @@ -523,14 +515,8 @@ void GenCollectedHeap::do_collection(bool full, post_full_gc_dump(NULL); // do any post full gc dumps } - if (PrintGCDetails) { - print_heap_change(gch_prev_used); - - // Print metaspace info for full GC with PrintGCDetails flag. - if (complete) { - MetaspaceAux::print_metaspace_change(metadata_prev_used); - } - } + print_heap_change(young_prev_used, old_prev_used); + MetaspaceAux::print_metaspace_change(metadata_prev_used); // Adjust generation sizes. if (collected_old) { @@ -874,10 +860,7 @@ void GenCollectedHeap::do_full_collection(bool clear_all_soft_refs, // been attempted and failed, because the old gen was too full if (local_last_generation == YoungGen && gc_cause() == GCCause::_gc_locker && incremental_collection_will_fail(false /* don't consult_young */)) { - if (PrintGCDetails) { - gclog_or_tty->print_cr("GC locker: Trying a full collection " - "because scavenge failed"); - } + log_debug(gc, jni)("GC locker: Trying a full collection because scavenge failed"); // This time allow the old gen to be collected as well do_collection(true, // full clear_all_soft_refs, // clear_all_soft_refs @@ -1106,22 +1089,14 @@ void GenCollectedHeap::prepare_for_compaction() { _young_gen->prepare_for_compaction(&cp); } -void GenCollectedHeap::verify(bool silent, VerifyOption option /* ignored */) { - if (!silent) { - gclog_or_tty->print("%s", _old_gen->name()); - gclog_or_tty->print(" "); - } +void GenCollectedHeap::verify(VerifyOption option /* ignored */) { + log_debug(gc, verify)("%s", _old_gen->name()); _old_gen->verify(); - if (!silent) { - gclog_or_tty->print("%s", _young_gen->name()); - gclog_or_tty->print(" "); - } + log_debug(gc, verify)("%s", _old_gen->name()); _young_gen->verify(); - if (!silent) { - gclog_or_tty->print("remset "); - } + log_debug(gc, verify)("RemSet"); rem_set()->verify(); } @@ -1171,18 +1146,11 @@ void GenCollectedHeap::print_tracing_info() const { } } -void GenCollectedHeap::print_heap_change(size_t prev_used) const { - if (PrintGCDetails && Verbose) { - gclog_or_tty->print(" " SIZE_FORMAT - "->" SIZE_FORMAT - "(" SIZE_FORMAT ")", - prev_used, used(), capacity()); - } else { - gclog_or_tty->print(" " SIZE_FORMAT "K" - "->" SIZE_FORMAT "K" - "(" SIZE_FORMAT "K)", - prev_used / K, used() / K, capacity() / K); - } +void GenCollectedHeap::print_heap_change(size_t young_prev_used, size_t old_prev_used) const { + log_info(gc, heap)("%s: " SIZE_FORMAT "K->" SIZE_FORMAT "K(" SIZE_FORMAT "K)", + _young_gen->short_name(), young_prev_used / K, _young_gen->used() /K, _young_gen->capacity() /K); + log_info(gc, heap)("%s: " SIZE_FORMAT "K->" SIZE_FORMAT "K(" SIZE_FORMAT "K)", + _old_gen->short_name(), old_prev_used / K, _old_gen->used() /K, _old_gen->capacity() /K); } class GenGCPrologueClosure: public GenCollectedHeap::GenClosure { diff --git a/hotspot/src/share/vm/gc/shared/genCollectedHeap.hpp b/hotspot/src/share/vm/gc/shared/genCollectedHeap.hpp index 11114dd38f0..fad2457c595 100644 --- a/hotspot/src/share/vm/gc/shared/genCollectedHeap.hpp +++ b/hotspot/src/share/vm/gc/shared/genCollectedHeap.hpp @@ -142,6 +142,14 @@ public: return CollectedHeap::GenCollectedHeap; } + virtual const char* name() const { + if (UseConcMarkSweepGC) { + return "Concurrent Mark Sweep"; + } else { + return "Serial"; + } + } + Generation* young_gen() const { return _young_gen; } Generation* old_gen() const { return _old_gen; } @@ -329,7 +337,7 @@ public: void prepare_for_verify(); // Override. - void verify(bool silent, VerifyOption option); + void verify(VerifyOption option); // Override. virtual void print_on(outputStream* st) const; @@ -338,8 +346,7 @@ public: virtual void print_tracing_info() const; virtual void print_on_error(outputStream* st) const; - // PrintGC, PrintGCDetails support - void print_heap_change(size_t prev_used) const; + void print_heap_change(size_t young_prev_used, size_t old_prev_used) const; // The functions below are helper functions that a subclass of // "CollectedHeap" can use in the implementation of its virtual diff --git a/hotspot/src/share/vm/gc/shared/generation.cpp b/hotspot/src/share/vm/gc/shared/generation.cpp index 8663f5449cd..d86103ae077 100644 --- a/hotspot/src/share/vm/gc/shared/generation.cpp +++ b/hotspot/src/share/vm/gc/shared/generation.cpp @@ -36,6 +36,7 @@ #include "gc/shared/generation.hpp" #include "gc/shared/space.inline.hpp" #include "gc/shared/spaceDecorator.hpp" +#include "logging/log.hpp" #include "memory/allocation.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/java.hpp" @@ -70,20 +71,6 @@ size_t Generation::max_capacity() const { return reserved().byte_size(); } -void Generation::print_heap_change(size_t prev_used) const { - if (PrintGCDetails && Verbose) { - gclog_or_tty->print(" " SIZE_FORMAT - "->" SIZE_FORMAT - "(" SIZE_FORMAT ")", - prev_used, used(), capacity()); - } else { - gclog_or_tty->print(" " SIZE_FORMAT "K" - "->" SIZE_FORMAT "K" - "(" SIZE_FORMAT "K)", - prev_used / K, used() / K, capacity() / K); - } -} - // By default we get a single threaded default reference processor; // generations needing multi-threaded refs processing or discovery override this method. void Generation::ref_processor_init() { @@ -171,12 +158,8 @@ size_t Generation::max_contiguous_available() const { bool Generation::promotion_attempt_is_safe(size_t max_promotion_in_bytes) const { size_t available = max_contiguous_available(); bool res = (available >= max_promotion_in_bytes); - if (PrintGC && Verbose) { - gclog_or_tty->print_cr( - "Generation: promo attempt is%s safe: available(" SIZE_FORMAT ") %s max_promo(" SIZE_FORMAT ")", - res? "":" not", available, res? ">=":"<", - max_promotion_in_bytes); - } + log_trace(gc)("Generation: promo attempt is%s safe: available(" SIZE_FORMAT ") %s max_promo(" SIZE_FORMAT ")", + res? "":" not", available, res? ">=":"<", max_promotion_in_bytes); return res; } diff --git a/hotspot/src/share/vm/gc/shared/generation.hpp b/hotspot/src/share/vm/gc/shared/generation.hpp index 7e35485510b..9e1eed7d9f4 100644 --- a/hotspot/src/share/vm/gc/shared/generation.hpp +++ b/hotspot/src/share/vm/gc/shared/generation.hpp @@ -536,11 +536,8 @@ class Generation: public CHeapObj { // the block is an object. virtual bool block_is_obj(const HeapWord* addr) const; - - // PrintGC, PrintGCDetails support void print_heap_change(size_t prev_used) const; - // PrintHeapAtGC support virtual void print() const; virtual void print_on(outputStream* st) const; diff --git a/hotspot/src/share/vm/gc/shared/plab.cpp b/hotspot/src/share/vm/gc/shared/plab.cpp index ba8052d8d28..d8566523e7c 100644 --- a/hotspot/src/share/vm/gc/shared/plab.cpp +++ b/hotspot/src/share/vm/gc/shared/plab.cpp @@ -26,6 +26,7 @@ #include "gc/shared/collectedHeap.hpp" #include "gc/shared/plab.inline.hpp" #include "gc/shared/threadLocalAllocBuffer.hpp" +#include "logging/log.hpp" #include "oops/arrayOop.hpp" #include "oops/oop.inline.hpp" @@ -149,18 +150,8 @@ void PLABStats::adjust_desired_plab_sz() { new_plab_sz = MIN2(max_size(), new_plab_sz); new_plab_sz = align_object_size(new_plab_sz); // Latch the result - if (PrintPLAB) { - gclog_or_tty->print(" (plab_sz = " SIZE_FORMAT " desired_net_plab_sz = " SIZE_FORMAT ") ", recent_plab_sz, new_plab_sz); - } + log_trace(gc, plab)("plab_size = " SIZE_FORMAT " desired_net_plab_sz = " SIZE_FORMAT ") ", recent_plab_sz, new_plab_sz); _desired_net_plab_sz = new_plab_sz; reset(); } - -#ifndef PRODUCT -void PLAB::print() { - gclog_or_tty->print_cr("PLAB: _bottom: " PTR_FORMAT " _top: " PTR_FORMAT - " _end: " PTR_FORMAT " _hard_end: " PTR_FORMAT ")", - p2i(_bottom), p2i(_top), p2i(_end), p2i(_hard_end)); -} -#endif // !PRODUCT diff --git a/hotspot/src/share/vm/gc/shared/plab.hpp b/hotspot/src/share/vm/gc/shared/plab.hpp index 60dc080a45c..b684769ed61 100644 --- a/hotspot/src/share/vm/gc/shared/plab.hpp +++ b/hotspot/src/share/vm/gc/shared/plab.hpp @@ -141,8 +141,6 @@ public: // Fills in the unallocated portion of the buffer with a garbage object and updates // statistics. To be called during GC. virtual void retire(); - - void print() PRODUCT_RETURN; }; // PLAB book-keeping. diff --git a/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp b/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp index 684b64e2b21..1b71b4d3d29 100644 --- a/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp +++ b/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp @@ -28,9 +28,10 @@ #include "gc/shared/collectedHeap.hpp" #include "gc/shared/collectedHeap.inline.hpp" #include "gc/shared/gcTimer.hpp" -#include "gc/shared/gcTraceTime.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/referencePolicy.hpp" #include "gc/shared/referenceProcessor.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" #include "oops/oop.inline.hpp" #include "runtime/java.hpp" @@ -186,21 +187,6 @@ size_t ReferenceProcessor::total_count(DiscoveredList lists[]) { return total; } -static void log_ref_count(size_t count, bool doit) { - if (doit) { - gclog_or_tty->print(", " SIZE_FORMAT " refs", count); - } -} - -class GCRefTraceTime : public StackObj { - GCTraceTimeImpl _gc_trace_time; - public: - GCRefTraceTime(const char* title, bool doit, GCTimer* timer, size_t count) : - _gc_trace_time(title, doit, false, timer) { - log_ref_count(count, doit); - } -}; - ReferenceProcessorStats ReferenceProcessor::process_discovered_references( BoolObjectClosure* is_alive, OopClosure* keep_alive, @@ -222,8 +208,6 @@ ReferenceProcessorStats ReferenceProcessor::process_discovered_references( _soft_ref_timestamp_clock = java_lang_ref_SoftReference::clock(); - bool trace_time = PrintGCDetails && PrintReferenceGC; - // Include cleaners in phantom statistics. We expect Cleaner // references to be temporary, and don't want to deal with // possible incompatibilities arising from making it more visible. @@ -235,7 +219,7 @@ ReferenceProcessorStats ReferenceProcessor::process_discovered_references( // Soft references { - GCRefTraceTime tt("SoftReference", trace_time, gc_timer, stats.soft_count()); + GCTraceTime(Debug, gc, ref) tt("SoftReference", gc_timer); process_discovered_reflist(_discoveredSoftRefs, _current_soft_ref_policy, true, is_alive, keep_alive, complete_gc, task_executor); } @@ -244,21 +228,21 @@ ReferenceProcessorStats ReferenceProcessor::process_discovered_references( // Weak references { - GCRefTraceTime tt("WeakReference", trace_time, gc_timer, stats.weak_count()); + GCTraceTime(Debug, gc, ref) tt("WeakReference", gc_timer); process_discovered_reflist(_discoveredWeakRefs, NULL, true, is_alive, keep_alive, complete_gc, task_executor); } // Final references { - GCRefTraceTime tt("FinalReference", trace_time, gc_timer, stats.final_count()); + GCTraceTime(Debug, gc, ref) tt("FinalReference", gc_timer); process_discovered_reflist(_discoveredFinalRefs, NULL, false, is_alive, keep_alive, complete_gc, task_executor); } // Phantom references { - GCRefTraceTime tt("PhantomReference", trace_time, gc_timer, stats.phantom_count()); + GCTraceTime(Debug, gc, ref) tt("PhantomReference", gc_timer); process_discovered_reflist(_discoveredPhantomRefs, NULL, false, is_alive, keep_alive, complete_gc, task_executor); @@ -275,20 +259,23 @@ ReferenceProcessorStats ReferenceProcessor::process_discovered_references( // thus use JNI weak references to circumvent the phantom references and // resurrect a "post-mortem" object. { - GCTraceTime tt("JNI Weak Reference", trace_time, false, gc_timer); - NOT_PRODUCT(log_ref_count(count_jni_refs(), trace_time);) + GCTraceTime(Debug, gc, ref) tt("JNI Weak Reference", gc_timer); if (task_executor != NULL) { task_executor->set_single_threaded_mode(); } process_phaseJNI(is_alive, keep_alive, complete_gc); } + log_debug(gc, ref)("Ref Counts: Soft: " SIZE_FORMAT " Weak: " SIZE_FORMAT " Final: " SIZE_FORMAT " Phantom: " SIZE_FORMAT, + stats.soft_count(), stats.weak_count(), stats.final_count(), stats.phantom_count()); + log_develop_trace(gc, ref)("JNI Weak Reference count: " SIZE_FORMAT, count_jni_refs()); + return stats; } #ifndef PRODUCT // Calculate the number of jni handles. -uint ReferenceProcessor::count_jni_refs() { +size_t ReferenceProcessor::count_jni_refs() { class AlwaysAliveClosure: public BoolObjectClosure { public: virtual bool do_object_b(oop obj) { return true; } @@ -296,12 +283,12 @@ uint ReferenceProcessor::count_jni_refs() { class CountHandleClosure: public OopClosure { private: - int _count; + size_t _count; public: CountHandleClosure(): _count(0) {} void do_oop(oop* unused) { _count++; } void do_oop(narrowOop* unused) { ShouldNotReachHere(); } - int count() { return _count; } + size_t count() { return _count; } }; CountHandleClosure global_handle_count; AlwaysAliveClosure always_alive; @@ -362,10 +349,7 @@ void ReferenceProcessor::enqueue_discovered_reflist(DiscoveredList& refs_list, // all linked Reference objects. Note that it is important to not dirty any // cards during reference processing since this will cause card table // verification to fail for G1. - if (TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr("ReferenceProcessor::enqueue_discovered_reflist list " - INTPTR_FORMAT, p2i(refs_list.head())); - } + log_develop_trace(gc, ref)("ReferenceProcessor::enqueue_discovered_reflist list " INTPTR_FORMAT, p2i(refs_list.head())); oop obj = NULL; oop next_d = refs_list.head(); @@ -376,10 +360,7 @@ void ReferenceProcessor::enqueue_discovered_reflist(DiscoveredList& refs_list, assert(obj->is_instance(), "should be an instance object"); assert(InstanceKlass::cast(obj->klass())->is_reference_instance_klass(), "should be reference object"); next_d = java_lang_ref_Reference::discovered(obj); - if (TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" obj " INTPTR_FORMAT "/next_d " INTPTR_FORMAT, - p2i(obj), p2i(next_d)); - } + log_develop_trace(gc, ref)(" obj " INTPTR_FORMAT "/next_d " INTPTR_FORMAT, p2i(obj), p2i(next_d)); assert(java_lang_ref_Reference::next(obj) == NULL, "Reference not active; should not be discovered"); // Self-loop next, so as to make Ref not active. @@ -517,10 +498,8 @@ ReferenceProcessor::process_phase1(DiscoveredList& refs_list, bool referent_is_dead = (iter.referent() != NULL) && !iter.is_referent_alive(); if (referent_is_dead && !policy->should_clear_reference(iter.obj(), _soft_ref_timestamp_clock)) { - if (TraceReferenceGC) { - gclog_or_tty->print_cr("Dropping reference (" INTPTR_FORMAT ": %s" ") by policy", - p2i(iter.obj()), iter.obj()->klass()->internal_name()); - } + log_develop_trace(gc, ref)("Dropping reference (" INTPTR_FORMAT ": %s" ") by policy", + p2i(iter.obj()), iter.obj()->klass()->internal_name()); // Remove Reference object from list iter.remove(); // keep the referent around @@ -532,14 +511,9 @@ ReferenceProcessor::process_phase1(DiscoveredList& refs_list, } // Close the reachable set complete_gc->do_void(); - NOT_PRODUCT( - if (PrintGCDetails && TraceReferenceGC) { - gclog_or_tty->print_cr(" Dropped " SIZE_FORMAT " dead Refs out of " SIZE_FORMAT - " discovered Refs by policy, from list " INTPTR_FORMAT, - iter.removed(), iter.processed(), p2i(refs_list.head())); + log_develop_trace(gc, ref)(" Dropped " SIZE_FORMAT " dead Refs out of " SIZE_FORMAT " discovered Refs by policy, from list " INTPTR_FORMAT, + iter.removed(), iter.processed(), p2i(refs_list.head())); } - ) -} // Traverse the list and remove any Refs that are not active, or // whose referents are either alive or NULL. @@ -554,10 +528,8 @@ ReferenceProcessor::pp2_work(DiscoveredList& refs_list, DEBUG_ONLY(oop next = java_lang_ref_Reference::next(iter.obj());) assert(next == NULL, "Should not discover inactive Reference"); if (iter.is_referent_alive()) { - if (TraceReferenceGC) { - gclog_or_tty->print_cr("Dropping strongly reachable reference (" INTPTR_FORMAT ": %s)", - p2i(iter.obj()), iter.obj()->klass()->internal_name()); - } + log_develop_trace(gc, ref)("Dropping strongly reachable reference (" INTPTR_FORMAT ": %s)", + p2i(iter.obj()), iter.obj()->klass()->internal_name()); // The referent is reachable after all. // Remove Reference object from list. iter.remove(); @@ -571,8 +543,8 @@ ReferenceProcessor::pp2_work(DiscoveredList& refs_list, } } NOT_PRODUCT( - if (PrintGCDetails && TraceReferenceGC && (iter.processed() > 0)) { - gclog_or_tty->print_cr(" Dropped " SIZE_FORMAT " active Refs out of " SIZE_FORMAT + if (iter.processed() > 0) { + log_develop_trace(gc, ref)(" Dropped " SIZE_FORMAT " active Refs out of " SIZE_FORMAT " Refs in discovered list " INTPTR_FORMAT, iter.removed(), iter.processed(), p2i(refs_list.head())); } @@ -610,8 +582,8 @@ ReferenceProcessor::pp2_work_concurrent_discovery(DiscoveredList& refs_list, // Now close the newly reachable set complete_gc->do_void(); NOT_PRODUCT( - if (PrintGCDetails && TraceReferenceGC && (iter.processed() > 0)) { - gclog_or_tty->print_cr(" Dropped " SIZE_FORMAT " active Refs out of " SIZE_FORMAT + if (iter.processed() > 0) { + log_develop_trace(gc, ref)(" Dropped " SIZE_FORMAT " active Refs out of " SIZE_FORMAT " Refs in discovered list " INTPTR_FORMAT, iter.removed(), iter.processed(), p2i(refs_list.head())); } @@ -638,11 +610,8 @@ ReferenceProcessor::process_phase3(DiscoveredList& refs_list, // keep the referent around iter.make_referent_alive(); } - if (TraceReferenceGC) { - gclog_or_tty->print_cr("Adding %sreference (" INTPTR_FORMAT ": %s) as pending", - clear_referent ? "cleared " : "", - p2i(iter.obj()), iter.obj()->klass()->internal_name()); - } + log_develop_trace(gc, ref)("Adding %sreference (" INTPTR_FORMAT ": %s) as pending", + clear_referent ? "cleared " : "", p2i(iter.obj()), iter.obj()->klass()->internal_name()); assert(iter.obj()->is_oop(UseConcMarkSweepGC), "Adding a bad reference"); iter.next(); } @@ -666,8 +635,8 @@ ReferenceProcessor::clear_discovered_references(DiscoveredList& refs_list) { void ReferenceProcessor::abandon_partial_discovery() { // loop over the lists for (uint i = 0; i < _max_num_q * number_of_subclasses_of_ref(); i++) { - if (TraceReferenceGC && PrintGCDetails && ((i % _max_num_q) == 0)) { - gclog_or_tty->print_cr("\nAbandoning %s discovered list", list_name(i)); + if ((i % _max_num_q) == 0) { + log_develop_trace(gc, ref)("Abandoning %s discovered list", list_name(i)); } clear_discovered_references(_discovered_refs[i]); } @@ -736,6 +705,20 @@ private: bool _clear_referent; }; +#ifndef PRODUCT +void ReferenceProcessor::log_reflist_counts(DiscoveredList ref_lists[], size_t total_refs) { + if (!log_is_enabled(Trace, gc, ref)) { + return; + } + + stringStream st; + for (uint i = 0; i < _max_num_q; ++i) { + st.print(SIZE_FORMAT " ", ref_lists[i].length()); + } + log_develop_trace(gc, ref)("%s= " SIZE_FORMAT, st.as_string(), total_refs); +} +#endif + // Balances reference queues. // Move entries from all queues[0, 1, ..., _max_num_q-1] to // queues[0, 1, ..., _num_q-1] because only the first _num_q @@ -744,19 +727,12 @@ void ReferenceProcessor::balance_queues(DiscoveredList ref_lists[]) { // calculate total length size_t total_refs = 0; - if (TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr("\nBalance ref_lists "); - } + log_develop_trace(gc, ref)("Balance ref_lists "); for (uint i = 0; i < _max_num_q; ++i) { total_refs += ref_lists[i].length(); - if (TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print(SIZE_FORMAT " ", ref_lists[i].length()); } - } - if (TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" = " SIZE_FORMAT, total_refs); - } + log_reflist_counts(ref_lists, total_refs); size_t avg_refs = total_refs / _num_q + 1; uint to_idx = 0; for (uint from_idx = 0; from_idx < _max_num_q; from_idx++) { @@ -820,14 +796,8 @@ void ReferenceProcessor::balance_queues(DiscoveredList ref_lists[]) size_t balanced_total_refs = 0; for (uint i = 0; i < _max_num_q; ++i) { balanced_total_refs += ref_lists[i].length(); - if (TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print(SIZE_FORMAT " ", ref_lists[i].length()); } - } - if (TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" = " SIZE_FORMAT, balanced_total_refs); - gclog_or_tty->flush(); - } + log_reflist_counts(ref_lists, balanced_total_refs); assert(total_refs == balanced_total_refs, "Balancing was incomplete"); #endif } @@ -950,9 +920,7 @@ inline DiscoveredList* ReferenceProcessor::get_discovered_list(ReferenceType rt) default: ShouldNotReachHere(); } - if (TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr("Thread %d gets list " INTPTR_FORMAT, id, p2i(list)); - } + log_develop_trace(gc, ref)("Thread %d gets list " INTPTR_FORMAT, id, p2i(list)); return list; } @@ -976,19 +944,15 @@ ReferenceProcessor::add_to_discovered_list_mt(DiscoveredList& refs_list, refs_list.set_head(obj); refs_list.inc_length(1); - if (TraceReferenceGC) { - gclog_or_tty->print_cr("Discovered reference (mt) (" INTPTR_FORMAT ": %s)", - p2i(obj), obj->klass()->internal_name()); - } + log_develop_trace(gc, ref)("Discovered reference (mt) (" INTPTR_FORMAT ": %s)", + p2i(obj), obj->klass()->internal_name()); } else { // If retest was non NULL, another thread beat us to it: // The reference has already been discovered... - if (TraceReferenceGC) { - gclog_or_tty->print_cr("Already discovered reference (" INTPTR_FORMAT ": %s)", - p2i(obj), obj->klass()->internal_name()); + log_develop_trace(gc, ref)("Already discovered reference (" INTPTR_FORMAT ": %s)", + p2i(obj), obj->klass()->internal_name()); } } -} #ifndef PRODUCT // Non-atomic (i.e. concurrent) discovery might allow us @@ -1078,10 +1042,8 @@ bool ReferenceProcessor::discover_reference(oop obj, ReferenceType rt) { assert(discovered->is_oop_or_null(), "Expected an oop or NULL for discovered field at " PTR_FORMAT, p2i(discovered)); if (discovered != NULL) { // The reference has already been discovered... - if (TraceReferenceGC) { - gclog_or_tty->print_cr("Already discovered reference (" INTPTR_FORMAT ": %s)", - p2i(obj), obj->klass()->internal_name()); - } + log_develop_trace(gc, ref)("Already discovered reference (" INTPTR_FORMAT ": %s)", + p2i(obj), obj->klass()->internal_name()); if (RefDiscoveryPolicy == ReferentBasedDiscovery) { // assumes that an object is not processed twice; // if it's been already discovered it must be on another @@ -1136,10 +1098,7 @@ bool ReferenceProcessor::discover_reference(oop obj, ReferenceType rt) { list->set_head(obj); list->inc_length(1); - if (TraceReferenceGC) { - gclog_or_tty->print_cr("Discovered reference (" INTPTR_FORMAT ": %s)", - p2i(obj), obj->klass()->internal_name()); - } + log_develop_trace(gc, ref)("Discovered reference (" INTPTR_FORMAT ": %s)", p2i(obj), obj->klass()->internal_name()); } assert(obj->is_oop(), "Discovered a bad reference"); verify_referent(obj); @@ -1159,8 +1118,7 @@ void ReferenceProcessor::preclean_discovered_references( // Soft references { - GCTraceTime tt("Preclean SoftReferences", PrintGCDetails && PrintReferenceGC, - false, gc_timer); + GCTraceTime(Debug, gc, ref) tm("Preclean SoftReferences", gc_timer); for (uint i = 0; i < _max_num_q; i++) { if (yield->should_return()) { return; @@ -1172,8 +1130,7 @@ void ReferenceProcessor::preclean_discovered_references( // Weak references { - GCTraceTime tt("Preclean WeakReferences", PrintGCDetails && PrintReferenceGC, - false, gc_timer); + GCTraceTime(Debug, gc, ref) tm("Preclean WeakReferences", gc_timer); for (uint i = 0; i < _max_num_q; i++) { if (yield->should_return()) { return; @@ -1185,8 +1142,7 @@ void ReferenceProcessor::preclean_discovered_references( // Final references { - GCTraceTime tt("Preclean FinalReferences", PrintGCDetails && PrintReferenceGC, - false, gc_timer); + GCTraceTime(Debug, gc, ref) tm("Preclean FinalReferences", gc_timer); for (uint i = 0; i < _max_num_q; i++) { if (yield->should_return()) { return; @@ -1198,8 +1154,7 @@ void ReferenceProcessor::preclean_discovered_references( // Phantom references { - GCTraceTime tt("Preclean PhantomReferences", PrintGCDetails && PrintReferenceGC, - false, gc_timer); + GCTraceTime(Debug, gc, ref) tm("Preclean PhantomReferences", gc_timer); for (uint i = 0; i < _max_num_q; i++) { if (yield->should_return()) { return; @@ -1244,10 +1199,8 @@ ReferenceProcessor::preclean_discovered_reflist(DiscoveredList& refs_list, next != NULL) { // The referent has been cleared, or is alive, or the Reference is not // active; we need to trace and mark its cohort. - if (TraceReferenceGC) { - gclog_or_tty->print_cr("Precleaning Reference (" INTPTR_FORMAT ": %s)", - p2i(iter.obj()), iter.obj()->klass()->internal_name()); - } + log_develop_trace(gc, ref)("Precleaning Reference (" INTPTR_FORMAT ": %s)", + p2i(iter.obj()), iter.obj()->klass()->internal_name()); // Remove Reference object from list iter.remove(); // Keep alive its cohort. @@ -1268,9 +1221,8 @@ ReferenceProcessor::preclean_discovered_reflist(DiscoveredList& refs_list, complete_gc->do_void(); NOT_PRODUCT( - if (PrintGCDetails && PrintReferenceGC && (iter.processed() > 0)) { - gclog_or_tty->print_cr(" Dropped " SIZE_FORMAT " Refs out of " SIZE_FORMAT - " Refs in discovered list " INTPTR_FORMAT, + if (iter.processed() > 0) { + log_develop_trace(gc, ref)(" Dropped " SIZE_FORMAT " Refs out of " SIZE_FORMAT " Refs in discovered list " INTPTR_FORMAT, iter.removed(), iter.processed(), p2i(refs_list.head())); } ) diff --git a/hotspot/src/share/vm/gc/shared/referenceProcessor.hpp b/hotspot/src/share/vm/gc/shared/referenceProcessor.hpp index 20c405de7e0..fcfcbccd02d 100644 --- a/hotspot/src/share/vm/gc/shared/referenceProcessor.hpp +++ b/hotspot/src/share/vm/gc/shared/referenceProcessor.hpp @@ -364,7 +364,9 @@ class ReferenceProcessor : public CHeapObj { void clear_discovered_references(DiscoveredList& refs_list); // Calculate the number of jni handles. - unsigned int count_jni_refs(); + size_t count_jni_refs(); + + void log_reflist_counts(DiscoveredList ref_lists[], size_t total_count) PRODUCT_RETURN; // Balances reference queues. void balance_queues(DiscoveredList ref_lists[]); diff --git a/hotspot/src/share/vm/gc/shared/space.hpp b/hotspot/src/share/vm/gc/shared/space.hpp index 6b74b872619..036677410bd 100644 --- a/hotspot/src/share/vm/gc/shared/space.hpp +++ b/hotspot/src/share/vm/gc/shared/space.hpp @@ -220,7 +220,6 @@ class Space: public CHeapObj { // moving as a part of compaction. virtual void adjust_pointers() = 0; - // PrintHeapAtGC support virtual void print() const; virtual void print_on(outputStream* st) const; virtual void print_short() const; @@ -659,7 +658,6 @@ class ContiguousSpace: public CompactibleSpace { // Overrides for more efficient compaction support. void prepare_for_compaction(CompactPoint* cp); - // PrintHeapAtGC support. virtual void print_on(outputStream* st) const; // Checked dynamic downcasts. diff --git a/hotspot/src/share/vm/gc/shared/spaceDecorator.cpp b/hotspot/src/share/vm/gc/shared/spaceDecorator.cpp index b69e68762af..636f09ba1e9 100644 --- a/hotspot/src/share/vm/gc/shared/spaceDecorator.cpp +++ b/hotspot/src/share/vm/gc/shared/spaceDecorator.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "gc/shared/space.inline.hpp" #include "gc/shared/spaceDecorator.hpp" +#include "logging/log.hpp" #include "utilities/copy.hpp" // Catch-all file for utility classes @@ -83,13 +84,9 @@ void SpaceMangler::mangle_unused_area_complete() { void SpaceMangler::mangle_region(MemRegion mr) { assert(ZapUnusedHeapArea, "Mangling should not be in use"); #ifdef ASSERT - if(TraceZapUnusedHeapArea) { - gclog_or_tty->print("Mangling [" PTR_FORMAT " to " PTR_FORMAT ")", p2i(mr.start()), p2i(mr.end())); - } + log_develop_trace(gc)("Mangling [" PTR_FORMAT " to " PTR_FORMAT ")", p2i(mr.start()), p2i(mr.end())); Copy::fill_to_words(mr.start(), mr.word_size(), badHeapWord); - if(TraceZapUnusedHeapArea) { - gclog_or_tty->print_cr(" done"); - } + log_develop_trace(gc)("Mangling done."); #endif } diff --git a/hotspot/src/share/vm/gc/shared/taskqueue.cpp b/hotspot/src/share/vm/gc/shared/taskqueue.cpp index cc21a1e731f..57b65fbcc73 100644 --- a/hotspot/src/share/vm/gc/shared/taskqueue.cpp +++ b/hotspot/src/share/vm/gc/shared/taskqueue.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "gc/shared/taskqueue.hpp" #include "oops/oop.inline.hpp" +#include "logging/log.hpp" #include "runtime/atomic.inline.hpp" #include "runtime/os.hpp" #include "runtime/thread.inline.hpp" @@ -212,11 +213,8 @@ ParallelTaskTerminator::offer_termination(TerminatorTerminator* terminator) { #endif } } else { - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr("ParallelTaskTerminator::offer_termination() " - "thread " PTR_FORMAT " sleeps after %u yields", - p2i(Thread::current()), yield_count); - } + log_develop_trace(gc, task)("ParallelTaskTerminator::offer_termination() thread " PTR_FORMAT " sleeps after %u yields", + p2i(Thread::current()), yield_count); yield_count = 0; // A sleep will cause this processor to seek work on another processor's // runqueue, if it has nothing else to run (as opposed to the yield @@ -240,7 +238,7 @@ ParallelTaskTerminator::offer_termination(TerminatorTerminator* terminator) { #ifdef TRACESPINNING void ParallelTaskTerminator::print_termination_counts() { - gclog_or_tty->print_cr("ParallelTaskTerminator Total yields: %u" + log_trace(gc, task)("ParallelTaskTerminator Total yields: %u" " Total spins: %u Total peeks: %u", total_yields(), total_spins(), diff --git a/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.cpp b/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.cpp index fe24138088e..43389fb4613 100644 --- a/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.cpp +++ b/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/threadLocalAllocBuffer.inline.hpp" +#include "logging/log.hpp" #include "memory/resourceArea.hpp" #include "memory/universe.inline.hpp" #include "oops/oop.inline.hpp" @@ -54,9 +55,7 @@ void ThreadLocalAllocBuffer::accumulate_statistics_before_gc() { // Publish new stats if some allocation occurred. if (global_stats()->allocation() != 0) { global_stats()->publish(); - if (PrintTLAB) { - global_stats()->print(); - } + global_stats()->print(); } } @@ -70,9 +69,7 @@ void ThreadLocalAllocBuffer::accumulate_statistics() { size_t allocated_since_last_gc = total_allocated - _allocated_before_last_gc; _allocated_before_last_gc = total_allocated; - if (PrintTLAB && (_number_of_refills > 0 || Verbose)) { - print_stats("gc"); - } + print_stats("gc"); if (_number_of_refills > 0) { // Update allocation history if a reasonable amount of eden was allocated. @@ -149,12 +146,11 @@ void ThreadLocalAllocBuffer::resize() { size_t aligned_new_size = align_object_size(new_size); - if (PrintTLAB && Verbose) { - gclog_or_tty->print("TLAB new size: thread: " INTPTR_FORMAT " [id: %2d]" - " refills %d alloc: %8.6f desired_size: " SIZE_FORMAT " -> " SIZE_FORMAT "\n", - p2i(myThread()), myThread()->osthread()->thread_id(), - _target_refills, _allocation_fraction.average(), desired_size(), aligned_new_size); - } + log_trace(gc, tlab)("TLAB new size: thread: " INTPTR_FORMAT " [id: %2d]" + " refills %d alloc: %8.6f desired_size: " SIZE_FORMAT " -> " SIZE_FORMAT, + p2i(myThread()), myThread()->osthread()->thread_id(), + _target_refills, _allocation_fraction.average(), desired_size(), aligned_new_size); + set_desired_size(aligned_new_size); set_refill_waste_limit(initial_refill_waste_limit()); } @@ -171,9 +167,7 @@ void ThreadLocalAllocBuffer::fill(HeapWord* start, HeapWord* top, size_t new_size) { _number_of_refills++; - if (PrintTLAB && Verbose) { - print_stats("fill"); - } + print_stats("fill"); assert(top <= start + new_size - alignment_reserve(), "size too small"); initialize(start, top, start + new_size - alignment_reserve()); @@ -226,10 +220,8 @@ void ThreadLocalAllocBuffer::startup_initialization() { guarantee(Thread::current()->is_Java_thread(), "tlab initialization thread not Java thread"); Thread::current()->tlab().initialize(); - if (PrintTLAB && Verbose) { - gclog_or_tty->print("TLAB min: " SIZE_FORMAT " initial: " SIZE_FORMAT " max: " SIZE_FORMAT "\n", - min_size(), Thread::current()->tlab().initial_desired_size(), max_size()); - } + log_develop_trace(gc, tlab)("TLAB min: " SIZE_FORMAT " initial: " SIZE_FORMAT " max: " SIZE_FORMAT, + min_size(), Thread::current()->tlab().initial_desired_size(), max_size()); } size_t ThreadLocalAllocBuffer::initial_desired_size() { @@ -250,26 +242,31 @@ size_t ThreadLocalAllocBuffer::initial_desired_size() { } void ThreadLocalAllocBuffer::print_stats(const char* tag) { + LogHandle(gc, tlab) log; + if (!log.is_trace()) { + return; + } + Thread* thrd = myThread(); size_t waste = _gc_waste + _slow_refill_waste + _fast_refill_waste; size_t alloc = _number_of_refills * _desired_size; double waste_percent = alloc == 0 ? 0.0 : 100.0 * waste / alloc; size_t tlab_used = Universe::heap()->tlab_used(thrd); - gclog_or_tty->print("TLAB: %s thread: " INTPTR_FORMAT " [id: %2d]" - " desired_size: " SIZE_FORMAT "KB" - " slow allocs: %d refill waste: " SIZE_FORMAT "B" - " alloc:%8.5f %8.0fKB refills: %d waste %4.1f%% gc: %dB" - " slow: %dB fast: %dB\n", - tag, p2i(thrd), thrd->osthread()->thread_id(), - _desired_size / (K / HeapWordSize), - _slow_allocations, _refill_waste_limit * HeapWordSize, - _allocation_fraction.average(), - _allocation_fraction.average() * tlab_used / K, - _number_of_refills, waste_percent, - _gc_waste * HeapWordSize, - _slow_refill_waste * HeapWordSize, - _fast_refill_waste * HeapWordSize); + log.trace("TLAB: %s thread: " INTPTR_FORMAT " [id: %2d]" + " desired_size: " SIZE_FORMAT "KB" + " slow allocs: %d refill waste: " SIZE_FORMAT "B" + " alloc:%8.5f %8.0fKB refills: %d waste %4.1f%% gc: %dB" + " slow: %dB fast: %dB", + tag, p2i(thrd), thrd->osthread()->thread_id(), + _desired_size / (K / HeapWordSize), + _slow_allocations, _refill_waste_limit * HeapWordSize, + _allocation_fraction.average(), + _allocation_fraction.average() * tlab_used / K, + _number_of_refills, waste_percent, + _gc_waste * HeapWordSize, + _slow_refill_waste * HeapWordSize, + _fast_refill_waste * HeapWordSize); } void ThreadLocalAllocBuffer::verify() { @@ -388,22 +385,27 @@ void GlobalTLABStats::publish() { } void GlobalTLABStats::print() { + LogHandle(gc, tlab) log; + if (!log.is_debug()) { + return; + } + size_t waste = _total_gc_waste + _total_slow_refill_waste + _total_fast_refill_waste; double waste_percent = _total_allocation == 0 ? 0.0 : 100.0 * waste / _total_allocation; - gclog_or_tty->print("TLAB totals: thrds: %d refills: %d max: %d" - " slow allocs: %d max %d waste: %4.1f%%" - " gc: " SIZE_FORMAT "B max: " SIZE_FORMAT "B" - " slow: " SIZE_FORMAT "B max: " SIZE_FORMAT "B" - " fast: " SIZE_FORMAT "B max: " SIZE_FORMAT "B\n", - _allocating_threads, - _total_refills, _max_refills, - _total_slow_allocations, _max_slow_allocations, - waste_percent, - _total_gc_waste * HeapWordSize, - _max_gc_waste * HeapWordSize, - _total_slow_refill_waste * HeapWordSize, - _max_slow_refill_waste * HeapWordSize, - _total_fast_refill_waste * HeapWordSize, - _max_fast_refill_waste * HeapWordSize); + log.debug("TLAB totals: thrds: %d refills: %d max: %d" + " slow allocs: %d max %d waste: %4.1f%%" + " gc: " SIZE_FORMAT "B max: " SIZE_FORMAT "B" + " slow: " SIZE_FORMAT "B max: " SIZE_FORMAT "B" + " fast: " SIZE_FORMAT "B max: " SIZE_FORMAT "B", + _allocating_threads, + _total_refills, _max_refills, + _total_slow_allocations, _max_slow_allocations, + waste_percent, + _total_gc_waste * HeapWordSize, + _max_gc_waste * HeapWordSize, + _total_slow_refill_waste * HeapWordSize, + _max_slow_refill_waste * HeapWordSize, + _total_fast_refill_waste * HeapWordSize, + _max_fast_refill_waste * HeapWordSize); } diff --git a/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.inline.hpp b/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.inline.hpp index 809760fc1b2..8c1178b8cdf 100644 --- a/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.inline.hpp +++ b/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.inline.hpp @@ -27,6 +27,7 @@ #include "gc/shared/collectedHeap.hpp" #include "gc/shared/threadLocalAllocBuffer.hpp" +#include "logging/log.hpp" #include "runtime/thread.hpp" #include "utilities/copy.hpp" @@ -66,18 +67,12 @@ inline size_t ThreadLocalAllocBuffer::compute_size(size_t obj_size) { const size_t obj_plus_filler_size = aligned_obj_size + alignment_reserve(); if (new_tlab_size < obj_plus_filler_size) { // If there isn't enough room for the allocation, return failure. - if (PrintTLAB && Verbose) { - gclog_or_tty->print_cr("ThreadLocalAllocBuffer::compute_size(" SIZE_FORMAT ")" - " returns failure", - obj_size); - } + log_trace(gc, tlab)("ThreadLocalAllocBuffer::compute_size(" SIZE_FORMAT ") returns failure", + obj_size); return 0; } - if (PrintTLAB && Verbose) { - gclog_or_tty->print_cr("ThreadLocalAllocBuffer::compute_size(" SIZE_FORMAT ")" - " returns " SIZE_FORMAT, - obj_size, new_tlab_size); - } + log_trace(gc, tlab)("ThreadLocalAllocBuffer::compute_size(" SIZE_FORMAT ") returns " SIZE_FORMAT, + obj_size, new_tlab_size); return new_tlab_size; } @@ -91,15 +86,12 @@ void ThreadLocalAllocBuffer::record_slow_allocation(size_t obj_size) { _slow_allocations++; - if (PrintTLAB && Verbose) { - Thread* thrd = myThread(); - gclog_or_tty->print("TLAB: %s thread: " INTPTR_FORMAT " [id: %2d]" - " obj: " SIZE_FORMAT - " free: " SIZE_FORMAT - " waste: " SIZE_FORMAT "\n", - "slow", p2i(thrd), thrd->osthread()->thread_id(), - obj_size, free(), refill_waste_limit()); - } + log_develop_trace(gc, tlab)("TLAB: %s thread: " INTPTR_FORMAT " [id: %2d]" + " obj: " SIZE_FORMAT + " free: " SIZE_FORMAT + " waste: " SIZE_FORMAT, + "slow", p2i(myThread()), myThread()->osthread()->thread_id(), + obj_size, free(), refill_waste_limit()); } #endif // SHARE_VM_GC_SHARED_THREADLOCALALLOCBUFFER_INLINE_HPP diff --git a/hotspot/src/share/vm/gc/shared/vmGCOperations.cpp b/hotspot/src/share/vm/gc/shared/vmGCOperations.cpp index 20d3d1d74ae..7b022a7e23e 100644 --- a/hotspot/src/share/vm/gc/shared/vmGCOperations.cpp +++ b/hotspot/src/share/vm/gc/shared/vmGCOperations.cpp @@ -29,6 +29,7 @@ #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/vmGCOperations.hpp" #include "memory/oopFactory.hpp" +#include "logging/log.hpp" #include "oops/instanceKlass.hpp" #include "oops/instanceRefKlass.hpp" #include "runtime/handles.inline.hpp" @@ -216,16 +217,6 @@ bool VM_CollectForMetadataAllocation::initiate_concurrent_GC() { return false; } -static void log_metaspace_alloc_failure_for_concurrent_GC() { - if (Verbose && PrintGCDetails) { - if (UseConcMarkSweepGC) { - gclog_or_tty->print_cr("\nCMS full GC for Metaspace"); - } else if (UseG1GC) { - gclog_or_tty->print_cr("\nG1 full GC for Metaspace"); - } - } -} - void VM_CollectForMetadataAllocation::doit() { SvcGCMarker sgcm(SvcGCMarker::FULL); @@ -249,7 +240,7 @@ void VM_CollectForMetadataAllocation::doit() { return; } - log_metaspace_alloc_failure_for_concurrent_GC(); + log_debug(gc)("%s full GC for Metaspace", UseConcMarkSweepGC ? "CMS" : "G1"); } // Don't clear the soft refs yet. @@ -282,10 +273,7 @@ void VM_CollectForMetadataAllocation::doit() { return; } - if (Verbose && PrintGCDetails) { - gclog_or_tty->print_cr("\nAfter Metaspace GC failed to allocate size " - SIZE_FORMAT, _size); - } + log_debug(gc)("After Metaspace GC failed to allocate size " SIZE_FORMAT, _size); if (GC_locker::is_active_and_needs_gc()) { set_gc_locked(); diff --git a/hotspot/src/share/vm/logging/logPrefix.hpp b/hotspot/src/share/vm/logging/logPrefix.hpp index 443f20a0a4d..2948e6cddce 100644 --- a/hotspot/src/share/vm/logging/logPrefix.hpp +++ b/hotspot/src/share/vm/logging/logPrefix.hpp @@ -38,7 +38,38 @@ // List of prefixes for specific tags and/or tagsets. // Syntax: LOG_PREFIX(, LOG_TAGS()) // Where the prefixer function matches the following signature: size_t (*)(char*, size_t) -#define LOG_PREFIX_LIST // Currently unused/empty +#define LOG_PREFIX_LIST \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, age)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, alloc)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, barrier)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, compaction)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, compaction, phases)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, cpu)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, ergo)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, ergo, cset)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, ergo, heap)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, ergo, ihop)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, heap)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, freelist)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, ihop)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, liveness)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, metaspace)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, phases)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, phases, start)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, plab)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, region)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, remset)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, ref)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, ref, start)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, start)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, sweep)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, task)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, task, start)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, task, stats)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, task, time)) \ + LOG_PREFIX(GCId::print_prefix, LOG_TAGS(gc, tlab)) + // The empty prefix, used when there's no prefix defined. template diff --git a/hotspot/src/share/vm/logging/logTag.hpp b/hotspot/src/share/vm/logging/logTag.hpp index 4dd9e35baf3..de21a9e6f11 100644 --- a/hotspot/src/share/vm/logging/logTag.hpp +++ b/hotspot/src/share/vm/logging/logTag.hpp @@ -31,11 +31,52 @@ // (The tags 'all', 'disable' and 'help' are special tags that can // not be used in log calls, and should not be listed below.) #define LOG_TAG_LIST \ + LOG_TAG(alloc) \ + LOG_TAG(age) \ + LOG_TAG(barrier) \ + LOG_TAG(bot) \ + LOG_TAG(census) \ + LOG_TAG(classhisto) \ LOG_TAG(classinit) \ + LOG_TAG(comp) \ + LOG_TAG(compaction) \ + LOG_TAG(cpu) \ + LOG_TAG(cset) \ LOG_TAG(defaultmethods) \ + LOG_TAG(ergo) \ + LOG_TAG(exit) \ + LOG_TAG(freelist) \ LOG_TAG(gc) \ + LOG_TAG(heap) \ + LOG_TAG(humongous) \ + LOG_TAG(ihop) \ + LOG_TAG(jni) \ + LOG_TAG(liveness) \ LOG_TAG(logging) \ + LOG_TAG(marking) \ + LOG_TAG(metaspace) \ + LOG_TAG(phases) \ + LOG_TAG(plab) \ + LOG_TAG(promotion) \ + LOG_TAG(ref) \ + LOG_TAG(refine) \ + LOG_TAG(region) \ + LOG_TAG(remset) \ + LOG_TAG(rt) \ LOG_TAG(safepoint) \ + LOG_TAG(scavenge) \ + LOG_TAG(scrub) \ + LOG_TAG(start) \ + LOG_TAG(state) \ + LOG_TAG(stats) \ + LOG_TAG(stringdedup) \ + LOG_TAG(survivor) \ + LOG_TAG(svc) \ + LOG_TAG(sweep) \ + LOG_TAG(task) \ + LOG_TAG(tlab) \ + LOG_TAG(time) \ + LOG_TAG(verify) \ LOG_TAG(vmoperation) #define PREFIX_LOG_TAG(T) (LogTag::_##T) diff --git a/hotspot/src/share/vm/memory/binaryTreeDictionary.cpp b/hotspot/src/share/vm/memory/binaryTreeDictionary.cpp index 8837c8a6e2d..c96fd6a32f1 100644 --- a/hotspot/src/share/vm/memory/binaryTreeDictionary.cpp +++ b/hotspot/src/share/vm/memory/binaryTreeDictionary.cpp @@ -29,6 +29,7 @@ #include "memory/freeBlockDictionary.hpp" #include "memory/freeList.hpp" #include "memory/metachunk.hpp" +#include "memory/resourceArea.hpp" #include "runtime/globals.hpp" #include "utilities/macros.hpp" #include "utilities/ostream.hpp" @@ -1189,27 +1190,29 @@ void BinaryTreeDictionary::end_sweep_dict_census(double spl // Does walking the tree 3 times hurt? set_tree_surplus(splitSurplusPercent); set_tree_hints(); - if (PrintGC && Verbose) { - report_statistics(); + LogHandle(gc, freelist, stats) log; + if (log.is_trace()) { + ResourceMark rm; + report_statistics(log.trace_stream()); } clear_tree_census(); } // Print summary statistics template -void BinaryTreeDictionary::report_statistics() const { +void BinaryTreeDictionary::report_statistics(outputStream* st) const { FreeBlockDictionary::verify_par_locked(); - gclog_or_tty->print("Statistics for BinaryTreeDictionary:\n" - "------------------------------------\n"); + st->print_cr("Statistics for BinaryTreeDictionary:"); + st->print_cr("------------------------------------"); size_t total_size = total_chunk_size(debug_only(NULL)); - size_t free_blocks = num_free_blocks(); - gclog_or_tty->print("Total Free Space: " SIZE_FORMAT "\n", total_size); - gclog_or_tty->print("Max Chunk Size: " SIZE_FORMAT "\n", max_chunk_size()); - gclog_or_tty->print("Number of Blocks: " SIZE_FORMAT "\n", free_blocks); + size_t free_blocks = num_free_blocks(); + st->print_cr("Total Free Space: " SIZE_FORMAT, total_size); + st->print_cr("Max Chunk Size: " SIZE_FORMAT, max_chunk_size()); + st->print_cr("Number of Blocks: " SIZE_FORMAT, free_blocks); if (free_blocks > 0) { - gclog_or_tty->print("Av. Block Size: " SIZE_FORMAT "\n", total_size/free_blocks); + st->print_cr("Av. Block Size: " SIZE_FORMAT, total_size/free_blocks); } - gclog_or_tty->print("Tree Height: " SIZE_FORMAT "\n", tree_height()); + st->print_cr("Tree Height: " SIZE_FORMAT, tree_height()); } // Print census information - counts, births, deaths, etc. @@ -1229,22 +1232,27 @@ class PrintTreeCensusClosure : public AscendTreeCensusClosure* fl) { + LogHandle(gc, freelist, census) log; + outputStream* out = log.debug_stream(); if (++_print_line >= 40) { - FreeList_t::print_labels_on(gclog_or_tty, "size"); + ResourceMark rm; + FreeList_t::print_labels_on(out, "size"); _print_line = 0; } - fl->print_on(gclog_or_tty); - _total_free += fl->count() * fl->size() ; - total()->set_count( total()->count() + fl->count() ); + fl->print_on(out); + _total_free += fl->count() * fl->size(); + total()->set_count(total()->count() + fl->count()); } #if INCLUDE_ALL_GCS void do_list(AdaptiveFreeList* fl) { + LogHandle(gc, freelist, census) log; + outputStream* out = log.debug_stream(); if (++_print_line >= 40) { - FreeList_t::print_labels_on(gclog_or_tty, "size"); + FreeList_t::print_labels_on(out, "size"); _print_line = 0; } - fl->print_on(gclog_or_tty); + fl->print_on(out); _total_free += fl->count() * fl->size() ; total()->set_count( total()->count() + fl->count() ); total()->set_bfr_surp( total()->bfr_surp() + fl->bfr_surp() ); @@ -1261,38 +1269,36 @@ class PrintTreeCensusClosure : public AscendTreeCensusClosure -void BinaryTreeDictionary::print_dict_census(void) const { +void BinaryTreeDictionary::print_dict_census(outputStream* st) const { - gclog_or_tty->print("\nBinaryTree\n"); - FreeList_t::print_labels_on(gclog_or_tty, "size"); + st->print("BinaryTree"); + FreeList_t::print_labels_on(st, "size"); PrintTreeCensusClosure ptc; ptc.do_tree(root()); FreeList_t* total = ptc.total(); - FreeList_t::print_labels_on(gclog_or_tty, " "); + FreeList_t::print_labels_on(st, " "); } #if INCLUDE_ALL_GCS template <> -void AFLBinaryTreeDictionary::print_dict_census(void) const { +void AFLBinaryTreeDictionary::print_dict_census(outputStream* st) const { - gclog_or_tty->print("\nBinaryTree\n"); - AdaptiveFreeList::print_labels_on(gclog_or_tty, "size"); + st->print_cr("BinaryTree"); + AdaptiveFreeList::print_labels_on(st, "size"); PrintTreeCensusClosure > ptc; ptc.do_tree(root()); AdaptiveFreeList* total = ptc.total(); - AdaptiveFreeList::print_labels_on(gclog_or_tty, " "); - total->print_on(gclog_or_tty, "TOTAL\t"); - gclog_or_tty->print( - "total_free(words): " SIZE_FORMAT_W(16) - " growth: %8.5f deficit: %8.5f\n", - ptc.total_free(), - (double)(total->split_births() + total->coal_births() - - total->split_deaths() - total->coal_deaths()) - /(total->prev_sweep() != 0 ? (double)total->prev_sweep() : 1.0), - (double)(total->desired() - total->count()) - /(total->desired() != 0 ? (double)total->desired() : 1.0)); + AdaptiveFreeList::print_labels_on(st, " "); + total->print_on(st, "TOTAL\t"); + st->print_cr("total_free(words): " SIZE_FORMAT_W(16) " growth: %8.5f deficit: %8.5f", + ptc.total_free(), + (double)(total->split_births() + total->coal_births() + - total->split_deaths() - total->coal_deaths()) + /(total->prev_sweep() != 0 ? (double)total->prev_sweep() : 1.0), + (double)(total->desired() - total->count()) + /(total->desired() != 0 ? (double)total->desired() : 1.0)); } #endif // INCLUDE_ALL_GCS @@ -1311,7 +1317,7 @@ class PrintFreeListsClosure : public AscendTreeCensusClosureprint_on(gclog_or_tty); + fl->print_on(_st); size_t sz = fl->size(); for (Chunk_t* fc = fl->head(); fc != NULL; fc = fc->next()) { diff --git a/hotspot/src/share/vm/memory/binaryTreeDictionary.hpp b/hotspot/src/share/vm/memory/binaryTreeDictionary.hpp index 8377912f242..9221f3406d5 100644 --- a/hotspot/src/share/vm/memory/binaryTreeDictionary.hpp +++ b/hotspot/src/share/vm/memory/binaryTreeDictionary.hpp @@ -324,7 +324,7 @@ class BinaryTreeDictionary: public FreeBlockDictionary { void clear_tree_census(void); // Print the statistics for all the lists in the tree. Also may // print out summaries. - void print_dict_census(void) const; + void print_dict_census(outputStream* st) const; void print_free_lists(outputStream* st) const; // For debugging. Returns the sum of the _returned_bytes for @@ -335,7 +335,7 @@ class BinaryTreeDictionary: public FreeBlockDictionary { // For debugging. Return the total number of chunks in the dictionary. size_t total_count() PRODUCT_RETURN0; - void report_statistics() const; + void report_statistics(outputStream* st) const; void verify() const; }; diff --git a/hotspot/src/share/vm/memory/filemap.cpp b/hotspot/src/share/vm/memory/filemap.cpp index b05df839cb1..59c82277c07 100644 --- a/hotspot/src/share/vm/memory/filemap.cpp +++ b/hotspot/src/share/vm/memory/filemap.cpp @@ -954,11 +954,11 @@ bool FileMapInfo::is_in_shared_space(const void* p) { } void FileMapInfo::print_shared_spaces() { - gclog_or_tty->print_cr("Shared Spaces:"); + tty->print_cr("Shared Spaces:"); for (int i = 0; i < MetaspaceShared::n_regions; i++) { struct FileMapInfo::FileMapHeader::space_info* si = &_header->_space[i]; char *base = _header->region_addr(i); - gclog_or_tty->print(" %s " INTPTR_FORMAT "-" INTPTR_FORMAT, + tty->print(" %s " INTPTR_FORMAT "-" INTPTR_FORMAT, shared_region_name[i], p2i(base), p2i(base + si->_used)); } diff --git a/hotspot/src/share/vm/memory/freeBlockDictionary.hpp b/hotspot/src/share/vm/memory/freeBlockDictionary.hpp index 2502e362d9c..a989396f6bf 100644 --- a/hotspot/src/share/vm/memory/freeBlockDictionary.hpp +++ b/hotspot/src/share/vm/memory/freeBlockDictionary.hpp @@ -89,11 +89,11 @@ class FreeBlockDictionary: public CHeapObj { virtual size_t total_count() = 0; ) - virtual void report_statistics() const { - gclog_or_tty->print("No statistics available"); + virtual void report_statistics(outputStream* st) const { + st->print_cr("No statistics available"); } - virtual void print_dict_census() const = 0; + virtual void print_dict_census(outputStream* st) const = 0; virtual void print_free_lists(outputStream* st) const = 0; virtual void verify() const = 0; diff --git a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp index 74ee0877ba9..a59bf063d51 100644 --- a/hotspot/src/share/vm/memory/metaspace.cpp +++ b/hotspot/src/share/vm/memory/metaspace.cpp @@ -25,6 +25,7 @@ #include "gc/shared/collectedHeap.hpp" #include "gc/shared/collectorPolicy.hpp" #include "gc/shared/gcLocker.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" #include "memory/binaryTreeDictionary.hpp" #include "memory/filemap.hpp" @@ -811,8 +812,10 @@ void VirtualSpaceNode::verify_container_count() { BlockFreelist::BlockFreelist() : _dictionary(new BlockTreeDictionary()) {} BlockFreelist::~BlockFreelist() { - if (Verbose && TraceMetadataChunkAllocation) { - dictionary()->print_free_lists(gclog_or_tty); + LogHandle(gc, metaspace, freelist) log; + if (log.is_trace()) { + ResourceMark rm; + dictionary()->print_free_lists(log.trace_stream()); } delete _dictionary; } @@ -892,11 +895,11 @@ Metachunk* VirtualSpaceNode::take_from_committed(size_t chunk_word_size) { "The committed memory doesn't match the expanded memory."); if (!is_available(chunk_word_size)) { - if (TraceMetadataChunkAllocation) { - gclog_or_tty->print("VirtualSpaceNode::take_from_committed() not available " SIZE_FORMAT " words ", chunk_word_size); - // Dump some information about the virtual space that is nearly full - print_on(gclog_or_tty); - } + LogHandle(gc, metaspace, freelist) log; + log.debug("VirtualSpaceNode::take_from_committed() not available " SIZE_FORMAT " words ", chunk_word_size); + // Dump some information about the virtual space that is nearly full + ResourceMark rm; + print_on(log.debug_stream()); return NULL; } @@ -1231,9 +1234,11 @@ void VirtualSpaceList::link_vs(VirtualSpaceNode* new_entry) { #ifdef ASSERT new_entry->mangle(); #endif - if (TraceMetavirtualspaceAllocation && Verbose) { + if (develop_log_is_enabled(Trace, gc, metaspace)) { + LogHandle(gc, metaspace) log; VirtualSpaceNode* vsl = current_virtual_space(); - vsl->print_on(gclog_or_tty); + ResourceMark rm; + vsl->print_on(log.trace_stream()); } } @@ -1330,12 +1335,10 @@ Metachunk* VirtualSpaceList::get_new_chunk(size_t word_size, } void VirtualSpaceList::print_on(outputStream* st) const { - if (TraceMetadataChunkAllocation && Verbose) { - VirtualSpaceListIterator iter(virtual_space_list()); - while (iter.repeat()) { - VirtualSpaceNode* node = iter.get_next(); - node->print_on(st); - } + VirtualSpaceListIterator iter(virtual_space_list()); + while (iter.repeat()) { + VirtualSpaceNode* node = iter.get_next(); + node->print_on(st); } } @@ -1497,17 +1500,10 @@ void MetaspaceGC::compute_new_size() { minimum_desired_capacity = MAX2(minimum_desired_capacity, MetaspaceSize); - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr("\nMetaspaceGC::compute_new_size: "); - gclog_or_tty->print_cr(" " - " minimum_free_percentage: %6.2f" - " maximum_used_percentage: %6.2f", - minimum_free_percentage, - maximum_used_percentage); - gclog_or_tty->print_cr(" " - " used_after_gc : %6.1fKB", - used_after_gc / (double) K); - } + log_trace(gc, metaspace)("MetaspaceGC::compute_new_size: "); + log_trace(gc, metaspace)(" minimum_free_percentage: %6.2f maximum_used_percentage: %6.2f", + minimum_free_percentage, maximum_used_percentage); + log_trace(gc, metaspace)(" used_after_gc : %6.1fKB", used_after_gc / (double) K); size_t shrink_bytes = 0; @@ -1525,17 +1521,11 @@ void MetaspaceGC::compute_new_size() { Metaspace::tracer()->report_gc_threshold(capacity_until_GC, new_capacity_until_GC, MetaspaceGCThresholdUpdater::ComputeNewSize); - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr(" expanding:" - " minimum_desired_capacity: %6.1fKB" - " expand_bytes: %6.1fKB" - " MinMetaspaceExpansion: %6.1fKB" - " new metaspace HWM: %6.1fKB", - minimum_desired_capacity / (double) K, - expand_bytes / (double) K, - MinMetaspaceExpansion / (double) K, - new_capacity_until_GC / (double) K); - } + log_trace(gc, metaspace)(" expanding: minimum_desired_capacity: %6.1fKB expand_bytes: %6.1fKB MinMetaspaceExpansion: %6.1fKB new metaspace HWM: %6.1fKB", + minimum_desired_capacity / (double) K, + expand_bytes / (double) K, + MinMetaspaceExpansion / (double) K, + new_capacity_until_GC / (double) K); } return; } @@ -1555,18 +1545,10 @@ void MetaspaceGC::compute_new_size() { size_t maximum_desired_capacity = (size_t)MIN2(max_tmp, double(max_uintx)); maximum_desired_capacity = MAX2(maximum_desired_capacity, MetaspaceSize); - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr(" " - " maximum_free_percentage: %6.2f" - " minimum_used_percentage: %6.2f", - maximum_free_percentage, - minimum_used_percentage); - gclog_or_tty->print_cr(" " - " minimum_desired_capacity: %6.1fKB" - " maximum_desired_capacity: %6.1fKB", - minimum_desired_capacity / (double) K, - maximum_desired_capacity / (double) K); - } + log_trace(gc, metaspace)(" maximum_free_percentage: %6.2f minimum_used_percentage: %6.2f", + maximum_free_percentage, minimum_used_percentage); + log_trace(gc, metaspace)(" minimum_desired_capacity: %6.1fKB maximum_desired_capacity: %6.1fKB", + minimum_desired_capacity / (double) K, maximum_desired_capacity / (double) K); assert(minimum_desired_capacity <= maximum_desired_capacity, "sanity check"); @@ -1592,23 +1574,10 @@ void MetaspaceGC::compute_new_size() { } else { _shrink_factor = MIN2(current_shrink_factor * 4, (uint) 100); } - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr(" " - " shrinking:" - " initSize: %.1fK" - " maximum_desired_capacity: %.1fK", - MetaspaceSize / (double) K, - maximum_desired_capacity / (double) K); - gclog_or_tty->print_cr(" " - " shrink_bytes: %.1fK" - " current_shrink_factor: %d" - " new shrink factor: %d" - " MinMetaspaceExpansion: %.1fK", - shrink_bytes / (double) K, - current_shrink_factor, - _shrink_factor, - MinMetaspaceExpansion / (double) K); - } + log_trace(gc, metaspace)(" shrinking: initSize: %.1fK maximum_desired_capacity: %.1fK", + MetaspaceSize / (double) K, maximum_desired_capacity / (double) K); + log_trace(gc, metaspace)(" shrink_bytes: %.1fK current_shrink_factor: %d new shrink factor: %d MinMetaspaceExpansion: %.1fK", + shrink_bytes / (double) K, current_shrink_factor, _shrink_factor, MinMetaspaceExpansion / (double) K); } } @@ -1638,10 +1607,7 @@ bool Metadebug::test_metadata_failure() { if (_allocation_fail_alot_count > 0) { _allocation_fail_alot_count--; } else { - if (TraceMetadataChunkAllocation && Verbose) { - gclog_or_tty->print_cr("Metadata allocation failing for " - "MetadataAllocationFailALot"); - } + log_trace(gc, metaspace, freelist)("Metadata allocation failing for MetadataAllocationFailALot"); init_allocation_fail_alot_count(); return true; } @@ -1786,11 +1752,8 @@ Metachunk* ChunkManager::free_chunks_get(size_t word_size) { // Remove the chunk as the head of the list. free_list->remove_chunk(chunk); - if (TraceMetadataChunkAllocation && Verbose) { - gclog_or_tty->print_cr("ChunkManager::free_chunks_get: free_list " - PTR_FORMAT " head " PTR_FORMAT " size " SIZE_FORMAT, - p2i(free_list), p2i(chunk), chunk->word_size()); - } + log_trace(gc, metaspace, freelist)("ChunkManager::free_chunks_get: free_list " PTR_FORMAT " head " PTR_FORMAT " size " SIZE_FORMAT, + p2i(free_list), p2i(chunk), chunk->word_size()); } else { chunk = humongous_dictionary()->get_chunk( word_size, @@ -1800,13 +1763,8 @@ Metachunk* ChunkManager::free_chunks_get(size_t word_size) { return NULL; } - if (TraceMetadataHumongousAllocation) { - size_t waste = chunk->word_size() - word_size; - gclog_or_tty->print_cr("Free list allocate humongous chunk size " - SIZE_FORMAT " for requested size " SIZE_FORMAT - " waste " SIZE_FORMAT, - chunk->word_size(), word_size, waste); - } + log_debug(gc, metaspace, alloc)("Free list allocate humongous chunk size " SIZE_FORMAT " for requested size " SIZE_FORMAT " waste " SIZE_FORMAT, + chunk->word_size(), word_size, chunk->word_size() - word_size); } // Chunk is being removed from the chunks free list. @@ -1839,7 +1797,8 @@ Metachunk* ChunkManager::chunk_freelist_allocate(size_t word_size) { assert((word_size <= chunk->word_size()) || list_index(chunk->word_size() == HumongousIndex), "Non-humongous variable sized chunk"); - if (TraceMetadataChunkAllocation) { + LogHandle(gc, metaspace, freelist) log; + if (log.is_debug()) { size_t list_count; if (list_index(word_size) < HumongousIndex) { ChunkList* list = find_free_chunks_list(word_size); @@ -1847,19 +1806,17 @@ Metachunk* ChunkManager::chunk_freelist_allocate(size_t word_size) { } else { list_count = humongous_dictionary()->total_count(); } - gclog_or_tty->print("ChunkManager::chunk_freelist_allocate: " PTR_FORMAT " chunk " - PTR_FORMAT " size " SIZE_FORMAT " count " SIZE_FORMAT " ", - p2i(this), p2i(chunk), chunk->word_size(), list_count); - locked_print_free_chunks(gclog_or_tty); + log.debug("ChunkManager::chunk_freelist_allocate: " PTR_FORMAT " chunk " PTR_FORMAT " size " SIZE_FORMAT " count " SIZE_FORMAT " ", + p2i(this), p2i(chunk), chunk->word_size(), list_count); + ResourceMark rm; + locked_print_free_chunks(log.debug_stream()); } return chunk; } void ChunkManager::print_on(outputStream* out) const { - if (PrintFLSStatistics != 0) { - const_cast(this)->humongous_dictionary()->report_statistics(); - } + const_cast(this)->humongous_dictionary()->report_statistics(out); } // SpaceManager methods @@ -2039,14 +1996,12 @@ size_t SpaceManager::calc_chunk_size(size_t word_size) { "Size calculation is wrong, word_size " SIZE_FORMAT " chunk_word_size " SIZE_FORMAT, word_size, chunk_word_size); - if (TraceMetadataHumongousAllocation && - SpaceManager::is_humongous(word_size)) { - gclog_or_tty->print_cr("Metadata humongous allocation:"); - gclog_or_tty->print_cr(" word_size " PTR_FORMAT, word_size); - gclog_or_tty->print_cr(" chunk_word_size " PTR_FORMAT, - chunk_word_size); - gclog_or_tty->print_cr(" chunk overhead " PTR_FORMAT, - Metachunk::overhead()); + LogHandle(gc, metaspace, alloc) log; + if (log.is_debug() && SpaceManager::is_humongous(word_size)) { + log.debug("Metadata humongous allocation:"); + log.debug(" word_size " PTR_FORMAT, word_size); + log.debug(" chunk_word_size " PTR_FORMAT, chunk_word_size); + log.debug(" chunk overhead " PTR_FORMAT, Metachunk::overhead()); } return chunk_word_size; } @@ -2068,17 +2023,15 @@ MetaWord* SpaceManager::grow_and_allocate(size_t word_size) { "Don't need to expand"); MutexLockerEx cl(SpaceManager::expand_lock(), Mutex::_no_safepoint_check_flag); - if (TraceMetadataChunkAllocation && Verbose) { + if (log_is_enabled(Trace, gc, metaspace, freelist)) { size_t words_left = 0; size_t words_used = 0; if (current_chunk() != NULL) { words_left = current_chunk()->free_word_size(); words_used = current_chunk()->used_word_size(); } - gclog_or_tty->print_cr("SpaceManager::grow_and_allocate for " SIZE_FORMAT - " words " SIZE_FORMAT " words used " SIZE_FORMAT - " words left", - word_size, words_used, words_left); + log_trace(gc, metaspace, freelist)("SpaceManager::grow_and_allocate for " SIZE_FORMAT " words " SIZE_FORMAT " words used " SIZE_FORMAT " words left", + word_size, words_used, words_left); } // Get another chunk @@ -2169,9 +2122,7 @@ void SpaceManager::initialize() { _chunks_in_use[i] = NULL; } _current_chunk = NULL; - if (TraceMetadataChunkAllocation && Verbose) { - gclog_or_tty->print_cr("SpaceManager(): " PTR_FORMAT, p2i(this)); - } + log_trace(gc, metaspace, freelist)("SpaceManager(): " PTR_FORMAT, p2i(this)); } void ChunkManager::return_chunks(ChunkIndex index, Metachunk* chunks) { @@ -2213,9 +2164,11 @@ SpaceManager::~SpaceManager() { dec_total_from_size_metrics(); - if (TraceMetadataChunkAllocation && Verbose) { - gclog_or_tty->print_cr("~SpaceManager(): " PTR_FORMAT, p2i(this)); - locked_print_chunks_in_use_on(gclog_or_tty); + LogHandle(gc, metaspace, freelist) log; + if (log.is_trace()) { + log.trace("~SpaceManager(): " PTR_FORMAT, p2i(this)); + ResourceMark rm; + locked_print_chunks_in_use_on(log.trace_stream()); } // Do not mangle freed Metachunks. The chunk size inside Metachunks @@ -2233,19 +2186,11 @@ SpaceManager::~SpaceManager() { // free lists. Each list is NULL terminated. for (ChunkIndex i = ZeroIndex; i < HumongousIndex; i = next_chunk_index(i)) { - if (TraceMetadataChunkAllocation && Verbose) { - gclog_or_tty->print_cr("returned " SIZE_FORMAT " %s chunks to freelist", - sum_count_in_chunks_in_use(i), - chunk_size_name(i)); - } + log.trace("returned " SIZE_FORMAT " %s chunks to freelist", sum_count_in_chunks_in_use(i), chunk_size_name(i)); Metachunk* chunks = chunks_in_use(i); chunk_manager()->return_chunks(i, chunks); set_chunks_in_use(i, NULL); - if (TraceMetadataChunkAllocation && Verbose) { - gclog_or_tty->print_cr("updated freelist count " SSIZE_FORMAT " %s", - chunk_manager()->free_chunks(i)->count(), - chunk_size_name(i)); - } + log.trace("updated freelist count " SSIZE_FORMAT " %s", chunk_manager()->free_chunks(i)->count(), chunk_size_name(i)); assert(i != HumongousIndex, "Humongous chunks are handled explicitly later"); } @@ -2254,12 +2199,9 @@ SpaceManager::~SpaceManager() { // the current chunk but there are probably exceptions. // Humongous chunks - if (TraceMetadataChunkAllocation && Verbose) { - gclog_or_tty->print_cr("returned " SIZE_FORMAT " %s humongous chunks to dictionary", - sum_count_in_chunks_in_use(HumongousIndex), - chunk_size_name(HumongousIndex)); - gclog_or_tty->print("Humongous chunk dictionary: "); - } + log.trace("returned " SIZE_FORMAT " %s humongous chunks to dictionary", + sum_count_in_chunks_in_use(HumongousIndex), chunk_size_name(HumongousIndex)); + log.trace("Humongous chunk dictionary: "); // Humongous chunks are never the current chunk. Metachunk* humongous_chunks = chunks_in_use(HumongousIndex); @@ -2267,11 +2209,7 @@ SpaceManager::~SpaceManager() { #ifdef ASSERT humongous_chunks->set_is_tagged_free(true); #endif - if (TraceMetadataChunkAllocation && Verbose) { - gclog_or_tty->print(PTR_FORMAT " (" SIZE_FORMAT ") ", - p2i(humongous_chunks), - humongous_chunks->word_size()); - } + log.trace(PTR_FORMAT " (" SIZE_FORMAT ") ", p2i(humongous_chunks), humongous_chunks->word_size()); assert(humongous_chunks->word_size() == (size_t) align_size_up(humongous_chunks->word_size(), smallest_chunk_size()), @@ -2283,12 +2221,7 @@ SpaceManager::~SpaceManager() { chunk_manager()->humongous_dictionary()->return_chunk(humongous_chunks); humongous_chunks = next_humongous_chunks; } - if (TraceMetadataChunkAllocation && Verbose) { - gclog_or_tty->cr(); - gclog_or_tty->print_cr("updated dictionary count " SIZE_FORMAT " %s", - chunk_manager()->humongous_dictionary()->total_count(), - chunk_size_name(HumongousIndex)); - } + log.trace("updated dictionary count " SIZE_FORMAT " %s", chunk_manager()->humongous_dictionary()->total_count(), chunk_size_name(HumongousIndex)); chunk_manager()->slow_locked_verify(); } @@ -2374,11 +2307,13 @@ void SpaceManager::add_chunk(Metachunk* new_chunk, bool make_current) { inc_size_metrics(new_chunk->word_size()); assert(new_chunk->is_empty(), "Not ready for reuse"); - if (TraceMetadataChunkAllocation && Verbose) { - gclog_or_tty->print("SpaceManager::add_chunk: " SIZE_FORMAT ") ", - sum_count_in_chunks_in_use()); - new_chunk->print_on(gclog_or_tty); - chunk_manager()->locked_print_free_chunks(gclog_or_tty); + LogHandle(gc, metaspace, freelist) log; + if (log.is_trace()) { + log.trace("SpaceManager::add_chunk: " SIZE_FORMAT ") ", sum_count_in_chunks_in_use()); + ResourceMark rm; + outputStream* out = log.trace_stream(); + new_chunk->print_on(out); + chunk_manager()->locked_print_free_chunks(out); } } @@ -2403,10 +2338,10 @@ Metachunk* SpaceManager::get_new_chunk(size_t word_size, medium_chunk_bunch()); } - if (TraceMetadataHumongousAllocation && next != NULL && + LogHandle(gc, metaspace, alloc) log; + if (log.is_debug() && next != NULL && SpaceManager::is_humongous(next->word_size())) { - gclog_or_tty->print_cr(" new humongous chunk word size " - PTR_FORMAT, next->word_size()); + log.debug(" new humongous chunk word size " PTR_FORMAT, next->word_size()); } return next; @@ -2571,7 +2506,7 @@ void SpaceManager::dump(outputStream* const out) const { } } - if (TraceMetadataChunkAllocation && Verbose) { + if (log_is_enabled(Trace, gc, metaspace, freelist)) { block_freelists()->print_on(out); } @@ -2756,27 +2691,10 @@ MetaspaceChunkFreeListSummary MetaspaceAux::chunk_free_list_summary(Metaspace::M } void MetaspaceAux::print_metaspace_change(size_t prev_metadata_used) { - gclog_or_tty->print(", [Metaspace:"); - if (PrintGCDetails && Verbose) { - gclog_or_tty->print(" " SIZE_FORMAT - "->" SIZE_FORMAT - "(" SIZE_FORMAT ")", - prev_metadata_used, - used_bytes(), - reserved_bytes()); - } else { - gclog_or_tty->print(" " SIZE_FORMAT "K" - "->" SIZE_FORMAT "K" - "(" SIZE_FORMAT "K)", - prev_metadata_used/K, - used_bytes()/K, - reserved_bytes()/K); - } - - gclog_or_tty->print("]"); + log_info(gc, metaspace)("Metaspace: " SIZE_FORMAT "K->" SIZE_FORMAT "K(" SIZE_FORMAT "K)", + prev_metadata_used/K, used_bytes()/K, reserved_bytes()/K); } -// This is printed when PrintGCDetails void MetaspaceAux::print_on(outputStream* out) { Metaspace::MetadataType nct = Metaspace::NonClassType; @@ -3133,8 +3051,10 @@ void Metaspace::allocate_metaspace_compressed_klass_ptrs(char* requested_addr, a initialize_class_space(metaspace_rs); - if (PrintCompressedOopsMode || (PrintMiscellaneous && Verbose)) { - print_compressed_class_space(gclog_or_tty, requested_addr); + if (develop_log_is_enabled(Trace, gc, metaspace)) { + LogHandle(gc, metaspace) log; + ResourceMark rm; + print_compressed_class_space(log.trace_stream(), requested_addr); } } @@ -3256,10 +3176,8 @@ void Metaspace::global_initialize() { assert(UseCompressedOops && UseCompressedClassPointers, "UseCompressedOops and UseCompressedClassPointers must be set"); Universe::set_narrow_klass_base((address)_space_list->current_virtual_space()->bottom()); - if (TraceMetavirtualspaceAllocation && Verbose) { - gclog_or_tty->print_cr("Setting_narrow_klass_base to Address: " PTR_FORMAT, - p2i(_space_list->current_virtual_space()->bottom())); - } + log_develop_trace(gc, metaspace)("Setting_narrow_klass_base to Address: " PTR_FORMAT, + p2i(_space_list->current_virtual_space()->bottom())); Universe::set_narrow_klass_shift(0); #endif // _LP64 @@ -3446,10 +3364,7 @@ MetaWord* Metaspace::expand_and_allocate(size_t word_size, MetadataType mdtype) if (incremented) { tracer()->report_gc_threshold(before, after, MetaspaceGCThresholdUpdater::ExpandAndAllocate); - if (PrintGCDetails && Verbose) { - gclog_or_tty->print_cr("Increase capacity to GC from " SIZE_FORMAT - " to " SIZE_FORMAT, before, after); - } + log_trace(gc, metaspace)("Increase capacity to GC from " SIZE_FORMAT " to " SIZE_FORMAT, before, after); } return res; @@ -3612,13 +3527,15 @@ void Metaspace::report_metadata_oome(ClassLoaderData* loader_data, size_t word_s tracer()->report_metadata_oom(loader_data, word_size, type, mdtype); // If result is still null, we are out of memory. - if (Verbose && TraceMetadataChunkAllocation) { - gclog_or_tty->print_cr("Metaspace allocation failed for size " - SIZE_FORMAT, word_size); + LogHandle(gc, metaspace, freelist) log; + if (log.is_trace()) { + log.trace("Metaspace allocation failed for size " SIZE_FORMAT, word_size); + ResourceMark rm; + outputStream* out = log.trace_stream(); if (loader_data->metaspace_or_null() != NULL) { - loader_data->dump(gclog_or_tty); + loader_data->dump(out); } - MetaspaceAux::dump(gclog_or_tty); + MetaspaceAux::dump(out); } bool out_of_compressed_class_space = false; diff --git a/hotspot/src/share/vm/memory/universe.cpp b/hotspot/src/share/vm/memory/universe.cpp index 3985cd832a3..630afe63abf 100644 --- a/hotspot/src/share/vm/memory/universe.cpp +++ b/hotspot/src/share/vm/memory/universe.cpp @@ -36,8 +36,10 @@ #include "gc/shared/gcLocker.inline.hpp" #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/generation.hpp" +#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/space.hpp" #include "interpreter/interpreter.hpp" +#include "logging/log.hpp" #include "memory/filemap.hpp" #include "memory/metadataFactory.hpp" #include "memory/metaspaceShared.hpp" @@ -72,6 +74,7 @@ #include "utilities/events.hpp" #include "utilities/hashtable.inline.hpp" #include "utilities/macros.hpp" +#include "utilities/ostream.hpp" #include "utilities/preserveException.hpp" #if INCLUDE_ALL_GCS #include "gc/cms/cmsCollectorPolicy.hpp" @@ -489,7 +492,7 @@ void Universe::run_finalizers_on_exit() { has_run_finalizers_on_exit = true; // Called on VM exit. This ought to be run in a separate thread. - if (TraceReferenceGC) tty->print_cr("Callback to run finalizers on exit"); + log_trace(ref)("Callback to run finalizers on exit"); { PRESERVE_EXCEPTION_MARK; KlassHandle finalizer_klass(THREAD, SystemDictionary::Finalizer_klass()); @@ -713,6 +716,7 @@ jint Universe::initialize_heap() { if (status != JNI_OK) { return status; } + log_info(gc)("Using %s", _collectedHeap->name()); ThreadLocalAllocBuffer::set_max_size(Universe::heap()->max_tlab_size()); @@ -1059,18 +1063,9 @@ void Universe::compute_base_vtable_size() { _base_vtable_size = ClassLoader::compute_Object_vtable(); } - -void Universe::print() { - print_on(gclog_or_tty); -} - -void Universe::print_on(outputStream* st, bool extended) { +void Universe::print_on(outputStream* st) { st->print_cr("Heap"); - if (!extended) { - heap()->print_on(st); - } else { - heap()->print_extended_on(st); - } + heap()->print_on(st); } void Universe::print_heap_at_SIGBREAK() { @@ -1082,30 +1077,25 @@ void Universe::print_heap_at_SIGBREAK() { } } -void Universe::print_heap_before_gc(outputStream* st, bool ignore_extended) { - st->print_cr("{Heap before GC invocations=%u (full %u):", - heap()->total_collections(), - heap()->total_full_collections()); - if (!PrintHeapAtGCExtended || ignore_extended) { - heap()->print_on(st); - } else { - heap()->print_extended_on(st); +void Universe::print_heap_before_gc() { + LogHandle(gc, heap) log; + if (log.is_trace()) { + log.trace("Heap before GC invocations=%u (full %u):", heap()->total_collections(), heap()->total_full_collections()); + ResourceMark rm; + heap()->print_on(log.trace_stream()); } } -void Universe::print_heap_after_gc(outputStream* st, bool ignore_extended) { - st->print_cr("Heap after GC invocations=%u (full %u):", - heap()->total_collections(), - heap()->total_full_collections()); - if (!PrintHeapAtGCExtended || ignore_extended) { - heap()->print_on(st); - } else { - heap()->print_extended_on(st); +void Universe::print_heap_after_gc() { + LogHandle(gc, heap) log; + if (log.is_trace()) { + log.trace("Heap after GC invocations=%u (full %u):", heap()->total_collections(), heap()->total_full_collections()); + ResourceMark rm; + heap()->print_on(log.trace_stream()); } - st->print_cr("}"); } -void Universe::verify(VerifyOption option, const char* prefix, bool silent) { +void Universe::verify(VerifyOption option, const char* prefix) { // The use of _verify_in_progress is a temporary work around for // 6320749. Don't bother with a creating a class to set and clear // it since it is only used in this method and the control flow is @@ -1122,36 +1112,35 @@ void Universe::verify(VerifyOption option, const char* prefix, bool silent) { HandleMark hm; // Handles created during verification can be zapped _verify_count++; - if (!silent) gclog_or_tty->print("%s", prefix); - if (!silent) gclog_or_tty->print("[Verifying "); - if (!silent) gclog_or_tty->print("threads "); + FormatBuffer<> title("Verifying %s", prefix); + GCTraceTime(Info, gc, verify) tm(title.buffer()); + log_debug(gc, verify)("Threads"); Threads::verify(); - if (!silent) gclog_or_tty->print("heap "); - heap()->verify(silent, option); - if (!silent) gclog_or_tty->print("syms "); + log_debug(gc, verify)("Heap"); + heap()->verify(option); + log_debug(gc, verify)("SymbolTable"); SymbolTable::verify(); - if (!silent) gclog_or_tty->print("strs "); + log_debug(gc, verify)("StringTable"); StringTable::verify(); { MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); - if (!silent) gclog_or_tty->print("zone "); + log_debug(gc, verify)("CodeCache"); CodeCache::verify(); } - if (!silent) gclog_or_tty->print("dict "); + log_debug(gc, verify)("SystemDictionary"); SystemDictionary::verify(); #ifndef PRODUCT - if (!silent) gclog_or_tty->print("cldg "); + log_debug(gc, verify)("ClassLoaderDataGraph"); ClassLoaderDataGraph::verify(); #endif - if (!silent) gclog_or_tty->print("metaspace chunks "); + log_debug(gc, verify)("MetaspaceAux"); MetaspaceAux::verify_free_chunks(); - if (!silent) gclog_or_tty->print("hand "); + log_debug(gc, verify)("JNIHandles"); JNIHandles::verify(); - if (!silent) gclog_or_tty->print("C-heap "); + log_debug(gc, verify)("C-heap"); os::check_heap(); - if (!silent) gclog_or_tty->print("code cache "); + log_debug(gc, verify)("CodeCache Oops"); CodeCache::verify_oops(); - if (!silent) gclog_or_tty->print_cr("]"); _verify_in_progress = false; } diff --git a/hotspot/src/share/vm/memory/universe.hpp b/hotspot/src/share/vm/memory/universe.hpp index f2dc42e6cfe..e55c3e121b2 100644 --- a/hotspot/src/share/vm/memory/universe.hpp +++ b/hotspot/src/share/vm/memory/universe.hpp @@ -460,26 +460,19 @@ class Universe: AllStatic { // Debugging static bool verify_in_progress() { return _verify_in_progress; } - static void verify(VerifyOption option, const char* prefix, bool silent = VerifySilently); - static void verify(const char* prefix, bool silent = VerifySilently) { - verify(VerifyOption_Default, prefix, silent); + static void verify(VerifyOption option, const char* prefix); + static void verify(const char* prefix) { + verify(VerifyOption_Default, prefix); } - static void verify(bool silent = VerifySilently) { - verify("", silent); + static void verify() { + verify(""); } static int verify_count() { return _verify_count; } - // The default behavior is to call print_on() on gclog_or_tty. - static void print(); - // The extended parameter determines which method on the heap will - // be called: print_on() (extended == false) or print_extended_on() - // (extended == true). - static void print_on(outputStream* st, bool extended = false); + static void print_on(outputStream* st); static void print_heap_at_SIGBREAK(); - static void print_heap_before_gc() { print_heap_before_gc(gclog_or_tty); } - static void print_heap_after_gc() { print_heap_after_gc(gclog_or_tty); } - static void print_heap_before_gc(outputStream* st, bool ignore_extended = false); - static void print_heap_after_gc(outputStream* st, bool ignore_extended = false); + static void print_heap_before_gc(); + static void print_heap_after_gc(); // Change the number of dummy objects kept reachable by the full gc dummy // array; this should trigger relocation in a sliding compaction collector. diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp index 808b9327679..d54d593594b 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.cpp +++ b/hotspot/src/share/vm/oops/instanceKlass.cpp @@ -2957,7 +2957,7 @@ class VerifyFieldClosure: public OopClosure { oop obj = oopDesc::load_decode_heap_oop(p); if (!obj->is_oop_or_null()) { tty->print_cr("Failed: " PTR_FORMAT " -> " PTR_FORMAT, p2i(p), p2i(obj)); - Universe::print(); + Universe::print_on(tty); guarantee(false, "boom"); } } diff --git a/hotspot/src/share/vm/oops/instanceRefKlass.inline.hpp b/hotspot/src/share/vm/oops/instanceRefKlass.inline.hpp index 4581a23e8c7..580d99346b3 100644 --- a/hotspot/src/share/vm/oops/instanceRefKlass.inline.hpp +++ b/hotspot/src/share/vm/oops/instanceRefKlass.inline.hpp @@ -27,6 +27,7 @@ #include "classfile/javaClasses.hpp" #include "gc/shared/referenceProcessor.hpp" +#include "logging/log.hpp" #include "oops/instanceKlass.inline.hpp" #include "oops/instanceRefKlass.hpp" #include "oops/oop.inline.hpp" @@ -59,12 +60,7 @@ void InstanceRefKlass::oop_oop_iterate_ref_processing_specialized(oop obj, OopCl // Treat discovered as normal oop, if ref is not "active" (next non-NULL) if (!oopDesc::is_null(next_oop) && contains(disc_addr)) { // i.e. ref is not "active" - debug_only( - if(TraceReferenceGC && PrintGCDetails) { - gclog_or_tty->print_cr(" Process discovered as normal " - PTR_FORMAT, p2i(disc_addr)); - } - ) + log_develop_trace(gc, ref)(" Process discovered as normal " PTR_FORMAT, p2i(disc_addr)); Devirtualizer::do_oop(closure, disc_addr); } // treat next as normal oop diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp index 96785e24952..724d75b8495 100644 --- a/hotspot/src/share/vm/prims/jni.cpp +++ b/hotspot/src/share/vm/prims/jni.cpp @@ -3917,7 +3917,6 @@ void execute_internal_vm_tests() { run_unit_test(QuickSort::test_quick_sort()); run_unit_test(GuardedMemory::test_guarded_memory()); run_unit_test(AltHashing::test_alt_hash()); - run_unit_test(test_loggc_filename()); run_unit_test(TestNewSize_test()); run_unit_test(TestOldSize_test()); run_unit_test(TestKlass_test()); diff --git a/hotspot/src/share/vm/prims/jvmtiEnv.cpp b/hotspot/src/share/vm/prims/jvmtiEnv.cpp index 741f2329626..ab6d8258358 100644 --- a/hotspot/src/share/vm/prims/jvmtiEnv.cpp +++ b/hotspot/src/share/vm/prims/jvmtiEnv.cpp @@ -29,6 +29,7 @@ #include "interpreter/bytecodeStream.hpp" #include "interpreter/interpreter.hpp" #include "jvmtifiles/jvmtiEnv.hpp" +#include "logging/logConfiguration.hpp" #include "memory/resourceArea.hpp" #include "memory/universe.inline.hpp" #include "oops/instanceKlass.hpp" @@ -628,7 +629,22 @@ JvmtiEnv::SetVerboseFlag(jvmtiVerboseFlag flag, jboolean value) { TraceClassUnloading = value != 0; break; case JVMTI_VERBOSE_GC: - PrintGC = value != 0; + { + // This is a temporary solution to work around initialization issues. + // JDK-8145083 will fix this. + Mutex* conf_mutex = LogConfiguration_lock; + if (Threads::number_of_threads() == 0) { + // We're too early in the initialization to use mutexes + LogConfiguration_lock = NULL; + } + MutexLockerEx ml(LogConfiguration_lock); + if (value == 0) { + LogConfiguration::parse_log_arguments("stdout", "gc=off", NULL, NULL, NULL); + } else { + LogConfiguration::parse_log_arguments("stdout", "gc", NULL, NULL, NULL); + } + LogConfiguration_lock = conf_mutex; + } break; case JVMTI_VERBOSE_JNI: PrintJNIResolving = value != 0; diff --git a/hotspot/src/share/vm/prims/whitebox.cpp b/hotspot/src/share/vm/prims/whitebox.cpp index 6c68a00d29c..59944c9ea76 100644 --- a/hotspot/src/share/vm/prims/whitebox.cpp +++ b/hotspot/src/share/vm/prims/whitebox.cpp @@ -159,7 +159,7 @@ WB_END WB_ENTRY(void, WB_PrintHeapSizes(JNIEnv* env, jobject o)) { CollectorPolicy * p = Universe::heap()->collector_policy(); - gclog_or_tty->print_cr("Minimum heap " SIZE_FORMAT " Initial heap " + tty->print_cr("Minimum heap " SIZE_FORMAT " Initial heap " SIZE_FORMAT " Maximum heap " SIZE_FORMAT " Space alignment " SIZE_FORMAT " Heap alignment " SIZE_FORMAT, p->min_heap_byte_size(), p->initial_heap_byte_size(), p->max_heap_byte_size(), p->space_alignment(), p->heap_alignment()); diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index 017f4693dd7..a33b676ce7c 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -32,6 +32,7 @@ #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/referenceProcessor.hpp" #include "gc/shared/taskqueue.hpp" +#include "logging/log.hpp" #include "logging/logConfiguration.hpp" #include "memory/allocation.inline.hpp" #include "memory/universe.inline.hpp" @@ -81,7 +82,6 @@ char** Arguments::_jvm_args_array = NULL; int Arguments::_num_jvm_args = 0; char* Arguments::_java_command = NULL; SystemProperty* Arguments::_system_properties = NULL; -const char* Arguments::_gc_log_filename = NULL; bool Arguments::_has_profile = false; size_t Arguments::_conservative_max_heap_alignment = 0; size_t Arguments::_min_heap_size = 0; @@ -1602,19 +1602,11 @@ void Arguments::set_cms_and_parnew_gc_flags() { } else { FLAG_SET_ERGO(size_t, MaxNewSize, preferred_max_new_size); } - if (PrintGCDetails && Verbose) { - // Too early to use gclog_or_tty - tty->print_cr("CMS ergo set MaxNewSize: " SIZE_FORMAT, MaxNewSize); - } + log_trace(gc, heap)("CMS ergo set MaxNewSize: " SIZE_FORMAT, MaxNewSize); // Code along this path potentially sets NewSize and OldSize - if (PrintGCDetails && Verbose) { - // Too early to use gclog_or_tty - tty->print_cr("CMS set min_heap_size: " SIZE_FORMAT - " initial_heap_size: " SIZE_FORMAT - " max_heap: " SIZE_FORMAT, - min_heap_size(), InitialHeapSize, max_heap); - } + log_trace(gc, heap)("CMS set min_heap_size: " SIZE_FORMAT " initial_heap_size: " SIZE_FORMAT " max_heap: " SIZE_FORMAT, + min_heap_size(), InitialHeapSize, max_heap); size_t min_new = preferred_max_new_size; if (FLAG_IS_CMDLINE(NewSize)) { min_new = NewSize; @@ -1625,20 +1617,14 @@ void Arguments::set_cms_and_parnew_gc_flags() { if (FLAG_IS_DEFAULT(NewSize)) { FLAG_SET_ERGO(size_t, NewSize, MAX2(NewSize, min_new)); FLAG_SET_ERGO(size_t, NewSize, MIN2(preferred_max_new_size, NewSize)); - if (PrintGCDetails && Verbose) { - // Too early to use gclog_or_tty - tty->print_cr("CMS ergo set NewSize: " SIZE_FORMAT, NewSize); - } + log_trace(gc, heap)("CMS ergo set NewSize: " SIZE_FORMAT, NewSize); } // Unless explicitly requested otherwise, size old gen // so it's NewRatio x of NewSize. if (FLAG_IS_DEFAULT(OldSize)) { if (max_heap > NewSize) { FLAG_SET_ERGO(size_t, OldSize, MIN2(NewRatio*NewSize, max_heap - NewSize)); - if (PrintGCDetails && Verbose) { - // Too early to use gclog_or_tty - tty->print_cr("CMS ergo set OldSize: " SIZE_FORMAT, OldSize); - } + log_trace(gc, heap)("CMS ergo set OldSize: " SIZE_FORMAT, OldSize); } } } @@ -1682,11 +1668,8 @@ void Arguments::set_cms_and_parnew_gc_flags() { FLAG_SET_CMDLINE(bool, ExplicitGCInvokesConcurrentAndUnloadsClasses, false); } - if (PrintGCDetails && Verbose) { - tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk", - (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K)); - tty->print_cr("ConcGCThreads: %u", ConcGCThreads); - } + log_trace(gc)("MarkStackSize: %uk MarkStackSizeMax: %uk", (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K)); + log_trace(gc)("ConcGCThreads: %u", ConcGCThreads); } #endif // INCLUDE_ALL_GCS @@ -1733,11 +1716,7 @@ bool Arguments::should_auto_select_low_pause_collector() { if (UseAutoGCSelectPolicy && !FLAG_IS_DEFAULT(MaxGCPauseMillis) && (MaxGCPauseMillis <= AutoGCSelectPauseMillis)) { - if (PrintGCDetails) { - // Cannot use gclog_or_tty yet. - tty->print_cr("Automatic selection of the low pause collector" - " based on pause goal of %d (ms)", (int) MaxGCPauseMillis); - } + log_trace(gc)("Automatic selection of the low pause collector based on pause goal of %d (ms)", (int) MaxGCPauseMillis); return true; } return false; @@ -1956,11 +1935,8 @@ void Arguments::set_g1_gc_flags() { FLAG_SET_DEFAULT(GCTimeRatio, 12); } - if (PrintGCDetails && Verbose) { - tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk", - (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K)); - tty->print_cr("ConcGCThreads: %u", ConcGCThreads); - } + log_trace(gc)("MarkStackSize: %uk MarkStackSizeMax: %uk", (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K)); + log_trace(gc)("ConcGCThreads: %u", ConcGCThreads); } #if !INCLUDE_ALL_GCS @@ -2072,10 +2048,7 @@ void Arguments::set_heap_size() { reasonable_max = MAX2(reasonable_max, (julong)InitialHeapSize); } - if (PrintGCDetails && Verbose) { - // Cannot use gclog_or_tty yet. - tty->print_cr(" Maximum heap size " SIZE_FORMAT, (size_t) reasonable_max); - } + log_trace(gc, heap)(" Maximum heap size " SIZE_FORMAT, (size_t) reasonable_max); FLAG_SET_ERGO(size_t, MaxHeapSize, (size_t)reasonable_max); } @@ -2096,20 +2069,14 @@ void Arguments::set_heap_size() { reasonable_initial = limit_by_allocatable_memory(reasonable_initial); - if (PrintGCDetails && Verbose) { - // Cannot use gclog_or_tty yet. - tty->print_cr(" Initial heap size " SIZE_FORMAT, (size_t)reasonable_initial); - } + log_trace(gc, heap)(" Initial heap size " SIZE_FORMAT, (size_t)reasonable_initial); FLAG_SET_ERGO(size_t, InitialHeapSize, (size_t)reasonable_initial); } // If the minimum heap size has not been set (via -Xms), // synchronize with InitialHeapSize to avoid errors with the default value. if (min_heap_size() == 0) { set_min_heap_size(MIN2((size_t)reasonable_minimum, InitialHeapSize)); - if (PrintGCDetails && Verbose) { - // Cannot use gclog_or_tty yet. - tty->print_cr(" Minimum heap size " SIZE_FORMAT, min_heap_size()); - } + log_trace(gc, heap)(" Minimum heap size " SIZE_FORMAT, min_heap_size()); } } } @@ -2312,77 +2279,8 @@ bool Arguments::sun_java_launcher_is_altjvm() { //=========================================================================================================== // Parsing of main arguments -// check if do gclog rotation -// +UseGCLogFileRotation is a must, -// no gc log rotation when log file not supplied or -// NumberOfGCLogFiles is 0 -void check_gclog_consistency() { - if (UseGCLogFileRotation) { - if ((Arguments::gc_log_filename() == NULL) || (NumberOfGCLogFiles == 0)) { - jio_fprintf(defaultStream::output_stream(), - "To enable GC log rotation, use -Xloggc: -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=\n" - "where num_of_file > 0\n" - "GC log rotation is turned off\n"); - UseGCLogFileRotation = false; - } - } - - if (UseGCLogFileRotation && (GCLogFileSize != 0) && (GCLogFileSize < 8*K)) { - if (FLAG_SET_CMDLINE(size_t, GCLogFileSize, 8*K) == Flag::SUCCESS) { - jio_fprintf(defaultStream::output_stream(), - "GCLogFileSize changed to minimum 8K\n"); - } - } -} - -// This function is called for -Xloggc:, it can be used -// to check if a given file name(or string) conforms to the following -// specification: -// A valid string only contains "[A-Z][a-z][0-9].-_%[p|t]" -// %p and %t only allowed once. We only limit usage of filename not path -bool is_filename_valid(const char *file_name) { - const char* p = file_name; - char file_sep = os::file_separator()[0]; - const char* cp; - // skip prefix path - for (cp = file_name; *cp != '\0'; cp++) { - if (*cp == '/' || *cp == file_sep) { - p = cp + 1; - } - } - - int count_p = 0; - int count_t = 0; - while (*p != '\0') { - if ((*p >= '0' && *p <= '9') || - (*p >= 'A' && *p <= 'Z') || - (*p >= 'a' && *p <= 'z') || - *p == '-' || - *p == '_' || - *p == '.') { - p++; - continue; - } - if (*p == '%') { - if(*(p + 1) == 'p') { - p += 2; - count_p ++; - continue; - } - if (*(p + 1) == 't') { - p += 2; - count_t ++; - continue; - } - } - return false; - } - return count_p < 2 && count_t < 2; -} - // Check consistency of GC selection bool Arguments::check_gc_consistency() { - check_gclog_consistency(); // Ensure that the user has not selected conflicting sets // of collectors. uint i = 0; @@ -2725,7 +2623,9 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, return JNI_EINVAL; } } else if (!strcmp(tail, ":gc")) { - if (FLAG_SET_CMDLINE(bool, PrintGC, true) != Flag::SUCCESS) { + // LogConfiguration_lock is not set up yet, but this code is executed by a single thread + bool ret = LogConfiguration::parse_log_arguments("stdout", "gc", NULL, NULL, NULL); + if (!ret) { return JNI_EINVAL; } } else if (!strcmp(tail, ":jni")) { @@ -3158,24 +3058,6 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, // -Xnoagent } else if (match_option(option, "-Xnoagent")) { // For compatibility with classic. HotSpot refuses to load the old style agent.dll. - } else if (match_option(option, "-Xloggc:", &tail)) { - // Redirect GC output to the file. -Xloggc: - // ostream_init_log(), when called will use this filename - // to initialize a fileStream. - _gc_log_filename = os::strdup_check_oom(tail); - if (!is_filename_valid(_gc_log_filename)) { - jio_fprintf(defaultStream::output_stream(), - "Invalid file name for use with -Xloggc: Filename can only contain the " - "characters [A-Z][a-z][0-9]-_.%%[p|t] but it has been %s\n" - "Note %%p or %%t can only be used once\n", _gc_log_filename); - return JNI_EINVAL; - } - if (FLAG_SET_CMDLINE(bool, PrintGC, true) != Flag::SUCCESS) { - return JNI_EINVAL; - } - if (FLAG_SET_CMDLINE(bool, PrintGCTimeStamps, true) != Flag::SUCCESS) { - return JNI_EINVAL; - } } else if (match_option(option, "-Xlog", &tail)) { bool ret = false; if (strcmp(tail, ":help") == 0) { @@ -4180,11 +4062,6 @@ jint Arguments::parse(const JavaVMInitArgs* args) { ScavengeRootsInCode = 1; } - if (PrintGCDetails) { - // Turn on -verbose:gc options as well - PrintGC = true; - } - // Set object alignment values. set_object_alignment(); diff --git a/hotspot/src/share/vm/runtime/arguments.hpp b/hotspot/src/share/vm/runtime/arguments.hpp index 2322f05bb64..fc07f0f9c0e 100644 --- a/hotspot/src/share/vm/runtime/arguments.hpp +++ b/hotspot/src/share/vm/runtime/arguments.hpp @@ -284,7 +284,6 @@ class Arguments : AllStatic { // Option flags static bool _has_profile; - static const char* _gc_log_filename; // Value of the conservative maximum heap alignment needed static size_t _conservative_max_heap_alignment; @@ -543,9 +542,6 @@ class Arguments : AllStatic { // -Dsun.java.launcher.pid static int sun_java_launcher_pid() { return _sun_java_launcher_pid; } - // -Xloggc:, if not specified will be NULL - static const char* gc_log_filename() { return _gc_log_filename; } - // -Xprof static bool has_profile() { return _has_profile; } diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index f7ced655614..c0764db8f92 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -985,9 +985,6 @@ public: develop(bool, ZapUnusedHeapArea, trueInDebug, \ "Zap unused heap space with 0xBAADBABE") \ \ - develop(bool, TraceZapUnusedHeapArea, false, \ - "Trace zapping of unused heap space") \ - \ develop(bool, CheckZapUnusedHeapArea, false, \ "Check zapping of unused heap space") \ \ @@ -997,12 +994,6 @@ public: develop(bool, PrintVMMessages, true, \ "Print VM messages on console") \ \ - product(bool, PrintGCApplicationConcurrentTime, false, \ - "Print the time the application has been running") \ - \ - product(bool, PrintGCApplicationStoppedTime, false, \ - "Print the time the application has been stopped") \ - \ diagnostic(bool, VerboseVerification, false, \ "Display detailed verification details") \ \ @@ -1576,9 +1567,6 @@ public: "number of GC threads") \ range((size_t)os::vm_page_size(), (size_t)max_uintx) \ \ - product(bool, TraceDynamicGCThreads, false, \ - "Trace the dynamic GC thread usage") \ - \ product(uint, ConcGCThreads, 0, \ "Number of threads concurrent gc will use") \ constraint(ConcGCThreadsConstraintFunc,AfterErgo) \ @@ -1629,12 +1617,6 @@ public: product(bool, UseParNewGC, false, \ "Use parallel threads in the new generation") \ \ - product(bool, PrintTaskqueue, false, \ - "Print taskqueue statistics for parallel collectors") \ - \ - product(bool, PrintTerminationStats, false, \ - "Print termination statistics for parallel collectors") \ - \ product(uintx, ParallelGCBufferWastePct, 10, \ "Wasted fraction of parallel allocation buffer") \ range(0, 100) \ @@ -1652,9 +1634,6 @@ public: product(bool, ResizePLAB, true, \ "Dynamically resize (survivor space) promotion LAB's") \ \ - product(bool, PrintPLAB, false, \ - "Print (survivor space) promotion LAB's sizing decisions") \ - \ product(intx, ParGCArrayScanChunk, 50, \ "Scan a subset of object array and push remainder, if array is " \ "bigger than this") \ @@ -1698,9 +1677,6 @@ public: product(bool, ResizeOldPLAB, true, \ "Dynamically resize (old gen) promotion LAB's") \ \ - product(bool, PrintOldPLAB, false, \ - "Print (old gen) promotion LAB's sizing decisions") \ - \ product(size_t, CMSOldPLABMax, 1024, \ "Maximum size of CMS gen promotion LAB caches per worker " \ "per block size") \ @@ -1899,10 +1875,6 @@ public: "Always record eden chunks used for the parallel initial mark " \ "or remark of eden") \ \ - product(bool, CMSPrintEdenSurvivorChunks, false, \ - "Print the eden and the survivor chunks used for the parallel " \ - "initial mark or remark of the eden/survivor spaces") \ - \ product(bool, CMSConcurrentMTEnabled, true, \ "Whether multi-threaded concurrent work enabled " \ "(effective only if ParNewGC)") \ @@ -1971,9 +1943,6 @@ public: product(bool, CMSScavengeBeforeRemark, false, \ "Attempt scavenge before the CMS remark step") \ \ - develop(bool, CMSTraceSweeper, false, \ - "Trace some actions of the CMS sweeper") \ - \ product(uintx, CMSWorkQueueDrainThreshold, 10, \ "Don't drain below this size per parallel worker/thief") \ range(1, max_juint) \ @@ -1995,17 +1964,15 @@ public: "between yields") \ range(1, max_uintx) \ \ - product(bool, CMSDumpAtPromotionFailure, false, \ - "Dump useful information about the state of the CMS old " \ - "generation upon a promotion failure") \ - \ product(bool, CMSPrintChunksInDump, false, \ - "In a dump enabled by CMSDumpAtPromotionFailure, include " \ - "more detailed information about the free chunks") \ + "If logging for the \"gc\" and \"promotion\" tags is enabled on" \ + "trace level include more detailed information about the" \ + "free chunks") \ \ product(bool, CMSPrintObjectsInDump, false, \ - "In a dump enabled by CMSDumpAtPromotionFailure, include " \ - "more detailed information about the allocated objects") \ + "If logging for the \"gc\" and \"promotion\" tags is enabled on" \ + "trace level include more detailed information about the" \ + "allocated objects") \ \ diagnostic(bool, FLSVerifyAllHeapReferences, false, \ "Verify that all references across the FLS boundary " \ @@ -2027,9 +1994,6 @@ public: "Maintain _unallocated_block in BlockOffsetArray " \ "(currently applicable only to CMS collector)") \ \ - develop(bool, TraceCMSState, false, \ - "Trace the state of the CMS collection") \ - \ product(intx, RefDiscoveryPolicy, 0, \ "Select type of reference discovery policy: " \ "reference-based(0) or referent-based(1)") \ @@ -2097,10 +2061,6 @@ public: notproduct(bool, GCALotAtAllSafepoints, false, \ "Enforce ScavengeALot/GCALot at all potential safepoints") \ \ - product(bool, PrintPromotionFailure, false, \ - "Print additional diagnostic information following " \ - "promotion failure") \ - \ notproduct(bool, PromotionFailureALot, false, \ "Use promotion failure handling on every youngest generation " \ "collection") \ @@ -2140,12 +2100,6 @@ public: develop(bool, TraceMetadataChunkAllocation, false, \ "Trace chunk metadata allocations") \ \ - product(bool, TraceMetadataHumongousAllocation, false, \ - "Trace humongous metadata allocations") \ - \ - develop(bool, TraceMetavirtualspaceAllocation, false, \ - "Trace virtual space metadata allocations") \ - \ notproduct(bool, ExecuteInternalVMTests, false, \ "Enable execution of internal VM tests") \ \ @@ -2163,12 +2117,8 @@ public: product(bool, FastTLABRefill, true, \ "Use fast TLAB refill code") \ \ - product(bool, PrintTLAB, false, \ - "Print various TLAB related information") \ - \ product(bool, TLABStats, true, \ - "Provide more detailed and expensive TLAB statistics " \ - "(with PrintTLAB)") \ + "Provide more detailed and expensive TLAB statistics.") \ \ product_pd(bool, NeverActAsServerClassMachine, \ "Never act like a server-class machine") \ @@ -2228,9 +2178,6 @@ public: product(bool, UseAdaptiveGCBoundary, false, \ "Allow young-old boundary to move") \ \ - develop(bool, TraceAdaptiveGCBoundary, false, \ - "Trace young-old boundary moves") \ - \ develop(intx, PSAdaptiveSizePolicyResizeVirtualSpaceAlot, -1, \ "Resize the virtual spaces of the young or old generations") \ range(-1, 1) \ @@ -2366,9 +2313,6 @@ public: "Number of consecutive collections before gc time limit fires") \ range(1, max_uintx) \ \ - product(bool, PrintAdaptiveSizePolicy, false, \ - "Print information about AdaptiveSizePolicy") \ - \ product(intx, PrefetchCopyIntervalInBytes, -1, \ "How far ahead to prefetch destination area (<= 0 means off)") \ range(-1, max_jint) \ @@ -2381,9 +2325,6 @@ public: "How many fields ahead to prefetch in oop scan (<= 0 means off)") \ range(-1, max_jint) \ \ - diagnostic(bool, VerifySilently, false, \ - "Do not print the verification progress") \ - \ diagnostic(bool, VerifyDuringStartup, false, \ "Verify memory system before executing any Java code " \ "during VM initialization") \ @@ -2449,37 +2390,11 @@ public: "will sleep while yielding before giving up and resuming GC") \ range(0, max_juint) \ \ - /* gc tracing */ \ - manageable(bool, PrintGC, false, \ - "Print message at garbage collection") \ - \ - manageable(bool, PrintGCDetails, false, \ - "Print more details at garbage collection") \ - \ - manageable(bool, PrintGCDateStamps, false, \ - "Print date stamps at garbage collection") \ - \ - manageable(bool, PrintGCTimeStamps, false, \ - "Print timestamps at garbage collection") \ - \ - manageable(bool, PrintGCID, true, \ - "Print an identifier for each garbage collection") \ - \ - product(bool, PrintGCTaskTimeStamps, false, \ - "Print timestamps for individual gc worker thread tasks") \ - \ develop(intx, ConcGCYieldTimeout, 0, \ "If non-zero, assert that GC threads yield within this " \ "number of milliseconds") \ range(0, max_intx) \ \ - product(bool, PrintReferenceGC, false, \ - "Print times spent handling reference objects during GC " \ - "(enabled only when PrintGCDetails)") \ - \ - develop(bool, TraceReferenceGC, false, \ - "Trace handling of soft/weak/final/phantom references") \ - \ develop(bool, TraceFinalizerRegistration, false, \ "Trace registration of final references") \ \ @@ -2519,37 +2434,15 @@ public: product(bool, TraceOldGenTime, false, \ "Trace accumulated time for old collection") \ \ - product(bool, PrintTenuringDistribution, false, \ - "Print tenuring age information") \ - \ - product_rw(bool, PrintHeapAtGC, false, \ - "Print heap layout before and after each GC") \ - \ - product_rw(bool, PrintHeapAtGCExtended, false, \ - "Print extended information about the layout of the heap " \ - "when -XX:+PrintHeapAtGC is set") \ - \ product(bool, PrintHeapAtSIGBREAK, true, \ "Print heap layout in response to SIGBREAK") \ \ - manageable(bool, PrintClassHistogramBeforeFullGC, false, \ - "Print a class histogram before any major stop-world GC") \ - \ - manageable(bool, PrintClassHistogramAfterFullGC, false, \ - "Print a class histogram after any major stop-world GC") \ - \ manageable(bool, PrintClassHistogram, false, \ "Print a histogram of class instances") \ \ develop(bool, TraceWorkGang, false, \ "Trace activities of work gangs") \ \ - develop(bool, TraceBlockOffsetTable, false, \ - "Print BlockOffsetTable maps") \ - \ - develop(bool, TraceCardTableModRefBS, false, \ - "Print CardTableModRefBS maps") \ - \ develop(bool, TraceGCTaskManager, false, \ "Trace actions of the GC task manager") \ \ @@ -2559,50 +2452,20 @@ public: diagnostic(bool, TraceGCTaskThread, false, \ "Trace actions of the GC task threads") \ \ - product(bool, PrintParallelOldGCPhaseTimes, false, \ - "Print the time taken by each phase in ParallelOldGC " \ - "(PrintGCDetails must also be enabled)") \ - \ develop(bool, TraceParallelOldGCMarkingPhase, false, \ "Trace marking phase in ParallelOldGC") \ \ - develop(bool, TraceParallelOldGCSummaryPhase, false, \ - "Trace summary phase in ParallelOldGC") \ - \ - develop(bool, TraceParallelOldGCCompactionPhase, false, \ - "Trace compaction phase in ParallelOldGC") \ - \ develop(bool, TraceParallelOldGCDensePrefix, false, \ "Trace dense prefix computation for ParallelOldGC") \ \ develop(bool, IgnoreLibthreadGPFault, false, \ "Suppress workaround for libthread GP fault") \ \ - product(bool, PrintJNIGCStalls, false, \ - "Print diagnostic message when GC is stalled " \ - "by JNI critical section") \ - \ experimental(double, ObjectCountCutOffPercent, 0.5, \ "The percentage of the used heap that the instances of a class " \ "must occupy for the class to generate a trace event") \ range(0.0, 100.0) \ \ - /* GC log rotation setting */ \ - \ - product(bool, UseGCLogFileRotation, false, \ - "Rotate gclog files (for long running applications). It requires "\ - "-Xloggc:") \ - \ - product(uintx, NumberOfGCLogFiles, 0, \ - "Number of gclog files in rotation " \ - "(default: 0, no rotation)") \ - range(0, max_uintx) \ - \ - product(size_t, GCLogFileSize, 8*K, \ - "GC log file size, requires UseGCLogFileRotation. " \ - "Set to 0 to only trigger rotation via jcmd") \ - range(0, max_uintx) \ - \ /* JVMTI heap profiling */ \ \ diagnostic(bool, TraceJVMTIObjectTagging, false, \ @@ -3539,21 +3402,6 @@ public: "space parameters)") \ range(1, max_uintx) \ \ - product(intx, PrintCMSStatistics, 0, \ - "Statistics for CMS") \ - range(0, 2) \ - \ - product(bool, PrintCMSInitiationStatistics, false, \ - "Statistics for initiating a CMS collection") \ - \ - product(intx, PrintFLSStatistics, 0, \ - "Statistics for CMS' FreeListSpace") \ - range(0, 2) \ - \ - product(intx, PrintFLSCensus, 0, \ - "Census for CMS' FreeListSpace") \ - range(0, 1) \ - \ develop(uintx, GCExpandToAllocateDelayMillis, 0, \ "Delay between expansion and allocation (in milliseconds)") \ \ @@ -4248,9 +4096,6 @@ public: product(bool, UseStringDeduplication, false, \ "Use string deduplication") \ \ - product(bool, PrintStringDeduplicationStatistics, false, \ - "Print string deduplication statistics") \ - \ product(uintx, StringDeduplicationAgeThreshold, 3, \ "A string must reach this age (or be promoted to an old region) " \ "to be considered for deduplication") \ @@ -4265,9 +4110,6 @@ public: diagnostic(bool, WhiteBoxAPI, false, \ "Enable internal testing APIs") \ \ - product(bool, PrintGCCause, true, \ - "Include GC cause in GC logging") \ - \ experimental(intx, SurvivorAlignmentInBytes, 0, \ "Default survivor space alignment in bytes") \ constraint(SurvivorAlignmentInBytesConstraintFunc,AfterErgo) \ diff --git a/hotspot/src/share/vm/runtime/interfaceSupport.cpp b/hotspot/src/share/vm/runtime/interfaceSupport.cpp index e8dcb72d2fb..cd0d20a65e2 100644 --- a/hotspot/src/share/vm/runtime/interfaceSupport.cpp +++ b/hotspot/src/share/vm/runtime/interfaceSupport.cpp @@ -101,15 +101,13 @@ void InterfaceSupport::gc_alot() { // Compute new interval if (FullGCALotInterval > 1) { _fullgc_alot_counter = 1+(long)((double)FullGCALotInterval*os::random()/(max_jint+1.0)); - if (PrintGCDetails && Verbose) { - tty->print_cr("Full gc no: %u\tInterval: %ld", invocations, _fullgc_alot_counter); - } + log_trace(gc)("Full gc no: %u\tInterval: %ld", invocations, _fullgc_alot_counter); } else { _fullgc_alot_counter = 1; } // Print progress message if (invocations % 100 == 0) { - if (PrintGCDetails && Verbose) tty->print_cr("Full gc no: %u", invocations); + log_trace(gc)("Full gc no: %u", invocations); } } else { if (ScavengeALot) _scavenge_alot_counter--; @@ -121,15 +119,13 @@ void InterfaceSupport::gc_alot() { // Compute new interval if (ScavengeALotInterval > 1) { _scavenge_alot_counter = 1+(long)((double)ScavengeALotInterval*os::random()/(max_jint+1.0)); - if (PrintGCDetails && Verbose) { - tty->print_cr("Scavenge no: %u\tInterval: %ld", invocations, _scavenge_alot_counter); - } + log_trace(gc)("Scavenge no: %u\tInterval: %ld", invocations, _scavenge_alot_counter); } else { _scavenge_alot_counter = 1; } // Print progress message if (invocations % 1000 == 0) { - if (PrintGCDetails && Verbose) tty->print_cr("Scavenge no: %u", invocations); + log_trace(gc)("Scavenge no: %u", invocations); } } } diff --git a/hotspot/src/share/vm/runtime/java.cpp b/hotspot/src/share/vm/runtime/java.cpp index 4ce260ae193..b65c2c2e1aa 100644 --- a/hotspot/src/share/vm/runtime/java.cpp +++ b/hotspot/src/share/vm/runtime/java.cpp @@ -35,6 +35,7 @@ #include "jvmci/jvmciCompiler.hpp" #include "jvmci/jvmciRuntime.hpp" #endif +#include "logging/log.hpp" #include "memory/oopFactory.hpp" #include "memory/universe.hpp" #include "oops/constantPool.hpp" @@ -453,13 +454,15 @@ void before_exit(JavaThread * thread) { Universe::heap()->stop(); // Print GC/heap related information. - if (PrintGCDetails) { - Universe::print(); - AdaptiveSizePolicyOutput(0); - if (Verbose) { - ClassLoaderDataGraph::dump_on(gclog_or_tty); + LogHandle(gc, heap, exit) log; + if (log.is_info()) { + ResourceMark rm; + Universe::print_on(log.info_stream()); + if (log.is_trace()) { + ClassLoaderDataGraph::dump_on(log.trace_stream()); } } + AdaptiveSizePolicyOutput::print(); if (PrintBytecodeHistogram) { BytecodeHistogram::print(); diff --git a/hotspot/src/share/vm/runtime/jniHandles.cpp b/hotspot/src/share/vm/runtime/jniHandles.cpp index a19283eb432..3c4baed8e0e 100644 --- a/hotspot/src/share/vm/runtime/jniHandles.cpp +++ b/hotspot/src/share/vm/runtime/jniHandles.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "classfile/systemDictionary.hpp" +#include "logging/log.hpp" #include "oops/oop.inline.hpp" #include "prims/jvmtiExport.hpp" #include "runtime/jniHandles.hpp" @@ -393,9 +394,7 @@ void JNIHandleBlock::weak_oops_do(BoolObjectClosure* is_alive, f->do_oop(root); } else { // The weakly referenced object is not alive, clear the reference by storing NULL - if (TraceReferenceGC) { - tty->print_cr("Clearing JNI weak reference (" INTPTR_FORMAT ")", p2i(root)); - } + log_develop_trace(gc, ref)("Clearing JNI weak reference (" INTPTR_FORMAT ")", p2i(root)); *root = NULL; } } diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp index 5c0ebf54c79..4be64a724d2 100644 --- a/hotspot/src/share/vm/runtime/os.cpp +++ b/hotspot/src/share/vm/runtime/os.cpp @@ -262,7 +262,7 @@ static void signal_thread_entry(JavaThread* thread, TRAPS) { VMThread::execute(&op1); Universe::print_heap_at_SIGBREAK(); if (PrintClassHistogram) { - VM_GC_HeapInspection op1(gclog_or_tty, true /* force full GC before heap inspection */); + VM_GC_HeapInspection op1(tty, true /* force full GC before heap inspection */); VMThread::execute(&op1); } if (JvmtiExport::should_post_data_dump()) { diff --git a/hotspot/src/share/vm/runtime/safepoint.cpp b/hotspot/src/share/vm/runtime/safepoint.cpp index e6e2c6f30c0..09f6ea8d1a4 100644 --- a/hotspot/src/share/vm/runtime/safepoint.cpp +++ b/hotspot/src/share/vm/runtime/safepoint.cpp @@ -515,11 +515,6 @@ void SafepointSynchronize::do_cleanup_tasks() { StringTable::rehash_table(); } - // rotate log files? - if (UseGCLogFileRotation) { - gclog_or_tty->rotate_log(false); - } - { // CMS delays purging the CLDG until the beginning of the next safepoint and to // make sure concurrent sweep is done diff --git a/hotspot/src/share/vm/runtime/timer.cpp b/hotspot/src/share/vm/runtime/timer.cpp index 0a869a43b8a..ec4ec0fa662 100644 --- a/hotspot/src/share/vm/runtime/timer.cpp +++ b/hotspot/src/share/vm/runtime/timer.cpp @@ -120,7 +120,6 @@ TraceTime::TraceTime(const char* title, if (_active) { _accum = NULL; - tty->stamp(PrintGCTimeStamps); tty->print("[%s", title); tty->flush(); _t.start(); @@ -135,7 +134,6 @@ TraceTime::TraceTime(const char* title, _verbose = verbose; if (_active) { if (_verbose) { - tty->stamp(PrintGCTimeStamps); tty->print("[%s", title); tty->flush(); } diff --git a/hotspot/src/share/vm/runtime/vmThread.cpp b/hotspot/src/share/vm/runtime/vmThread.cpp index e91faff6b28..77935603075 100644 --- a/hotspot/src/share/vm/runtime/vmThread.cpp +++ b/hotspot/src/share/vm/runtime/vmThread.cpp @@ -285,7 +285,7 @@ void VMThread::run() { os::check_heap(); // Silent verification so as not to pollute normal output, // unless we really asked for it. - Universe::verify(!(PrintGCDetails || Verbose) || VerifySilently); + Universe::verify(); } CompileBroker::set_should_block(); diff --git a/hotspot/src/share/vm/runtime/vm_operations.cpp b/hotspot/src/share/vm/runtime/vm_operations.cpp index edc3876a78f..7e5d06c0162 100644 --- a/hotspot/src/share/vm/runtime/vm_operations.cpp +++ b/hotspot/src/share/vm/runtime/vm_operations.cpp @@ -189,7 +189,7 @@ void VM_UnlinkSymbols::doit() { void VM_Verify::doit() { Universe::heap()->prepare_for_verify(); - Universe::verify(_silent); + Universe::verify(); } bool VM_PrintThreads::doit_prologue() { diff --git a/hotspot/src/share/vm/runtime/vm_operations.hpp b/hotspot/src/share/vm/runtime/vm_operations.hpp index ac53ea63913..14f837ec1a1 100644 --- a/hotspot/src/share/vm/runtime/vm_operations.hpp +++ b/hotspot/src/share/vm/runtime/vm_operations.hpp @@ -311,10 +311,7 @@ class VM_UnlinkSymbols: public VM_Operation { }; class VM_Verify: public VM_Operation { - private: - bool _silent; public: - VM_Verify(bool silent = VerifySilently) : _silent(silent) {} VMOp_Type type() const { return VMOp_Verify; } void doit(); }; @@ -418,17 +415,6 @@ class VM_Exit: public VM_Operation { void doit(); }; - -class VM_RotateGCLog: public VM_Operation { - private: - outputStream* _out; - - public: - VM_RotateGCLog(outputStream* st) : _out(st) {} - VMOp_Type type() const { return VMOp_RotateGCLog; } - void doit() { gclog_or_tty->rotate_log(true, _out); } -}; - class VM_PrintCompileQueue: public VM_Operation { private: outputStream* _out; diff --git a/hotspot/src/share/vm/services/diagnosticCommand.cpp b/hotspot/src/share/vm/services/diagnosticCommand.cpp index 89b616931b5..bf531a4d100 100644 --- a/hotspot/src/share/vm/services/diagnosticCommand.cpp +++ b/hotspot/src/share/vm/services/diagnosticCommand.cpp @@ -73,7 +73,6 @@ void DCmdRegistrant::register_dcmds(){ DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); #endif // INCLUDE_JVMTI DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); - DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); @@ -826,15 +825,6 @@ void VMDynamicLibrariesDCmd::execute(DCmdSource source, TRAPS) { output()->cr(); } -void RotateGCLogDCmd::execute(DCmdSource source, TRAPS) { - if (UseGCLogFileRotation) { - VM_RotateGCLog rotateop(output()); - VMThread::execute(&rotateop); - } else { - output()->print_cr("Target VM does not support GC log file rotation."); - } -} - void CompileQueueDCmd::execute(DCmdSource source, TRAPS) { VM_PrintCompileQueue printCompileQueueOp(output()); VMThread::execute(&printCompileQueueOp); diff --git a/hotspot/src/share/vm/services/diagnosticCommand.hpp b/hotspot/src/share/vm/services/diagnosticCommand.hpp index 3b0505a7347..d7e86f2dbd0 100644 --- a/hotspot/src/share/vm/services/diagnosticCommand.hpp +++ b/hotspot/src/share/vm/services/diagnosticCommand.hpp @@ -549,23 +549,6 @@ public: }; -class RotateGCLogDCmd : public DCmd { -public: - RotateGCLogDCmd(outputStream* output, bool heap) : DCmd(output, heap) {} - static const char* name() { return "GC.rotate_log"; } - static const char* description() { - return "Force the GC log file to be rotated."; - } - static const char* impact() { return "Low"; } - virtual void execute(DCmdSource source, TRAPS); - static int num_arguments() { return 0; } - static const JavaPermission permission() { - JavaPermission p = {"java.lang.management.ManagementPermission", - "control", NULL}; - return p; - } -}; - class CompileQueueDCmd : public DCmd { public: CompileQueueDCmd(outputStream* output, bool heap) : DCmd(output, heap) {} diff --git a/hotspot/src/share/vm/services/memoryService.cpp b/hotspot/src/share/vm/services/memoryService.cpp index 187425ba92b..ea2ae889563 100644 --- a/hotspot/src/share/vm/services/memoryService.cpp +++ b/hotspot/src/share/vm/services/memoryService.cpp @@ -32,6 +32,7 @@ #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/generation.hpp" #include "gc/shared/generationSpec.hpp" +#include "logging/logConfiguration.hpp" #include "memory/heap.hpp" #include "memory/memRegion.hpp" #include "oops/oop.inline.hpp" @@ -517,8 +518,12 @@ void MemoryService::oops_do(OopClosure* f) { bool MemoryService::set_verbose(bool verbose) { MutexLocker m(Management_lock); // verbose will be set to the previous value - Flag::Error error = CommandLineFlags::boolAtPut("PrintGC", &verbose, Flag::MANAGEMENT); - assert(error==Flag::SUCCESS, "Setting PrintGC flag failed with error %s", Flag::flag_error_str(error)); + MutexLocker ml(LogConfiguration_lock); + if (verbose) { + LogConfiguration::parse_log_arguments("stdout", "gc", NULL, NULL, NULL); + } else { + LogConfiguration::parse_log_arguments("stdout", "gc=off", NULL, NULL, NULL); + } ClassLoadingService::reset_trace_class_unloading(); return verbose; diff --git a/hotspot/src/share/vm/services/memoryService.hpp b/hotspot/src/share/vm/services/memoryService.hpp index d03eb86f873..86a6a95fa90 100644 --- a/hotspot/src/share/vm/services/memoryService.hpp +++ b/hotspot/src/share/vm/services/memoryService.hpp @@ -27,6 +27,7 @@ #include "gc/shared/gcCause.hpp" #include "gc/shared/generation.hpp" +#include "logging/log.hpp" #include "memory/allocation.hpp" #include "runtime/handles.hpp" #include "services/memoryUsage.hpp" @@ -164,7 +165,7 @@ public: static void oops_do(OopClosure* f); - static bool get_verbose() { return PrintGC; } + static bool get_verbose() { return log_is_enabled(Info, gc); } static bool set_verbose(bool verbose); // Create an instance of java/lang/management/MemoryUsage diff --git a/hotspot/src/share/vm/services/runtimeService.cpp b/hotspot/src/share/vm/services/runtimeService.cpp index 13ddd03740f..48f14646303 100644 --- a/hotspot/src/share/vm/services/runtimeService.cpp +++ b/hotspot/src/share/vm/services/runtimeService.cpp @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "classfile/classLoader.hpp" +#include "logging/log.hpp" #include "runtime/vm_version.hpp" #include "services/attachListener.hpp" #include "services/management.hpp" @@ -87,11 +88,8 @@ void RuntimeService::record_safepoint_begin() { HS_PRIVATE_SAFEPOINT_BEGIN(); // Print the time interval in which the app was executing - if (PrintGCApplicationConcurrentTime && _app_timer.is_updated()) { - gclog_or_tty->date_stamp(PrintGCDateStamps); - gclog_or_tty->stamp(PrintGCTimeStamps); - gclog_or_tty->print_cr("Application time: %3.7f seconds", - last_application_time_sec()); + if (_app_timer.is_updated()) { + log_info(safepoint)("Application time: %3.7f seconds", last_application_time_sec()); } // update the time stamp to begin recording safepoint time @@ -109,7 +107,7 @@ void RuntimeService::record_safepoint_synchronized() { if (UsePerfData) { _sync_time_ticks->inc(_safepoint_timer.ticks_since_update()); } - if (PrintGCApplicationStoppedTime) { + if (log_is_enabled(Info, safepoint)) { _last_safepoint_sync_time_sec = last_safepoint_time_sec(); } } @@ -119,15 +117,8 @@ void RuntimeService::record_safepoint_end() { // Print the time interval for which the app was stopped // during the current safepoint operation. - if (PrintGCApplicationStoppedTime) { - gclog_or_tty->date_stamp(PrintGCDateStamps); - gclog_or_tty->stamp(PrintGCTimeStamps); - gclog_or_tty->print_cr("Total time for which application threads " - "were stopped: %3.7f seconds, " - "Stopping threads took: %3.7f seconds", - last_safepoint_time_sec(), - _last_safepoint_sync_time_sec); - } + log_info(safepoint)("Total time for which application threads were stopped: %3.7f seconds, Stopping threads took: %3.7f seconds", + last_safepoint_time_sec(), _last_safepoint_sync_time_sec); // update the time stamp to begin recording app time _app_timer.update(); diff --git a/hotspot/src/share/vm/utilities/debug.cpp b/hotspot/src/share/vm/utilities/debug.cpp index 8f6569e80c0..29ccf223721 100644 --- a/hotspot/src/share/vm/utilities/debug.cpp +++ b/hotspot/src/share/vm/utilities/debug.cpp @@ -505,7 +505,7 @@ extern "C" void printnm(intptr_t p) { extern "C" void universe() { Command c("universe"); - Universe::print(); + Universe::print_on(tty); } diff --git a/hotspot/src/share/vm/utilities/numberSeq.cpp b/hotspot/src/share/vm/utilities/numberSeq.cpp index 702a16a2a7f..ddb1683b74b 100644 --- a/hotspot/src/share/vm/utilities/numberSeq.cpp +++ b/hotspot/src/share/vm/utilities/numberSeq.cpp @@ -234,7 +234,7 @@ double TruncatedSeq::predict_next() const { // Printing/Debugging Support -void AbsSeq::dump() { dump_on(gclog_or_tty); } +void AbsSeq::dump() { dump_on(tty); } void AbsSeq::dump_on(outputStream* s) { s->print_cr("\t _num = %d, _sum = %7.3f, _sum_of_squares = %7.3f", diff --git a/hotspot/src/share/vm/utilities/ostream.cpp b/hotspot/src/share/vm/utilities/ostream.cpp index 0c09556e72a..d3583a006ff 100644 --- a/hotspot/src/share/vm/utilities/ostream.cpp +++ b/hotspot/src/share/vm/utilities/ostream.cpp @@ -239,14 +239,6 @@ void outputStream::date_stamp(bool guard, return; } -void outputStream::gclog_stamp() { - date_stamp(PrintGCDateStamps); - stamp(PrintGCTimeStamps); - if (PrintGCID) { - print("#%u: ", GCId::current()); - } -} - outputStream& outputStream::indent() { while (_position < _indentation) sp(); return *this; @@ -366,7 +358,6 @@ stringStream::~stringStream() {} xmlStream* xtty; outputStream* tty; -outputStream* gclog_or_tty; CDS_ONLY(fileStream* classlist_file;) // Only dump the classes that can be stored into the CDS archive extern Mutex* tty_lock; @@ -482,7 +473,7 @@ static const char* make_log_name_internal(const char* log_name, const char* forc return buf; } -// log_name comes from -XX:LogFile=log_name, -Xloggc:log_name or +// log_name comes from -XX:LogFile=log_name or // -XX:DumpLoadedClassList= // in log_name, %p => pid1234 and // %t => YYYY-MM-DD_HH-MM-SS @@ -493,95 +484,6 @@ static const char* make_log_name(const char* log_name, const char* force_directo timestr); } -#ifndef PRODUCT -void test_loggc_filename() { - int pid; - char tms[32]; - char i_result[JVM_MAXPATHLEN]; - const char* o_result; - get_datetime_string(tms, sizeof(tms)); - pid = os::current_process_id(); - - // test.log - jio_snprintf(i_result, JVM_MAXPATHLEN, "test.log", tms); - o_result = make_log_name_internal("test.log", NULL, pid, tms); - assert(strcmp(i_result, o_result) == 0, "failed on testing make_log_name(\"test.log\", NULL)"); - FREE_C_HEAP_ARRAY(char, o_result); - - // test-%t-%p.log - jio_snprintf(i_result, JVM_MAXPATHLEN, "test-%s-pid%u.log", tms, pid); - o_result = make_log_name_internal("test-%t-%p.log", NULL, pid, tms); - assert(strcmp(i_result, o_result) == 0, "failed on testing make_log_name(\"test-%%t-%%p.log\", NULL)"); - FREE_C_HEAP_ARRAY(char, o_result); - - // test-%t%p.log - jio_snprintf(i_result, JVM_MAXPATHLEN, "test-%spid%u.log", tms, pid); - o_result = make_log_name_internal("test-%t%p.log", NULL, pid, tms); - assert(strcmp(i_result, o_result) == 0, "failed on testing make_log_name(\"test-%%t%%p.log\", NULL)"); - FREE_C_HEAP_ARRAY(char, o_result); - - // %p%t.log - jio_snprintf(i_result, JVM_MAXPATHLEN, "pid%u%s.log", pid, tms); - o_result = make_log_name_internal("%p%t.log", NULL, pid, tms); - assert(strcmp(i_result, o_result) == 0, "failed on testing make_log_name(\"%%p%%t.log\", NULL)"); - FREE_C_HEAP_ARRAY(char, o_result); - - // %p-test.log - jio_snprintf(i_result, JVM_MAXPATHLEN, "pid%u-test.log", pid); - o_result = make_log_name_internal("%p-test.log", NULL, pid, tms); - assert(strcmp(i_result, o_result) == 0, "failed on testing make_log_name(\"%%p-test.log\", NULL)"); - FREE_C_HEAP_ARRAY(char, o_result); - - // %t.log - jio_snprintf(i_result, JVM_MAXPATHLEN, "%s.log", tms); - o_result = make_log_name_internal("%t.log", NULL, pid, tms); - assert(strcmp(i_result, o_result) == 0, "failed on testing make_log_name(\"%%t.log\", NULL)"); - FREE_C_HEAP_ARRAY(char, o_result); - - { - // longest filename - char longest_name[JVM_MAXPATHLEN]; - memset(longest_name, 'a', sizeof(longest_name)); - longest_name[JVM_MAXPATHLEN - 1] = '\0'; - o_result = make_log_name_internal((const char*)&longest_name, NULL, pid, tms); - assert(strcmp(longest_name, o_result) == 0, "longest name does not match. expected '%s' but got '%s'", longest_name, o_result); - FREE_C_HEAP_ARRAY(char, o_result); - } - - { - // too long file name - char too_long_name[JVM_MAXPATHLEN + 100]; - int too_long_length = sizeof(too_long_name); - memset(too_long_name, 'a', too_long_length); - too_long_name[too_long_length - 1] = '\0'; - o_result = make_log_name_internal((const char*)&too_long_name, NULL, pid, tms); - assert(o_result == NULL, "Too long file name should return NULL, but got '%s'", o_result); - } - - { - // too long with timestamp - char longest_name[JVM_MAXPATHLEN]; - memset(longest_name, 'a', JVM_MAXPATHLEN); - longest_name[JVM_MAXPATHLEN - 3] = '%'; - longest_name[JVM_MAXPATHLEN - 2] = 't'; - longest_name[JVM_MAXPATHLEN - 1] = '\0'; - o_result = make_log_name_internal((const char*)&longest_name, NULL, pid, tms); - assert(o_result == NULL, "Too long file name after timestamp expansion should return NULL, but got '%s'", o_result); - } - - { - // too long with pid - char longest_name[JVM_MAXPATHLEN]; - memset(longest_name, 'a', JVM_MAXPATHLEN); - longest_name[JVM_MAXPATHLEN - 3] = '%'; - longest_name[JVM_MAXPATHLEN - 2] = 'p'; - longest_name[JVM_MAXPATHLEN - 1] = '\0'; - o_result = make_log_name_internal((const char*)&longest_name, NULL, pid, tms); - assert(o_result == NULL, "Too long file name after pid expansion should return NULL, but got '%s'", o_result); - } -} -#endif // PRODUCT - fileStream::fileStream(const char* file_name) { _file = fopen(file_name, "w"); if (_file != NULL) { @@ -660,202 +562,6 @@ void fdStream::write(const char* s, size_t len) { update_position(s, len); } -// dump vm version, os version, platform info, build id, -// memory usage and command line flags into header -void gcLogFileStream::dump_loggc_header() { - if (is_open()) { - print_cr("%s", Abstract_VM_Version::internal_vm_info_string()); - os::print_memory_info(this); - print("CommandLine flags: "); - CommandLineFlags::printSetFlags(this); - } -} - -gcLogFileStream::~gcLogFileStream() { - if (_file != NULL) { - if (_need_close) fclose(_file); - _file = NULL; - } - if (_file_name != NULL) { - FREE_C_HEAP_ARRAY(char, _file_name); - _file_name = NULL; - } -} - -gcLogFileStream::gcLogFileStream(const char* file_name) { - _cur_file_num = 0; - _bytes_written = 0L; - _file_name = make_log_name(file_name, NULL); - - if (_file_name == NULL) { - warning("Cannot open file %s: file name is too long.\n", file_name); - _need_close = false; - UseGCLogFileRotation = false; - return; - } - - // gc log file rotation - if (UseGCLogFileRotation && NumberOfGCLogFiles > 1) { - char tempbuf[JVM_MAXPATHLEN]; - jio_snprintf(tempbuf, sizeof(tempbuf), "%s.%d" CURRENTAPPX, _file_name, _cur_file_num); - _file = fopen(tempbuf, "w"); - } else { - _file = fopen(_file_name, "w"); - } - if (_file != NULL) { - _need_close = true; - dump_loggc_header(); - } else { - warning("Cannot open file %s due to %s\n", _file_name, strerror(errno)); - _need_close = false; - } -} - -void gcLogFileStream::write(const char* s, size_t len) { - if (_file != NULL) { - size_t count = fwrite(s, 1, len, _file); - _bytes_written += count; - } - update_position(s, len); -} - -// rotate_log must be called from VMThread at safepoint. In case need change parameters -// for gc log rotation from thread other than VMThread, a sub type of VM_Operation -// should be created and be submitted to VMThread's operation queue. DO NOT call this -// function directly. Currently, it is safe to rotate log at safepoint through VMThread. -// That is, no mutator threads and concurrent GC threads run parallel with VMThread to -// write to gc log file at safepoint. If in future, changes made for mutator threads or -// concurrent GC threads to run parallel with VMThread at safepoint, write and rotate_log -// must be synchronized. -void gcLogFileStream::rotate_log(bool force, outputStream* out) { - char time_msg[O_BUFLEN]; - char time_str[EXTRACHARLEN]; - char current_file_name[JVM_MAXPATHLEN]; - char renamed_file_name[JVM_MAXPATHLEN]; - - if (!should_rotate(force)) { - return; - } - -#ifdef ASSERT - Thread *thread = Thread::current_or_null(); - assert(thread == NULL || - (thread->is_VM_thread() && SafepointSynchronize::is_at_safepoint()), - "Must be VMThread at safepoint"); -#endif - if (NumberOfGCLogFiles == 1) { - // rotate in same file - rewind(); - _bytes_written = 0L; - jio_snprintf(time_msg, sizeof(time_msg), "File %s rotated at %s\n", - _file_name, os::local_time_string((char *)time_str, sizeof(time_str))); - write(time_msg, strlen(time_msg)); - - if (out != NULL) { - out->print("%s", time_msg); - } - - dump_loggc_header(); - return; - } - -#if defined(_WINDOWS) -#ifndef F_OK -#define F_OK 0 -#endif -#endif // _WINDOWS - - // rotate file in names extended_filename.0, extended_filename.1, ..., - // extended_filename.. Current rotation file name will - // have a form of extended_filename..current where i is the current rotation - // file number. After it reaches max file size, the file will be saved and renamed - // with .current removed from its tail. - if (_file != NULL) { - jio_snprintf(renamed_file_name, JVM_MAXPATHLEN, "%s.%d", - _file_name, _cur_file_num); - int result = jio_snprintf(current_file_name, JVM_MAXPATHLEN, - "%s.%d" CURRENTAPPX, _file_name, _cur_file_num); - if (result >= JVM_MAXPATHLEN) { - warning("Cannot create new log file name: %s: file name is too long.\n", current_file_name); - return; - } - - const char* msg = force ? "GC log rotation request has been received." - : "GC log file has reached the maximum size."; - jio_snprintf(time_msg, sizeof(time_msg), "%s %s Saved as %s\n", - os::local_time_string((char *)time_str, sizeof(time_str)), - msg, renamed_file_name); - write(time_msg, strlen(time_msg)); - - if (out != NULL) { - out->print("%s", time_msg); - } - - fclose(_file); - _file = NULL; - - bool can_rename = true; - if (access(current_file_name, F_OK) != 0) { - // current file does not exist? - warning("No source file exists, cannot rename\n"); - can_rename = false; - } - if (can_rename) { - if (access(renamed_file_name, F_OK) == 0) { - if (remove(renamed_file_name) != 0) { - warning("Could not delete existing file %s\n", renamed_file_name); - can_rename = false; - } - } else { - // file does not exist, ok to rename - } - } - if (can_rename && rename(current_file_name, renamed_file_name) != 0) { - warning("Could not rename %s to %s\n", _file_name, renamed_file_name); - } - } - - _cur_file_num++; - if (_cur_file_num > NumberOfGCLogFiles - 1) _cur_file_num = 0; - int result = jio_snprintf(current_file_name, JVM_MAXPATHLEN, "%s.%d" CURRENTAPPX, - _file_name, _cur_file_num); - if (result >= JVM_MAXPATHLEN) { - warning("Cannot create new log file name: %s: file name is too long.\n", current_file_name); - return; - } - - _file = fopen(current_file_name, "w"); - - if (_file != NULL) { - _bytes_written = 0L; - _need_close = true; - // reuse current_file_name for time_msg - jio_snprintf(current_file_name, JVM_MAXPATHLEN, - "%s.%d", _file_name, _cur_file_num); - jio_snprintf(time_msg, sizeof(time_msg), "%s GC log file created %s\n", - os::local_time_string((char *)time_str, sizeof(time_str)), current_file_name); - write(time_msg, strlen(time_msg)); - - if (out != NULL) { - out->print("%s", time_msg); - } - - dump_loggc_header(); - // remove the existing file - if (access(current_file_name, F_OK) == 0) { - if (remove(current_file_name) != 0) { - warning("Could not delete existing file %s\n", current_file_name); - } - } - } else { - warning("failed to open rotation log file %s due to %s\n" - "Turned off GC log file rotation\n", - _file_name, strerror(errno)); - _need_close = false; - FLAG_SET_DEFAULT(UseGCLogFileRotation, false); - } -} - defaultStream* defaultStream::instance = NULL; int defaultStream::_output_fd = 1; int defaultStream::_error_fd = 2; @@ -1194,21 +900,8 @@ void ostream_init() { } void ostream_init_log() { - // For -Xloggc: option - called in runtime/thread.cpp // Note : this must be called AFTER ostream_init() - gclog_or_tty = tty; // default to tty - if (Arguments::gc_log_filename() != NULL) { - fileStream * gclog = new(ResourceObj::C_HEAP, mtInternal) - gcLogFileStream(Arguments::gc_log_filename()); - if (gclog->is_open()) { - // now we update the time stamp of the GC log to be synced up - // with tty. - gclog->time_stamp().update_to(tty->time_stamp().ticks()); - } - gclog_or_tty = gclog; - } - #if INCLUDE_CDS // For -XX:DumpLoadedClassList= option if (DumpLoadedClassList != NULL) { @@ -1236,9 +929,6 @@ void ostream_exit() { delete classlist_file; } #endif - if (gclog_or_tty != tty) { - delete gclog_or_tty; - } { // we temporaly disable PrintMallocFree here // as otherwise it'll lead to using of almost deleted @@ -1254,14 +944,12 @@ void ostream_exit() { } tty = NULL; xtty = NULL; - gclog_or_tty = NULL; defaultStream::instance = NULL; } // ostream_abort() is called by os::abort() when VM is about to die. void ostream_abort() { - // Here we can't delete gclog_or_tty and tty, just flush their output - if (gclog_or_tty) gclog_or_tty->flush(); + // Here we can't delete tty, just flush its output if (tty) tty->flush(); if (defaultStream::instance != NULL) { diff --git a/hotspot/src/share/vm/utilities/ostream.hpp b/hotspot/src/share/vm/utilities/ostream.hpp index a9447b64c60..627ba90fb92 100644 --- a/hotspot/src/share/vm/utilities/ostream.hpp +++ b/hotspot/src/share/vm/utilities/ostream.hpp @@ -108,7 +108,6 @@ class outputStream : public ResourceObj { void date_stamp(bool guard) { date_stamp(guard, "", ": "); } - void gclog_stamp(); // portable printing of 64 bit integers void print_jlong(jlong value); @@ -127,7 +126,6 @@ class outputStream : public ResourceObj { // standard output // ANSI C++ name collision extern outputStream* tty; // tty output -extern outputStream* gclog_or_tty; // stream for gc log if -Xloggc:, or tty class streamIndentor : public StackObj { private: @@ -247,30 +245,6 @@ public: } }; -class gcLogFileStream : public fileStream { - protected: - const char* _file_name; - jlong _bytes_written; - uintx _cur_file_num; // current logfile rotation number, from 0 to NumberOfGCLogFiles-1 - public: - gcLogFileStream(const char* file_name); - ~gcLogFileStream(); - virtual void write(const char* c, size_t len); - virtual void rotate_log(bool force, outputStream* out = NULL); - void dump_loggc_header(); - - /* If "force" sets true, force log file rotation from outside JVM */ - bool should_rotate(bool force) { - return force || - ((GCLogFileSize != 0) && (_bytes_written >= (jlong)GCLogFileSize)); - } -}; - -#ifndef PRODUCT -// unit test for checking -Xloggc: parsing result -void test_loggc_filename(); -#endif - void ostream_init(); void ostream_init_log(); void ostream_exit(); diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups index ab2b89acaf8..0ab5b18b6e1 100644 --- a/hotspot/test/TEST.groups +++ b/hotspot/test/TEST.groups @@ -145,7 +145,6 @@ needs_compact3 = \ gc/g1/TestShrinkAuxiliaryData25.java \ gc/g1/TestShrinkAuxiliaryData30.java \ gc/survivorAlignment \ - gc/TestGCLogRotationViaJcmd.java \ runtime/InternalApi/ThreadCpuTimesDeadlock.java \ runtime/NMT/JcmdSummaryDiff.java \ runtime/RedefineTests/RedefineAnnotations.java diff --git a/hotspot/test/gc/7072527/TestFullGCCount.java b/hotspot/test/gc/7072527/TestFullGCCount.java index fcd422ff389..6732a01c355 100644 --- a/hotspot/test/gc/7072527/TestFullGCCount.java +++ b/hotspot/test/gc/7072527/TestFullGCCount.java @@ -26,7 +26,7 @@ * @bug 7072527 * @summary CMS: JMM GC counters overcount in some cases * @modules java.management - * @run main/othervm -XX:+PrintGC TestFullGCCount + * @run main/othervm -Xlog:gc TestFullGCCount */ import java.util.*; import java.lang.management.*; diff --git a/hotspot/test/gc/TestDisableExplicitGC.java b/hotspot/test/gc/TestDisableExplicitGC.java index 9f0d5c7cbb8..10199fd0bb0 100644 --- a/hotspot/test/gc/TestDisableExplicitGC.java +++ b/hotspot/test/gc/TestDisableExplicitGC.java @@ -26,9 +26,9 @@ * @requires vm.opt.DisableExplicitGC == null * @summary Verify GC behavior with DisableExplicitGC flag. * @library /testlibrary - * @run main/othervm -XX:+PrintGCDetails TestDisableExplicitGC - * @run main/othervm/fail -XX:+DisableExplicitGC -XX:+PrintGCDetails TestDisableExplicitGC - * @run main/othervm -XX:-DisableExplicitGC -XX:+PrintGCDetails TestDisableExplicitGC + * @run main/othervm -Xlog:gc=debug TestDisableExplicitGC + * @run main/othervm/fail -XX:+DisableExplicitGC -Xlog:gc=debug TestDisableExplicitGC + * @run main/othervm -XX:-DisableExplicitGC -Xlog:gc=debug TestDisableExplicitGC */ import java.lang.management.GarbageCollectorMXBean; import java.util.List; diff --git a/hotspot/test/gc/TestGCLogRotationViaJcmd.java b/hotspot/test/gc/TestGCLogRotationViaJcmd.java deleted file mode 100644 index fd0e331ffa6..00000000000 --- a/hotspot/test/gc/TestGCLogRotationViaJcmd.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test TestGCLogRotationViaJcmd.java - * @bug 7090324 - * @summary test for gc log rotation via jcmd - * @library /testlibrary - * @modules java.base/sun.misc - * java.management - * @run main/othervm -Xloggc:test.log -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=3 TestGCLogRotationViaJcmd - * - */ -import jdk.test.lib.*; -import java.io.File; -import java.io.FilenameFilter; - -public class TestGCLogRotationViaJcmd { - - static final File currentDirectory = new File("."); - static final String LOG_FILE_NAME = "test.log"; - static final int NUM_LOGS = 3; - - static FilenameFilter logFilter = new FilenameFilter() { - @Override - public boolean accept(File dir, String name) { - return name.startsWith(LOG_FILE_NAME); - } - }; - - public static void main(String[] args) throws Exception { - // Grab the pid from the current java process - String pid = Integer.toString(ProcessTools.getProcessId()); - - // Create a JDKToolLauncher - JDKToolLauncher jcmd = JDKToolLauncher.create("jcmd") - .addToolArg(pid) - .addToolArg("GC.rotate_log"); - - for (int times = 1; times < NUM_LOGS; times++) { - // Run jcmd GC.rotate_log - ProcessBuilder pb = new ProcessBuilder(jcmd.getCommand()); - - // Make sure we didn't crash - OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldHaveExitValue(0); - } - - // GC log check - File[] logs = currentDirectory.listFiles(logFilter); - if (logs.length != NUM_LOGS) { - throw new Error("There are only " + logs.length - + " logs instead " + NUM_LOGS); - } - - } - -} - diff --git a/hotspot/test/gc/TestVerifyDuringStartup.java b/hotspot/test/gc/TestVerifyDuringStartup.java index 95643aee4ce..69466673a16 100644 --- a/hotspot/test/gc/TestVerifyDuringStartup.java +++ b/hotspot/test/gc/TestVerifyDuringStartup.java @@ -48,6 +48,7 @@ public class TestVerifyDuringStartup { Collections.addAll(vmOpts, new String[] {"-XX:-UseTLAB", "-XX:+UnlockDiagnosticVMOptions", "-XX:+VerifyDuringStartup", + "-Xlog:gc+verify=debug", "-version"}); System.out.print("Testing:\n" + JDKToolFinder.getJDKTool("java")); @@ -62,7 +63,7 @@ public class TestVerifyDuringStartup { System.out.println("Output:\n" + output.getOutput()); - output.shouldContain("[Verifying"); + output.shouldContain("Verifying"); output.shouldHaveExitValue(0); } } diff --git a/hotspot/test/gc/TestVerifySilently.java b/hotspot/test/gc/TestVerifySilently.java index b2861d6026a..3694f2f027b 100644 --- a/hotspot/test/gc/TestVerifySilently.java +++ b/hotspot/test/gc/TestVerifySilently.java @@ -60,7 +60,7 @@ public class TestVerifySilently { "-XX:+VerifyDuringStartup", "-XX:+VerifyBeforeGC", "-XX:+VerifyAfterGC", - "-XX:" + (verifySilently ? "+":"-") + "VerifySilently", + (verifySilently ? "-Xlog:gc":"-Xlog:gc+verify=debug"), RunSystemGC.class.getName()}); ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(vmOpts.toArray(new String[vmOpts.size()])); @@ -76,11 +76,11 @@ public class TestVerifySilently { OutputAnalyzer output; output = runTest(false); - output.shouldContain("[Verifying"); + output.shouldContain("Verifying"); output.shouldHaveExitValue(0); output = runTest(true); - output.shouldNotContain("[Verifying"); + output.shouldNotContain("Verifying"); output.shouldHaveExitValue(0); } } diff --git a/hotspot/test/gc/arguments/TestTargetSurvivorRatioFlag.java b/hotspot/test/gc/arguments/TestTargetSurvivorRatioFlag.java index a9d8a984d0b..3dc2980a9ee 100644 --- a/hotspot/test/gc/arguments/TestTargetSurvivorRatioFlag.java +++ b/hotspot/test/gc/arguments/TestTargetSurvivorRatioFlag.java @@ -79,7 +79,7 @@ public class TestTargetSurvivorRatioFlag { // Patterns used during log parsing public static final String TENURING_DISTRIBUTION = "Desired survivor size"; - public static final String AGE_TABLE_ENTRY = "-[\\s]+age[\\s]+([0-9]+):[\\s]+([0-9]+)[\\s]+bytes,[\\s]+([0-9]+)[\\s]+total"; + public static final String AGE_TABLE_ENTRY = ".*-[\\s]+age[\\s]+([0-9]+):[\\s]+([0-9]+)[\\s]+bytes,[\\s]+([0-9]+)[\\s]+total"; public static final String MAX_SURVIVOR_SIZE = "Max survivor size: ([0-9]+)"; public static void main(String args[]) throws Exception { @@ -133,7 +133,7 @@ public class TestTargetSurvivorRatioFlag { "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", "-XX:+UseAdaptiveSizePolicy", - "-XX:+PrintTenuringDistribution", + "-Xlog:gc+age=trace", "-XX:MaxTenuringThreshold=" + MAX_TENURING_THRESHOLD, "-XX:NewSize=" + MAX_NEW_SIZE, "-XX:MaxNewSize=" + MAX_NEW_SIZE, diff --git a/hotspot/test/gc/arguments/TestUnrecognizedVMOptionsHandling.java b/hotspot/test/gc/arguments/TestUnrecognizedVMOptionsHandling.java index 1e08a1088ca..787e23e8156 100644 --- a/hotspot/test/gc/arguments/TestUnrecognizedVMOptionsHandling.java +++ b/hotspot/test/gc/arguments/TestUnrecognizedVMOptionsHandling.java @@ -39,11 +39,11 @@ public class TestUnrecognizedVMOptionsHandling { public static void main(String args[]) throws Exception { // The first two JAVA processes are expected to fail, but with a correct VM option suggestion ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-XX:+PrintGc", + "-XX:+UseDynamicNumberOfGcThreads", "-version" ); OutputAnalyzer outputWithError = new OutputAnalyzer(pb.start()); - outputWithError.shouldContain("Did you mean '(+/-)PrintGC'?"); + outputWithError.shouldContain("Did you mean '(+/-)UseDynamicNumberOfGCThreads'?"); if (outputWithError.getExitValue() == 0) { throw new RuntimeException("Not expected to get exit value 0"); } @@ -60,11 +60,11 @@ public class TestUnrecognizedVMOptionsHandling { // The last JAVA process should run successfully for the purpose of sanity check pb = ProcessTools.createJavaProcessBuilder( - "-XX:+PrintGC", + "-XX:+UseDynamicNumberOfGCThreads", "-version" ); OutputAnalyzer outputWithNoError = new OutputAnalyzer(pb.start()); - outputWithNoError.shouldNotContain("Did you mean '(+/-)PrintGC'?"); + outputWithNoError.shouldNotContain("Did you mean '(+/-)UseDynamicNumberOfGCThreads'?"); outputWithNoError.shouldHaveExitValue(0); } } diff --git a/hotspot/test/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java b/hotspot/test/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java index f716bdc67de..3706d955bda 100644 --- a/hotspot/test/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java +++ b/hotspot/test/gc/arguments/TestVerifyBeforeAndAfterGCFlags.java @@ -43,18 +43,18 @@ import jdk.test.lib.ProcessTools; public class TestVerifyBeforeAndAfterGCFlags { // VerifyBeforeGC:[Verifying threads heap tenured eden syms strs zone dict metaspace chunks hand C-heap code cache ] - public static final String VERIFY_BEFORE_GC_PATTERN = "VerifyBeforeGC:\\[Verifying\\s+([^]\\s]+\\s+)+\\]"; + public static final String VERIFY_BEFORE_GC_PATTERN = "Verifying Before GC"; // VerifyBeforeGC: VerifyBeforeGC: VerifyBeforeGC: public static final String VERIFY_BEFORE_GC_CORRUPTED_PATTERN = "VerifyBeforeGC:(?!\\[Verifying[^]]+\\])"; // VerifyAfterGC:[Verifying threads heap tenured eden syms strs zone dict metaspace chunks hand C-heap code cache ] - public static final String VERIFY_AFTER_GC_PATTERN = "VerifyAfterGC:\\[Verifying\\s+([^]\\s]+\\s+)+\\]"; + public static final String VERIFY_AFTER_GC_PATTERN = "Verifying After GC"; // VerifyAfterGC: VerifyAfterGC: VerifyAfterGC: public static final String VERIFY_AFTER_GC_CORRUPTED_PATTERN = "VerifyAfterGC:(?!\\[Verifying[^]]+\\])"; public static void main(String args[]) throws Exception { String[] filteredOpts = Utils.getFilteredTestJavaOpts( - new String[] { "-Xloggc:", + new String[] { "-Xlog:gc+verify=debug", "-XX:+UseGCLogFileRotation", "-XX:-DisplayVMOutput", "VerifyBeforeGC", @@ -74,6 +74,7 @@ public class TestVerifyBeforeAndAfterGCFlags { } Collections.addAll(vmOpts, new String[] { + "-Xlog:gc+verify=debug", "-Xmx5m", "-Xms5m", "-Xmn3m", diff --git a/hotspot/test/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java b/hotspot/test/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java index 634cc87edf5..12acc0fe0a9 100644 --- a/hotspot/test/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java +++ b/hotspot/test/gc/class_unloading/TestCMSClassUnloadingEnabledHWM.java @@ -59,9 +59,7 @@ public class TestCMSClassUnloadingEnabledHWM { "-Xmn" + YoungGenSize, "-XX:+UseConcMarkSweepGC", "-XX:" + (enableUnloading ? "+" : "-") + "CMSClassUnloadingEnabled", - "-XX:+PrintHeapAtGC", - "-XX:+PrintGCDetails", - "-XX:+PrintGCTimeStamps", + "-Xlog:gc", TestCMSClassUnloadingEnabledHWM.AllocateBeyondMetaspaceSize.class.getName(), "" + MetaspaceSize); return new OutputAnalyzer(pb.start()); @@ -79,16 +77,16 @@ public class TestCMSClassUnloadingEnabledHWM { // -XX:-CMSClassUnloadingEnabled is used, so we expect a full GC instead of a concurrent cycle. OutputAnalyzer out = runWithoutCMSClassUnloading(); - out.shouldMatch(".*Full GC.*"); - out.shouldNotMatch(".*CMS Initial Mark.*"); + out.shouldMatch(".*Pause Full.*"); + out.shouldNotMatch(".*Pause Initial Mark.*"); } public static void testWithCMSClassUnloading() throws Exception { // -XX:+CMSClassUnloadingEnabled is used, so we expect a concurrent cycle instead of a full GC. OutputAnalyzer out = runWithCMSClassUnloading(); - out.shouldMatch(".*CMS Initial Mark.*"); - out.shouldNotMatch(".*Full GC.*"); + out.shouldMatch(".*Pause Initial Mark.*"); + out.shouldNotMatch(".*Pause Full.*"); } public static void main(String args[]) throws Exception { diff --git a/hotspot/test/gc/class_unloading/TestG1ClassUnloadingHWM.java b/hotspot/test/gc/class_unloading/TestG1ClassUnloadingHWM.java index 8637e6f4b9c..3d382c91c25 100644 --- a/hotspot/test/gc/class_unloading/TestG1ClassUnloadingHWM.java +++ b/hotspot/test/gc/class_unloading/TestG1ClassUnloadingHWM.java @@ -54,8 +54,7 @@ public class TestG1ClassUnloadingHWM { "-Xmn" + YoungGenSize, "-XX:+UseG1GC", "-XX:" + (enableUnloading ? "+" : "-") + "ClassUnloadingWithConcurrentMark", - "-XX:+PrintHeapAtGC", - "-XX:+PrintGCDetails", + "-Xlog:gc", TestG1ClassUnloadingHWM.AllocateBeyondMetaspaceSize.class.getName(), "" + MetaspaceSize, "" + YoungGenSize); @@ -74,16 +73,16 @@ public class TestG1ClassUnloadingHWM { // -XX:-ClassUnloadingWithConcurrentMark is used, so we expect a full GC instead of a concurrent cycle. OutputAnalyzer out = runWithoutG1ClassUnloading(); - out.shouldMatch(".*Full GC.*"); - out.shouldNotMatch(".*initial-mark.*"); + out.shouldMatch(".*Pause Full.*"); + out.shouldNotMatch(".*Pause Initial Mark.*"); } public static void testWithG1ClassUnloading() throws Exception { // -XX:+ClassUnloadingWithConcurrentMark is used, so we expect a concurrent cycle instead of a full GC. OutputAnalyzer out = runWithG1ClassUnloading(); - out.shouldMatch(".*initial-mark.*"); - out.shouldNotMatch(".*Full GC.*"); + out.shouldMatch(".*Pause Initial Mark.*"); + out.shouldNotMatch(".*Pause Full.*"); } public static void main(String args[]) throws Exception { diff --git a/hotspot/test/gc/cms/DisableResizePLAB.java b/hotspot/test/gc/cms/DisableResizePLAB.java index b7cad24eae6..d1e4e681eb1 100644 --- a/hotspot/test/gc/cms/DisableResizePLAB.java +++ b/hotspot/test/gc/cms/DisableResizePLAB.java @@ -28,7 +28,7 @@ * @author filipp.zhinkin@oracle.com, john.coomes@oracle.com * @requires vm.gc=="ConcMarkSweep" | vm.gc=="null" * @summary Run CMS with PLAB resizing disabled and a small OldPLABSize - * @run main/othervm -XX:+UseConcMarkSweepGC -XX:-ResizePLAB -XX:OldPLABSize=1k -Xmx256m -XX:+PrintGCDetails DisableResizePLAB + * @run main/othervm -XX:+UseConcMarkSweepGC -XX:-ResizePLAB -XX:OldPLABSize=1k -Xmx256m -Xlog:gc=debug DisableResizePLAB */ public class DisableResizePLAB { diff --git a/hotspot/test/gc/cms/TestCMSScavengeBeforeRemark.java b/hotspot/test/gc/cms/TestCMSScavengeBeforeRemark.java index b124541e1e0..91376c18ced 100644 --- a/hotspot/test/gc/cms/TestCMSScavengeBeforeRemark.java +++ b/hotspot/test/gc/cms/TestCMSScavengeBeforeRemark.java @@ -27,7 +27,7 @@ * @bug 8139868 * @requires vm.gc=="ConcMarkSweep" | vm.gc=="null" * @summary Run CMS with CMSScavengeBeforeRemark - * @run main/othervm -XX:+UseConcMarkSweepGC -XX:+CMSScavengeBeforeRemark -XX:+ExplicitGCInvokesConcurrent -Xmx256m -XX:+PrintGCDetails TestCMSScavengeBeforeRemark + * @run main/othervm -XX:+UseConcMarkSweepGC -XX:+CMSScavengeBeforeRemark -XX:+ExplicitGCInvokesConcurrent -Xmx256m -Xlog:gc=debug TestCMSScavengeBeforeRemark */ public class TestCMSScavengeBeforeRemark { diff --git a/hotspot/test/gc/ergonomics/TestDynamicNumberOfGCThreads.java b/hotspot/test/gc/ergonomics/TestDynamicNumberOfGCThreads.java index 3bcec291cdc..afa2103783c 100644 --- a/hotspot/test/gc/ergonomics/TestDynamicNumberOfGCThreads.java +++ b/hotspot/test/gc/ergonomics/TestDynamicNumberOfGCThreads.java @@ -50,7 +50,7 @@ public class TestDynamicNumberOfGCThreads { private static void testDynamicNumberOfGCThreads(String gcFlag) throws Exception { // UseDynamicNumberOfGCThreads and TraceDynamicGCThreads enabled - String[] baseArgs = {"-XX:+" + gcFlag, "-Xmx10M", "-XX:+PrintGCDetails", "-XX:+UseDynamicNumberOfGCThreads", "-XX:+TraceDynamicGCThreads", GCTest.class.getName()}; + String[] baseArgs = {"-XX:+" + gcFlag, "-Xmx10M", "-XX:+UseDynamicNumberOfGCThreads", "-Xlog:gc+task=trace", GCTest.class.getName()}; // Base test with gc and +UseDynamicNumberOfGCThreads: ProcessBuilder pb_enabled = ProcessTools.createJavaProcessBuilder(baseArgs); diff --git a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegions.java b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegions.java index 3876dc092ef..487a4b10c43 100644 --- a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegions.java +++ b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegions.java @@ -82,7 +82,7 @@ public class TestEagerReclaimHumongousRegions { "-Xms128M", "-Xmx128M", "-Xmn16M", - "-XX:+PrintGC", + "-Xlog:gc", ReclaimRegionFast.class.getName()); Pattern p = Pattern.compile("Full GC"); diff --git a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java index 0dfe7ac0b3d..5dde4f48b9f 100644 --- a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java +++ b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsClearMarkBits.java @@ -120,7 +120,7 @@ public class TestEagerReclaimHumongousRegionsClearMarkBits { "-Xmn2M", "-XX:G1HeapRegionSize=1M", "-XX:InitiatingHeapOccupancyPercent=0", // Want to have as much as possible initial marks. - "-XX:+PrintGC", + "-Xlog:gc", "-XX:+UnlockDiagnosticVMOptions", "-XX:+VerifyAfterGC", "-XX:ConcGCThreads=1", // Want to make marking as slow as possible. diff --git a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java index 0dcd882a0f7..eacc9454701 100644 --- a/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java +++ b/hotspot/test/gc/g1/TestEagerReclaimHumongousRegionsWithRefs.java @@ -94,7 +94,7 @@ public class TestEagerReclaimHumongousRegionsWithRefs { "-Xms128M", "-Xmx128M", "-Xmn16M", - "-XX:+PrintGC", + "-Xlog:gc", ReclaimRegionFast.class.getName()); Pattern p = Pattern.compile("Full GC"); diff --git a/hotspot/test/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java b/hotspot/test/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java index cd87f2cd586..6ce8613468e 100644 --- a/hotspot/test/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java +++ b/hotspot/test/gc/g1/TestG1TraceEagerReclaimHumongousObjects.java @@ -49,20 +49,18 @@ public class TestG1TraceEagerReclaimHumongousObjects { "-Xmx128M", "-Xmn16M", "-XX:G1HeapRegionSize=1M", - "-XX:+PrintGC", + "-Xlog:gc+phases=trace", "-XX:+UnlockExperimentalVMOptions", - "-XX:G1LogLevel=finest", - "-XX:+G1TraceEagerReclaimHumongousObjects", GCTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); // As G1EagerReclaimHumongousObjects is set(default), below logs should be displayed. // And GCTest doesn't have humongous objects, so values should be zero. - output.shouldContain("[Humongous Reclaim"); - output.shouldContain("[Humongous Total: 0]"); - output.shouldContain("[Humongous Candidate: 0]"); - output.shouldContain("[Humongous Reclaimed: 0]"); + output.shouldContain("Humongous Reclaim"); + output.shouldContain("Humongous Total: 0"); + output.shouldContain("Humongous Candidate: 0"); + output.shouldContain("Humongous Reclaimed: 0"); output.shouldHaveExitValue(0); } @@ -73,19 +71,17 @@ public class TestG1TraceEagerReclaimHumongousObjects { "-Xmx128M", "-Xmn16M", "-XX:G1HeapRegionSize=1M", - "-XX:+PrintGC", + "-Xlog:gc+phases=trace,gc+humongous=trace", "-XX:+UnlockExperimentalVMOptions", - "-XX:G1LogLevel=finest", - "-XX:+G1TraceEagerReclaimHumongousObjects", GCWithHumongousObjectTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); // As G1ReclaimDeadHumongousObjectsAtYoungGC is set(default), below logs should be displayed. - output.shouldContain("[Humongous Reclaim"); - output.shouldContain("[Humongous Total"); - output.shouldContain("[Humongous Candidate"); - output.shouldContain("[Humongous Reclaimed"); + output.shouldContain("Humongous Reclaim"); + output.shouldContain("Humongous Total"); + output.shouldContain("Humongous Candidate"); + output.shouldContain("Humongous Reclaimed"); // As G1TraceReclaimDeadHumongousObjectsAtYoungGC is set and GCWithHumongousObjectTest has humongous objects, // these logs should be displayed. diff --git a/hotspot/test/gc/g1/TestGCLogMessages.java b/hotspot/test/gc/g1/TestGCLogMessages.java index ec5b87d3081..8ab921b0186 100644 --- a/hotspot/test/gc/g1/TestGCLogMessages.java +++ b/hotspot/test/gc/g1/TestGCLogMessages.java @@ -24,7 +24,7 @@ /* * @test TestGCLogMessages * @bug 8035406 8027295 8035398 8019342 8027959 8048179 8027962 8069330 - * @summary Ensure that the PrintGCDetails output for a minor GC with G1 + * @summary Ensure the output for a minor GC with G1 * includes the expected necessary messages. * @key gc * @library /testlibrary @@ -38,7 +38,7 @@ import jdk.test.lib.OutputAnalyzer; public class TestGCLogMessages { private enum Level { - OFF, FINER, FINEST; + OFF, DEBUG, TRACE; public boolean lessOrEqualTo(Level other) { return this.compareTo(other) < 0; } @@ -56,36 +56,36 @@ public class TestGCLogMessages { private LogMessageWithLevel allLogMessages[] = new LogMessageWithLevel[] { // Update RS - new LogMessageWithLevel("Scan HCC (ms)", Level.FINER), + new LogMessageWithLevel("Scan HCC", Level.DEBUG), // Ext Root Scan - new LogMessageWithLevel("Thread Roots (ms)", Level.FINEST), - new LogMessageWithLevel("StringTable Roots (ms)", Level.FINEST), - new LogMessageWithLevel("Universe Roots (ms)", Level.FINEST), - new LogMessageWithLevel("JNI Handles Roots (ms)", Level.FINEST), - new LogMessageWithLevel("ObjectSynchronizer Roots (ms)", Level.FINEST), - new LogMessageWithLevel("FlatProfiler Roots", Level.FINEST), - new LogMessageWithLevel("Management Roots", Level.FINEST), - new LogMessageWithLevel("SystemDictionary Roots", Level.FINEST), - new LogMessageWithLevel("CLDG Roots", Level.FINEST), - new LogMessageWithLevel("JVMTI Roots", Level.FINEST), - new LogMessageWithLevel("SATB Filtering", Level.FINEST), - new LogMessageWithLevel("CM RefProcessor Roots", Level.FINEST), - new LogMessageWithLevel("Wait For Strong CLD", Level.FINEST), - new LogMessageWithLevel("Weak CLD Roots", Level.FINEST), + new LogMessageWithLevel("Thread Roots:", Level.DEBUG), + new LogMessageWithLevel("StringTable Roots:", Level.DEBUG), + new LogMessageWithLevel("Universe Roots:", Level.DEBUG), + new LogMessageWithLevel("JNI Handles Roots:", Level.DEBUG), + new LogMessageWithLevel("ObjectSynchronizer Roots:", Level.DEBUG), + new LogMessageWithLevel("FlatProfiler Roots", Level.DEBUG), + new LogMessageWithLevel("Management Roots", Level.DEBUG), + new LogMessageWithLevel("SystemDictionary Roots", Level.DEBUG), + new LogMessageWithLevel("CLDG Roots", Level.DEBUG), + new LogMessageWithLevel("JVMTI Roots", Level.DEBUG), + new LogMessageWithLevel("SATB Filtering", Level.DEBUG), + new LogMessageWithLevel("CM RefProcessor Roots", Level.DEBUG), + new LogMessageWithLevel("Wait For Strong CLD", Level.DEBUG), + new LogMessageWithLevel("Weak CLD Roots", Level.DEBUG), // Redirty Cards - new LogMessageWithLevel("Redirty Cards", Level.FINER), - new LogMessageWithLevel("Parallel Redirty", Level.FINEST), - new LogMessageWithLevel("Redirtied Cards", Level.FINEST), + new LogMessageWithLevel("Redirty Cards", Level.DEBUG), + new LogMessageWithLevel("Parallel Redirty", Level.DEBUG), + new LogMessageWithLevel("Redirtied Cards", Level.DEBUG), // Misc Top-level - new LogMessageWithLevel("Code Root Purge", Level.FINER), - new LogMessageWithLevel("String Dedup Fixup", Level.FINER), - new LogMessageWithLevel("Expand Heap After Collection", Level.FINER), + new LogMessageWithLevel("Code Root Purge", Level.DEBUG), + new LogMessageWithLevel("String Dedup Fixup", Level.DEBUG), + new LogMessageWithLevel("Expand Heap After Collection", Level.DEBUG), // Free CSet - new LogMessageWithLevel("Young Free CSet", Level.FINEST), - new LogMessageWithLevel("Non-Young Free CSet", Level.FINEST), + new LogMessageWithLevel("Young Free CSet", Level.TRACE), + new LogMessageWithLevel("Non-Young Free CSet", Level.TRACE), // Humongous Eager Reclaim - new LogMessageWithLevel("Humongous Reclaim", Level.FINER), - new LogMessageWithLevel("Humongous Register", Level.FINER), + new LogMessageWithLevel("Humongous Reclaim", Level.DEBUG), + new LogMessageWithLevel("Humongous Register", Level.DEBUG), }; void checkMessagesAtLevel(OutputAnalyzer output, LogMessageWithLevel messages[], Level level) throws Exception { @@ -116,53 +116,49 @@ public class TestGCLogMessages { pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", "-XX:+UseStringDeduplication", "-Xmx10M", - "-XX:+PrintGCDetails", + "-Xlog:gc+phases=debug", GCTest.class.getName()); output = new OutputAnalyzer(pb.start()); - checkMessagesAtLevel(output, allLogMessages, Level.FINER); + checkMessagesAtLevel(output, allLogMessages, Level.DEBUG); pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", "-XX:+UseStringDeduplication", "-Xmx10M", - "-XX:+PrintGCDetails", - "-XX:+UnlockExperimentalVMOptions", - "-XX:G1LogLevel=finest", + "-Xlog:gc+phases=trace", GCTest.class.getName()); output = new OutputAnalyzer(pb.start()); - checkMessagesAtLevel(output, allLogMessages, Level.FINEST); + checkMessagesAtLevel(output, allLogMessages, Level.TRACE); output.shouldHaveExitValue(0); } LogMessageWithLevel exhFailureMessages[] = new LogMessageWithLevel[] { - new LogMessageWithLevel("Evacuation Failure", Level.FINER), - new LogMessageWithLevel("Recalculate Used", Level.FINEST), - new LogMessageWithLevel("Remove Self Forwards", Level.FINEST), - new LogMessageWithLevel("Restore RemSet", Level.FINEST), + new LogMessageWithLevel("Evacuation Failure", Level.DEBUG), + new LogMessageWithLevel("Recalculate Used", Level.TRACE), + new LogMessageWithLevel("Remove Self Forwards", Level.TRACE), + new LogMessageWithLevel("Restore RemSet", Level.TRACE), }; private void testWithToSpaceExhaustionLogs() throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", "-Xmx32M", "-Xmn16M", - "-XX:+PrintGCDetails", + "-Xlog:gc+phases=debug", GCTestWithToSpaceExhaustion.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - checkMessagesAtLevel(output, exhFailureMessages, Level.FINER); + checkMessagesAtLevel(output, exhFailureMessages, Level.DEBUG); output.shouldHaveExitValue(0); pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", "-Xmx32M", "-Xmn16M", - "-XX:+PrintGCDetails", - "-XX:+UnlockExperimentalVMOptions", - "-XX:G1LogLevel=finest", + "-Xlog:gc+phases=trace", GCTestWithToSpaceExhaustion.class.getName()); output = new OutputAnalyzer(pb.start()); - checkMessagesAtLevel(output, exhFailureMessages, Level.FINEST); + checkMessagesAtLevel(output, exhFailureMessages, Level.TRACE); output.shouldHaveExitValue(0); } diff --git a/hotspot/test/gc/g1/TestHumongousAllocInitialMark.java b/hotspot/test/gc/g1/TestHumongousAllocInitialMark.java index 120c0d85ca6..ef0109679ef 100644 --- a/hotspot/test/gc/g1/TestHumongousAllocInitialMark.java +++ b/hotspot/test/gc/g1/TestHumongousAllocInitialMark.java @@ -46,11 +46,11 @@ public class TestHumongousAllocInitialMark { "-Xmx" + heapSize + "m", "-XX:G1HeapRegionSize=" + heapRegionSize + "m", "-XX:InitiatingHeapOccupancyPercent=" + initiatingHeapOccupancyPercent, - "-XX:+PrintGC", + "-Xlog:gc", HumongousObjectAllocator.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("GC pause (G1 Humongous Allocation) (young) (initial-mark)"); + output.shouldContain("Pause Initial Mark (G1 Humongous Allocation)"); output.shouldNotContain("Full GC"); output.shouldHaveExitValue(0); } diff --git a/hotspot/test/gc/g1/TestHumongousAllocNearlyFullRegion.java b/hotspot/test/gc/g1/TestHumongousAllocNearlyFullRegion.java index 2e5a470f18d..2173dbdb9f4 100644 --- a/hotspot/test/gc/g1/TestHumongousAllocNearlyFullRegion.java +++ b/hotspot/test/gc/g1/TestHumongousAllocNearlyFullRegion.java @@ -44,11 +44,11 @@ public class TestHumongousAllocNearlyFullRegion { "-Xms" + heapSize + "m", "-Xmx" + heapSize + "m", "-XX:G1HeapRegionSize=" + heapRegionSize + "m", - "-XX:+PrintGC", + "-Xlog:gc", HumongousObjectAllocator.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("GC pause (G1 Humongous Allocation) (young) (initial-mark)"); + output.shouldContain("Pause Initial Mark (G1 Humongous Allocation)"); output.shouldHaveExitValue(0); } diff --git a/hotspot/test/gc/g1/TestNoEagerReclaimOfHumongousRegions.java b/hotspot/test/gc/g1/TestNoEagerReclaimOfHumongousRegions.java index 7d505d5ae5c..5090309c7f9 100644 --- a/hotspot/test/gc/g1/TestNoEagerReclaimOfHumongousRegions.java +++ b/hotspot/test/gc/g1/TestNoEagerReclaimOfHumongousRegions.java @@ -34,7 +34,7 @@ * @build TestNoEagerReclaimOfHumongousRegions * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+PrintGC -XX:+UseG1GC -XX:MaxTenuringThreshold=0 -XX:G1RSetSparseRegionEntries=32 -XX:G1HeapRegionSize=1m -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+G1TraceEagerReclaimHumongousObjects TestNoEagerReclaimOfHumongousRegions + * @run main/othervm -Xbootclasspath/a:. -Xlog:gc,gc+humongous=debug -XX:+UseG1GC -XX:MaxTenuringThreshold=0 -XX:G1RSetSparseRegionEntries=32 -XX:G1HeapRegionSize=1m -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI TestNoEagerReclaimOfHumongousRegions */ import java.util.LinkedList; diff --git a/hotspot/test/gc/g1/TestPLABOutput.java b/hotspot/test/gc/g1/TestPLABOutput.java index 7c60731d4f1..44c99b928c2 100644 --- a/hotspot/test/gc/g1/TestPLABOutput.java +++ b/hotspot/test/gc/g1/TestPLABOutput.java @@ -54,8 +54,7 @@ public class TestPLABOutput { "-XX:+WhiteBoxAPI", "-XX:+UseG1GC", "-Xmx10M", - "-XX:+PrintGC", - "-XX:+PrintPLAB", + "-Xlog:gc+plab=debug", GCTest.class.getName() }; @@ -66,7 +65,7 @@ public class TestPLABOutput { System.out.println(output.getStdout()); - String pattern = "#0:.*allocated = (\\d+).*"; + String pattern = ".*GC\\(0\\) .*allocated = (\\d+).*"; Pattern r = Pattern.compile(pattern); Matcher m = r.matcher(output.getStdout()); diff --git a/hotspot/test/gc/g1/TestPrintGCDetails.java b/hotspot/test/gc/g1/TestPrintGCDetails.java deleted file mode 100644 index e6572b908af..00000000000 --- a/hotspot/test/gc/g1/TestPrintGCDetails.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test TestPrintGCDetails - * @bug 8010738 - * @summary Ensure that the PrintGCDetails for a full GC with G1 includes Metaspace. - * @key gc - * @key regression - * @library /testlibrary - * @modules java.base/sun.misc - * java.management - */ - -import jdk.test.lib.ProcessTools; -import jdk.test.lib.OutputAnalyzer; - -public class TestPrintGCDetails { - public static void main(String[] args) throws Exception { - - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", - "-XX:+PrintGCDetails", - SystemGCTest.class.getName()); - - OutputAnalyzer output = new OutputAnalyzer(pb.start()); - - System.out.println("Output:\n" + output.getOutput()); - - output.shouldContain("Metaspace"); - output.shouldHaveExitValue(0); - } - - static class SystemGCTest { - public static void main(String [] args) { - System.out.println("Calling System.gc()"); - System.gc(); - } - } -} diff --git a/hotspot/test/gc/g1/TestPrintRegionRememberedSetInfo.java b/hotspot/test/gc/g1/TestPrintRegionRememberedSetInfo.java index c319416514c..7d51fb6a97b 100644 --- a/hotspot/test/gc/g1/TestPrintRegionRememberedSetInfo.java +++ b/hotspot/test/gc/g1/TestPrintRegionRememberedSetInfo.java @@ -57,7 +57,6 @@ public class TestPrintRegionRememberedSetInfo { "-Xmx10m", "-XX:+ExplicitGCInvokesConcurrent", "-XX:+UnlockDiagnosticVMOptions", - "-XX:+G1PrintRegionLivenessInfo", "-XX:G1HeapRegionSize=1M", "-XX:InitiatingHeapOccupancyPercent=0", }; @@ -79,13 +78,13 @@ public class TestPrintRegionRememberedSetInfo { public static void main(String[] args) throws Exception { String result; - result = runTest("-XX:+G1PrintRegionLivenessInfo"); + result = runTest("-Xlog:gc+liveness=trace"); // check that we got region statistics output if (result.indexOf("PHASE") == -1) { throw new RuntimeException("Unexpected output from -XX:+PrintRegionLivenessInfo found."); } - result = runTest("-XX:-G1PrintRegionLivenessInfo"); + result = runTest("-Xlog:gc+liveness"); if (result.indexOf("remset") != -1) { throw new RuntimeException("Should find remembered set information in output."); } diff --git a/hotspot/test/gc/g1/TestRemsetLogging.java b/hotspot/test/gc/g1/TestRemsetLogging.java new file mode 100644 index 00000000000..a03b8b9c45d --- /dev/null +++ b/hotspot/test/gc/g1/TestRemsetLogging.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test TestRemsetLogging.java + * @bug 8013895 8129977 + * @library /testlibrary + * @modules java.base/sun.misc + * java.management/sun.management + * @build TestRemsetLoggingTools TestRemsetLogging + * @summary Verify output of -Xlog:gc+remset*=trace + * @run main TestRemsetLogging + * + * Test the output of -Xlog:gc+remset*=trace in conjunction with G1SummarizeRSetStatsPeriod. + */ + +public class TestRemsetLogging { + + public static void main(String[] args) throws Exception { + String result; + + if (!TestRemsetLoggingTools.testingG1GC()) { + return; + } + + // no remembered set summary output + result = TestRemsetLoggingTools.runTest(null, 0); + TestRemsetLoggingTools.expectRSetSummaries(result, 0, 0); + + // no remembered set summary output + result = TestRemsetLoggingTools.runTest(null, 2); + TestRemsetLoggingTools.expectRSetSummaries(result, 0, 0); + + // no remembered set summary output + result = TestRemsetLoggingTools.runTest(new String[] { "-XX:G1SummarizeRSetStatsPeriod=1" }, 3); + TestRemsetLoggingTools.expectRSetSummaries(result, 0, 0); + + // single remembered set summary output at the end + result = TestRemsetLoggingTools.runTest(new String[] { "-Xlog:gc+remset*=trace" }, 0); + TestRemsetLoggingTools.expectRSetSummaries(result, 1, 0); + + // single remembered set summary output at the end + result = TestRemsetLoggingTools.runTest(new String[] { "-Xlog:gc+remset*=trace" }, 2); + TestRemsetLoggingTools.expectRSetSummaries(result, 1, 0); + + // single remembered set summary output + result = TestRemsetLoggingTools.runTest(new String[] { "-Xlog:gc+remset*=trace", "-XX:G1SummarizeRSetStatsPeriod=1" }, 0); + TestRemsetLoggingTools.expectRSetSummaries(result, 1, 0); + + // two times remembered set summary output + result = TestRemsetLoggingTools.runTest(new String[] { "-Xlog:gc+remset*=trace", "-XX:G1SummarizeRSetStatsPeriod=1" }, 1); + TestRemsetLoggingTools.expectRSetSummaries(result, 1, 2); + + // four times remembered set summary output + result = TestRemsetLoggingTools.runTest(new String[] { "-Xlog:gc+remset*=trace", "-XX:G1SummarizeRSetStatsPeriod=1" }, 3); + TestRemsetLoggingTools.expectRSetSummaries(result, 1, 6); + + // three times remembered set summary output + result = TestRemsetLoggingTools.runTest(new String[] { "-Xlog:gc+remset*=trace", "-XX:G1SummarizeRSetStatsPeriod=2" }, 3); + TestRemsetLoggingTools.expectRSetSummaries(result, 1, 4); + + // single remembered set summary output + result = TestRemsetLoggingTools.runTest(new String[] { "-Xlog:gc+remset*=trace", "-XX:G1SummarizeRSetStatsPeriod=100" }, 3); + TestRemsetLoggingTools.expectRSetSummaries(result, 1, 2); + } +} + diff --git a/hotspot/test/gc/g1/TestSummarizeRSetStatsPerRegion.java b/hotspot/test/gc/g1/TestRemsetLoggingPerRegion.java similarity index 66% rename from hotspot/test/gc/g1/TestSummarizeRSetStatsPerRegion.java rename to hotspot/test/gc/g1/TestRemsetLoggingPerRegion.java index 78ec6544d07..e61c181f5f7 100644 --- a/hotspot/test/gc/g1/TestSummarizeRSetStatsPerRegion.java +++ b/hotspot/test/gc/g1/TestRemsetLoggingPerRegion.java @@ -22,14 +22,14 @@ */ /* - * @test TestSummarizeRSetStatsPerRegion.java + * @test TestRemsetLoggingPerRegion.java * @bug 8014078 8129977 * @library /testlibrary * @modules java.base/sun.misc * java.management/sun.management - * @build TestSummarizeRSetStatsTools TestSummarizeRSetStatsPerRegion - * @summary Verify output of -XX:+G1SummarizeRSetStats in regards to per-region type output - * @run main TestSummarizeRSetStatsPerRegion + * @build TestRemsetLoggingTools TestRemsetLoggingPerRegion + * @summary Verify output of -Xlog:gc+remset*=trace in regards to per-region type output + * @run main TestRemsetLoggingPerRegion */ import jdk.test.lib.*; @@ -37,21 +37,21 @@ import java.lang.Thread; import java.util.ArrayList; import java.util.Arrays; -public class TestSummarizeRSetStatsPerRegion { +public class TestRemsetLoggingPerRegion { public static void main(String[] args) throws Exception { String result; - if (!TestSummarizeRSetStatsTools.testingG1GC()) { + if (!TestRemsetLoggingTools.testingG1GC()) { return; } // single remembered set summary output at the end - result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats" }, 0); - TestSummarizeRSetStatsTools.expectPerRegionRSetSummaries(result, 1, 0); + result = TestRemsetLoggingTools.runTest(new String[] { "-Xlog:gc+remset*=trace" }, 0); + TestRemsetLoggingTools.expectPerRegionRSetSummaries(result, 1, 0); // two times remembered set summary output - result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=1" }, 1); - TestSummarizeRSetStatsTools.expectPerRegionRSetSummaries(result, 1, 2); + result = TestRemsetLoggingTools.runTest(new String[] { "-Xlog:gc+remset*=trace", "-XX:G1SummarizeRSetStatsPeriod=1" }, 1); + TestRemsetLoggingTools.expectPerRegionRSetSummaries(result, 1, 2); } } diff --git a/hotspot/test/gc/g1/TestSummarizeRSetStatsThreads.java b/hotspot/test/gc/g1/TestRemsetLoggingThreads.java similarity index 83% rename from hotspot/test/gc/g1/TestSummarizeRSetStatsThreads.java rename to hotspot/test/gc/g1/TestRemsetLoggingThreads.java index 0743d66e404..12362a472e2 100644 --- a/hotspot/test/gc/g1/TestSummarizeRSetStatsThreads.java +++ b/hotspot/test/gc/g1/TestRemsetLoggingThreads.java @@ -22,7 +22,7 @@ */ /* - * @test TestSummarizeRSetStatsThreads + * @test TestRemsetLoggingThreads * @bug 8025441 * @summary Ensure that various values of worker threads/concurrent * refinement threads do not crash the VM. @@ -38,29 +38,23 @@ import java.util.regex.Pattern; import jdk.test.lib.ProcessTools; import jdk.test.lib.OutputAnalyzer; -public class TestSummarizeRSetStatsThreads { +public class TestRemsetLoggingThreads { private static void runTest(int refinementThreads, int workerThreads) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", "-XX:+UnlockDiagnosticVMOptions", - "-XX:+G1SummarizeRSetStats", + "-Xlog:gc+remset+exit=trace", "-XX:G1ConcRefinementThreads=" + refinementThreads, "-XX:ParallelGCThreads=" + workerThreads, "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - // check output to contain the string "Concurrent RS threads times (s)" followed by - // the correct number of values in the next line. - // a zero in refinement thread numbers indicates that the value in ParallelGCThreads should be used. // Additionally use at least one thread. int expectedNumRefinementThreads = refinementThreads; - // create the pattern made up of n copies of a floating point number pattern - String numberPattern = String.format("%0" + expectedNumRefinementThreads + "d", 0) - .replace("0", "\\s+\\d+\\.\\d+"); - String pattern = "Concurrent RS threads times \\(s\\)$" + numberPattern + "$"; + String pattern = "Concurrent RS threads times \\(s\\)$"; Matcher m = Pattern.compile(pattern, Pattern.MULTILINE).matcher(output.getStdout()); if (!m.find()) { @@ -71,7 +65,7 @@ public class TestSummarizeRSetStatsThreads { } public static void main(String[] args) throws Exception { - if (!TestSummarizeRSetStatsTools.testingG1GC()) { + if (!TestRemsetLoggingTools.testingG1GC()) { return; } // different valid combinations of number of refinement and gc worker threads diff --git a/hotspot/test/gc/g1/TestSummarizeRSetStatsTools.java b/hotspot/test/gc/g1/TestRemsetLoggingTools.java similarity index 97% rename from hotspot/test/gc/g1/TestSummarizeRSetStatsTools.java rename to hotspot/test/gc/g1/TestRemsetLoggingTools.java index 648a5cd08f0..24ba4048ff5 100644 --- a/hotspot/test/gc/g1/TestSummarizeRSetStatsTools.java +++ b/hotspot/test/gc/g1/TestRemsetLoggingTools.java @@ -22,7 +22,7 @@ */ /* - * Common helpers for TestSummarizeRSetStats* tests + * Common helpers for TestRemsetLogging* tests */ import com.sun.management.HotSpotDiagnosticMXBean; @@ -67,7 +67,7 @@ class VerifySummaryOutput { } } -public class TestSummarizeRSetStatsTools { +public class TestRemsetLoggingTools { // the VM is currently run using G1GC, i.e. trying to test G1 functionality. public static boolean testingG1GC() { @@ -90,7 +90,6 @@ public class TestSummarizeRSetStatsTools { "-Xms20m", "-Xmx20m", "-XX:InitiatingHeapOccupancyPercent=100", // we don't want the additional GCs due to initial marking - "-XX:+PrintGC", "-XX:+UnlockDiagnosticVMOptions", "-XX:G1HeapRegionSize=1M", }; diff --git a/hotspot/test/gc/g1/TestShrinkAuxiliaryData.java b/hotspot/test/gc/g1/TestShrinkAuxiliaryData.java index 069ee189da1..65247c6edf4 100644 --- a/hotspot/test/gc/g1/TestShrinkAuxiliaryData.java +++ b/hotspot/test/gc/g1/TestShrinkAuxiliaryData.java @@ -49,7 +49,7 @@ public class TestShrinkAuxiliaryData { "-XX:+UseG1GC", "-XX:G1HeapRegionSize=" + REGION_SIZE, "-XX:-ExplicitGCInvokesConcurrent", - "-XX:+PrintGCDetails", + "-Xlog:gc=debug", "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", "-Xbootclasspath/a:.", diff --git a/hotspot/test/gc/g1/TestStringDeduplicationTools.java b/hotspot/test/gc/g1/TestStringDeduplicationTools.java index 583b7545b20..3e725f78132 100644 --- a/hotspot/test/gc/g1/TestStringDeduplicationTools.java +++ b/hotspot/test/gc/g1/TestStringDeduplicationTools.java @@ -304,10 +304,8 @@ class TestStringDeduplicationTools { } public static OutputAnalyzer run() throws Exception { - return runTest("-XX:+PrintGC", - "-XX:+PrintGCDetails", + return runTest("-Xlog:gc=debug,gc+stringdedup=trace", "-XX:+UseStringDeduplication", - "-XX:+PrintStringDeduplicationStatistics", "-XX:StringDeduplicationAgeThreshold=" + DefaultAgeThreshold, InternedTest.class.getName(), "" + DefaultAgeThreshold); @@ -333,11 +331,10 @@ class TestStringDeduplicationTools { OutputAnalyzer output = DeduplicationTest.run(LargeNumberOfStrings, DefaultAgeThreshold, YoungGC, - "-XX:+PrintGC", - "-XX:+PrintStringDeduplicationStatistics"); + "-Xlog:gc,gc+stringdedup=trace"); output.shouldNotContain("Full GC"); - output.shouldContain("GC pause (G1 Evacuation Pause) (young)"); - output.shouldContain("GC concurrent-string-deduplication"); + output.shouldContain("Pause Young (G1 Evacuation Pause)"); + output.shouldContain("Concurrent String Deduplication"); output.shouldContain("Deduplicated:"); output.shouldHaveExitValue(0); } @@ -347,11 +344,10 @@ class TestStringDeduplicationTools { OutputAnalyzer output = DeduplicationTest.run(LargeNumberOfStrings, DefaultAgeThreshold, FullGC, - "-XX:+PrintGC", - "-XX:+PrintStringDeduplicationStatistics"); - output.shouldNotContain("GC pause (G1 Evacuation Pause) (young)"); + "-Xlog:gc,gc+stringdedup=trace"); + output.shouldNotContain("Pause Young (G1 Evacuation Pause)"); output.shouldContain("Full GC"); - output.shouldContain("GC concurrent-string-deduplication"); + output.shouldContain("Concurrent String Deduplication"); output.shouldContain("Deduplicated:"); output.shouldHaveExitValue(0); } @@ -361,10 +357,9 @@ class TestStringDeduplicationTools { OutputAnalyzer output = DeduplicationTest.run(LargeNumberOfStrings, DefaultAgeThreshold, YoungGC, - "-XX:+PrintGC", - "-XX:+PrintStringDeduplicationStatistics", + "-Xlog:gc,gc+stringdedup=trace", "-XX:+StringDeduplicationResizeALot"); - output.shouldContain("GC concurrent-string-deduplication"); + output.shouldContain("Concurrent String Deduplication"); output.shouldContain("Deduplicated:"); output.shouldNotContain("Resize Count: 0"); output.shouldHaveExitValue(0); @@ -375,10 +370,9 @@ class TestStringDeduplicationTools { OutputAnalyzer output = DeduplicationTest.run(LargeNumberOfStrings, DefaultAgeThreshold, YoungGC, - "-XX:+PrintGC", - "-XX:+PrintStringDeduplicationStatistics", + "-Xlog:gc,gc+stringdedup=trace", "-XX:+StringDeduplicationRehashALot"); - output.shouldContain("GC concurrent-string-deduplication"); + output.shouldContain("Concurrent String Deduplication"); output.shouldContain("Deduplicated:"); output.shouldNotContain("Rehash Count: 0"); output.shouldNotContain("Hash Seed: 0x0"); @@ -392,9 +386,8 @@ class TestStringDeduplicationTools { output = DeduplicationTest.run(SmallNumberOfStrings, MaxAgeThreshold, YoungGC, - "-XX:+PrintGC", - "-XX:+PrintStringDeduplicationStatistics"); - output.shouldContain("GC concurrent-string-deduplication"); + "-Xlog:gc,gc+stringdedup=trace"); + output.shouldContain("Concurrent String Deduplication"); output.shouldContain("Deduplicated:"); output.shouldHaveExitValue(0); @@ -402,9 +395,8 @@ class TestStringDeduplicationTools { output = DeduplicationTest.run(SmallNumberOfStrings, MinAgeThreshold, YoungGC, - "-XX:+PrintGC", - "-XX:+PrintStringDeduplicationStatistics"); - output.shouldContain("GC concurrent-string-deduplication"); + "-Xlog:gc,gc+stringdedup=trace"); + output.shouldContain("Concurrent String Deduplication"); output.shouldContain("Deduplicated:"); output.shouldHaveExitValue(0); @@ -426,20 +418,20 @@ class TestStringDeduplicationTools { public static void testPrintOptions() throws Exception { OutputAnalyzer output; - // Test without PrintGC and without PrintStringDeduplicationStatistics + // Test without -Xlog:gc output = DeduplicationTest.run(SmallNumberOfStrings, DefaultAgeThreshold, YoungGC); - output.shouldNotContain("GC concurrent-string-deduplication"); + output.shouldNotContain("Concurrent String Deduplication"); output.shouldNotContain("Deduplicated:"); output.shouldHaveExitValue(0); - // Test with PrintGC but without PrintStringDeduplicationStatistics + // Test with -Xlog:gc+stringdedup output = DeduplicationTest.run(SmallNumberOfStrings, DefaultAgeThreshold, YoungGC, - "-XX:+PrintGC"); - output.shouldContain("GC concurrent-string-deduplication"); + "-Xlog:gc+stringdedup"); + output.shouldContain("Concurrent String Deduplication"); output.shouldNotContain("Deduplicated:"); output.shouldHaveExitValue(0); } diff --git a/hotspot/test/gc/g1/TestStringSymbolTableStats.java b/hotspot/test/gc/g1/TestStringSymbolTableStats.java index aeef3f742cb..f50bcf3e73f 100644 --- a/hotspot/test/gc/g1/TestStringSymbolTableStats.java +++ b/hotspot/test/gc/g1/TestStringSymbolTableStats.java @@ -39,7 +39,7 @@ public class TestStringSymbolTableStats { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", "-XX:+UnlockExperimentalVMOptions", - "-XX:+G1TraceStringSymbolTableScrubbing", + "-Xlog:gc+stringdedup=trace", SystemGCTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/hotspot/test/gc/g1/TestSummarizeRSetStats.java b/hotspot/test/gc/g1/TestSummarizeRSetStats.java deleted file mode 100644 index 577c48c99cd..00000000000 --- a/hotspot/test/gc/g1/TestSummarizeRSetStats.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test TestSummarizeRSetStats.java - * @bug 8013895 8129977 - * @library /testlibrary - * @modules java.base/sun.misc - * java.management/sun.management - * @build TestSummarizeRSetStatsTools TestSummarizeRSetStats - * @summary Verify output of -XX:+G1SummarizeRSetStats - * @run main TestSummarizeRSetStats - * - * Test the output of G1SummarizeRSetStats in conjunction with G1SummarizeRSetStatsPeriod. - */ - -public class TestSummarizeRSetStats { - - public static void main(String[] args) throws Exception { - String result; - - if (!TestSummarizeRSetStatsTools.testingG1GC()) { - return; - } - - // no remembered set summary output - result = TestSummarizeRSetStatsTools.runTest(null, 0); - TestSummarizeRSetStatsTools.expectRSetSummaries(result, 0, 0); - - // no remembered set summary output - result = TestSummarizeRSetStatsTools.runTest(null, 2); - TestSummarizeRSetStatsTools.expectRSetSummaries(result, 0, 0); - - // no remembered set summary output - result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:G1SummarizeRSetStatsPeriod=1" }, 3); - TestSummarizeRSetStatsTools.expectRSetSummaries(result, 0, 0); - - // single remembered set summary output at the end - result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats" }, 0); - TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 0); - - // single remembered set summary output at the end - result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats" }, 2); - TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 0); - - // single remembered set summary output - result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=1" }, 0); - TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 0); - - // two times remembered set summary output - result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=1" }, 1); - TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 2); - - // four times remembered set summary output - result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=1" }, 3); - TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 6); - - // three times remembered set summary output - result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=2" }, 3); - TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 4); - - // single remembered set summary output - result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=100" }, 3); - TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 2); - } -} - diff --git a/hotspot/test/gc/g1/mixedgc/TestLogging.java b/hotspot/test/gc/g1/mixedgc/TestLogging.java index 7e1ce49e642..913097d50ae 100644 --- a/hotspot/test/gc/g1/mixedgc/TestLogging.java +++ b/hotspot/test/gc/g1/mixedgc/TestLogging.java @@ -68,10 +68,10 @@ public class TestLogging { public static final int ALLOCATION_COUNT = 15; public static void main(String args[]) throws Exception { - // Test turns logging on by giving -XX:+PrintGC flag - test("-XX:+PrintGC"); - // Test turns logging on by giving -XX:+PrintGCDetails - test("-XX:+PrintGCDetails"); + // Test turns logging on by giving -Xlog:gc flag + test("-Xlog:gc"); + // Test turns logging on by giving -Xlog:gc=debug flag + test("-Xlog:gc=debug"); } private static void test(String vmFlag) throws Exception { @@ -79,7 +79,7 @@ public class TestLogging { OutputAnalyzer output = spawnMixedGCProvoker(vmFlag); System.out.println(output.getStdout()); output.shouldHaveExitValue(0); - output.shouldContain("GC pause (G1 Evacuation Pause) (mixed)"); + output.shouldContain("Pause Mixed (G1 Evacuation Pause)"); } /** diff --git a/hotspot/test/gc/logging/TestGCId.java b/hotspot/test/gc/logging/TestGCId.java index 976ab8ab958..5204d914f20 100644 --- a/hotspot/test/gc/logging/TestGCId.java +++ b/hotspot/test/gc/logging/TestGCId.java @@ -36,44 +36,21 @@ import jdk.test.lib.OutputAnalyzer; public class TestGCId { public static void main(String[] args) throws Exception { - testGCId("UseParallelGC", "PrintGC"); - testGCId("UseParallelGC", "PrintGCDetails"); - - testGCId("UseG1GC", "PrintGC"); - testGCId("UseG1GC", "PrintGCDetails"); - - testGCId("UseConcMarkSweepGC", "PrintGC"); - testGCId("UseConcMarkSweepGC", "PrintGCDetails"); - - testGCId("UseSerialGC", "PrintGC"); - testGCId("UseSerialGC", "PrintGCDetails"); + testGCId("UseParallelGC"); + testGCId("UseG1GC"); + testGCId("UseConcMarkSweepGC"); + testGCId("UseSerialGC"); } private static void verifyContainsGCIDs(OutputAnalyzer output) { - output.shouldMatch("^#0: \\["); - output.shouldMatch("^#1: \\["); + output.shouldMatch("\\[.*\\]\\[.*\\]\\[.*\\] GC\\(0\\) "); + output.shouldMatch("\\[.*\\]\\[.*\\]\\[.*\\] GC\\(1\\) "); output.shouldHaveExitValue(0); } - private static void verifyContainsNoGCIDs(OutputAnalyzer output) { - output.shouldNotMatch("^#[0-9]+: \\["); - output.shouldHaveExitValue(0); - } - - private static void testGCId(String gcFlag, String logFlag) throws Exception { - // GCID logging enabled - ProcessBuilder pb_enabled = - ProcessTools.createJavaProcessBuilder("-XX:+" + gcFlag, "-XX:+" + logFlag, "-Xmx10M", "-XX:+PrintGCID", GCTest.class.getName()); - verifyContainsGCIDs(new OutputAnalyzer(pb_enabled.start())); - - // GCID logging disabled - ProcessBuilder pb_disabled = - ProcessTools.createJavaProcessBuilder("-XX:+" + gcFlag, "-XX:+" + logFlag, "-Xmx10M", "-XX:-PrintGCID", GCTest.class.getName()); - verifyContainsNoGCIDs(new OutputAnalyzer(pb_disabled.start())); - - // GCID logging default + private static void testGCId(String gcFlag) throws Exception { ProcessBuilder pb_default = - ProcessTools.createJavaProcessBuilder("-XX:+" + gcFlag, "-XX:+" + logFlag, "-Xmx10M", GCTest.class.getName()); + ProcessTools.createJavaProcessBuilder("-XX:+" + gcFlag, "-Xlog:gc", "-Xmx10M", GCTest.class.getName()); verifyContainsGCIDs(new OutputAnalyzer(pb_default.start())); } diff --git a/hotspot/test/gc/logging/TestPrintReferences.java b/hotspot/test/gc/logging/TestPrintReferences.java index 65485708f3f..b8b94cd04be 100644 --- a/hotspot/test/gc/logging/TestPrintReferences.java +++ b/hotspot/test/gc/logging/TestPrintReferences.java @@ -37,18 +37,18 @@ import jdk.test.lib.OutputAnalyzer; public class TestPrintReferences { public static void main(String[] args) throws Exception { ProcessBuilder pb_enabled = - ProcessTools.createJavaProcessBuilder("-XX:+PrintGCDetails", "-XX:+PrintReferenceGC", "-Xmx10M", GCTest.class.getName()); + ProcessTools.createJavaProcessBuilder("-Xlog:gc+ref=debug", "-Xmx10M", GCTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb_enabled.start()); String countRegex = "[0-9]+ refs"; - String timeRegex = "[0-9]+[.,][0-9]+ secs"; + String timeRegex = "\\([0-9]+[.,][0-9]+s, [0-9]+[.,][0-9]+s\\) [0-9]+[.,][0-9]+ms"; - output.shouldMatch( - "#[0-9]+: \\[SoftReference, " + countRegex + ", " + timeRegex + "\\]" + - "#[0-9]+: \\[WeakReference, " + countRegex + ", " + timeRegex + "\\]" + - "#[0-9]+: \\[FinalReference, " + countRegex + ", " + timeRegex + "\\]" + - "#[0-9]+: \\[PhantomReference, " + countRegex + ", " + timeRegex + "\\]" + - "#[0-9]+: \\[JNI Weak Reference, (" + countRegex + ", )?" + timeRegex + "\\]"); + output.shouldMatch(".* GC\\([0-9]+\\) SoftReference " + timeRegex + "\n" + + ".* GC\\([0-9]+\\) WeakReference " + timeRegex + "\n" + + ".* GC\\([0-9]+\\) FinalReference " + timeRegex + "\n" + + ".* GC\\([0-9]+\\) PhantomReference " + timeRegex + "\n" + + ".* GC\\([0-9]+\\) JNI Weak Reference " + timeRegex + "\n" + + ".* GC\\([0-9]+\\) Ref Counts: Soft: [0-9]+ Weak: [0-9]+ Final: [0-9]+ Phantom: [0-9]+\n"); output.shouldHaveExitValue(0); } diff --git a/hotspot/test/gc/serial/HeapChangeLogging.java b/hotspot/test/gc/serial/HeapChangeLogging.java index ff4555c23ba..27823a320ec 100644 --- a/hotspot/test/gc/serial/HeapChangeLogging.java +++ b/hotspot/test/gc/serial/HeapChangeLogging.java @@ -39,11 +39,11 @@ import jdk.test.lib.*; public class HeapChangeLogging { public static void main(String[] args) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xmx128m", "-Xmn100m", "-XX:+UseSerialGC", "-XX:+PrintGC", "HeapFiller"); + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xmx128m", "-Xmn100m", "-XX:+UseSerialGC", "-Xlog:gc", "HeapFiller"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); String stdout = output.getStdout(); System.out.println(stdout); - Matcher stdoutMatcher = Pattern.compile("\\[GC .Allocation Failure.*K->.*K\\(.*K\\), .* secs\\]", Pattern.MULTILINE).matcher(stdout); + Matcher stdoutMatcher = Pattern.compile(".*\\(Allocation Failure\\) [0-9]+[KMG]->[0-9]+[KMG]\\([0-9]+[KMG]\\)", Pattern.MULTILINE).matcher(stdout); if (!stdoutMatcher.find()) { throw new RuntimeException("No proper GC log line found"); } diff --git a/hotspot/test/gc/whitebox/TestWBGC.java b/hotspot/test/gc/whitebox/TestWBGC.java index 707edbd8386..509456a2860 100644 --- a/hotspot/test/gc/whitebox/TestWBGC.java +++ b/hotspot/test/gc/whitebox/TestWBGC.java @@ -44,7 +44,7 @@ public class TestWBGC { "-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI", "-XX:MaxTenuringThreshold=1", - "-XX:+PrintGC", + "-Xlog:gc", GCYoungTest.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); diff --git a/hotspot/test/runtime/7158988/FieldMonitor.java b/hotspot/test/runtime/7158988/FieldMonitor.java index 231884ece03..42b82768530 100644 --- a/hotspot/test/runtime/7158988/FieldMonitor.java +++ b/hotspot/test/runtime/7158988/FieldMonitor.java @@ -63,7 +63,7 @@ public class FieldMonitor { public static final String CLASS_NAME = "TestPostFieldModification"; public static final String FIELD_NAME = "value"; - public static final String ARGUMENTS = "-Xshare:off -XX:+PrintGC"; + public static final String ARGUMENTS = "-Xshare:off -Xlog:gc"; public static void main(String[] args) throws IOException, InterruptedException { diff --git a/hotspot/test/runtime/CommandLine/PrintGCApplicationConcurrentTime.java b/hotspot/test/runtime/CommandLine/PrintGCApplicationConcurrentTime.java index e6cf34962a4..2e68f07140f 100644 --- a/hotspot/test/runtime/CommandLine/PrintGCApplicationConcurrentTime.java +++ b/hotspot/test/runtime/CommandLine/PrintGCApplicationConcurrentTime.java @@ -24,7 +24,7 @@ /* * @test * @bug 8026041 - * @run main/othervm -XX:+PrintGCApplicationConcurrentTime -Xcomp PrintGCApplicationConcurrentTime + * @run main/othervm -Xlog:safepoint -Xcomp PrintGCApplicationConcurrentTime */ public class PrintGCApplicationConcurrentTime { diff --git a/hotspot/test/runtime/CommandLine/TestVMOptions.java b/hotspot/test/runtime/CommandLine/TestVMOptions.java index 36bfd5d5f9f..a725fa7704d 100644 --- a/hotspot/test/runtime/CommandLine/TestVMOptions.java +++ b/hotspot/test/runtime/CommandLine/TestVMOptions.java @@ -41,7 +41,7 @@ public class TestVMOptions { "-XX:+IgnoreUnrecognizedVMOptions", "-XX:+PrintFlagsInitial"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("bool PrintGCDetails"); + output.shouldContain("bool UseSerialGC"); pb = ProcessTools.createJavaProcessBuilder( "-XX:-PrintVMOptions", "-version"); diff --git a/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java b/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java index 12afc40c37d..54616e4b176 100644 --- a/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java +++ b/hotspot/test/runtime/CompressedOops/CompressedClassPointers.java @@ -39,7 +39,7 @@ public class CompressedClassPointers { "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedBaseAddress=8g", "-Xmx128m", - "-XX:+PrintCompressedOopsMode", + "-Xlog:gc+metaspace=trace", "-XX:+VerifyBeforeGC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Narrow klass base: 0x0000000000000000"); @@ -51,7 +51,7 @@ public class CompressedClassPointers { "-XX:+UnlockDiagnosticVMOptions", "-XX:CompressedClassSpaceSize=3g", "-Xmx128m", - "-XX:+PrintCompressedOopsMode", + "-Xlog:gc+metaspace=trace", "-XX:+VerifyBeforeGC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Narrow klass base: 0x0000000000000000, Narrow klass shift: 3"); @@ -62,7 +62,7 @@ public class CompressedClassPointers { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( "-XX:+UnlockDiagnosticVMOptions", "-Xmx30g", - "-XX:+PrintCompressedOopsMode", + "-Xlog:gc+metaspace=trace", "-XX:+VerifyBeforeGC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldNotContain("Narrow klass base: 0x0000000000000000"); @@ -75,7 +75,7 @@ public class CompressedClassPointers { "-XX:+UnlockDiagnosticVMOptions", "-Xmx128m", "-XX:+UseLargePages", - "-XX:+PrintCompressedOopsMode", + "-Xlog:gc+metaspace=trace", "-XX:+VerifyBeforeGC", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Narrow klass base:"); diff --git a/hotspot/test/runtime/CompressedOops/CompressedClassSpaceSize.java b/hotspot/test/runtime/CompressedOops/CompressedClassSpaceSize.java index bf7eed4fc95..5192c3b4c99 100644 --- a/hotspot/test/runtime/CompressedOops/CompressedClassSpaceSize.java +++ b/hotspot/test/runtime/CompressedOops/CompressedClassSpaceSize.java @@ -64,7 +64,7 @@ public class CompressedClassSpaceSize { // Make sure the minimum size is set correctly and printed pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:CompressedClassSpaceSize=1m", - "-XX:+PrintCompressedOopsMode", + "-Xlog:gc+metaspace=trace", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Compressed class space size: 1048576") @@ -74,7 +74,7 @@ public class CompressedClassSpaceSize { // Make sure the maximum size is set correctly and printed pb = ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:CompressedClassSpaceSize=3g", - "-XX:+PrintCompressedOopsMode", + "-Xlog:gc+metaspace=trace", "-version"); output = new OutputAnalyzer(pb.start()); output.shouldContain("Compressed class space size: 3221225472") diff --git a/hotspot/test/serviceability/dcmd/gc/RunGCTest.java b/hotspot/test/serviceability/dcmd/gc/RunGCTest.java index 8746f7f26d6..acb1f9c57d4 100644 --- a/hotspot/test/serviceability/dcmd/gc/RunGCTest.java +++ b/hotspot/test/serviceability/dcmd/gc/RunGCTest.java @@ -43,7 +43,7 @@ import jdk.test.lib.dcmd.JMXExecutor; * jdk.jvmstat/sun.jvmstat.monitor * @build jdk.test.lib.* * @build jdk.test.lib.dcmd.* - * @run testng/othervm -XX:+PrintGCDetails -Xloggc:RunGC.gclog -XX:-ExplicitGCInvokesConcurrent RunGCTest + * @run testng/othervm -Xlog:gc=debug:RunGC.gclog -XX:-ExplicitGCInvokesConcurrent RunGCTest */ public class RunGCTest { public void run(CommandExecutor executor) { @@ -59,7 +59,7 @@ public class RunGCTest { } OutputAnalyzer output = new OutputAnalyzer(gcLog, ""); - output.shouldContain("[Full GC (Diagnostic Command)"); + output.shouldContain("Pause Full (Diagnostic Command)"); } @Test diff --git a/hotspot/test/serviceability/dcmd/vm/FlagsTest.java b/hotspot/test/serviceability/dcmd/vm/FlagsTest.java index cd4c021854f..69d2771f2eb 100644 --- a/hotspot/test/serviceability/dcmd/vm/FlagsTest.java +++ b/hotspot/test/serviceability/dcmd/vm/FlagsTest.java @@ -36,14 +36,13 @@ import org.testng.annotations.Test; * jdk.jvmstat/sun.jvmstat.monitor * @build jdk.test.lib.* * @build jdk.test.lib.dcmd.* - * @run testng/othervm -Xmx129m -XX:+PrintGC -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions -XX:+ThereShouldNotBeAnyVMOptionNamedLikeThis_Right -XX:-TieredCompilation FlagsTest + * @run testng/othervm -Xmx129m -XX:+UnlockDiagnosticVMOptions -XX:+IgnoreUnrecognizedVMOptions -XX:+ThereShouldNotBeAnyVMOptionNamedLikeThis_Right -XX:-TieredCompilation FlagsTest */ public class FlagsTest { public void run(CommandExecutor executor) { OutputAnalyzer output = executor.execute("VM.flags"); /* The following are interpreted by the JVM as actual "flags" */ - output.shouldContain("-XX:+PrintGC"); output.shouldContain("-XX:+UnlockDiagnosticVMOptions"); output.shouldContain("-XX:+IgnoreUnrecognizedVMOptions"); output.shouldContain("-XX:-TieredCompilation"); diff --git a/hotspot/test/gc/6941923/Test6941923.java b/hotspot/test/serviceability/logging/TestLogRotation.java similarity index 89% rename from hotspot/test/gc/6941923/Test6941923.java rename to hotspot/test/serviceability/logging/TestLogRotation.java index 86f2456f391..cd056dec1fe 100644 --- a/hotspot/test/gc/6941923/Test6941923.java +++ b/hotspot/test/serviceability/logging/TestLogRotation.java @@ -22,13 +22,12 @@ */ /* - * @test Test6941923.java - * @bug 6941923 - * @summary test flags for gc log rotation + * @test TestLogRotation.java + * @summary test flags for log rotation * @library /testlibrary * @modules java.base/sun.misc * java.management - * @run main/othervm/timeout=600 Test6941923 + * @run main/othervm/timeout=600 TestLogRotation * */ import jdk.test.lib.*; @@ -51,7 +50,7 @@ class GCLoggingGenerator { } } -public class Test6941923 { +public class TestLogRotation { static final File currentDirectory = new File("."); static final String logFileName = "test.log"; @@ -76,11 +75,9 @@ public class Test6941923 { ArrayList args = new ArrayList(); String[] logOpts = new String[]{ "-cp", System.getProperty("java.class.path"), - "-Xloggc:" + logFileName, - "-XX:-DisableExplicitGC", // to sure that System.gc() works - "-XX:+PrintGC", "-XX:+PrintGCDetails", "-XX:+UseGCLogFileRotation", - "-XX:NumberOfGCLogFiles=" + numberOfFiles, - "-XX:GCLogFileSize=" + logFileSizeK + "K", "-Xmx128M"}; + "-Xlog:gc=debug:" + logFileName + "::filesize=" + logFileSizeK + ",filecount=" + numberOfFiles, + "-XX:-DisableExplicitGC", // to ensure that System.gc() works + "-Xmx128M"}; // System.getProperty("test.java.opts") is '' if no options is set // need to skip such empty String[] externalVMopts = System.getProperty("test.java.opts").length() == 0 From 97e8a96fe1488c0f6ae5e2a756dc8d593a42e13a Mon Sep 17 00:00:00 2001 From: Stefan Johansson Date: Fri, 11 Dec 2015 09:08:08 +0100 Subject: [PATCH 065/146] 8144486: Change G1UpdateRSOrPushRefOopClosure to inherit OopClosure Reviewed-by: mgerdin, stefank --- hotspot/src/share/vm/gc/g1/g1OopClosures.hpp | 10 ++++------ hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp | 2 +- .../src/share/vm/gc/g1/g1_specialized_oop_closures.hpp | 4 +--- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp b/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp index 3ba370e7882..c995b9c5d0b 100644 --- a/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp +++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp @@ -242,7 +242,7 @@ public: virtual void do_oop(narrowOop* p) { do_oop_nv(p); } }; -class G1UpdateRSOrPushRefOopClosure: public ExtendedOopClosure { +class G1UpdateRSOrPushRefOopClosure: public OopClosure { G1CollectedHeap* _g1; G1RemSet* _g1_rem_set; HeapRegion* _from; @@ -268,11 +268,9 @@ public: return result; } - bool apply_to_weak_ref_discovered_field() { return true; } - - template void do_oop_nv(T* p); - virtual void do_oop(narrowOop* p) { do_oop_nv(p); } - virtual void do_oop(oop* p) { do_oop_nv(p); } + template void do_oop_work(T* p); + virtual void do_oop(narrowOop* p) { do_oop_work(p); } + virtual void do_oop(oop* p) { do_oop_work(p); } }; #endif // SHARE_VM_GC_G1_G1OOPCLOSURES_HPP diff --git a/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp b/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp index efad4ae2caa..ff07495f9f6 100644 --- a/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp @@ -156,7 +156,7 @@ inline void G1InvokeIfNotTriggeredClosure::do_oop_nv(T* p) { } template -inline void G1UpdateRSOrPushRefOopClosure::do_oop_nv(T* p) { +inline void G1UpdateRSOrPushRefOopClosure::do_oop_work(T* p) { oop obj = oopDesc::load_decode_heap_oop(p); if (obj == NULL) { return; diff --git a/hotspot/src/share/vm/gc/g1/g1_specialized_oop_closures.hpp b/hotspot/src/share/vm/gc/g1/g1_specialized_oop_closures.hpp index 68708b891cc..5243d76c4e3 100644 --- a/hotspot/src/share/vm/gc/g1/g1_specialized_oop_closures.hpp +++ b/hotspot/src/share/vm/gc/g1/g1_specialized_oop_closures.hpp @@ -44,7 +44,6 @@ class G1RootRegionScanClosure; class G1Mux2Closure; class G1TriggerClosure; class G1InvokeIfNotTriggeredClosure; -class G1UpdateRSOrPushRefOopClosure; #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1(f) \ f(G1ParScanClosure,_nv) \ @@ -55,7 +54,6 @@ class G1UpdateRSOrPushRefOopClosure; f(G1RootRegionScanClosure,_nv) \ f(G1Mux2Closure,_nv) \ f(G1TriggerClosure,_nv) \ - f(G1InvokeIfNotTriggeredClosure,_nv) \ - f(G1UpdateRSOrPushRefOopClosure,_nv) + f(G1InvokeIfNotTriggeredClosure,_nv) #endif // SHARE_VM_GC_G1_G1_SPECIALIZED_OOP_CLOSURES_HPP From faf57db7c80a219e0499a4084362093b83b213c5 Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Thu, 10 Dec 2015 15:27:16 +0100 Subject: [PATCH 066/146] 8144847: PPC64: Update Transactional Memory and Atomic::cmpxchg code Reviewed-by: stuefe, goetz --- .../src/cpu/ppc/vm/globalDefinitions_ppc.hpp | 5 + .../src/cpu/ppc/vm/metaspaceShared_ppc.cpp | 19 ++- hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp | 19 ++- hotspot/src/os/aix/vm/libodm_aix.cpp | 118 ++++++++++++++++++ hotspot/src/os/aix/vm/libodm_aix.hpp | 106 ++++++++++++++++ hotspot/src/os/aix/vm/os_aix.cpp | 47 ++++--- hotspot/src/os/aix/vm/os_aix.hpp | 34 +++-- .../aix_ppc/vm/atomic_aix_ppc.inline.hpp | 65 ++++++++++ .../linux_ppc/vm/atomic_linux_ppc.inline.hpp | 65 ++++++++++ 9 files changed, 440 insertions(+), 38 deletions(-) create mode 100644 hotspot/src/os/aix/vm/libodm_aix.cpp create mode 100644 hotspot/src/os/aix/vm/libodm_aix.hpp diff --git a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp index da5c8b008c5..43fe93146a9 100644 --- a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp @@ -36,4 +36,9 @@ const int StackAlignmentInBytes = 16; // The PPC CPUs are NOT multiple-copy-atomic. #define CPU_NOT_MULTIPLE_COPY_ATOMIC +#if defined(COMPILER2) && defined(AIX) +// Include Transactional Memory lock eliding optimization +#define INCLUDE_RTM_OPT 1 +#endif + #endif // CPU_PPC_VM_GLOBALDEFINITIONS_PPC_HPP diff --git a/hotspot/src/cpu/ppc/vm/metaspaceShared_ppc.cpp b/hotspot/src/cpu/ppc/vm/metaspaceShared_ppc.cpp index 9d68ca0f79b..9aa479a0e09 100644 --- a/hotspot/src/cpu/ppc/vm/metaspaceShared_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/metaspaceShared_ppc.cpp @@ -50,12 +50,29 @@ // to be 'vtbl_list_size' instances of the vtable in order to // differentiate between the 'vtable_list_size' original Klass objects. +#define __ masm-> + void MetaspaceShared::generate_vtable_methods(void** vtbl_list, void** vtable, char** md_top, char* md_end, char** mc_top, char* mc_end) { - Unimplemented(); + intptr_t vtable_bytes = (num_virtuals * vtbl_list_size) * sizeof(void*); + *(intptr_t *)(*md_top) = vtable_bytes; + *md_top += sizeof(intptr_t); + void** dummy_vtable = (void**)*md_top; + *vtable = dummy_vtable; + *md_top += vtable_bytes; + + // Get ready to generate dummy methods. + + CodeBuffer cb((unsigned char*)*mc_top, mc_end - *mc_top); + MacroAssembler* masm = new MacroAssembler(&cb); + + // There are more general problems with CDS on ppc, so I can not + // really test this. But having this instead of Unimplementd() allows + // us to pass TestOptionsWithRanges.java. + __ unimplemented(); } diff --git a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp index 90bd9c2ad7a..443c26aba54 100644 --- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp @@ -210,12 +210,27 @@ void VM_Version::initialize() { } // Adjust RTM (Restricted Transactional Memory) flags. - if (!has_tcheck() && UseRTMLocking) { + if (UseRTMLocking) { + // If CPU or OS are too old: // Can't continue because UseRTMLocking affects UseBiasedLocking flag // setting during arguments processing. See use_biased_locking(). // VM_Version_init() is executed after UseBiasedLocking is used // in Thread::allocate(). - vm_exit_during_initialization("RTM instructions are not available on this CPU"); + if (!has_tcheck()) { + vm_exit_during_initialization("RTM instructions are not available on this CPU"); + } + bool os_too_old = true; +#ifdef AIX + if (os::Aix::os_version() >= 0x0701031e) { // at least AIX 7.1.3.30 + os_too_old = false; + } +#endif +#ifdef linux + // TODO: check kernel version (we currently have too old versions only) +#endif + if (os_too_old) { + vm_exit_during_initialization("RTM is not supported on this OS version."); + } } if (UseRTMLocking) { diff --git a/hotspot/src/os/aix/vm/libodm_aix.cpp b/hotspot/src/os/aix/vm/libodm_aix.cpp new file mode 100644 index 00000000000..e39a97d9f77 --- /dev/null +++ b/hotspot/src/os/aix/vm/libodm_aix.cpp @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2015, 2015 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "libodm_aix.hpp" +#include "misc_aix.hpp" +#include +#include +#include +#include "runtime/arguments.hpp" + + +dynamicOdm::dynamicOdm() { + const char *libodmname = "/usr/lib/libodm.a(shr_64.o)"; + _libhandle = dlopen(libodmname, RTLD_MEMBER | RTLD_NOW); + if (!_libhandle) { + trcVerbose("Couldn't open %s", libodmname); + return; + } + _odm_initialize = (fun_odm_initialize )dlsym(_libhandle, "odm_initialize" ); + _odm_set_path = (fun_odm_set_path )dlsym(_libhandle, "odm_set_path" ); + _odm_mount_class = (fun_odm_mount_class)dlsym(_libhandle, "odm_mount_class"); + _odm_get_obj = (fun_odm_get_obj )dlsym(_libhandle, "odm_get_obj" ); + _odm_terminate = (fun_odm_terminate )dlsym(_libhandle, "odm_terminate" ); + if (!_odm_initialize || !_odm_set_path || !_odm_mount_class || !_odm_get_obj || !_odm_terminate) { + trcVerbose("Couldn't find all required odm symbols from %s", libodmname); + dlclose(_libhandle); + _libhandle = NULL; + return; + } +} + +dynamicOdm::~dynamicOdm() { + if (_libhandle) { dlclose(_libhandle); } +} + + +void odmWrapper::clean_data() { if (_data) { free(_data); _data = NULL; } } + + +int odmWrapper::class_offset(char *field, bool is_aix_5) +{ + assert(has_class(), "initialization"); + for (int i = 0; i < odm_class()->nelem; i++) { + if (strcmp(odm_class()->elem[i].elemname, field) == 0) { + int offset = odm_class()->elem[i].offset; + if (is_aix_5) { offset += LINK_VAL_OFFSET; } + return offset; + } + } + return -1; +} + + +void odmWrapper::determine_os_kernel_version(uint32_t* p_ver) { + int major_aix_version = ((*p_ver) >> 24) & 0xFF, + minor_aix_version = ((*p_ver) >> 16) & 0xFF; + assert(*p_ver, "must be initialized"); + + odmWrapper odm("product", "/usr/lib/objrepos"); // could also use "lpp" + if (!odm.has_class()) { + trcVerbose("try_determine_os_kernel_version: odm init problem"); + return; + } + int voff, roff, moff, foff; + bool is_aix_5 = (major_aix_version == 5); + voff = odm.class_offset("ver", is_aix_5); + roff = odm.class_offset("rel", is_aix_5); + moff = odm.class_offset("mod", is_aix_5); + foff = odm.class_offset("fix", is_aix_5); + if (voff == -1 || roff == -1 || moff == -1 || foff == -1) { + trcVerbose("try_determine_os_kernel_version: could not get offsets"); + return; + } + if (!odm.retrieve_obj("name='bos.mp64'")) { + trcVerbose("try_determine_os_kernel_version: odm_get_obj failed"); + return; + } + int version, release, modification, fix_level; + do { + version = odm.read_short(voff); + release = odm.read_short(roff); + modification = odm.read_short(moff); + fix_level = odm.read_short(foff); + trcVerbose("odm found version: %d.%d.%d.%d", version, release, modification, fix_level); + if (version >> 8 != 0 || release >> 8 != 0 || modification >> 8 != 0 || fix_level >> 8 != 0) { + trcVerbose("8 bit numbers expected"); + return; + } + } while (odm.retrieve_obj()); + + if (version != major_aix_version || release != minor_aix_version) { + trcVerbose("version determined by odm does not match uname"); + return; + } + *p_ver = version << 24 | release << 16 | modification << 8 | fix_level; +} diff --git a/hotspot/src/os/aix/vm/libodm_aix.hpp b/hotspot/src/os/aix/vm/libodm_aix.hpp new file mode 100644 index 00000000000..908bb2686a4 --- /dev/null +++ b/hotspot/src/os/aix/vm/libodm_aix.hpp @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright 2015, 2015 SAP AG. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// Encapsulates the libodm library and provides more convenient interfaces. + +#ifndef OS_AIX_VM_LIBODM_AIX_HPP +#define OS_AIX_VM_LIBODM_AIX_HPP + +#include + + +// The purpose of this code is to dynamically load the libodm library +// instead of statically linking against it. The library is AIX-specific. +// It only exists on AIX, not on PASE. In order to share binaries +// between AIX and PASE, we can't directly link against it. + +typedef int (*fun_odm_initialize )(void); +typedef char* (*fun_odm_set_path )(char*); +typedef CLASS_SYMBOL (*fun_odm_mount_class)(char*); +typedef void* (*fun_odm_get_obj )(CLASS_SYMBOL, char*, void*, int); +typedef int (*fun_odm_terminate )(void); + +class dynamicOdm { + void *_libhandle; + protected: + fun_odm_initialize _odm_initialize; + fun_odm_set_path _odm_set_path; + fun_odm_mount_class _odm_mount_class; + fun_odm_get_obj _odm_get_obj; + fun_odm_terminate _odm_terminate; + public: + dynamicOdm(); + ~dynamicOdm(); + bool odm_loaded() {return _libhandle != NULL; } +}; + + +// We provide a more convenient interface for odm access and +// especially to determine the exact AIX kernel version. + +class odmWrapper : private dynamicOdm { + CLASS_SYMBOL _odm_class; + char *_data; + bool _initialized; + void clean_data(); + + public: + // Make sure everything gets initialized and cleaned up properly. + explicit odmWrapper(char* odm_class_name, char* odm_path = NULL) : _odm_class((CLASS_SYMBOL)-1), + _data(NULL), _initialized(false) { + if (!odm_loaded()) { return; } + _initialized = ((*_odm_initialize)() != -1); + if (_initialized) { + if (odm_path) { (*_odm_set_path)(odm_path); } + _odm_class = (*_odm_mount_class)(odm_class_name); + } + } + ~odmWrapper() { + if (_initialized) { (*_odm_terminate)(); clean_data(); } + } + + CLASS_SYMBOL odm_class() { return _odm_class; } + bool has_class() { return odm_class() != (CLASS_SYMBOL)-1; } + int class_offset(char *field, bool is_aix_5); + char* data() { return _data; } + + char* retrieve_obj(char* name = NULL) { + clean_data(); + char *cnp = (char*)(void*)(*_odm_get_obj)(odm_class(), name, NULL, (name == NULL) ? ODM_NEXT : ODM_FIRST); + if (cnp != (char*)-1) { _data = cnp; } + return data(); + } + + int read_short(int offs) { + short *addr = (short*)(data() + offs); + return *addr; + } + + // Determine the exact AIX kernel version as 4 byte value. + // The high order 2 bytes must be initialized already. They can be determined by uname. + static void determine_os_kernel_version(uint32_t* p_ver); +}; + +#endif // OS_AIX_VM_LIBODM_AIX_HPP diff --git a/hotspot/src/os/aix/vm/os_aix.cpp b/hotspot/src/os/aix/vm/os_aix.cpp index a0a1e38239a..2cc40ed4d7f 100644 --- a/hotspot/src/os/aix/vm/os_aix.cpp +++ b/hotspot/src/os/aix/vm/os_aix.cpp @@ -38,6 +38,7 @@ #include "jvm_aix.h" #include "libo4.hpp" #include "libperfstat_aix.hpp" +#include "libodm_aix.hpp" #include "loadlib_aix.hpp" #include "memory/allocation.inline.hpp" #include "memory/filemap.hpp" @@ -197,9 +198,13 @@ int os::Aix::_page_size = -1; // -1 = uninitialized, 0 if AIX, 1 if OS/400 pase int os::Aix::_on_pase = -1; -// -1 = uninitialized, otherwise os version in the form 0xMMmm - MM:major, mm:minor -// E.g. 0x0601 for AIX 6.1 or 0x0504 for OS/400 V5R4 -int os::Aix::_os_version = -1; +// 0 = uninitialized, otherwise 32 bit number: +// 0xVVRRTTSS +// VV - major version +// RR - minor version +// TT - tech level, if known, 0 otherwise +// SS - service pack, if known, 0 otherwise +uint32_t os::Aix::_os_version = 0; int os::Aix::_stack_page_size = -1; @@ -358,7 +363,7 @@ static char cpu_arch[] = "ppc64"; // Wrap the function "vmgetinfo" which is not available on older OS releases. static int checked_vmgetinfo(void *out, int command, int arg) { - if (os::Aix::on_pase() && os::Aix::os_version() < 0x0601) { + if (os::Aix::on_pase() && os::Aix::os_version_short() < 0x0601) { guarantee(false, "cannot call vmgetinfo on AS/400 older than V6R1"); } return ::vmgetinfo(out, command, arg); @@ -367,7 +372,7 @@ static int checked_vmgetinfo(void *out, int command, int arg) { // Given an address, returns the size of the page backing that address. size_t os::Aix::query_pagesize(void* addr) { - if (os::Aix::on_pase() && os::Aix::os_version() < 0x0601) { + if (os::Aix::on_pase() && os::Aix::os_version_short() < 0x0601) { // AS/400 older than V6R1: no vmgetinfo here, default to 4K return SIZE_4K; } @@ -1491,6 +1496,10 @@ void os::print_os_info(outputStream* st) { st->print(name.machine); st->cr(); + uint32_t ver = os::Aix::os_version(); + st->print_cr("AIX kernel version %u.%u.%u.%u", + (ver >> 24) & 0xFF, (ver >> 16) & 0xFF, (ver >> 8) & 0xFF, ver & 0xFF); + // rlimit st->print("rlimit:"); struct rlimit rlim; @@ -4255,7 +4264,7 @@ bool os::Aix::is_primordial_thread() { // one of Aix::on_pase(), Aix::os_version() static void os::Aix::initialize_os_info() { - assert(_on_pase == -1 && _os_version == -1, "already called."); + assert(_on_pase == -1 && _os_version == 0, "already called."); struct utsname uts; memset(&uts, 0, sizeof(uts)); @@ -4271,28 +4280,34 @@ void os::Aix::initialize_os_info() { assert(major > 0, "invalid OS version"); const int minor = atoi(uts.release); assert(minor > 0, "invalid OS release"); - _os_version = (major << 8) | minor; + _os_version = (major << 24) | (minor << 16); + char ver_str[20] = {0}; + char *name_str = "unknown OS"; if (strcmp(uts.sysname, "OS400") == 0) { // We run on AS/400 PASE. We do not support versions older than V5R4M0. _on_pase = 1; - if (_os_version < 0x0504) { + if (os_version_short() < 0x0504) { trcVerbose("OS/400 releases older than V5R4M0 not supported."); assert(false, "OS/400 release too old."); - } else { - trcVerbose("We run on OS/400 (pase) V%dR%d", major, minor); } + name_str = "OS/400 (pase)"; + jio_snprintf(ver_str, sizeof(ver_str), "%u.%u", major, minor); } else if (strcmp(uts.sysname, "AIX") == 0) { // We run on AIX. We do not support versions older than AIX 5.3. _on_pase = 0; - if (_os_version < 0x0503) { + // Determine detailed AIX version: Version, Release, Modification, Fix Level. + odmWrapper::determine_os_kernel_version(&_os_version); + if (os_version_short() < 0x0503) { trcVerbose("AIX release older than AIX 5.3 not supported."); assert(false, "AIX release too old."); - } else { - trcVerbose("We run on AIX %d.%d", major, minor); } + name_str = "AIX"; + jio_snprintf(ver_str, sizeof(ver_str), "%u.%u.%u.%u", + major, minor, (_os_version >> 8) & 0xFF, _os_version & 0xFF); } else { - assert(false, "unknown OS"); + assert(false, name_str); } + trcVerbose("We run on %s %s", name_str, ver_str); } guarantee(_on_pase != -1 && _os_version, "Could not determine AIX/OS400 release"); @@ -4357,7 +4372,7 @@ void os::Aix::scan_environment() { p = ::getenv("LDR_CNTRL"); trcVerbose("LDR_CNTRL=%s.", p ? p : ""); - if (os::Aix::on_pase() && os::Aix::os_version() == 0x0701) { + if (os::Aix::on_pase() && os::Aix::os_version_short() == 0x0701) { if (p && ::strstr(p, "TEXTPSIZE")) { trcVerbose("*** WARNING - LDR_CNTRL contains TEXTPSIZE. " "you may experience hangs or crashes on OS/400 V7R1."); @@ -5016,7 +5031,7 @@ void TestReserveMemorySpecial_test() { } #endif -bool os::start_debugging(char *buf, int buflen) { +bool os::start_debugging(char *buf, int buflen) { int len = (int)strlen(buf); char *p = &buf[len]; diff --git a/hotspot/src/os/aix/vm/os_aix.hpp b/hotspot/src/os/aix/vm/os_aix.hpp index 11942fc9fb1..7cd372807e6 100644 --- a/hotspot/src/os/aix/vm/os_aix.hpp +++ b/hotspot/src/os/aix/vm/os_aix.hpp @@ -55,15 +55,12 @@ class Aix { // -1 = uninitialized, 0 = AIX, 1 = OS/400 (PASE) static int _on_pase; - // -1 = uninitialized, otherwise 16 bit number: + // 0 = uninitialized, otherwise 16 bit number: // lower 8 bit - minor version // higher 8 bit - major version // For AIX, e.g. 0x0601 for AIX 6.1 // for OS/400 e.g. 0x0504 for OS/400 V5R4 - static int _os_version; - - // 4 Byte kernel version: Version, Release, Tech Level, Service Pack. - static unsigned int _os_kernel_version; + static uint32_t _os_version; // -1 = uninitialized, // 0 - SPEC1170 not requested (XPG_SUS_ENV is OFF or not set) @@ -175,32 +172,31 @@ class Aix { return _on_pase ? false : true; } - // -1 = uninitialized, otherwise 16 bit number: + // Get 4 byte AIX kernel version number: + // highest 2 bytes: Version, Release + // if available: lowest 2 bytes: Tech Level, Service Pack. + static uint32_t os_version() { + assert(_os_version != 0, "not initialized"); + return _os_version; + } + + // 0 = uninitialized, otherwise 16 bit number: // lower 8 bit - minor version // higher 8 bit - major version // For AIX, e.g. 0x0601 for AIX 6.1 // for OS/400 e.g. 0x0504 for OS/400 V5R4 - static int os_version () { - assert(_os_version != -1, "not initialized"); - return _os_version; - } - - // Get 4 byte AIX kernel version number: - // highest 2 bytes: Version, Release - // if available: lowest 2 bytes: Tech Level, Service Pack. - static unsigned int os_kernel_version() { - if (_os_kernel_version) return _os_kernel_version; - return os_version() << 16; + static int os_version_short() { + return os_version() >> 16; } // Convenience method: returns true if running on PASE V5R4 or older. static bool on_pase_V5R4_or_older() { - return on_pase() && os_version() <= 0x0504; + return on_pase() && os_version_short() <= 0x0504; } // Convenience method: returns true if running on AIX 5.3 or older. static bool on_aix_53_or_older() { - return on_aix() && os_version() <= 0x0503; + return on_aix() && os_version_short() <= 0x0503; } // Returns true if we run in SPEC1170 compliant mode (XPG_SUS_ENV=ON). diff --git a/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp b/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp index 046912a2c24..d3afeeb399d 100644 --- a/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp +++ b/hotspot/src/os_cpu/aix_ppc/vm/atomic_aix_ppc.inline.hpp @@ -291,6 +291,71 @@ inline void* Atomic::xchg_ptr(void* exchange_value, volatile void* dest) { return (void*)xchg_ptr((intptr_t)exchange_value, (volatile intptr_t*)dest); } +#define VM_HAS_SPECIALIZED_CMPXCHG_BYTE +inline jbyte Atomic::cmpxchg(jbyte exchange_value, volatile jbyte* dest, jbyte compare_value) { + + // Note that cmpxchg guarantees a two-way memory barrier across + // the cmpxchg, so it's really a a 'fence_cmpxchg_acquire' + // (see atomic.hpp). + + // Using 32 bit internally. + volatile int *dest_base = (volatile int*)((uintptr_t)dest & ~3); + +#ifdef VM_LITTLE_ENDIAN + const unsigned int shift_amount = ((uintptr_t)dest & 3) * 8; +#else + const unsigned int shift_amount = ((~(uintptr_t)dest) & 3) * 8; +#endif + const unsigned int masked_compare_val = ((unsigned int)(unsigned char)compare_value), + masked_exchange_val = ((unsigned int)(unsigned char)exchange_value), + xor_value = (masked_compare_val ^ masked_exchange_val) << shift_amount; + + unsigned int old_value, value32; + + __asm__ __volatile__ ( + /* fence */ + strasm_sync + /* simple guard */ + " lbz %[old_value], 0(%[dest]) \n" + " cmpw %[masked_compare_val], %[old_value] \n" + " bne- 2f \n" + /* atomic loop */ + "1: \n" + " lwarx %[value32], 0, %[dest_base] \n" + /* extract byte and compare */ + " srd %[old_value], %[value32], %[shift_amount] \n" + " clrldi %[old_value], %[old_value], 56 \n" + " cmpw %[masked_compare_val], %[old_value] \n" + " bne- 2f \n" + /* replace byte and try to store */ + " xor %[value32], %[xor_value], %[value32] \n" + " stwcx. %[value32], 0, %[dest_base] \n" + " bne- 1b \n" + /* acquire */ + strasm_sync + /* exit */ + "2: \n" + /* out */ + : [old_value] "=&r" (old_value), + [value32] "=&r" (value32), + "=m" (*dest), + "=m" (*dest_base) + /* in */ + : [dest] "b" (dest), + [dest_base] "b" (dest_base), + [shift_amount] "r" (shift_amount), + [masked_compare_val] "r" (masked_compare_val), + [xor_value] "r" (xor_value), + "m" (*dest), + "m" (*dest_base) + /* clobber */ + : "cc", + "memory" + ); + + return (jbyte)(unsigned char)old_value; +} + inline jint Atomic::cmpxchg(jint exchange_value, volatile jint* dest, jint compare_value) { // Note that cmpxchg guarantees a two-way memory barrier across diff --git a/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp b/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp index 39ed85ea361..d9e1f5d84e0 100644 --- a/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp +++ b/hotspot/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.inline.hpp @@ -291,6 +291,71 @@ inline void* Atomic::xchg_ptr(void* exchange_value, volatile void* dest) { return (void*)xchg_ptr((intptr_t)exchange_value, (volatile intptr_t*)dest); } +#define VM_HAS_SPECIALIZED_CMPXCHG_BYTE +inline jbyte Atomic::cmpxchg(jbyte exchange_value, volatile jbyte* dest, jbyte compare_value) { + + // Note that cmpxchg guarantees a two-way memory barrier across + // the cmpxchg, so it's really a a 'fence_cmpxchg_acquire' + // (see atomic.hpp). + + // Using 32 bit internally. + volatile int *dest_base = (volatile int*)((uintptr_t)dest & ~3); + +#ifdef VM_LITTLE_ENDIAN + const unsigned int shift_amount = ((uintptr_t)dest & 3) * 8; +#else + const unsigned int shift_amount = ((~(uintptr_t)dest) & 3) * 8; +#endif + const unsigned int masked_compare_val = ((unsigned int)(unsigned char)compare_value), + masked_exchange_val = ((unsigned int)(unsigned char)exchange_value), + xor_value = (masked_compare_val ^ masked_exchange_val) << shift_amount; + + unsigned int old_value, value32; + + __asm__ __volatile__ ( + /* fence */ + strasm_sync + /* simple guard */ + " lbz %[old_value], 0(%[dest]) \n" + " cmpw %[masked_compare_val], %[old_value] \n" + " bne- 2f \n" + /* atomic loop */ + "1: \n" + " lwarx %[value32], 0, %[dest_base] \n" + /* extract byte and compare */ + " srd %[old_value], %[value32], %[shift_amount] \n" + " clrldi %[old_value], %[old_value], 56 \n" + " cmpw %[masked_compare_val], %[old_value] \n" + " bne- 2f \n" + /* replace byte and try to store */ + " xor %[value32], %[xor_value], %[value32] \n" + " stwcx. %[value32], 0, %[dest_base] \n" + " bne- 1b \n" + /* acquire */ + strasm_sync + /* exit */ + "2: \n" + /* out */ + : [old_value] "=&r" (old_value), + [value32] "=&r" (value32), + "=m" (*dest), + "=m" (*dest_base) + /* in */ + : [dest] "b" (dest), + [dest_base] "b" (dest_base), + [shift_amount] "r" (shift_amount), + [masked_compare_val] "r" (masked_compare_val), + [xor_value] "r" (xor_value), + "m" (*dest), + "m" (*dest_base) + /* clobber */ + : "cc", + "memory" + ); + + return (jbyte)(unsigned char)old_value; +} + inline jint Atomic::cmpxchg(jint exchange_value, volatile jint* dest, jint compare_value) { // Note that cmpxchg guarantees a two-way memory barrier across From f9ecfbf758e7c6954960936f1dcf30d1fbe918fc Mon Sep 17 00:00:00 2001 From: Sebastian Sickelmann Date: Thu, 10 Dec 2015 17:48:44 +0100 Subject: [PATCH 067/146] 8145061: Too many instances of java.lang.Boolean created in Java application (hotspot repo) Avoid creating unused instances of Long and Boolean Reviewed-by: dholmes, sla --- .../share/classes/sun/jvm/hotspot/runtime/VM.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java index 18237d636fc..09bb426cfb3 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java @@ -229,17 +229,17 @@ public class VM { public String getValue() { if (isBool()) { - return new Boolean(getBool()).toString(); + return Boolean.toString(getBool()); } else if (isInt()) { - return new Long(getInt()).toString(); + return Long.toString(getInt()); } else if (isUInt()) { - return new Long(getUInt()).toString(); + return Long.toString(getUInt()); } else if (isIntx()) { - return new Long(getIntx()).toString(); + return Long.toString(getIntx()); } else if (isUIntx()) { - return new Long(getUIntx()).toString(); + return Long.toString(getUIntx()); } else if (isSizet()) { - return new Long(getSizet()).toString(); + return Long.toString(getSizet()); } else { return null; } From a1a959760b9904e482367abf25030019a4fefa95 Mon Sep 17 00:00:00 2001 From: David Lindholm Date: Fri, 11 Dec 2015 13:48:52 +0100 Subject: [PATCH 068/146] 8144996: Replace the HeapRegionSetCount class with an uint Reviewed-by: brutisso, jwilhelm --- .../jvm/hotspot/gc/g1/HeapRegionSetBase.java | 11 ++- .../jvm/hotspot/gc/g1/HeapRegionSetCount.java | 73 ------------------- .../sun/jvm/hotspot/tools/HeapSummary.java | 3 +- hotspot/src/share/vm/gc/g1/concurrentMark.cpp | 16 ++-- .../src/share/vm/gc/g1/g1CollectedHeap.cpp | 49 +++++-------- .../src/share/vm/gc/g1/g1CollectedHeap.hpp | 4 +- hotspot/src/share/vm/gc/g1/g1MarkSweep.cpp | 5 +- hotspot/src/share/vm/gc/g1/g1MarkSweep.hpp | 4 +- hotspot/src/share/vm/gc/g1/heapRegionSet.cpp | 14 ++-- hotspot/src/share/vm/gc/g1/heapRegionSet.hpp | 64 +++++----------- .../share/vm/gc/g1/heapRegionSet.inline.hpp | 6 +- hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp | 6 +- 12 files changed, 65 insertions(+), 190 deletions(-) delete mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionSetCount.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionSetBase.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionSetBase.java index bd64e0249e4..5e79ebaace8 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionSetBase.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionSetBase.java @@ -41,7 +41,8 @@ import sun.jvm.hotspot.types.TypeDataBase; public class HeapRegionSetBase extends VMObject { - static private long countField; + // uint _length + static private CIntegerField lengthField; static { VM.registerVMInitializedObserver(new Observer() { @@ -54,13 +55,11 @@ public class HeapRegionSetBase extends VMObject { static private synchronized void initialize(TypeDataBase db) { Type type = db.lookupType("HeapRegionSetBase"); - countField = type.getField("_count").getOffset(); + lengthField = type.getCIntegerField("_length"); } - - public HeapRegionSetCount count() { - Address countFieldAddr = addr.addOffsetTo(countField); - return (HeapRegionSetCount) VMObjectFactory.newObject(HeapRegionSetCount.class, countFieldAddr); + public long length() { + return lengthField.getValue(addr); } public HeapRegionSetBase(Address addr) { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionSetCount.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionSetCount.java deleted file mode 100644 index 2c9fd8280c8..00000000000 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionSetCount.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -package sun.jvm.hotspot.gc.g1; - -import java.util.Iterator; -import java.util.Observable; -import java.util.Observer; - -import sun.jvm.hotspot.debugger.Address; -import sun.jvm.hotspot.runtime.VM; -import sun.jvm.hotspot.runtime.VMObject; -import sun.jvm.hotspot.runtime.VMObjectFactory; -import sun.jvm.hotspot.types.AddressField; -import sun.jvm.hotspot.types.CIntegerField; -import sun.jvm.hotspot.types.Type; -import sun.jvm.hotspot.types.TypeDataBase; - -// Mirror class for HeapRegionSetCount. Represents a group of regions. - -public class HeapRegionSetCount extends VMObject { - - static private CIntegerField lengthField; - static private CIntegerField capacityField; - - static { - VM.registerVMInitializedObserver(new Observer() { - public void update(Observable o, Object data) { - initialize(VM.getVM().getTypeDataBase()); - } - }); - } - - static private synchronized void initialize(TypeDataBase db) { - Type type = db.lookupType("HeapRegionSetCount"); - - lengthField = type.getCIntegerField("_length"); - capacityField = type.getCIntegerField("_capacity"); - } - - public long length() { - return lengthField.getValue(addr); - } - - public long capacity() { - return capacityField.getValue(addr); - } - - public HeapRegionSetCount(Address addr) { - super(addr); - } -} diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java index 893c5e1e31b..601283072ff 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java @@ -112,8 +112,7 @@ public class HeapSummary extends Tool { long survivorRegionNum = g1mm.survivorRegionNum(); HeapRegionSetBase oldSet = g1h.oldSet(); HeapRegionSetBase humongousSet = g1h.humongousSet(); - long oldRegionNum = oldSet.count().length() - + humongousSet.count().capacity() / HeapRegion.grainBytes(); + long oldRegionNum = oldSet.length() + humongousSet.length(); printG1Space("G1 Heap:", g1h.n_regions(), g1h.used(), g1h.capacity()); System.out.println("G1 Young Generation:"); diff --git a/hotspot/src/share/vm/gc/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc/g1/concurrentMark.cpp index e1f73491452..02c4a718e71 100644 --- a/hotspot/src/share/vm/gc/g1/concurrentMark.cpp +++ b/hotspot/src/share/vm/gc/g1/concurrentMark.cpp @@ -1483,8 +1483,8 @@ class G1NoteEndOfConcMarkClosure : public HeapRegionClosure { G1CollectedHeap* _g1; size_t _freed_bytes; FreeRegionList* _local_cleanup_list; - HeapRegionSetCount _old_regions_removed; - HeapRegionSetCount _humongous_regions_removed; + uint _old_regions_removed; + uint _humongous_regions_removed; HRRSCleanupTask* _hrrs_cleanup_task; public: @@ -1494,13 +1494,13 @@ public: _g1(g1), _freed_bytes(0), _local_cleanup_list(local_cleanup_list), - _old_regions_removed(), - _humongous_regions_removed(), + _old_regions_removed(0), + _humongous_regions_removed(0), _hrrs_cleanup_task(hrrs_cleanup_task) { } size_t freed_bytes() { return _freed_bytes; } - const HeapRegionSetCount& old_regions_removed() { return _old_regions_removed; } - const HeapRegionSetCount& humongous_regions_removed() { return _humongous_regions_removed; } + const uint old_regions_removed() { return _old_regions_removed; } + const uint humongous_regions_removed() { return _humongous_regions_removed; } bool doHeapRegion(HeapRegion *hr) { if (hr->is_archive()) { @@ -1515,10 +1515,10 @@ public: _freed_bytes += hr->used(); hr->set_containing_set(NULL); if (hr->is_humongous()) { - _humongous_regions_removed.increment(1u, hr->capacity()); + _humongous_regions_removed++; _g1->free_humongous_region(hr, _local_cleanup_list, true); } else { - _old_regions_removed.increment(1u, hr->capacity()); + _old_regions_removed++; _g1->free_region(hr, _local_cleanup_list, true); } } else { diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp index 59fdc8b1381..56fbe83186c 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp @@ -5195,9 +5195,9 @@ void G1CollectedHeap::free_humongous_region(HeapRegion* hr, free_region(hr, free_list, par); } -void G1CollectedHeap::remove_from_old_sets(const HeapRegionSetCount& old_regions_removed, - const HeapRegionSetCount& humongous_regions_removed) { - if (old_regions_removed.length() > 0 || humongous_regions_removed.length() > 0) { +void G1CollectedHeap::remove_from_old_sets(const uint old_regions_removed, + const uint humongous_regions_removed) { + if (old_regions_removed > 0 || humongous_regions_removed > 0) { MutexLockerEx x(OldSets_lock, Mutex::_no_safepoint_check_flag); _old_set.bulk_remove(old_regions_removed); _humongous_set.bulk_remove(humongous_regions_removed); @@ -5582,12 +5582,12 @@ class G1FreeHumongousRegionClosure : public HeapRegionClosure { private: FreeRegionList* _free_region_list; HeapRegionSet* _proxy_set; - HeapRegionSetCount _humongous_regions_removed; + uint _humongous_regions_removed; size_t _freed_bytes; public: G1FreeHumongousRegionClosure(FreeRegionList* free_region_list) : - _free_region_list(free_region_list), _humongous_regions_removed(), _freed_bytes(0) { + _free_region_list(free_region_list), _humongous_regions_removed(0), _freed_bytes(0) { } virtual bool doHeapRegion(HeapRegion* r) { @@ -5667,7 +5667,7 @@ class G1FreeHumongousRegionClosure : public HeapRegionClosure { HeapRegion* next = g1h->next_region_in_humongous(r); _freed_bytes += r->used(); r->set_containing_set(NULL); - _humongous_regions_removed.increment(1u, r->capacity()); + _humongous_regions_removed++; g1h->free_humongous_region(r, _free_region_list, false); r = next; } while (r != NULL); @@ -5675,17 +5675,13 @@ class G1FreeHumongousRegionClosure : public HeapRegionClosure { return false; } - HeapRegionSetCount& humongous_free_count() { + uint humongous_free_count() { return _humongous_regions_removed; } size_t bytes_freed() const { return _freed_bytes; } - - size_t humongous_reclaimed() const { - return _humongous_regions_removed.length(); - } }; void G1CollectedHeap::eagerly_reclaim_humongous_regions() { @@ -5704,8 +5700,7 @@ void G1CollectedHeap::eagerly_reclaim_humongous_regions() { G1FreeHumongousRegionClosure cl(&local_cleanup_list); heap_region_iterate(&cl); - HeapRegionSetCount empty_set; - remove_from_old_sets(empty_set, cl.humongous_free_count()); + remove_from_old_sets(0, cl.humongous_free_count()); G1HRPrinter* hrp = hr_printer(); if (hrp->is_active()) { @@ -5720,7 +5715,7 @@ void G1CollectedHeap::eagerly_reclaim_humongous_regions() { decrement_summary_bytes(cl.bytes_freed()); g1_policy()->phase_times()->record_fast_reclaim_humongous_time_ms((os::elapsedTime() - start_time) * 1000.0, - cl.humongous_reclaimed()); + cl.humongous_free_count()); } // This routine is similar to the above but does not record @@ -6066,9 +6061,9 @@ private: HeapRegionManager* _hrm; public: - HeapRegionSetCount _old_count; - HeapRegionSetCount _humongous_count; - HeapRegionSetCount _free_count; + uint _old_count; + uint _humongous_count; + uint _free_count; VerifyRegionListsClosure(HeapRegionSet* old_set, HeapRegionSet* humongous_set, @@ -6081,13 +6076,13 @@ public: // TODO } else if (hr->is_humongous()) { assert(hr->containing_set() == _humongous_set, "Heap region %u is humongous but not in humongous set.", hr->hrm_index()); - _humongous_count.increment(1u, hr->capacity()); + _humongous_count++; } else if (hr->is_empty()) { assert(_hrm->is_free(hr), "Heap region %u is empty but not on the free list.", hr->hrm_index()); - _free_count.increment(1u, hr->capacity()); + _free_count++; } else if (hr->is_old()) { assert(hr->containing_set() == _old_set, "Heap region %u is old but not in the old set.", hr->hrm_index()); - _old_count.increment(1u, hr->capacity()); + _old_count++; } else { // There are no other valid region types. Check for one invalid // one we can identify: pinned without old or humongous set. @@ -6098,17 +6093,9 @@ public: } void verify_counts(HeapRegionSet* old_set, HeapRegionSet* humongous_set, HeapRegionManager* free_list) { - guarantee(old_set->length() == _old_count.length(), "Old set count mismatch. Expected %u, actual %u.", old_set->length(), _old_count.length()); - guarantee(old_set->total_capacity_bytes() == _old_count.capacity(), "Old set capacity mismatch. Expected " SIZE_FORMAT ", actual " SIZE_FORMAT, - old_set->total_capacity_bytes(), _old_count.capacity()); - - guarantee(humongous_set->length() == _humongous_count.length(), "Hum set count mismatch. Expected %u, actual %u.", humongous_set->length(), _humongous_count.length()); - guarantee(humongous_set->total_capacity_bytes() == _humongous_count.capacity(), "Hum set capacity mismatch. Expected " SIZE_FORMAT ", actual " SIZE_FORMAT, - humongous_set->total_capacity_bytes(), _humongous_count.capacity()); - - guarantee(free_list->num_free_regions() == _free_count.length(), "Free list count mismatch. Expected %u, actual %u.", free_list->num_free_regions(), _free_count.length()); - guarantee(free_list->total_capacity_bytes() == _free_count.capacity(), "Free list capacity mismatch. Expected " SIZE_FORMAT ", actual " SIZE_FORMAT, - free_list->total_capacity_bytes(), _free_count.capacity()); + guarantee(old_set->length() == _old_count, "Old set count mismatch. Expected %u, actual %u.", old_set->length(), _old_count); + guarantee(humongous_set->length() == _humongous_count, "Hum set count mismatch. Expected %u, actual %u.", humongous_set->length(), _humongous_count); + guarantee(free_list->num_free_regions() == _free_count, "Free list count mismatch. Expected %u, actual %u.", free_list->num_free_regions(), _free_count); } }; diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp index 9bd26d31175..dafd2cd102b 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp @@ -1132,7 +1132,7 @@ public: inline void old_set_remove(HeapRegion* hr); size_t non_young_capacity_bytes() { - return _old_set.total_capacity_bytes() + _humongous_set.total_capacity_bytes(); + return (_old_set.length() + _humongous_set.length()) * HeapRegion::GrainBytes; } void set_free_regions_coming(); @@ -1157,7 +1157,7 @@ public: // True iff an evacuation has failed in the most-recent collection. bool evacuation_failed() { return _evacuation_failed; } - void remove_from_old_sets(const HeapRegionSetCount& old_regions_removed, const HeapRegionSetCount& humongous_regions_removed); + void remove_from_old_sets(const uint old_regions_removed, const uint humongous_regions_removed); void prepend_to_freelist(FreeRegionList* list); void decrement_summary_bytes(size_t bytes); diff --git a/hotspot/src/share/vm/gc/g1/g1MarkSweep.cpp b/hotspot/src/share/vm/gc/g1/g1MarkSweep.cpp index d1feefe2de5..7218472cc3c 100644 --- a/hotspot/src/share/vm/gc/g1/g1MarkSweep.cpp +++ b/hotspot/src/share/vm/gc/g1/g1MarkSweep.cpp @@ -329,7 +329,7 @@ void G1PrepareCompactClosure::free_humongous_region(HeapRegion* hr) { FreeRegionList dummy_free_list("Dummy Free List for G1MarkSweep"); hr->set_containing_set(NULL); - _humongous_regions_removed.increment(1u, hr->capacity()); + _humongous_regions_removed++; _g1h->free_humongous_region(hr, &dummy_free_list, false /* par */); prepare_for_compaction(hr, end); @@ -358,8 +358,7 @@ void G1PrepareCompactClosure::prepare_for_compaction_work(CompactPoint* cp, void G1PrepareCompactClosure::update_sets() { // We'll recalculate total used bytes and recreate the free list // at the end of the GC, so no point in updating those values here. - HeapRegionSetCount empty_set; - _g1h->remove_from_old_sets(empty_set, _humongous_regions_removed); + _g1h->remove_from_old_sets(0, _humongous_regions_removed); } bool G1PrepareCompactClosure::doHeapRegion(HeapRegion* hr) { diff --git a/hotspot/src/share/vm/gc/g1/g1MarkSweep.hpp b/hotspot/src/share/vm/gc/g1/g1MarkSweep.hpp index fc54b9ee79f..a6dab8a4324 100644 --- a/hotspot/src/share/vm/gc/g1/g1MarkSweep.hpp +++ b/hotspot/src/share/vm/gc/g1/g1MarkSweep.hpp @@ -92,7 +92,7 @@ class G1PrepareCompactClosure : public HeapRegionClosure { G1CollectedHeap* _g1h; ModRefBarrierSet* _mrbs; CompactPoint _cp; - HeapRegionSetCount _humongous_regions_removed; + uint _humongous_regions_removed; virtual void prepare_for_compaction(HeapRegion* hr, HeapWord* end); void prepare_for_compaction_work(CompactPoint* cp, HeapRegion* hr, HeapWord* end); @@ -103,7 +103,7 @@ class G1PrepareCompactClosure : public HeapRegionClosure { G1PrepareCompactClosure() : _g1h(G1CollectedHeap::heap()), _mrbs(_g1h->g1_barrier_set()), - _humongous_regions_removed() { } + _humongous_regions_removed(0) { } void update_sets(); bool doHeapRegion(HeapRegion* hr); diff --git a/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp b/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp index e0dc38be982..1240a43c028 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionSet.cpp @@ -49,8 +49,8 @@ void HeapRegionSetBase::verify() { // verification might fail and send us on a wild goose chase. check_mt_safety(); - guarantee_heap_region_set(( is_empty() && length() == 0 && total_capacity_bytes() == 0) || - (!is_empty() && length() > 0 && total_capacity_bytes() > 0) , + guarantee_heap_region_set(( is_empty() && length() == 0) || + (!is_empty() && length() > 0), "invariant"); } @@ -81,14 +81,12 @@ void HeapRegionSetBase::print_on(outputStream* out, bool print_contents) { out->print_cr(" free : %s", BOOL_TO_STR(regions_free())); out->print_cr(" Attributes"); out->print_cr(" length : %14u", length()); - out->print_cr(" total capacity : " SIZE_FORMAT_W(14) " bytes", - total_capacity_bytes()); } HeapRegionSetBase::HeapRegionSetBase(const char* name, bool humongous, bool free, HRSMtSafeChecker* mt_safety_checker) : _name(name), _verify_in_progress(false), _is_humongous(humongous), _is_free(free), _mt_safety_checker(mt_safety_checker), - _count() + _length(0) { } void FreeRegionList::set_unrealistically_long_length(uint len) { @@ -177,7 +175,7 @@ void FreeRegionList::add_ordered(FreeRegionList* from_list) { } } - _count.increment(from_list->length(), from_list->total_capacity_bytes()); + _length += from_list->length(); from_list->clear(); verify_optional(); @@ -255,7 +253,7 @@ void FreeRegionList::verify() { } void FreeRegionList::clear() { - _count = HeapRegionSetCount(); + _length = 0; _head = NULL; _tail = NULL; _last = NULL; @@ -294,8 +292,6 @@ void FreeRegionList::verify_list() { guarantee(_tail == prev0, "Expected %s to end with %u but it ended with %u.", name(), _tail->hrm_index(), prev0->hrm_index()); guarantee(_tail == NULL || _tail->next() == NULL, "_tail should not have a next"); guarantee(length() == count, "%s count mismatch. Expected %u, actual %u.", name(), length(), count); - guarantee(total_capacity_bytes() == capacity, "%s capacity mismatch. Expected " SIZE_FORMAT ", actual " SIZE_FORMAT, - name(), total_capacity_bytes(), capacity); } // Note on the check_mt_safety() methods below: diff --git a/hotspot/src/share/vm/gc/g1/heapRegionSet.hpp b/hotspot/src/share/vm/gc/g1/heapRegionSet.hpp index 1fb4c53330f..f953097ce97 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionSet.hpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionSet.hpp @@ -27,22 +27,22 @@ #include "gc/g1/heapRegion.hpp" -#define assert_heap_region_set(p, message) \ - do { \ - assert((p), "[%s] %s ln: %u cy: " SIZE_FORMAT, \ - name(), message, length(), total_capacity_bytes()); \ +#define assert_heap_region_set(p, message) \ + do { \ + assert((p), "[%s] %s ln: %u", \ + name(), message, length()); \ } while (0) -#define guarantee_heap_region_set(p, message) \ - do { \ - guarantee((p), "[%s] %s ln: %u cy: " SIZE_FORMAT, \ - name(), message, length(), total_capacity_bytes()); \ +#define guarantee_heap_region_set(p, message) \ + do { \ + guarantee((p), "[%s] %s ln: %u", \ + name(), message, length()); \ } while (0) -#define assert_free_region_list(p, message) \ - do { \ - assert((p), "[%s] %s ln: %u cy: " SIZE_FORMAT " hd: " PTR_FORMAT " tl: " PTR_FORMAT, \ - name(), message, length(), total_capacity_bytes(), p2i(_head), p2i(_tail)); \ +#define assert_free_region_list(p, message) \ + do { \ + assert((p), "[%s] %s ln: %u hd: " PTR_FORMAT " tl: " PTR_FORMAT, \ + name(), message, length(), p2i(_head), p2i(_tail)); \ } while (0) @@ -63,28 +63,6 @@ class SecondaryFreeRegionListMtSafeChecker : public HRSMtSafeChecker { public: v class HumongousRegionSetMtSafeChecker : public HRSMtSafeChecker { public: void check(); }; class OldRegionSetMtSafeChecker : public HRSMtSafeChecker { public: void check(); }; -class HeapRegionSetCount VALUE_OBJ_CLASS_SPEC { - friend class VMStructs; - uint _length; - size_t _capacity; - -public: - HeapRegionSetCount() : _length(0), _capacity(0) { } - - const uint length() const { return _length; } - const size_t capacity() const { return _capacity; } - - void increment(uint length_to_add, size_t capacity_to_add) { - _length += length_to_add; - _capacity += capacity_to_add; - } - - void decrement(const uint length_to_remove, const size_t capacity_to_remove) { - _length -= length_to_remove; - _capacity -= capacity_to_remove; - } -}; - // Base class for all the classes that represent heap region sets. It // contains the basic attributes that each set needs to maintain // (e.g., length, region num, used bytes sum) plus any shared @@ -98,10 +76,8 @@ private: HRSMtSafeChecker* _mt_safety_checker; protected: - // The number of regions added to the set. If the set contains - // only humongous regions, this reflects only 'starts humongous' - // regions and does not include 'continues humongous' ones. - HeapRegionSetCount _count; + // The number of regions in to the set. + uint _length; const char* _name; @@ -130,13 +106,9 @@ protected: public: const char* name() { return _name; } - uint length() const { return _count.length(); } + uint length() const { return _length; } - bool is_empty() { return _count.length() == 0; } - - size_t total_capacity_bytes() { - return _count.capacity(); - } + bool is_empty() { return _length == 0; } // It updates the fields of the set to reflect hr being added to // the set and tags the region appropriately. @@ -181,8 +153,8 @@ public: HeapRegionSet(const char* name, bool humongous, HRSMtSafeChecker* mt_safety_checker): HeapRegionSetBase(name, humongous, false /* free */, mt_safety_checker) { } - void bulk_remove(const HeapRegionSetCount& removed) { - _count.decrement(removed.length(), removed.capacity()); + void bulk_remove(const uint removed) { + _length -= removed; } }; diff --git a/hotspot/src/share/vm/gc/g1/heapRegionSet.inline.hpp b/hotspot/src/share/vm/gc/g1/heapRegionSet.inline.hpp index f733d567f34..06cdd773840 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionSet.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionSet.inline.hpp @@ -33,7 +33,7 @@ inline void HeapRegionSetBase::add(HeapRegion* hr) { assert_heap_region_set(hr->next() == NULL, "should not already be linked"); assert_heap_region_set(hr->prev() == NULL, "should not already be linked"); - _count.increment(1u, hr->capacity()); + _length++; hr->set_containing_set(this); verify_region(hr); } @@ -45,8 +45,8 @@ inline void HeapRegionSetBase::remove(HeapRegion* hr) { assert_heap_region_set(hr->prev() == NULL, "should already be unlinked"); hr->set_containing_set(NULL); - assert_heap_region_set(_count.length() > 0, "pre-condition"); - _count.decrement(1u, hr->capacity()); + assert_heap_region_set(_length > 0, "pre-condition"); + _length--; } inline void FreeRegionList::add_ordered(HeapRegion* hr) { diff --git a/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp b/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp index 1fad2b64637..672c4f855ac 100644 --- a/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp +++ b/hotspot/src/share/vm/gc/g1/vmStructs_g1.hpp @@ -59,10 +59,7 @@ nonstatic_field(G1MonitoringSupport, _old_committed, size_t) \ nonstatic_field(G1MonitoringSupport, _old_used, size_t) \ \ - nonstatic_field(HeapRegionSetBase, _count, HeapRegionSetCount) \ - \ - nonstatic_field(HeapRegionSetCount, _length, uint) \ - nonstatic_field(HeapRegionSetCount, _capacity, size_t) \ + nonstatic_field(HeapRegionSetBase, _length, uint) \ \ nonstatic_field(PtrQueue, _active, bool) \ nonstatic_field(PtrQueue, _buf, void**) \ @@ -103,7 +100,6 @@ declare_type(HeapRegion, G1OffsetTableContigSpace) \ declare_toplevel_type(HeapRegionManager) \ declare_toplevel_type(HeapRegionSetBase) \ - declare_toplevel_type(HeapRegionSetCount) \ declare_toplevel_type(G1MonitoringSupport) \ declare_toplevel_type(PtrQueue) \ \ From 27c56ca8af12e7013bbc8228c7060b71e072097c Mon Sep 17 00:00:00 2001 From: Stefan Johansson Date: Fri, 11 Dec 2015 17:49:40 +0100 Subject: [PATCH 069/146] 8144505: Change G1ParCopyHelper to inherit OopClosure Reviewed-by: mgerdin, stefank --- hotspot/src/share/vm/gc/g1/g1OopClosures.cpp | 3 ++- hotspot/src/share/vm/gc/g1/g1OopClosures.hpp | 14 +++++++------- .../src/share/vm/gc/g1/g1OopClosures.inline.hpp | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/g1OopClosures.cpp b/hotspot/src/share/vm/gc/g1/g1OopClosures.cpp index 1d1c5cb0503..aef1e961d44 100644 --- a/hotspot/src/share/vm/gc/g1/g1OopClosures.cpp +++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.cpp @@ -31,7 +31,8 @@ #include "utilities/stack.inline.hpp" G1ParCopyHelper::G1ParCopyHelper(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) : - G1ParClosureSuper(g1, par_scan_state), + _g1(g1), + _par_scan_state(par_scan_state), _worker_id(par_scan_state->worker_id()), _scanned_klass(NULL), _cm(_g1->concurrent_mark()) diff --git a/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp b/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp index c995b9c5d0b..86fadd14a10 100644 --- a/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp +++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp @@ -86,8 +86,10 @@ public: }; // Add back base class for metadata -class G1ParCopyHelper : public G1ParClosureSuper { +class G1ParCopyHelper : public OopClosure { protected: + G1CollectedHeap* _g1; + G1ParScanThreadState* _par_scan_state; uint _worker_id; // Cache value from par_scan_state. Klass* _scanned_klass; ConcurrentMark* _cm; @@ -125,13 +127,11 @@ template class G1ParCopyClosure : public G1ParCopyHelper { public: G1ParCopyClosure(G1CollectedHeap* g1, G1ParScanThreadState* par_scan_state) : - G1ParCopyHelper(g1, par_scan_state) { - assert(ref_processor() == NULL, "sanity"); - } + G1ParCopyHelper(g1, par_scan_state) { } - template void do_oop_nv(T* p); - virtual void do_oop(oop* p) { do_oop_nv(p); } - virtual void do_oop(narrowOop* p) { do_oop_nv(p); } + template void do_oop_work(T* p); + virtual void do_oop(oop* p) { do_oop_work(p); } + virtual void do_oop(narrowOop* p) { do_oop_work(p); } }; class G1KlassScanClosure : public KlassClosure { diff --git a/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp b/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp index ff07495f9f6..815c6e1bbc8 100644 --- a/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp @@ -256,7 +256,7 @@ void G1ParCopyHelper::mark_forwarded_object(oop from_obj, oop to_obj) { template template -void G1ParCopyClosure::do_oop_nv(T* p) { +void G1ParCopyClosure::do_oop_work(T* p) { T heap_oop = oopDesc::load_heap_oop(p); if (oopDesc::is_null(heap_oop)) { From 79ddc1524897bb7f8083fea68c7675fcb51beca7 Mon Sep 17 00:00:00 2001 From: Stefan Johansson Date: Fri, 11 Dec 2015 17:49:40 +0100 Subject: [PATCH 070/146] 8144584: Change FilterIntoCSClosure to inherit OopClosure Reviewed-by: kbarrett, mgerdin --- hotspot/src/share/vm/gc/g1/g1OopClosures.hpp | 15 +++++---------- .../src/share/vm/gc/g1/g1OopClosures.inline.hpp | 2 +- hotspot/src/share/vm/gc/g1/g1RemSet.cpp | 2 +- .../vm/gc/g1/g1_specialized_oop_closures.hpp | 2 -- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp b/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp index 86fadd14a10..f1cbae22bc7 100644 --- a/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp +++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp @@ -144,20 +144,15 @@ class G1KlassScanClosure : public KlassClosure { void do_klass(Klass* klass); }; -class FilterIntoCSClosure: public ExtendedOopClosure { +class FilterIntoCSClosure: public OopClosure { G1CollectedHeap* _g1; OopClosure* _oc; - DirtyCardToOopClosure* _dcto_cl; public: - FilterIntoCSClosure( DirtyCardToOopClosure* dcto_cl, - G1CollectedHeap* g1, - OopClosure* oc) : - _dcto_cl(dcto_cl), _g1(g1), _oc(oc) { } + FilterIntoCSClosure(G1CollectedHeap* g1, OopClosure* oc) : _g1(g1), _oc(oc) { } - template void do_oop_nv(T* p); - virtual void do_oop(oop* p) { do_oop_nv(p); } - virtual void do_oop(narrowOop* p) { do_oop_nv(p); } - bool apply_to_weak_ref_discovered_field() { return true; } + template void do_oop_work(T* p); + virtual void do_oop(oop* p) { do_oop_work(p); } + virtual void do_oop(narrowOop* p) { do_oop_work(p); } }; class FilterOutOfRegionClosure: public ExtendedOopClosure { diff --git a/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp b/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp index 815c6e1bbc8..9aaa408d3e8 100644 --- a/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp @@ -42,7 +42,7 @@ */ template -inline void FilterIntoCSClosure::do_oop_nv(T* p) { +inline void FilterIntoCSClosure::do_oop_work(T* p) { T heap_oop = oopDesc::load_heap_oop(p); if (!oopDesc::is_null(heap_oop) && _g1->is_in_cset_or_humongous(oopDesc::decode_heap_oop_not_null(heap_oop))) { diff --git a/hotspot/src/share/vm/gc/g1/g1RemSet.cpp b/hotspot/src/share/vm/gc/g1/g1RemSet.cpp index 0b812183c84..7bf28b5debf 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSet.cpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSet.cpp @@ -448,7 +448,7 @@ bool G1RemSet::refine_card(jbyte* card_ptr, uint worker_i, update_rs_oop_cl.set_from(r); G1TriggerClosure trigger_cl; - FilterIntoCSClosure into_cs_cl(NULL, _g1, &trigger_cl); + FilterIntoCSClosure into_cs_cl(_g1, &trigger_cl); G1InvokeIfNotTriggeredClosure invoke_cl(&trigger_cl, &into_cs_cl); G1Mux2Closure mux(&invoke_cl, &update_rs_oop_cl); diff --git a/hotspot/src/share/vm/gc/g1/g1_specialized_oop_closures.hpp b/hotspot/src/share/vm/gc/g1/g1_specialized_oop_closures.hpp index 5243d76c4e3..453165471be 100644 --- a/hotspot/src/share/vm/gc/g1/g1_specialized_oop_closures.hpp +++ b/hotspot/src/share/vm/gc/g1/g1_specialized_oop_closures.hpp @@ -35,7 +35,6 @@ class G1ParScanClosure; class G1ParPushHeapRSClosure; -class FilterIntoCSClosure; class FilterOutOfRegionClosure; class G1CMOopClosure; class G1RootRegionScanClosure; @@ -48,7 +47,6 @@ class G1InvokeIfNotTriggeredClosure; #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1(f) \ f(G1ParScanClosure,_nv) \ f(G1ParPushHeapRSClosure,_nv) \ - f(FilterIntoCSClosure,_nv) \ f(FilterOutOfRegionClosure,_nv) \ f(G1CMOopClosure,_nv) \ f(G1RootRegionScanClosure,_nv) \ From 33d3e19b81bd476a15bc43e90467cefd491c5bdb Mon Sep 17 00:00:00 2001 From: Stefan Johansson Date: Fri, 11 Dec 2015 17:49:41 +0100 Subject: [PATCH 071/146] 8144701: Change three G1 remembererd set closures to be OopClosures Reviewed-by: mgerdin, stefank --- hotspot/src/share/vm/gc/g1/g1OopClosures.hpp | 24 +++++++++---------- .../share/vm/gc/g1/g1OopClosures.inline.hpp | 6 ++--- .../vm/gc/g1/g1_specialized_oop_closures.hpp | 10 +------- 3 files changed, 16 insertions(+), 24 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp b/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp index f1cbae22bc7..2ba19e33d6c 100644 --- a/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp +++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.hpp @@ -201,40 +201,40 @@ public: // during an evacuation pause) to record cards containing // pointers into the collection set. -class G1Mux2Closure : public ExtendedOopClosure { +class G1Mux2Closure : public OopClosure { OopClosure* _c1; OopClosure* _c2; public: G1Mux2Closure(OopClosure *c1, OopClosure *c2); - template void do_oop_nv(T* p); - virtual void do_oop(oop* p) { do_oop_nv(p); } - virtual void do_oop(narrowOop* p) { do_oop_nv(p); } + template void do_oop_work(T* p); + virtual void do_oop(oop* p) { do_oop_work(p); } + virtual void do_oop(narrowOop* p) { do_oop_work(p); } }; // A closure that returns true if it is actually applied // to a reference -class G1TriggerClosure : public ExtendedOopClosure { +class G1TriggerClosure : public OopClosure { bool _triggered; public: G1TriggerClosure(); bool triggered() const { return _triggered; } - template void do_oop_nv(T* p); - virtual void do_oop(oop* p) { do_oop_nv(p); } - virtual void do_oop(narrowOop* p) { do_oop_nv(p); } + template void do_oop_work(T* p); + virtual void do_oop(oop* p) { do_oop_work(p); } + virtual void do_oop(narrowOop* p) { do_oop_work(p); } }; // A closure which uses a triggering closure to determine // whether to apply an oop closure. -class G1InvokeIfNotTriggeredClosure: public ExtendedOopClosure { +class G1InvokeIfNotTriggeredClosure: public OopClosure { G1TriggerClosure* _trigger_cl; OopClosure* _oop_cl; public: G1InvokeIfNotTriggeredClosure(G1TriggerClosure* t, OopClosure* oc); - template void do_oop_nv(T* p); - virtual void do_oop(oop* p) { do_oop_nv(p); } - virtual void do_oop(narrowOop* p) { do_oop_nv(p); } + template void do_oop_work(T* p); + virtual void do_oop(oop* p) { do_oop_work(p); } + virtual void do_oop(narrowOop* p) { do_oop_work(p); } }; class G1UpdateRSOrPushRefOopClosure: public OopClosure { diff --git a/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp b/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp index 9aaa408d3e8..b65002af6b4 100644 --- a/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp +++ b/hotspot/src/share/vm/gc/g1/g1OopClosures.inline.hpp @@ -136,20 +136,20 @@ inline void G1RootRegionScanClosure::do_oop_nv(T* p) { } template -inline void G1Mux2Closure::do_oop_nv(T* p) { +inline void G1Mux2Closure::do_oop_work(T* p) { // Apply first closure; then apply the second. _c1->do_oop(p); _c2->do_oop(p); } template -inline void G1TriggerClosure::do_oop_nv(T* p) { +inline void G1TriggerClosure::do_oop_work(T* p) { // Record that this closure was actually applied (triggered). _triggered = true; } template -inline void G1InvokeIfNotTriggeredClosure::do_oop_nv(T* p) { +inline void G1InvokeIfNotTriggeredClosure::do_oop_work(T* p) { if (!_trigger_cl->triggered()) { _oop_cl->do_oop(p); } diff --git a/hotspot/src/share/vm/gc/g1/g1_specialized_oop_closures.hpp b/hotspot/src/share/vm/gc/g1/g1_specialized_oop_closures.hpp index 453165471be..e2698be9963 100644 --- a/hotspot/src/share/vm/gc/g1/g1_specialized_oop_closures.hpp +++ b/hotspot/src/share/vm/gc/g1/g1_specialized_oop_closures.hpp @@ -39,19 +39,11 @@ class FilterOutOfRegionClosure; class G1CMOopClosure; class G1RootRegionScanClosure; -// Specialized oop closures from g1RemSet.cpp -class G1Mux2Closure; -class G1TriggerClosure; -class G1InvokeIfNotTriggeredClosure; - #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1(f) \ f(G1ParScanClosure,_nv) \ f(G1ParPushHeapRSClosure,_nv) \ f(FilterOutOfRegionClosure,_nv) \ f(G1CMOopClosure,_nv) \ - f(G1RootRegionScanClosure,_nv) \ - f(G1Mux2Closure,_nv) \ - f(G1TriggerClosure,_nv) \ - f(G1InvokeIfNotTriggeredClosure,_nv) + f(G1RootRegionScanClosure,_nv) #endif // SHARE_VM_GC_G1_G1_SPECIALIZED_OOP_CLOSURES_HPP From d95b280d791fc36cf2b9fc3092ff2264210ddda8 Mon Sep 17 00:00:00 2001 From: Stefan Johansson Date: Fri, 11 Dec 2015 17:49:42 +0100 Subject: [PATCH 072/146] 8144908: Remove apply_to_weak_ref_discovered_field override for UpdateRSOopClosure Reviewed-by: kbarrett, jmasa --- hotspot/src/share/vm/gc/g1/g1RemSet.hpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/g1RemSet.hpp b/hotspot/src/share/vm/gc/g1/g1RemSet.hpp index 1fe97fb7a81..73034313786 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSet.hpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSet.hpp @@ -198,10 +198,6 @@ public: virtual void do_oop(narrowOop* p) { do_oop_work(p); } virtual void do_oop(oop* p) { do_oop_work(p); } - - // Override: this closure is idempotent. - // bool idempotent() { return true; } - bool apply_to_weak_ref_discovered_field() { return true; } }; #endif // SHARE_VM_GC_G1_G1REMSET_HPP From ef800bd53f831e1554f04f5a7857501f29d7ef49 Mon Sep 17 00:00:00 2001 From: Frederic Parain Date: Fri, 11 Dec 2015 09:07:07 -0800 Subject: [PATCH 073/146] 8046936: JEP 270: Reserved Stack Areas for Critical Sections Reviewed-by: acorn, dcubed --- .../src/cpu/aarch64/vm/globals_aarch64.hpp | 3 + .../cpu/sparc/vm/c1_LIRAssembler_sparc.cpp | 3 + hotspot/src/cpu/sparc/vm/frame_sparc.cpp | 2 +- .../cpu/sparc/vm/globalDefinitions_sparc.hpp | 4 + hotspot/src/cpu/sparc/vm/globals_sparc.hpp | 3 + .../src/cpu/sparc/vm/interp_masm_sparc.cpp | 13 + .../src/cpu/sparc/vm/macroAssembler_sparc.cpp | 18 ++ .../src/cpu/sparc/vm/macroAssembler_sparc.hpp | 3 + hotspot/src/cpu/sparc/vm/sparc.ad | 4 + .../src/cpu/sparc/vm/stubGenerator_sparc.cpp | 7 +- .../src/cpu/x86/vm/c1_LIRAssembler_x86.cpp | 4 + .../src/cpu/x86/vm/globalDefinitions_x86.hpp | 4 + hotspot/src/cpu/x86/vm/globals_x86.hpp | 3 + hotspot/src/cpu/x86/vm/interp_masm_x86.cpp | 19 ++ hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp | 16 ++ hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp | 5 +- .../src/cpu/x86/vm/stubGenerator_x86_32.cpp | 5 +- .../src/cpu/x86/vm/stubGenerator_x86_64.cpp | 5 + .../vm/templateInterpreterGenerator_x86.cpp | 4 +- hotspot/src/cpu/x86/vm/x86_32.ad | 12 +- hotspot/src/cpu/x86/vm/x86_64.ad | 7 +- hotspot/src/cpu/zero/vm/globals_zero.hpp | 3 + .../HotSpotResolvedJavaMethodImpl.java | 4 +- .../jdk/vm/ci/hotspot/HotSpotVMConfig.java | 2 +- hotspot/src/os/bsd/vm/os_bsd.cpp | 2 +- hotspot/src/os/bsd/vm/os_bsd.hpp | 2 + hotspot/src/os/linux/vm/os_linux.cpp | 11 +- hotspot/src/os/linux/vm/os_linux.hpp | 2 + hotspot/src/os/solaris/vm/os_solaris.cpp | 3 +- hotspot/src/os/solaris/vm/os_solaris.hpp | 4 +- hotspot/src/os/windows/vm/os_windows.cpp | 44 +++- hotspot/src/os/windows/vm/os_windows.hpp | 4 + hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp | 63 ++++- .../src/os_cpu/linux_x86/vm/os_linux_x86.cpp | 68 ++++- .../solaris_sparc/vm/os_solaris_sparc.cpp | 55 +++- .../os_cpu/solaris_x86/vm/os_solaris_x86.cpp | 64 ++++- hotspot/src/share/vm/c1/c1_Compilation.cpp | 1 + hotspot/src/share/vm/c1/c1_Compilation.hpp | 6 +- hotspot/src/share/vm/c1/c1_GraphBuilder.cpp | 17 +- hotspot/src/share/vm/c1/c1_Runtime1.cpp | 2 +- hotspot/src/share/vm/ci/ciMethod.cpp | 1 + hotspot/src/share/vm/ci/ciMethod.hpp | 4 +- .../share/vm/classfile/classFileParser.cpp | 8 + hotspot/src/share/vm/classfile/vmSymbols.hpp | 1 + .../vm/interpreter/interpreterRuntime.cpp | 21 ++ .../vm/interpreter/interpreterRuntime.hpp | 3 + hotspot/src/share/vm/jvmci/jvmciRuntime.cpp | 2 +- hotspot/src/share/vm/memory/universe.cpp | 10 +- hotspot/src/share/vm/memory/universe.hpp | 4 + hotspot/src/share/vm/oops/method.hpp | 27 +- hotspot/src/share/vm/opto/compile.cpp | 3 +- hotspot/src/share/vm/opto/compile.hpp | 3 + hotspot/src/share/vm/opto/parse1.cpp | 6 +- hotspot/src/share/vm/runtime/arguments.cpp | 6 + .../src/share/vm/runtime/deoptimization.cpp | 2 +- hotspot/src/share/vm/runtime/globals.hpp | 7 + hotspot/src/share/vm/runtime/javaCalls.cpp | 4 +- hotspot/src/share/vm/runtime/os.cpp | 5 +- hotspot/src/share/vm/runtime/os.hpp | 1 + .../src/share/vm/runtime/sharedRuntime.cpp | 86 ++++++- .../src/share/vm/runtime/sharedRuntime.hpp | 5 + hotspot/src/share/vm/runtime/stubRoutines.cpp | 1 + hotspot/src/share/vm/runtime/stubRoutines.hpp | 2 + hotspot/src/share/vm/runtime/thread.cpp | 60 ++++- hotspot/src/share/vm/runtime/thread.hpp | 26 +- .../src/share/vm/runtime/thread.inline.hpp | 8 +- hotspot/src/share/vm/runtime/vmStructs.cpp | 2 +- hotspot/src/share/vm/trace/trace.xml | 7 +- .../ReservedStack/ReservedStackTest.java | 235 ++++++++++++++++++ 69 files changed, 987 insertions(+), 64 deletions(-) create mode 100644 hotspot/test/runtime/ReservedStack/ReservedStackTest.java diff --git a/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp index 0182af2400f..8e5ed8c43f0 100644 --- a/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp @@ -58,14 +58,17 @@ define_pd_global(intx, InlineFrequencyCount, 100); #define DEFAULT_STACK_YELLOW_PAGES (2) #define DEFAULT_STACK_RED_PAGES (1) #define DEFAULT_STACK_SHADOW_PAGES (4 DEBUG_ONLY(+5)) +#define DEFAULT_STACK_RESERVED_PAGES (0) #define MIN_STACK_YELLOW_PAGES 1 #define MIN_STACK_RED_PAGES 1 #define MIN_STACK_SHADOW_PAGES 1 +#define MIN_STACK_RESERVED_PAGES (0) define_pd_global(intx, StackYellowPages, DEFAULT_STACK_YELLOW_PAGES); define_pd_global(intx, StackRedPages, DEFAULT_STACK_RED_PAGES); define_pd_global(intx, StackShadowPages, DEFAULT_STACK_SHADOW_PAGES); +define_pd_global(intx, StackReservedPages, DEFAULT_STACK_RESERVED_PAGES); define_pd_global(bool, RewriteBytecodes, true); define_pd_global(bool, RewriteFrequentPairs, true); diff --git a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp index aa242573d66..82e9bbddf2a 100644 --- a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp @@ -1453,6 +1453,9 @@ void LIR_Assembler::reg2mem(LIR_Opr from_reg, LIR_Opr dest, BasicType type, void LIR_Assembler::return_op(LIR_Opr result) { + if (StackReservedPages > 0 && compilation()->has_reserved_stack_access()) { + __ reserved_stack_check(); + } // the poll may need a register so just pick one that isn't the return register #if defined(TIERED) && !defined(_LP64) if (result->type_field() == LIR_OprDesc::long_type) { diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp index 6a7df76bfeb..6ee253c4d0b 100644 --- a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp @@ -632,7 +632,7 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const { // stack frames shouldn't be much larger than max_stack elements - if (fp() - sp() > 1024 + m->max_stack()*Interpreter::stackElementSize) { + if (fp() - unextended_sp() > 1024 + m->max_stack()*Interpreter::stackElementSize) { return false; } diff --git a/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp b/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp index 93432223e8d..17492911197 100644 --- a/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/globalDefinitions_sparc.hpp @@ -54,4 +54,8 @@ const int StackAlignmentInBytes = (2*wordSize); #endif #endif +#if defined(SOLARIS) +#define SUPPORT_RESERVED_STACK_AREA +#endif + #endif // CPU_SPARC_VM_GLOBALDEFINITIONS_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp index 06867066fc1..6c6e3fb15c2 100644 --- a/hotspot/src/cpu/sparc/vm/globals_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/globals_sparc.hpp @@ -54,6 +54,7 @@ define_pd_global(intx, InlineSmallCode, 1500); #define DEFAULT_STACK_YELLOW_PAGES (2) #define DEFAULT_STACK_RED_PAGES (1) +#define DEFAULT_STACK_RESERVED_PAGES (SOLARIS_ONLY(1) NOT_SOLARIS(0)) #ifdef _LP64 // Stack slots are 2X larger in LP64 than in the 32 bit VM. @@ -69,10 +70,12 @@ define_pd_global(intx, VMThreadStackSize, 512); #define MIN_STACK_YELLOW_PAGES DEFAULT_STACK_YELLOW_PAGES #define MIN_STACK_RED_PAGES DEFAULT_STACK_RED_PAGES #define MIN_STACK_SHADOW_PAGES DEFAULT_STACK_SHADOW_PAGES +#define MIN_STACK_RESERVED_PAGES (0) define_pd_global(intx, StackYellowPages, DEFAULT_STACK_YELLOW_PAGES); define_pd_global(intx, StackRedPages, DEFAULT_STACK_RED_PAGES); define_pd_global(intx, StackShadowPages, DEFAULT_STACK_SHADOW_PAGES); +define_pd_global(intx, StackReservedPages, DEFAULT_STACK_RESERVED_PAGES); define_pd_global(bool, RewriteBytecodes, true); define_pd_global(bool, RewriteFrequentPairs, true); diff --git a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp index b53156f1393..1e8d36fbb88 100644 --- a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp @@ -1140,6 +1140,19 @@ void InterpreterMacroAssembler::remove_activation(TosState state, // save result (push state before jvmti call and pop it afterwards) and notify jvmti notify_method_exit(false, state, NotifyJVMTI); + if (StackReservedPages > 0) { + // testing if Stack Reserved Area needs to be re-enabled + Label no_reserved_zone_enabling; + ld_ptr(G2_thread, JavaThread::reserved_stack_activation_offset(), G3_scratch); + cmp_and_brx_short(SP, G3_scratch, Assembler::lessUnsigned, Assembler::pt, no_reserved_zone_enabling); + + call_VM_leaf(noreg, CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), G2_thread); + call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_delayed_StackOverflowError), G2_thread); + should_not_reach_here(); + + bind(no_reserved_zone_enabling); + } + interp_verify_oop(Otos_i, state, __FILE__, __LINE__); verify_thread(); diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp index 0d069a48ea5..1759df552e3 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp @@ -3601,6 +3601,24 @@ void MacroAssembler::bang_stack_size(Register Rsize, Register Rtsp, } } +void MacroAssembler::reserved_stack_check() { + // testing if reserved zone needs to be enabled + Label no_reserved_zone_enabling; + + ld_ptr(G2_thread, JavaThread::reserved_stack_activation_offset(), G4_scratch); + cmp_and_brx_short(SP, G4_scratch, Assembler::lessUnsigned, Assembler::pt, no_reserved_zone_enabling); + + call_VM_leaf(L0, CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), G2_thread); + + AddressLiteral stub(StubRoutines::throw_delayed_StackOverflowError_entry()); + jump_to(stub, G4_scratch); + delayed()->restore(); + + should_not_reach_here(); + + bind(no_reserved_zone_enabling); +} + /////////////////////////////////////////////////////////////////////////////////// #if INCLUDE_ALL_GCS diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp index d58fc54f1c9..a7703fa0262 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp @@ -1422,6 +1422,9 @@ public: // stack overflow + shadow pages. Clobbers tsp and scratch registers. void bang_stack_size(Register Rsize, Register Rtsp, Register Rscratch); + // Check for reserved stack access in method being exited (for JIT) + void reserved_stack_check(); + virtual RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr, Register tmp, int offset); void verify_tlab(); diff --git a/hotspot/src/cpu/sparc/vm/sparc.ad b/hotspot/src/cpu/sparc/vm/sparc.ad index 3b3a848cdb5..336a3cdd19e 100644 --- a/hotspot/src/cpu/sparc/vm/sparc.ad +++ b/hotspot/src/cpu/sparc/vm/sparc.ad @@ -1294,6 +1294,10 @@ void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const { __ verify_thread(); + if (StackReservedPages > 0 && C->has_reserved_stack_access()) { + __ reserved_stack_check(); + } + // If this does safepoint polling, then do it here if(do_polling() && ra_->C->is_method_compilation()) { AddressLiteral polling_page(os::get_polling_page()); diff --git a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp index df1b5be8097..98d82ee07e5 100644 --- a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp @@ -5355,7 +5355,12 @@ class StubGenerator: public StubCodeGenerator { #endif // COMPILER2 !=> _LP64 // Build this early so it's available for the interpreter. - StubRoutines::_throw_StackOverflowError_entry = generate_throw_exception("StackOverflowError throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_StackOverflowError)); + StubRoutines::_throw_StackOverflowError_entry = + generate_throw_exception("StackOverflowError throw_exception", + CAST_FROM_FN_PTR(address, SharedRuntime::throw_StackOverflowError)); + StubRoutines::_throw_delayed_StackOverflowError_entry = + generate_throw_exception("delayed StackOverflowError throw_exception", + CAST_FROM_FN_PTR(address, SharedRuntime::throw_delayed_StackOverflowError)); if (UseCRC32Intrinsics) { // set table address before stub generation which use it diff --git a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp index 6e62429a7ed..bfe8b8c86e9 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp @@ -518,6 +518,10 @@ void LIR_Assembler::return_op(LIR_Opr result) { // Pop the stack before the safepoint code __ remove_frame(initial_frame_size_in_bytes()); + if (StackReservedPages > 0 && compilation()->has_reserved_stack_access()) { + __ reserved_stack_check(); + } + bool result_is_oop = result->is_valid() ? result->is_oop() : false; // Note: we do not need to round double result; float result has the right precision diff --git a/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp b/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp index 8ddbdf82ca4..5118e01130b 100644 --- a/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp +++ b/hotspot/src/cpu/x86/vm/globalDefinitions_x86.hpp @@ -57,4 +57,8 @@ const int StackAlignmentInBytes = 16; #define INCLUDE_RTM_OPT 1 #endif +#if defined(LINUX) || defined(SOLARIS) || defined(__APPLE__) +#define SUPPORT_RESERVED_STACK_AREA +#endif + #endif // CPU_X86_VM_GLOBALDEFINITIONS_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/globals_x86.hpp b/hotspot/src/cpu/x86/vm/globals_x86.hpp index 43c4cca5b2a..07fc7d511b4 100644 --- a/hotspot/src/cpu/x86/vm/globals_x86.hpp +++ b/hotspot/src/cpu/x86/vm/globals_x86.hpp @@ -57,9 +57,11 @@ define_pd_global(intx, InlineSmallCode, 1000); #define DEFAULT_STACK_YELLOW_PAGES (NOT_WINDOWS(2) WINDOWS_ONLY(3)) #define DEFAULT_STACK_RED_PAGES (1) +#define DEFAULT_STACK_RESERVED_PAGES (NOT_WINDOWS(1) WINDOWS_ONLY(0)) #define MIN_STACK_YELLOW_PAGES DEFAULT_STACK_YELLOW_PAGES #define MIN_STACK_RED_PAGES DEFAULT_STACK_RED_PAGES +#define MIN_STACK_RESERVED_PAGES (0) #ifdef AMD64 // Very large C++ stack frames using solaris-amd64 optimized builds @@ -76,6 +78,7 @@ define_pd_global(intx, InlineSmallCode, 1000); define_pd_global(intx, StackYellowPages, DEFAULT_STACK_YELLOW_PAGES); define_pd_global(intx, StackRedPages, DEFAULT_STACK_RED_PAGES); define_pd_global(intx, StackShadowPages, DEFAULT_STACK_SHADOW_PAGES); +define_pd_global(intx, StackReservedPages, DEFAULT_STACK_RESERVED_PAGES); define_pd_global(bool, RewriteBytecodes, true); define_pd_global(bool, RewriteFrequentPairs, true); diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp index ea4c18d11c6..2ac94e22e17 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp @@ -1023,6 +1023,25 @@ void InterpreterMacroAssembler::remove_activation( // get sender sp movptr(rbx, Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize)); + if (StackReservedPages > 0) { + // testing if reserved zone needs to be re-enabled + Register rthread = LP64_ONLY(r15_thread) NOT_LP64(rcx); + Label no_reserved_zone_enabling; + + NOT_LP64(get_thread(rthread);) + + cmpptr(rbx, Address(rthread, JavaThread::reserved_stack_activation_offset())); + jcc(Assembler::lessEqual, no_reserved_zone_enabling); + + call_VM_leaf( + CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), rthread); + push(rthread); + call_VM(noreg, CAST_FROM_FN_PTR(address, + InterpreterRuntime::throw_delayed_StackOverflowError)); + should_not_reach_here(); + + bind(no_reserved_zone_enabling); + } leave(); // remove frame anchor pop(ret_addr); // get return address mov(rsp, rbx); // set sp to sender sp diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp index 50f85fbfa84..59364c7d1df 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp @@ -1067,6 +1067,22 @@ void MacroAssembler::bang_stack_size(Register size, Register tmp) { } } +void MacroAssembler::reserved_stack_check() { + // testing if reserved zone needs to be enabled + Label no_reserved_zone_enabling; + Register thread = NOT_LP64(rsi) LP64_ONLY(r15_thread); + NOT_LP64(get_thread(rsi);) + + cmpptr(rsp, Address(thread, JavaThread::reserved_stack_activation_offset())); + jcc(Assembler::below, no_reserved_zone_enabling); + + call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::enable_stack_reserved_zone), thread); + jump(RuntimeAddress(StubRoutines::throw_delayed_StackOverflowError_entry())); + should_not_reach_here(); + + bind(no_reserved_zone_enabling); +} + int MacroAssembler::biased_locking_enter(Register lock_reg, Register obj_reg, Register swap_reg, diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp index b4e440f4383..e185330f231 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -641,6 +641,9 @@ class MacroAssembler: public Assembler { // stack overflow + shadow pages. Also, clobbers tmp void bang_stack_size(Register size, Register tmp); + // Check for reserved stack access in method being exited (for JIT) + void reserved_stack_check(); + virtual RegisterOrConstant delayed_value_impl(intptr_t* delayed_value_addr, Register tmp, int offset); diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp index 6298be79e33..41373cb3bfe 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp @@ -3290,7 +3290,10 @@ class StubGenerator: public StubCodeGenerator { CAST_FROM_FN_PTR(address, SharedRuntime::d2l)); // Build this early so it's available for the interpreter - StubRoutines::_throw_StackOverflowError_entry = generate_throw_exception("StackOverflowError throw_exception", CAST_FROM_FN_PTR(address, SharedRuntime::throw_StackOverflowError)); + StubRoutines::_throw_StackOverflowError_entry = generate_throw_exception("StackOverflowError throw_exception", + CAST_FROM_FN_PTR(address, SharedRuntime::throw_StackOverflowError)); + StubRoutines::_throw_delayed_StackOverflowError_entry = generate_throw_exception("delayed StackOverflowError throw_exception", + CAST_FROM_FN_PTR(address, SharedRuntime::throw_delayed_StackOverflowError)); if (UseCRC32Intrinsics) { // set table address before stub generation which use it diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp index b68bedf1ad6..fa9ae3a14e1 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp @@ -4410,6 +4410,11 @@ class StubGenerator: public StubCodeGenerator { CAST_FROM_FN_PTR(address, SharedRuntime:: throw_StackOverflowError)); + StubRoutines::_throw_delayed_StackOverflowError_entry = + generate_throw_exception("delayed StackOverflowError throw_exception", + CAST_FROM_FN_PTR(address, + SharedRuntime:: + throw_delayed_StackOverflowError)); if (UseCRC32Intrinsics) { // set table address before stub generation which use it StubRoutines::_crc_table_adr = (address)StubRoutines::x86::_crc_table; diff --git a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp index e011552dfcb..42be5f952b2 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp @@ -541,8 +541,8 @@ void InterpreterGenerator::generate_stack_overflow_check(void) { __ subptr(rax, stack_size); // Use the maximum number of pages we might bang. - const int max_pages = StackShadowPages > (StackRedPages+StackYellowPages) ? StackShadowPages : - (StackRedPages+StackYellowPages); + const int max_pages = StackShadowPages > (StackRedPages+StackYellowPages+StackReservedPages) ? StackShadowPages : + (StackRedPages+StackYellowPages+StackReservedPages); // add in the red and yellow zone sizes __ addptr(rax, max_pages * page_size); diff --git a/hotspot/src/cpu/x86/vm/x86_32.ad b/hotspot/src/cpu/x86/vm/x86_32.ad index 1f38927626c..79f5e2b4462 100644 --- a/hotspot/src/cpu/x86/vm/x86_32.ad +++ b/hotspot/src/cpu/x86/vm/x86_32.ad @@ -670,17 +670,16 @@ void MachEpilogNode::format( PhaseRegAlloc *ra_, outputStream* st ) const { void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const { Compile *C = ra_->C; + MacroAssembler _masm(&cbuf); if (C->max_vector_size() > 16) { // Clear upper bits of YMM registers when current compiled code uses // wide vectors to avoid AVX <-> SSE transition penalty during call. - MacroAssembler masm(&cbuf); - masm.vzeroupper(); + _masm.vzeroupper(); } // If method set FPU control word, restore to standard control word if (C->in_24_bit_fp_mode()) { - MacroAssembler masm(&cbuf); - masm.fldcw(ExternalAddress(StubRoutines::addr_fpu_cntrl_wrd_std())); + _masm.fldcw(ExternalAddress(StubRoutines::addr_fpu_cntrl_wrd_std())); } int framesize = C->frame_size_in_bytes(); @@ -702,6 +701,10 @@ void MachEpilogNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const { emit_opcode(cbuf, 0x58 | EBP_enc); + if (StackReservedPages > 0 && C->has_reserved_stack_access()) { + __ reserved_stack_check(); + } + if (do_polling() && C->is_method_compilation()) { cbuf.relocate(cbuf.insts_end(), relocInfo::poll_return_type, 0); emit_opcode(cbuf,0x85); @@ -729,6 +732,7 @@ uint MachEpilogNode::size(PhaseRegAlloc *ra_) const { } else { size += framesize ? 3 : 0; } + size += 64; // added to support ReservedStackAccess return size; } diff --git a/hotspot/src/cpu/x86/vm/x86_64.ad b/hotspot/src/cpu/x86/vm/x86_64.ad index 9b4f9f9ebce..8a3cd428499 100644 --- a/hotspot/src/cpu/x86/vm/x86_64.ad +++ b/hotspot/src/cpu/x86/vm/x86_64.ad @@ -953,10 +953,11 @@ void MachEpilogNode::format(PhaseRegAlloc* ra_, outputStream* st) const void MachEpilogNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const { Compile* C = ra_->C; + MacroAssembler _masm(&cbuf); + if (C->max_vector_size() > 16) { // Clear upper bits of YMM registers when current compiled code uses // wide vectors to avoid AVX <-> SSE transition penalty during call. - MacroAssembler _masm(&cbuf); __ vzeroupper(); } @@ -984,6 +985,10 @@ void MachEpilogNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const // popq rbp emit_opcode(cbuf, 0x58 | RBP_enc); + if (StackReservedPages > 0 && C->has_reserved_stack_access()) { + __ reserved_stack_check(); + } + if (do_polling() && C->is_method_compilation()) { MacroAssembler _masm(&cbuf); AddressLiteral polling_page(os::get_polling_page(), relocInfo::poll_return_type); diff --git a/hotspot/src/cpu/zero/vm/globals_zero.hpp b/hotspot/src/cpu/zero/vm/globals_zero.hpp index 00c9d7e8a94..a85e5a92509 100644 --- a/hotspot/src/cpu/zero/vm/globals_zero.hpp +++ b/hotspot/src/cpu/zero/vm/globals_zero.hpp @@ -48,14 +48,17 @@ define_pd_global(intx, InlineSmallCode, 1000 ); #define DEFAULT_STACK_YELLOW_PAGES (2) #define DEFAULT_STACK_RED_PAGES (1) #define DEFAULT_STACK_SHADOW_PAGES (5 LP64_ONLY(+1) DEBUG_ONLY(+3)) +#define DEFAULT_STACK_RESERVED_PAGES (0) #define MIN_STACK_YELLOW_PAGES DEFAULT_STACK_YELLOW_PAGES #define MIN_STACK_RED_PAGES DEFAULT_STACK_RED_PAGES #define MIN_STACK_SHADOW_PAGES DEFAULT_STACK_SHADOW_PAGES +#define MIN_STACK_RESERVED_PAGES (0) define_pd_global(intx, StackYellowPages, DEFAULT_STACK_YELLOW_PAGES); define_pd_global(intx, StackRedPages, DEFAULT_STACK_RED_PAGES); define_pd_global(intx, StackShadowPages, DEFAULT_STACK_SHADOW_PAGES); +define_pd_global(intx, StackReservedPages, DEFAULT_STACK_RESERVED_PAGES); define_pd_global(bool, RewriteBytecodes, true); define_pd_global(bool, RewriteFrequentPairs, true); diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java index 4b7184e0529..34647ae886c 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -170,7 +170,7 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp * @return flags of this method */ private int getFlags() { - return UNSAFE.getByte(metaspaceMethod + config().methodFlagsOffset); + return UNSAFE.getShort(metaspaceMethod + config().methodFlagsOffset); } /** diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java index 2709c0807ac..2f8decbdeab 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java @@ -1244,7 +1244,7 @@ public class HotSpotVMConfig { @HotSpotVMField(name = "Method::_access_flags", type = "AccessFlags", get = HotSpotVMField.Type.OFFSET) @Stable public int methodAccessFlagsOffset; @HotSpotVMField(name = "Method::_constMethod", type = "ConstMethod*", get = HotSpotVMField.Type.OFFSET) @Stable public int methodConstMethodOffset; @HotSpotVMField(name = "Method::_intrinsic_id", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int methodIntrinsicIdOffset; - @HotSpotVMField(name = "Method::_flags", type = "u1", get = HotSpotVMField.Type.OFFSET) @Stable public int methodFlagsOffset; + @HotSpotVMField(name = "Method::_flags", type = "u2", get = HotSpotVMField.Type.OFFSET) @Stable public int methodFlagsOffset; @HotSpotVMField(name = "Method::_vtable_index", type = "int", get = HotSpotVMField.Type.OFFSET) @Stable public int methodVtableIndexOffset; @HotSpotVMConstant(name = "Method::_jfr_towrite") @Stable public int methodFlagsJfrTowrite; diff --git a/hotspot/src/os/bsd/vm/os_bsd.cpp b/hotspot/src/os/bsd/vm/os_bsd.cpp index 058b634e598..0efe55d829d 100644 --- a/hotspot/src/os/bsd/vm/os_bsd.cpp +++ b/hotspot/src/os/bsd/vm/os_bsd.cpp @@ -3497,7 +3497,7 @@ jint os::init_2(void) { // Add in 2*BytesPerWord times page size to account for VM stack during // class initialization depending on 32 or 64 bit VM. os::Bsd::min_stack_allowed = MAX2(os::Bsd::min_stack_allowed, - (size_t)(StackYellowPages+StackRedPages+StackShadowPages+ + (size_t)(StackReservedPages+StackYellowPages+StackRedPages+StackShadowPages+ 2*BytesPerWord COMPILER2_PRESENT(+1)) * Bsd::page_size()); size_t threadStackSizeInBytes = ThreadStackSize * K; diff --git a/hotspot/src/os/bsd/vm/os_bsd.hpp b/hotspot/src/os/bsd/vm/os_bsd.hpp index 4c63d532043..22c241ee3cc 100644 --- a/hotspot/src/os/bsd/vm/os_bsd.hpp +++ b/hotspot/src/os/bsd/vm/os_bsd.hpp @@ -99,6 +99,8 @@ class Bsd { static ExtendedPC fetch_frame_from_ucontext(Thread* thread, ucontext_t* uc, intptr_t** ret_sp, intptr_t** ret_fp); + static bool get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* uc, frame* fr); + // This boolean allows users to forward their own non-matching signals // to JVM_handle_bsd_signal, harmlessly. static bool signal_handlers_are_installed; diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp index 3a1769020b8..335a462b254 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -1861,8 +1861,8 @@ void * os::Linux::dll_load_in_vmthread(const char *filename, char *ebuf, JavaThread *jt = Threads::first(); while (jt) { - if (!jt->stack_guard_zone_unused() && // Stack not yet fully initialized - jt->stack_yellow_zone_enabled()) { // No pending stack overflow exceptions + if (!jt->stack_guard_zone_unused() && // Stack not yet fully initialized + jt->stack_guards_enabled()) { // No pending stack overflow exceptions if (!os::guard_memory((char *) jt->stack_red_zone_base() - jt->stack_red_zone_size(), jt->stack_yellow_zone_size() + jt->stack_red_zone_size())) { warning("Attempt to reguard stack yellow zone failed."); @@ -4603,6 +4603,11 @@ void os::init(void) { if (vm_page_size() > (int)Linux::vm_default_page_size()) { StackYellowPages = 1; StackRedPages = 1; +#if defined(IA32) || defined(IA64) + StackReservedPages = 1; +#else + StackReservedPages = 0; +#endif StackShadowPages = round_to((StackShadowPages*Linux::vm_default_page_size()), vm_page_size()) / vm_page_size(); } @@ -4664,7 +4669,7 @@ jint os::init_2(void) { // Add in 2*BytesPerWord times page size to account for VM stack during // class initialization depending on 32 or 64 bit VM. os::Linux::min_stack_allowed = MAX2(os::Linux::min_stack_allowed, - (size_t)(StackYellowPages+StackRedPages+StackShadowPages) * Linux::page_size() + + (size_t)(StackReservedPages+StackYellowPages+StackRedPages+StackShadowPages) * Linux::page_size() + (2*BytesPerWord COMPILER2_PRESENT(+1)) * Linux::vm_default_page_size()); size_t threadStackSizeInBytes = ThreadStackSize * K; diff --git a/hotspot/src/os/linux/vm/os_linux.hpp b/hotspot/src/os/linux/vm/os_linux.hpp index cbb649179fb..981dfe3fa2d 100644 --- a/hotspot/src/os/linux/vm/os_linux.hpp +++ b/hotspot/src/os/linux/vm/os_linux.hpp @@ -136,6 +136,8 @@ class Linux { static ExtendedPC fetch_frame_from_ucontext(Thread* thread, ucontext_t* uc, intptr_t** ret_sp, intptr_t** ret_fp); + static bool get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* uc, frame* fr); + // This boolean allows users to forward their own non-matching signals // to JVM_handle_linux_signal, harmlessly. static bool signal_handlers_are_installed; diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp index 6604a3b148a..3f47808051e 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.cpp +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp @@ -4382,6 +4382,7 @@ void os::init(void) { if (vm_page_size() > 8*K) { StackYellowPages = 1; StackRedPages = 1; + StackReservedPages = 1; StackShadowPages = round_to((StackShadowPages*8*K), vm_page_size()) / vm_page_size(); } } @@ -4438,7 +4439,7 @@ jint os::init_2(void) { // Add in 2*BytesPerWord times page size to account for VM stack during // class initialization depending on 32 or 64 bit VM. os::Solaris::min_stack_allowed = MAX2(os::Solaris::min_stack_allowed, - (size_t)(StackYellowPages+StackRedPages+StackShadowPages+ + (size_t)(StackReservedPages+StackYellowPages+StackRedPages+StackShadowPages+ 2*BytesPerWord COMPILER2_PRESENT(+1)) * page_size); size_t threadStackSizeInBytes = ThreadStackSize * K; diff --git a/hotspot/src/os/solaris/vm/os_solaris.hpp b/hotspot/src/os/solaris/vm/os_solaris.hpp index 9f5a450fb9a..7928349b63d 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.hpp +++ b/hotspot/src/os/solaris/vm/os_solaris.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -150,6 +150,8 @@ class Solaris { static ExtendedPC fetch_frame_from_ucontext(Thread* thread, ucontext_t* uc, intptr_t** ret_sp, intptr_t** ret_fp); + static bool get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* uc, frame* fr); + static void hotspot_sigmask(Thread* thread); // SR_handler diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index 7b2bf6d9e9c..47b28e3e43b 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -2374,6 +2374,39 @@ static inline void report_error(Thread* t, DWORD exception_code, // somewhere where we can find it in the minidump. } +bool os::win32::get_frame_at_stack_banging_point(JavaThread* thread, + struct _EXCEPTION_POINTERS* exceptionInfo, address pc, frame* fr) { + PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord; + address addr = (address) exceptionRecord->ExceptionInformation[1]; + if (Interpreter::contains(pc)) { + *fr = os::fetch_frame_from_context((void*)exceptionInfo->ContextRecord); + if (!fr->is_first_java_frame()) { + assert(fr->safe_for_sender(thread), "Safety check"); + *fr = fr->java_sender(); + } + } else { + // more complex code with compiled code + assert(!Interpreter::contains(pc), "Interpreted methods should have been handled above"); + CodeBlob* cb = CodeCache::find_blob(pc); + if (cb == NULL || !cb->is_nmethod() || cb->is_frame_complete_at(pc)) { + // Not sure where the pc points to, fallback to default + // stack overflow handling + return false; + } else { + *fr = os::fetch_frame_from_context((void*)exceptionInfo->ContextRecord); + // in compiled code, the stack banging is performed just after the return pc + // has been pushed on the stack + *fr = frame(fr->sp() + 1, fr->fp(), (address)*(fr->sp())); + if (!fr->is_java_frame()) { + assert(fr->safe_for_sender(thread), "Safety check"); + *fr = fr->java_sender(); + } + } + } + assert(fr->is_java_frame(), "Safety check"); + return true; +} + //----------------------------------------------------------------------------- LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) { if (InterceptOSException) return EXCEPTION_CONTINUE_SEARCH; @@ -2550,7 +2583,16 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) { SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW)); } #endif - if (thread->stack_yellow_zone_enabled()) { + if (thread->stack_guards_enabled()) { + if (_thread_in_Java) { + frame fr; + PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord; + address addr = (address) exceptionRecord->ExceptionInformation[1]; + if (os::win32::get_frame_at_stack_banging_point(thread, exceptionInfo, pc, &fr)) { + assert(fr.is_java_frame(), "Must be a Java frame"); + SharedRuntime::look_for_reserved_stack_annotated_method(thread, fr); + } + } // Yellow zone violation. The o/s has unprotected the first yellow // zone page for us. Note: must call disable_stack_yellow_zone to // update the enabled status, even if the zone contains only one page. diff --git a/hotspot/src/os/windows/vm/os_windows.hpp b/hotspot/src/os/windows/vm/os_windows.hpp index dd3911c48a7..58abc3510fd 100644 --- a/hotspot/src/os/windows/vm/os_windows.hpp +++ b/hotspot/src/os/windows/vm/os_windows.hpp @@ -110,6 +110,10 @@ class win32 { // Default stack size for the current process. static size_t default_stack_size() { return _default_stack_size; } + static bool get_frame_at_stack_banging_point(JavaThread* thread, + struct _EXCEPTION_POINTERS* exceptionInfo, + address pc, frame* fr); + #ifndef _WIN64 // A wrapper to install a structured exception handler for fast JNI accesors. static address fast_jni_accessor_wrapper(BasicType); diff --git a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp index 413cfc69560..4baa7301553 100644 --- a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp +++ b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp @@ -325,6 +325,7 @@ intptr_t* os::Bsd::ucontext_get_fp(ucontext_t * uc) { // os::Solaris::fetch_frame_from_ucontext() tries to skip nested signal // frames. Currently we don't do that on Bsd, so it's the same as // os::fetch_frame_from_context(). +// This method is also used for stack overflow signal handling. ExtendedPC os::Bsd::fetch_frame_from_ucontext(Thread* thread, ucontext_t* uc, intptr_t** ret_sp, intptr_t** ret_fp) { @@ -362,6 +363,48 @@ frame os::fetch_frame_from_context(void* ucVoid) { return frame(sp, fp, epc.pc()); } +frame os::fetch_frame_from_ucontext(Thread* thread, void* ucVoid) { + intptr_t* sp; + intptr_t* fp; + ExtendedPC epc = os::Bsd::fetch_frame_from_ucontext(thread, (ucontext_t*)ucVoid, &sp, &fp); + return frame(sp, fp, epc.pc()); +} + +bool os::Bsd::get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* uc, frame* fr) { + address pc = (address) os::Bsd::ucontext_get_pc(uc); + if (Interpreter::contains(pc)) { + // interpreter performs stack banging after the fixed frame header has + // been generated while the compilers perform it before. To maintain + // semantic consistency between interpreted and compiled frames, the + // method returns the Java sender of the current frame. + *fr = os::fetch_frame_from_ucontext(thread, uc); + if (!fr->is_first_java_frame()) { + assert(fr->safe_for_sender(thread), "Safety check"); + *fr = fr->java_sender(); + } + } else { + // more complex code with compiled code + assert(!Interpreter::contains(pc), "Interpreted methods should have been handled above"); + CodeBlob* cb = CodeCache::find_blob(pc); + if (cb == NULL || !cb->is_nmethod() || cb->is_frame_complete_at(pc)) { + // Not sure where the pc points to, fallback to default + // stack overflow handling + return false; + } else { + *fr = os::fetch_frame_from_ucontext(thread, uc); + // in compiled code, the stack banging is performed just after the return pc + // has been pushed on the stack + *fr = frame(fr->sp() + 1, fr->fp(), (address)*(fr->sp())); + if (!fr->is_java_frame()) { + assert(fr->safe_for_sender(thread), "Safety check"); + *fr = fr->java_sender(); + } + } + } + assert(fr->is_java_frame(), "Safety check"); + return true; +} + // By default, gcc always save frame pointer (%ebp/%rbp) on stack. It may get // turned off by -fomit-frame-pointer, frame os::get_sender_for_C_frame(frame* fr) { @@ -479,13 +522,31 @@ JVM_handle_bsd_signal(int sig, addr >= thread->stack_base() - thread->stack_size()) { // stack overflow if (thread->in_stack_yellow_zone(addr)) { - thread->disable_stack_yellow_zone(); if (thread->thread_state() == _thread_in_Java) { + if (thread->in_stack_reserved_zone(addr)) { + frame fr; + if (os::Bsd::get_frame_at_stack_banging_point(thread, uc, &fr)) { + assert(fr.is_java_frame(), "Must be a Java frame"); + frame activation = SharedRuntime::look_for_reserved_stack_annotated_method(thread, fr); + if (activation.sp() != NULL) { + thread->disable_stack_reserved_zone(); + if (activation.is_interpreted_frame()) { + thread->set_reserved_stack_activation((address)( + activation.fp() + frame::interpreter_frame_initial_sp_offset)); + } else { + thread->set_reserved_stack_activation((address)activation.unextended_sp()); + } + return 1; + } + } + } // Throw a stack overflow exception. Guard pages will be reenabled // while unwinding the stack. + thread->disable_stack_yellow_zone(); stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW); } else { // Thread was in the vm or native code. Return and try to finish. + thread->disable_stack_yellow_zone(); return 1; } } else if (thread->in_stack_red_zone(addr)) { diff --git a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp index 438b2673e66..0beebb05add 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp +++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp @@ -138,6 +138,7 @@ intptr_t* os::Linux::ucontext_get_fp(ucontext_t * uc) { // os::Solaris::fetch_frame_from_ucontext() tries to skip nested signal // frames. Currently we don't do that on Linux, so it's the same as // os::fetch_frame_from_context(). +// This method is also used for stack overflow signal handling. ExtendedPC os::Linux::fetch_frame_from_ucontext(Thread* thread, ucontext_t* uc, intptr_t** ret_sp, intptr_t** ret_fp) { @@ -175,6 +176,50 @@ frame os::fetch_frame_from_context(void* ucVoid) { return frame(sp, fp, epc.pc()); } +frame os::fetch_frame_from_ucontext(Thread* thread, void* ucVoid) { + intptr_t* sp; + intptr_t* fp; + ExtendedPC epc = os::Linux::fetch_frame_from_ucontext(thread, (ucontext_t*)ucVoid, &sp, &fp); + return frame(sp, fp, epc.pc()); +} + +bool os::Linux::get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* uc, frame* fr) { + address pc = (address) os::Linux::ucontext_get_pc(uc); + if (Interpreter::contains(pc)) { + // interpreter performs stack banging after the fixed frame header has + // been generated while the compilers perform it before. To maintain + // semantic consistency between interpreted and compiled frames, the + // method returns the Java sender of the current frame. + *fr = os::fetch_frame_from_ucontext(thread, uc); + if (!fr->is_first_java_frame()) { + assert(fr->safe_for_sender(thread), "Safety check"); + *fr = fr->java_sender(); + } + } else { + // more complex code with compiled code + assert(!Interpreter::contains(pc), "Interpreted methods should have been handled above"); + CodeBlob* cb = CodeCache::find_blob(pc); + if (cb == NULL || !cb->is_nmethod() || cb->is_frame_complete_at(pc)) { + // Not sure where the pc points to, fallback to default + // stack overflow handling + return false; + } else { + // in compiled code, the stack banging is performed just after the return pc + // has been pushed on the stack + intptr_t* fp = os::Linux::ucontext_get_fp(uc); + intptr_t* sp = os::Linux::ucontext_get_sp(uc); + *fr = frame(sp + 1, fp, (address)*sp); + if (!fr->is_java_frame()) { + assert(fr->safe_for_sender(thread), "Safety check"); + assert(!fr->is_first_frame(), "Safety check"); + *fr = fr->java_sender(); + } + } + } + assert(fr->is_java_frame(), "Safety check"); + return true; +} + // By default, gcc always save frame pointer (%ebp/%rbp) on stack. It may get // turned off by -fomit-frame-pointer, frame os::get_sender_for_C_frame(frame* fr) { @@ -305,13 +350,32 @@ JVM_handle_linux_signal(int sig, addr >= thread->stack_base() - thread->stack_size()) { // stack overflow if (thread->in_stack_yellow_zone(addr)) { - thread->disable_stack_yellow_zone(); if (thread->thread_state() == _thread_in_Java) { + if (thread->in_stack_reserved_zone(addr)) { + frame fr; + if (os::Linux::get_frame_at_stack_banging_point(thread, uc, &fr)) { + assert(fr.is_java_frame(), "Must be a Java frame"); + frame activation = + SharedRuntime::look_for_reserved_stack_annotated_method(thread, fr); + if (activation.sp() != NULL) { + thread->disable_stack_reserved_zone(); + if (activation.is_interpreted_frame()) { + thread->set_reserved_stack_activation((address)( + activation.fp() + frame::interpreter_frame_initial_sp_offset)); + } else { + thread->set_reserved_stack_activation((address)activation.unextended_sp()); + } + return 1; + } + } + } // Throw a stack overflow exception. Guard pages will be reenabled // while unwinding the stack. + thread->disable_stack_yellow_zone(); stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW); } else { // Thread was in the vm or native code. Return and try to finish. + thread->disable_stack_yellow_zone(); return 1; } } else if (thread->in_stack_red_zone(addr)) { @@ -868,7 +932,7 @@ void os::workaround_expand_exec_shield_cs_limit() { * we don't have much control or understanding of the address space, just let it slide. */ char* hint = (char*) (Linux::initial_thread_stack_bottom() - - ((StackYellowPages + StackRedPages + 1) * page_size)); + ((StackReservedPages + StackYellowPages + StackRedPages + 1) * page_size)); char* codebuf = os::attempt_reserve_memory_at(page_size, hint); if ( (codebuf == NULL) || (!os::commit_memory(codebuf, page_size, true)) ) { return; // No matter, we tried, best effort. diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp index faa33919e98..27666d6b951 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -213,6 +213,7 @@ address os::Solaris::ucontext_get_pc(ucontext_t *uc) { // // The difference between this and os::fetch_frame_from_context() is that // here we try to skip nested signal frames. +// This method is also used for stack overflow signal handling. ExtendedPC os::Solaris::fetch_frame_from_ucontext(Thread* thread, ucontext_t* uc, intptr_t** ret_sp, intptr_t** ret_fp) { @@ -252,6 +253,41 @@ frame os::fetch_frame_from_context(void* ucVoid) { return frame(sp, frame::unpatchable, epc.pc()); } +frame os::fetch_frame_from_ucontext(Thread* thread, void* ucVoid) { + intptr_t* sp; + ExtendedPC epc = os::Solaris::fetch_frame_from_ucontext(thread, (ucontext_t*)ucVoid, &sp, NULL); + return frame(sp, frame::unpatchable, epc.pc()); +} + +bool os::Solaris::get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* uc, frame* fr) { + address pc = (address) os::Solaris::ucontext_get_pc(uc); + if (Interpreter::contains(pc)) { + *fr = os::fetch_frame_from_ucontext(thread, uc); + if (!fr->is_first_java_frame()) { + assert(fr->safe_for_sender(thread), "Safety check"); + *fr = fr->java_sender(); + } + } else { + // more complex code with compiled code + assert(!Interpreter::contains(pc), "Interpreted methods should have been handled above"); + CodeBlob* cb = CodeCache::find_blob(pc); + if (cb == NULL || !cb->is_nmethod() || cb->is_frame_complete_at(pc)) { + // Not sure where the pc points to, fallback to default + // stack overflow handling + return false; + } else { + *fr = os::fetch_frame_from_ucontext(thread, uc); + *fr = frame(fr->sender_sp(), frame::unpatchable, fr->sender_pc()); + if (!fr->is_java_frame()) { + assert(fr->safe_for_sender(thread), "Safety check"); + *fr = fr->java_sender(); + } + } + } + assert(fr->is_java_frame(), "Safety check"); + return true; +} + frame os::get_sender_for_C_frame(frame* fr) { return frame(fr->sender_sp(), frame::unpatchable, fr->sender_pc()); } @@ -367,17 +403,32 @@ JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, if (sig == SIGSEGV && info->si_code == SEGV_ACCERR) { address addr = (address) info->si_addr; if (thread->in_stack_yellow_zone(addr)) { - thread->disable_stack_yellow_zone(); // Sometimes the register windows are not properly flushed. if(uc->uc_mcontext.gwins != NULL) { ::handle_unflushed_register_windows(uc->uc_mcontext.gwins); } if (thread->thread_state() == _thread_in_Java) { + if (thread->in_stack_reserved_zone(addr)) { + frame fr; + if (os::Solaris::get_frame_at_stack_banging_point(thread, uc, &fr)) { + assert(fr.is_java_frame(), "Must be a Java frame"); + frame activation = SharedRuntime::look_for_reserved_stack_annotated_method(thread, fr); + if (activation.sp() != NULL) { + thread->disable_stack_reserved_zone(); + RegisterMap map(thread); + int frame_size = activation.frame_size(&map); + thread->set_reserved_stack_activation((address)(((address)activation.sp()) - STACK_BIAS)); + return true; + } + } + } // Throw a stack overflow exception. Guard pages will be reenabled // while unwinding the stack. + thread->disable_stack_yellow_zone(); stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW); } else { // Thread was in the vm or native code. Return and try to finish. + thread->disable_stack_yellow_zone(); return true; } } else if (thread->in_stack_red_zone(addr)) { diff --git a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp index a28440fc9ff..e430553f2c2 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp @@ -198,6 +198,7 @@ address os::Solaris::ucontext_get_pc(ucontext_t *uc) { // // The difference between this and os::fetch_frame_from_context() is that // here we try to skip nested signal frames. +// This method is also used for stack overflow signal handling. ExtendedPC os::Solaris::fetch_frame_from_ucontext(Thread* thread, ucontext_t* uc, intptr_t** ret_sp, intptr_t** ret_fp) { @@ -236,6 +237,49 @@ frame os::fetch_frame_from_context(void* ucVoid) { return frame(sp, fp, epc.pc()); } +frame os::fetch_frame_from_ucontext(Thread* thread, void* ucVoid) { + intptr_t* sp; + intptr_t* fp; + ExtendedPC epc = os::Solaris::fetch_frame_from_ucontext(thread, (ucontext_t*)ucVoid, &sp, &fp); + return frame(sp, fp, epc.pc()); +} + +bool os::Solaris::get_frame_at_stack_banging_point(JavaThread* thread, ucontext_t* uc, frame* fr) { + address pc = (address) os::Solaris::ucontext_get_pc(uc); + if (Interpreter::contains(pc)) { + // interpreter performs stack banging after the fixed frame header has + // been generated while the compilers perform it before. To maintain + // semantic consistency between interpreted and compiled frames, the + // method returns the Java sender of the current frame. + *fr = os::fetch_frame_from_ucontext(thread, uc); + if (!fr->is_first_java_frame()) { + assert(fr->safe_for_sender(thread), "Safety check"); + *fr = fr->java_sender(); + } + } else { + // more complex code with compiled code + assert(!Interpreter::contains(pc), "Interpreted methods should have been handled above"); + CodeBlob* cb = CodeCache::find_blob(pc); + if (cb == NULL || !cb->is_nmethod() || cb->is_frame_complete_at(pc)) { + // Not sure where the pc points to, fallback to default + // stack overflow handling + return false; + } else { + // in compiled code, the stack banging is performed just after the return pc + // has been pushed on the stack + intptr_t* fp = os::Solaris::ucontext_get_fp(uc); + intptr_t* sp = os::Solaris::ucontext_get_sp(uc); + *fr = frame(sp + 1, fp, (address)*sp); + if (!fr->is_java_frame()) { + assert(fr->safe_for_sender(thread), "Safety check"); + *fr = fr->java_sender(); + } + } + } + assert(fr->is_java_frame(), "Safety check"); + return true; +} + frame os::get_sender_for_C_frame(frame* fr) { return frame(fr->sender_sp(), fr->link(), fr->sender_pc()); } @@ -422,13 +466,31 @@ JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, if (sig == SIGSEGV && info->si_code == SEGV_ACCERR) { address addr = (address) info->si_addr; if (thread->in_stack_yellow_zone(addr)) { - thread->disable_stack_yellow_zone(); if (thread->thread_state() == _thread_in_Java) { + if (thread->in_stack_reserved_zone(addr)) { + frame fr; + if (os::Solaris::get_frame_at_stack_banging_point(thread, uc, &fr)) { + assert(fr.is_java_frame(), "Must be Java frame"); + frame activation = SharedRuntime::look_for_reserved_stack_annotated_method(thread, fr); + if (activation.sp() != NULL) { + thread->disable_stack_reserved_zone(); + if (activation.is_interpreted_frame()) { + thread->set_reserved_stack_activation((address)( + activation.fp() + frame::interpreter_frame_initial_sp_offset)); + } else { + thread->set_reserved_stack_activation((address)activation.unextended_sp()); + } + return true; + } + } + } // Throw a stack overflow exception. Guard pages will be reenabled // while unwinding the stack. + thread->disable_stack_yellow_zone(); stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW); } else { // Thread was in the vm or native code. Return and try to finish. + thread->disable_stack_yellow_zone(); return true; } } else if (thread->in_stack_red_zone(addr)) { diff --git a/hotspot/src/share/vm/c1/c1_Compilation.cpp b/hotspot/src/share/vm/c1/c1_Compilation.cpp index fc805143d92..c8db6252c85 100644 --- a/hotspot/src/share/vm/c1/c1_Compilation.cpp +++ b/hotspot/src/share/vm/c1/c1_Compilation.cpp @@ -551,6 +551,7 @@ Compilation::Compilation(AbstractCompiler* compiler, ciEnv* env, ciMethod* metho , _would_profile(false) , _has_unsafe_access(false) , _has_method_handle_invokes(false) +, _has_reserved_stack_access(method->has_reserved_stack_access()) , _bailout_msg(NULL) , _exception_info_list(NULL) , _allocator(NULL) diff --git a/hotspot/src/share/vm/c1/c1_Compilation.hpp b/hotspot/src/share/vm/c1/c1_Compilation.hpp index 66e277d263e..f9f6eca889c 100644 --- a/hotspot/src/share/vm/c1/c1_Compilation.hpp +++ b/hotspot/src/share/vm/c1/c1_Compilation.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -81,6 +81,7 @@ class Compilation: public StackObj { bool _has_unsafe_access; bool _would_profile; bool _has_method_handle_invokes; // True if this method has MethodHandle invokes. + bool _has_reserved_stack_access; const char* _bailout_msg; ExceptionInfoList* _exception_info_list; ExceptionHandlerTable _exception_handler_table; @@ -171,6 +172,9 @@ class Compilation: public StackObj { bool has_method_handle_invokes() const { return _has_method_handle_invokes; } void set_has_method_handle_invokes(bool z) { _has_method_handle_invokes = z; } + bool has_reserved_stack_access() const { return _has_reserved_stack_access; } + void set_has_reserved_stack_access(bool z) { _has_reserved_stack_access = z; } + DebugInformationRecorder* debug_info_recorder() const; // = _env->debug_info(); Dependencies* dependency_recorder() const; // = _env->dependencies() ImplicitExceptionTable* implicit_exception_table() { return &_implicit_exception_table; } diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp index 6fac3e7b56d..952ce683db7 100644 --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp @@ -3322,7 +3322,13 @@ bool GraphBuilder::try_inline(ciMethod* callee, bool holder_known, Bytecodes::Co // method handle invokes if (callee->is_method_handle_intrinsic()) { - return try_method_handle_inline(callee); + if (try_method_handle_inline(callee)) { + if (callee->has_reserved_stack_access()) { + compilation()->set_has_reserved_stack_access(true); + } + return true; + } + return false; } // handle intrinsics @@ -3330,6 +3336,9 @@ bool GraphBuilder::try_inline(ciMethod* callee, bool holder_known, Bytecodes::Co (CheckIntrinsics ? callee->intrinsic_candidate() : true)) { if (try_inline_intrinsics(callee)) { print_inlining(callee, "intrinsic"); + if (callee->has_reserved_stack_access()) { + compilation()->set_has_reserved_stack_access(true); + } return true; } // try normal inlining @@ -3346,8 +3355,12 @@ bool GraphBuilder::try_inline(ciMethod* callee, bool holder_known, Bytecodes::Co if (bc == Bytecodes::_illegal) { bc = code(); } - if (try_inline_full(callee, holder_known, bc, receiver)) + if (try_inline_full(callee, holder_known, bc, receiver)) { + if (callee->has_reserved_stack_access()) { + compilation()->set_has_reserved_stack_access(true); + } return true; + } // Entire compilation could fail during try_inline_full call. // In that case printing inlining decision info is useless. diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp index faff84dcbe7..bfd902c9a0b 100644 --- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp +++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp @@ -502,7 +502,7 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t // Check the stack guard pages and reenable them if necessary and there is // enough space on the stack to do so. Use fast exceptions only if the guard // pages are enabled. - bool guard_pages_enabled = thread->stack_yellow_zone_enabled(); + bool guard_pages_enabled = thread->stack_guards_enabled(); if (!guard_pages_enabled) guard_pages_enabled = thread->reguard_stack(); if (JvmtiExport::can_post_on_exceptions()) { diff --git a/hotspot/src/share/vm/ci/ciMethod.cpp b/hotspot/src/share/vm/ci/ciMethod.cpp index e8d69c1ae3b..cb98f25e1c3 100644 --- a/hotspot/src/share/vm/ci/ciMethod.cpp +++ b/hotspot/src/share/vm/ci/ciMethod.cpp @@ -91,6 +91,7 @@ ciMethod::ciMethod(methodHandle h_m, ciInstanceKlass* holder) : _balanced_monitors = !_uses_monitors || h_m()->access_flags().is_monitor_matching(); _is_c1_compilable = !h_m()->is_not_c1_compilable(); _is_c2_compilable = !h_m()->is_not_c2_compilable(); + _has_reserved_stack_access = h_m()->has_reserved_stack_access(); // Lazy fields, filled in on demand. Require allocation. _code = NULL; _exception_handlers = NULL; diff --git a/hotspot/src/share/vm/ci/ciMethod.hpp b/hotspot/src/share/vm/ci/ciMethod.hpp index 5b19e95d39f..2adb4e52bb9 100644 --- a/hotspot/src/share/vm/ci/ciMethod.hpp +++ b/hotspot/src/share/vm/ci/ciMethod.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -81,6 +81,7 @@ class ciMethod : public ciMetadata { bool _is_c1_compilable; bool _is_c2_compilable; bool _can_be_statically_bound; + bool _has_reserved_stack_access; // Lazy fields, filled in on demand address _code; @@ -316,6 +317,7 @@ class ciMethod : public ciMetadata { bool is_accessor () const; bool is_initializer () const; bool can_be_statically_bound() const { return _can_be_statically_bound; } + bool has_reserved_stack_access() const { return _has_reserved_stack_access; } bool is_boxing_method() const; bool is_unboxing_method() const; diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp index 14d6efdba08..cd4518cf201 100644 --- a/hotspot/src/share/vm/classfile/classFileParser.cpp +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp @@ -946,6 +946,7 @@ public: _method_HotSpotIntrinsicCandidate, _jdk_internal_vm_annotation_Contended, _field_Stable, + _jdk_internal_vm_annotation_ReservedStackAccess, _annotation_LIMIT }; const Location _location; @@ -2016,6 +2017,11 @@ AnnotationCollector::annotation_index(const ClassLoaderData* loader_data, } return _jdk_internal_vm_annotation_Contended; } + case vmSymbols::VM_SYMBOL_ENUM_NAME(jdk_internal_vm_annotation_ReservedStackAccess_signature): { + if (_location != _in_method) break; // only allow for methods + if (RestrictReservedStack && !privileged) break; // honor privileges + return _jdk_internal_vm_annotation_ReservedStackAccess; + } default: { break; } @@ -2051,6 +2057,8 @@ void MethodAnnotationCollector::apply_to(methodHandle m) { m->set_hidden(true); if (has_annotation(_method_HotSpotIntrinsicCandidate) && !m->is_synthetic()) m->set_intrinsic_candidate(true); + if (has_annotation(_jdk_internal_vm_annotation_ReservedStackAccess)) + m->set_has_reserved_stack_access(true); } void ClassFileParser::ClassAnnotationCollector::apply_to(InstanceKlass* ik) { diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp index da0fca85e5b..cef61cc3aa2 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp @@ -212,6 +212,7 @@ template(java_util_concurrent_atomic_AtomicLongFieldUpdater_LockedUpdater, "java/util/concurrent/atomic/AtomicLongFieldUpdater$LockedUpdater") \ template(java_util_concurrent_atomic_AtomicReferenceFieldUpdater_Impl, "java/util/concurrent/atomic/AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl") \ template(jdk_internal_vm_annotation_Contended_signature, "Ljdk/internal/vm/annotation/Contended;") \ + template(jdk_internal_vm_annotation_ReservedStackAccess_signature, "Ljdk/internal/vm/annotation/ReservedStackAccess;") \ \ /* class symbols needed by intrinsics */ \ VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, template, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE) \ diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp index 60991b96ca8..077732802f5 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp @@ -314,6 +314,27 @@ IRT_ENTRY(void, InterpreterRuntime::throw_StackOverflowError(JavaThread* thread) THROW_HANDLE(exception); IRT_END +IRT_ENTRY(address, InterpreterRuntime::check_ReservedStackAccess_annotated_methods(JavaThread* thread)) + frame fr = thread->last_frame(); + assert(fr.is_java_frame(), "Must be a Java frame"); + frame activation = SharedRuntime::look_for_reserved_stack_annotated_method(thread, fr); + if (activation.sp() != NULL) { + thread->disable_stack_reserved_zone(); + thread->set_reserved_stack_activation((address)activation.unextended_sp()); + } + return (address)activation.sp(); +IRT_END + + IRT_ENTRY(void, InterpreterRuntime::throw_delayed_StackOverflowError(JavaThread* thread)) + Handle exception = get_preinitialized_exception( + SystemDictionary::StackOverflowError_klass(), + CHECK); + java_lang_Throwable::set_message(exception(), + Universe::delayed_stack_overflow_error_message()); + // Increment counter for hs_err file reporting + Atomic::inc(&Exceptions::_stack_overflow_errors); + THROW_HANDLE(exception); +IRT_END IRT_ENTRY(void, InterpreterRuntime::create_exception(JavaThread* thread, char* name, char* message)) // lookup exception klass diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp index 297102c4f1a..8bf2722442a 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp @@ -91,10 +91,13 @@ class InterpreterRuntime: AllStatic { // Quicken instance-of and check-cast bytecodes static void quicken_io_cc(JavaThread* thread); + static address check_ReservedStackAccess_annotated_methods(JavaThread* thread); + // Exceptions thrown by the interpreter static void throw_AbstractMethodError(JavaThread* thread); static void throw_IncompatibleClassChangeError(JavaThread* thread); static void throw_StackOverflowError(JavaThread* thread); + static void throw_delayed_StackOverflowError(JavaThread* thread); static void throw_ArrayIndexOutOfBoundsException(JavaThread* thread, char* name, jint index); static void throw_ClassCastException(JavaThread* thread, oopDesc* obj); static void create_exception(JavaThread* thread, char* name, char* message); diff --git a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp index afcbdf27f82..c401c698fde 100644 --- a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp @@ -248,7 +248,7 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t // Check the stack guard pages and reenable them if necessary and there is // enough space on the stack to do so. Use fast exceptions only if the guard // pages are enabled. - bool guard_pages_enabled = thread->stack_yellow_zone_enabled(); + bool guard_pages_enabled = thread->stack_guards_enabled(); if (!guard_pages_enabled) guard_pages_enabled = thread->reguard_stack(); if (JvmtiExport::can_post_on_exceptions()) { diff --git a/hotspot/src/share/vm/memory/universe.cpp b/hotspot/src/share/vm/memory/universe.cpp index 630afe63abf..d9c17bc71d1 100644 --- a/hotspot/src/share/vm/memory/universe.cpp +++ b/hotspot/src/share/vm/memory/universe.cpp @@ -125,6 +125,7 @@ oop Universe::_out_of_memory_error_class_metaspace = NULL; oop Universe::_out_of_memory_error_array_size = NULL; oop Universe::_out_of_memory_error_gc_overhead_limit = NULL; oop Universe::_out_of_memory_error_realloc_objects = NULL; +oop Universe::_delayed_stack_overflow_error_message = NULL; objArrayOop Universe::_preallocated_out_of_memory_error_array = NULL; volatile jint Universe::_preallocated_out_of_memory_error_avail_count = 0; bool Universe::_verify_in_progress = false; @@ -200,7 +201,8 @@ void Universe::oops_do(OopClosure* f, bool do_all) { f->do_oop((oop*)&_out_of_memory_error_array_size); f->do_oop((oop*)&_out_of_memory_error_gc_overhead_limit); f->do_oop((oop*)&_out_of_memory_error_realloc_objects); - f->do_oop((oop*)&_preallocated_out_of_memory_error_array); + f->do_oop((oop*)&_delayed_stack_overflow_error_message); + f->do_oop((oop*)&_preallocated_out_of_memory_error_array); f->do_oop((oop*)&_null_ptr_exception_instance); f->do_oop((oop*)&_arithmetic_exception_instance); f->do_oop((oop*)&_virtual_machine_error_instance); @@ -909,6 +911,12 @@ bool universe_post_init() { k_h->allocate_instance(CHECK_false); Universe::_out_of_memory_error_realloc_objects = k_h->allocate_instance(CHECK_false); + // Setup preallocated cause message for delayed StackOverflowError + if (StackReservedPages > 0) { + Universe::_delayed_stack_overflow_error_message = + java_lang_String::create_oop_from_str("Delayed StackOverflowError due to ReservedStackAccess annotated method", CHECK_false); + } + // Setup preallocated NullPointerException // (this is currently used for a cheap & dirty solution in compiler exception handling) k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_NullPointerException(), true, CHECK_false); diff --git a/hotspot/src/share/vm/memory/universe.hpp b/hotspot/src/share/vm/memory/universe.hpp index e55c3e121b2..e7ba90dba12 100644 --- a/hotspot/src/share/vm/memory/universe.hpp +++ b/hotspot/src/share/vm/memory/universe.hpp @@ -159,6 +159,9 @@ class Universe: AllStatic { static oop _out_of_memory_error_gc_overhead_limit; static oop _out_of_memory_error_realloc_objects; + // preallocated cause message for delayed StackOverflowError + static oop _delayed_stack_overflow_error_message; + static Array* _the_empty_int_array; // Canonicalized int array static Array* _the_empty_short_array; // Canonicalized short array static Array* _the_empty_klass_array; // Canonicalized klass obj array @@ -339,6 +342,7 @@ class Universe: AllStatic { static oop out_of_memory_error_array_size() { return gen_out_of_memory_error(_out_of_memory_error_array_size); } static oop out_of_memory_error_gc_overhead_limit() { return gen_out_of_memory_error(_out_of_memory_error_gc_overhead_limit); } static oop out_of_memory_error_realloc_objects() { return gen_out_of_memory_error(_out_of_memory_error_realloc_objects); } + static oop delayed_stack_overflow_error_message() { return _delayed_stack_overflow_error_message; } // Accessors needed for fast allocation static Klass** boolArrayKlassObj_addr() { return &_boolArrayKlassObj; } diff --git a/hotspot/src/share/vm/oops/method.hpp b/hotspot/src/share/vm/oops/method.hpp index fd4e0245068..662d66555a5 100644 --- a/hotspot/src/share/vm/oops/method.hpp +++ b/hotspot/src/share/vm/oops/method.hpp @@ -75,16 +75,17 @@ class Method : public Metadata { // Flags enum Flags { - _jfr_towrite = 1 << 0, - _caller_sensitive = 1 << 1, - _force_inline = 1 << 2, - _dont_inline = 1 << 3, - _hidden = 1 << 4, - _has_injected_profile = 1 << 5, - _running_emcp = 1 << 6, - _intrinsic_candidate = 1 << 7 + _jfr_towrite = 1 << 0, + _caller_sensitive = 1 << 1, + _force_inline = 1 << 2, + _dont_inline = 1 << 3, + _hidden = 1 << 4, + _has_injected_profile = 1 << 5, + _running_emcp = 1 << 6, + _intrinsic_candidate = 1 << 7, + _reserved_stack_access = 1 << 8 }; - mutable u1 _flags; + mutable u2 _flags; #ifndef PRODUCT int _compiled_invocation_count; // Number of nmethod invocations so far (for perf. debugging) @@ -835,6 +836,14 @@ class Method : public Metadata { _flags = x ? (_flags | _has_injected_profile) : (_flags & ~_has_injected_profile); } + bool has_reserved_stack_access() { + return (_flags & _reserved_stack_access) != 0; + } + + void set_has_reserved_stack_access(bool x) { + _flags = x ? (_flags | _reserved_stack_access) : (_flags & ~_reserved_stack_access); + } + ConstMethod::MethodType method_type() const { return _constMethod->method_type(); } diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp index 474aee8d8ea..41483faf907 100644 --- a/hotspot/src/share/vm/opto/compile.cpp +++ b/hotspot/src/share/vm/opto/compile.cpp @@ -672,7 +672,8 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr _print_inlining_idx(0), _print_inlining_output(NULL), _interpreter_frame_size(0), - _max_node_limit(MaxNodeLimit) { + _max_node_limit(MaxNodeLimit), + _has_reserved_stack_access(target->has_reserved_stack_access()) { C = this; #ifndef PRODUCT if (_printer != NULL) { diff --git a/hotspot/src/share/vm/opto/compile.hpp b/hotspot/src/share/vm/opto/compile.hpp index 27342ed12be..e012ea660f1 100644 --- a/hotspot/src/share/vm/opto/compile.hpp +++ b/hotspot/src/share/vm/opto/compile.hpp @@ -364,6 +364,7 @@ class Compile : public Phase { bool _has_unsafe_access; // True if the method _may_ produce faults in unsafe loads or stores. bool _has_stringbuilder; // True StringBuffers or StringBuilders are allocated bool _has_boxed_value; // True if a boxed object is allocated + bool _has_reserved_stack_access; // True if the method or an inlined method is annotated with ReservedStackAccess int _max_vector_size; // Maximum size of generated vectors uint _trap_hist[trapHistLength]; // Cumulative traps bool _trap_can_recompile; // Have we emitted a recompiling trap? @@ -637,6 +638,8 @@ class Compile : public Phase { void set_has_stringbuilder(bool z) { _has_stringbuilder = z; } bool has_boxed_value() const { return _has_boxed_value; } void set_has_boxed_value(bool z) { _has_boxed_value = z; } + bool has_reserved_stack_access() const { return _has_reserved_stack_access; } + void set_has_reserved_stack_access(bool z) { _has_reserved_stack_access = z; } int max_vector_size() const { return _max_vector_size; } void set_max_vector_size(int s) { _max_vector_size = s; } void set_trap_count(uint r, uint c) { assert(r < trapHistLength, "oob"); _trap_hist[r] = c; } diff --git a/hotspot/src/share/vm/opto/parse1.cpp b/hotspot/src/share/vm/opto/parse1.cpp index f33cc2a2acc..77154c5da07 100644 --- a/hotspot/src/share/vm/opto/parse1.cpp +++ b/hotspot/src/share/vm/opto/parse1.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -415,6 +415,10 @@ Parse::Parse(JVMState* caller, ciMethod* parse_method, float expected_uses) _est_switch_depth = 0; #endif + if (parse_method->has_reserved_stack_access()) { + C->set_has_reserved_stack_access(true); + } + _tf = TypeFunc::make(method()); _iter.reset_to_method(method()); _flow = method()->get_flow_analysis(); diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index a33b676ce7c..285e9e228e7 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -2426,6 +2426,12 @@ bool Arguments::check_vm_args_consistency() { warning("The VM option CICompilerCountPerCPU overrides CICompilerCount."); } +#ifndef SUPPORT_RESERVED_STACK_AREA + if (StackReservedPages != 0) { + FLAG_SET_CMDLINE(intx, StackReservedPages, 0); + warning("Reserved Stack Area not supported on this platform"); + } +#endif return status; } diff --git a/hotspot/src/share/vm/runtime/deoptimization.cpp b/hotspot/src/share/vm/runtime/deoptimization.cpp index 3b061d36bf9..a1711971464 100644 --- a/hotspot/src/share/vm/runtime/deoptimization.cpp +++ b/hotspot/src/share/vm/runtime/deoptimization.cpp @@ -1431,7 +1431,7 @@ void Deoptimization::load_class_by_index(const constantPoolHandle& constant_pool // stack bang causes a stack overflow we crash. assert(THREAD->is_Java_thread(), "only a java thread can be here"); JavaThread* thread = (JavaThread*)THREAD; - bool guard_pages_enabled = thread->stack_yellow_zone_enabled(); + bool guard_pages_enabled = thread->stack_guards_enabled(); if (!guard_pages_enabled) guard_pages_enabled = thread->reguard_stack(); assert(guard_pages_enabled, "stack banging in uncommon trap blob may cause crash"); } diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index c0764db8f92..18625166245 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -3438,6 +3438,13 @@ public: "Number of red zone (unrecoverable overflows) pages") \ range(MIN_STACK_RED_PAGES, (DEFAULT_STACK_RED_PAGES+2)) \ \ + product_pd(intx, StackReservedPages, \ + "Number of reserved zone (reserved to annotated methods) pages") \ + range(MIN_STACK_RESERVED_PAGES, (DEFAULT_STACK_RESERVED_PAGES+10))\ + \ + product(bool, RestrictReservedStack, true, \ + "Restrict @ReservedStackAccess to trusted classes") \ + \ /* greater stack shadow pages can't generate instruction to bang stack */ \ product_pd(intx, StackShadowPages, \ "Number of shadow zone (for overflow checking) pages " \ diff --git a/hotspot/src/share/vm/runtime/javaCalls.cpp b/hotspot/src/share/vm/runtime/javaCalls.cpp index 9acd0200b29..e0a04e6d3bc 100644 --- a/hotspot/src/share/vm/runtime/javaCalls.cpp +++ b/hotspot/src/share/vm/runtime/javaCalls.cpp @@ -371,9 +371,9 @@ void JavaCalls::call_helper(JavaValue* result, const methodHandle& method, JavaC // Find receiver Handle receiver = (!method->is_static()) ? args->receiver() : Handle(); - // When we reenter Java, we need to reenable the yellow zone which + // When we reenter Java, we need to reenable the reserved/yellow zone which // might already be disabled when we are in VM. - if (thread->stack_yellow_zone_disabled()) { + if (!thread->stack_guards_enabled()) { thread->reguard_stack(); } diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp index 4be64a724d2..e1c71bf1406 100644 --- a/hotspot/src/share/vm/runtime/os.cpp +++ b/hotspot/src/share/vm/runtime/os.cpp @@ -1386,8 +1386,9 @@ bool os::stack_shadow_pages_available(Thread *thread, const methodHandle& method // respectively. const int framesize_in_bytes = Interpreter::size_top_interpreter_activation(method()) * wordSize; - int reserved_area = ((StackShadowPages + StackRedPages + StackYellowPages) - * vm_page_size()) + framesize_in_bytes; + int reserved_area = ((StackShadowPages + StackRedPages + StackYellowPages + + StackReservedPages) * vm_page_size()) + + framesize_in_bytes; // The very lower end of the stack address stack_limit = thread->stack_base() - thread->stack_size(); return (sp > (stack_limit + reserved_area)); diff --git a/hotspot/src/share/vm/runtime/os.hpp b/hotspot/src/share/vm/runtime/os.hpp index ef8b2954518..1dd6f1bebf5 100644 --- a/hotspot/src/share/vm/runtime/os.hpp +++ b/hotspot/src/share/vm/runtime/os.hpp @@ -473,6 +473,7 @@ class os: AllStatic { static ExtendedPC fetch_frame_from_context(void* ucVoid, intptr_t** sp, intptr_t** fp); static frame fetch_frame_from_context(void* ucVoid); + static frame fetch_frame_from_ucontext(Thread* thread, void* ucVoid); static ExtendedPC get_thread_pc(Thread *thread); static void breakpoint(); diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp index e1d1392131d..12a657ea589 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp @@ -57,6 +57,7 @@ #include "runtime/stubRoutines.hpp" #include "runtime/vframe.hpp" #include "runtime/vframeArray.hpp" +#include "trace/tracing.hpp" #include "utilities/copy.hpp" #include "utilities/dtrace.hpp" #include "utilities/events.hpp" @@ -487,8 +488,11 @@ address SharedRuntime::raw_exception_handler_for_return_address(JavaThread* thre // unguarded. Reguard the stack otherwise if we return to the // deopt blob and the stack bang causes a stack overflow we // crash. - bool guard_pages_enabled = thread->stack_yellow_zone_enabled(); + bool guard_pages_enabled = thread->stack_guards_enabled(); if (!guard_pages_enabled) guard_pages_enabled = thread->reguard_stack(); + if (thread->reserved_stack_activation() != thread->stack_base()) { + thread->set_reserved_stack_activation(thread->stack_base()); + } assert(guard_pages_enabled, "stack banging in deopt blob may cause crash"); return SharedRuntime::deopt_blob()->unpack_with_exception(); } else { @@ -761,10 +765,23 @@ JRT_ENTRY(void, SharedRuntime::throw_NullPointerException_at_call(JavaThread* th JRT_END JRT_ENTRY(void, SharedRuntime::throw_StackOverflowError(JavaThread* thread)) + throw_StackOverflowError_common(thread, false); +JRT_END + +JRT_ENTRY(void, SharedRuntime::throw_delayed_StackOverflowError(JavaThread* thread)) + throw_StackOverflowError_common(thread, true); +JRT_END + +void SharedRuntime::throw_StackOverflowError_common(JavaThread* thread, bool delayed) { // We avoid using the normal exception construction in this case because // it performs an upcall to Java, and we're already out of stack space. + Thread* THREAD = thread; Klass* k = SystemDictionary::StackOverflowError_klass(); oop exception_oop = InstanceKlass::cast(k)->allocate_instance(CHECK); + if (delayed) { + java_lang_Throwable::set_message(exception_oop, + Universe::delayed_stack_overflow_error_message()); + } Handle exception (thread, exception_oop); if (StackTraceInThrowable) { java_lang_Throwable::fill_in_stack_trace(exception); @@ -772,7 +789,7 @@ JRT_ENTRY(void, SharedRuntime::throw_StackOverflowError(JavaThread* thread)) // Increment counter for hs_err file reporting Atomic::inc(&Exceptions::_stack_overflow_errors); throw_and_post_jvmti_exception(thread, exception); -JRT_END +} #if INCLUDE_JVMCI address SharedRuntime::deoptimize_for_implicit_exception(JavaThread* thread, address pc, nmethod* nm, int deopt_reason) { @@ -2934,3 +2951,68 @@ void AdapterHandlerLibrary::print_statistics() { } #endif /* PRODUCT */ + +JRT_LEAF(void, SharedRuntime::enable_stack_reserved_zone(JavaThread* thread)) + assert(thread->is_Java_thread(), "Only Java threads have a stack reserved zone"); + thread->enable_stack_reserved_zone(); + thread->set_reserved_stack_activation(thread->stack_base()); +JRT_END + +frame SharedRuntime::look_for_reserved_stack_annotated_method(JavaThread* thread, frame fr) { + frame activation; + int decode_offset = 0; + nmethod* nm = NULL; + frame prv_fr = fr; + int count = 1; + + assert(fr.is_java_frame(), "Must start on Java frame"); + + while (!fr.is_first_frame()) { + Method* method = NULL; + // Compiled java method case. + if (decode_offset != 0) { + DebugInfoReadStream stream(nm, decode_offset); + decode_offset = stream.read_int(); + method = (Method*)nm->metadata_at(stream.read_int()); + } else { + if (fr.is_first_java_frame()) break; + address pc = fr.pc(); + prv_fr = fr; + if (fr.is_interpreted_frame()) { + method = fr.interpreter_frame_method(); + fr = fr.java_sender(); + } else { + CodeBlob* cb = fr.cb(); + fr = fr.java_sender(); + if (cb == NULL || !cb->is_nmethod()) { + continue; + } + nm = (nmethod*)cb; + if (nm->method()->is_native()) { + method = nm->method(); + } else { + PcDesc* pd = nm->pc_desc_at(pc); + assert(pd != NULL, "PcDesc must not be NULL"); + decode_offset = pd->scope_decode_offset(); + // if decode_offset is not equal to 0, it will execute the + // "compiled java method case" at the beginning of the loop. + continue; + } + } + } + if (method->has_reserved_stack_access()) { + ResourceMark rm(thread); + activation = prv_fr; + warning("Potentially dangerous stack overflow in " + "ReservedStackAccess annotated method %s [%d]", + method->name_and_sig_as_C_string(), count++); + EventReservedStackActivation event; + if (event.should_commit()) { + event.set_method(method); + event.commit(); + } + } + } + return activation; +} + diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.hpp b/hotspot/src/share/vm/runtime/sharedRuntime.hpp index d41145435bb..b46a5037896 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.hpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.hpp @@ -201,6 +201,8 @@ class SharedRuntime: AllStatic { static void throw_NullPointerException(JavaThread* thread); static void throw_NullPointerException_at_call(JavaThread* thread); static void throw_StackOverflowError(JavaThread* thread); + static void throw_delayed_StackOverflowError(JavaThread* thread); + static void throw_StackOverflowError_common(JavaThread* thread, bool delayed); static address continuation_for_implicit_exception(JavaThread* thread, address faulting_pc, ImplicitExceptionKind exception_kind); @@ -208,6 +210,9 @@ class SharedRuntime: AllStatic { static address deoptimize_for_implicit_exception(JavaThread* thread, address pc, nmethod* nm, int deopt_reason); #endif + static void enable_stack_reserved_zone(JavaThread* thread); + static frame look_for_reserved_stack_annotated_method(JavaThread* thread, frame fr); + // Shared stub locations static address get_poll_stub(address pc); diff --git a/hotspot/src/share/vm/runtime/stubRoutines.cpp b/hotspot/src/share/vm/runtime/stubRoutines.cpp index fef7c0b3b03..7bce6760d07 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.cpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.cpp @@ -54,6 +54,7 @@ address StubRoutines::_throw_AbstractMethodError_entry = NULL; address StubRoutines::_throw_IncompatibleClassChangeError_entry = NULL; address StubRoutines::_throw_NullPointerException_at_call_entry = NULL; address StubRoutines::_throw_StackOverflowError_entry = NULL; +address StubRoutines::_throw_delayed_StackOverflowError_entry = NULL; address StubRoutines::_handler_for_unsafe_access_entry = NULL; jint StubRoutines::_verify_oop_count = 0; address StubRoutines::_verify_oop_subroutine_entry = NULL; diff --git a/hotspot/src/share/vm/runtime/stubRoutines.hpp b/hotspot/src/share/vm/runtime/stubRoutines.hpp index ac198d0746c..edc3acb3ac1 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.hpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp @@ -111,6 +111,7 @@ class StubRoutines: AllStatic { static address _throw_IncompatibleClassChangeError_entry; static address _throw_NullPointerException_at_call_entry; static address _throw_StackOverflowError_entry; + static address _throw_delayed_StackOverflowError_entry; static address _handler_for_unsafe_access_entry; static address _atomic_xchg_entry; @@ -275,6 +276,7 @@ class StubRoutines: AllStatic { static address throw_IncompatibleClassChangeError_entry(){ return _throw_IncompatibleClassChangeError_entry; } static address throw_NullPointerException_at_call_entry(){ return _throw_NullPointerException_at_call_entry; } static address throw_StackOverflowError_entry() { return _throw_StackOverflowError_entry; } + static address throw_delayed_StackOverflowError_entry() { return _throw_delayed_StackOverflowError_entry; } // Exceptions during unsafe access - should throw Java exception rather // than crash. diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index 6ee4c82dc73..12773612f19 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -307,6 +307,7 @@ void Thread::record_stack_base_and_size() { set_stack_size(os::current_stack_size()); if (is_Java_thread()) { ((JavaThread*) this)->set_stack_overflow_limit(); + ((JavaThread*) this)->set_reserved_stack_activation(stack_base()); } // CR 7190089: on Solaris, primordial thread's stack is adjusted // in initialize_thread(). Without the adjustment, stack size is @@ -908,7 +909,7 @@ bool Thread::is_in_stack(address adr) const { bool Thread::is_in_usable_stack(address adr) const { - size_t stack_guard_size = os::uses_stack_guard_pages() ? (StackYellowPages + StackRedPages) * os::vm_page_size() : 0; + size_t stack_guard_size = os::uses_stack_guard_pages() ? (StackReservedPages + StackYellowPages + StackRedPages) * os::vm_page_size() : 0; size_t usable_stack_size = _stack_size - stack_guard_size; return ((adr < stack_base()) && (adr >= stack_base() - usable_stack_size)); @@ -1460,6 +1461,7 @@ void JavaThread::initialize() { _jvmci_counters = NULL; } #endif // INCLUDE_JVMCI + _reserved_stack_activation = NULL; // stack base not known yet (void)const_cast(_exception_oop = oop(NULL)); _exception_pc = 0; _exception_handler_pc = 0; @@ -1532,7 +1534,8 @@ JavaThread::JavaThread(bool is_attaching_via_jni) : } bool JavaThread::reguard_stack(address cur_sp) { - if (_stack_guard_state != stack_guard_yellow_disabled) { + if (_stack_guard_state != stack_guard_yellow_disabled + && _stack_guard_state != stack_guard_reserved_disabled) { return true; // Stack already guarded or guard pages not needed. } @@ -1549,8 +1552,15 @@ bool JavaThread::reguard_stack(address cur_sp) { // some exception code in c1, c2 or the interpreter isn't unwinding // when it should. guarantee(cur_sp > stack_yellow_zone_base(), "not enough space to reguard - increase StackShadowPages"); - - enable_stack_yellow_zone(); + if (_stack_guard_state == stack_guard_yellow_disabled) { + enable_stack_yellow_zone(); + if (reserved_stack_activation() != stack_base()) { + set_reserved_stack_activation(stack_base()); + } + } else if (_stack_guard_state == stack_guard_reserved_disabled) { + set_reserved_stack_activation(stack_base()); + enable_stack_reserved_zone(); + } return true; } @@ -2473,7 +2483,7 @@ void JavaThread::java_resume() { void JavaThread::create_stack_guard_pages() { if (! os::uses_stack_guard_pages() || _stack_guard_state != stack_guard_unused) return; address low_addr = stack_base() - stack_size(); - size_t len = (StackYellowPages + StackRedPages) * os::vm_page_size(); + size_t len = (StackReservedPages + StackYellowPages + StackRedPages) * os::vm_page_size(); int allocate = os::allocate_stack_guard_pages(); // warning("Guarding at " PTR_FORMAT " for len " SIZE_FORMAT "\n", low_addr, len); @@ -2497,7 +2507,7 @@ void JavaThread::remove_stack_guard_pages() { assert(Thread::current() == this, "from different thread"); if (_stack_guard_state == stack_guard_unused) return; address low_addr = stack_base() - stack_size(); - size_t len = (StackYellowPages + StackRedPages) * os::vm_page_size(); + size_t len = (StackReservedPages + StackYellowPages + StackRedPages) * os::vm_page_size(); if (os::allocate_stack_guard_pages()) { if (os::remove_stack_guard_pages((char *) low_addr, len)) { @@ -2515,6 +2525,44 @@ void JavaThread::remove_stack_guard_pages() { } } +void JavaThread::enable_stack_reserved_zone() { + assert(_stack_guard_state != stack_guard_unused, "must be using guard pages."); + assert(_stack_guard_state != stack_guard_enabled, "already enabled"); + + // The base notation is from the stack's point of view, growing downward. + // We need to adjust it to work correctly with guard_memory() + address base = stack_reserved_zone_base() - stack_reserved_zone_size(); + + guarantee(base < stack_base(),"Error calculating stack reserved zone"); + guarantee(base < os::current_stack_pointer(),"Error calculating stack reserved zone"); + + if (os::guard_memory((char *) base, stack_reserved_zone_size())) { + _stack_guard_state = stack_guard_enabled; + } else { + warning("Attempt to guard stack reserved zone failed."); + } + enable_register_stack_guard(); +} + +void JavaThread::disable_stack_reserved_zone() { + assert(_stack_guard_state != stack_guard_unused, "must be using guard pages."); + assert(_stack_guard_state != stack_guard_reserved_disabled, "already disabled"); + + // Simply return if called for a thread that does not use guard pages. + if (_stack_guard_state == stack_guard_unused) return; + + // The base notation is from the stack's point of view, growing downward. + // We need to adjust it to work correctly with guard_memory() + address base = stack_reserved_zone_base() - stack_reserved_zone_size(); + + if (os::unguard_memory((char *)base, stack_reserved_zone_size())) { + _stack_guard_state = stack_guard_reserved_disabled; + } else { + warning("Attempt to unguard stack reserved zone failed."); + } + disable_register_stack_guard(); +} + void JavaThread::enable_stack_yellow_zone() { assert(_stack_guard_state != stack_guard_unused, "must be using guard pages."); assert(_stack_guard_state != stack_guard_enabled, "already enabled"); diff --git a/hotspot/src/share/vm/runtime/thread.hpp b/hotspot/src/share/vm/runtime/thread.hpp index c74d54f4b7a..8948ed0ddaf 100644 --- a/hotspot/src/share/vm/runtime/thread.hpp +++ b/hotspot/src/share/vm/runtime/thread.hpp @@ -909,6 +909,7 @@ class JavaThread: public Thread { // State of the stack guard pages for this thread. enum StackGuardState { stack_guard_unused, // not needed + stack_guard_reserved_disabled, stack_guard_yellow_disabled,// disabled (temporarily) after stack overflow stack_guard_enabled // enabled }; @@ -957,6 +958,7 @@ class JavaThread: public Thread { // Precompute the limit of the stack as used in stack overflow checks. // We load it from here to simplify the stack overflow check in assembly. address _stack_overflow_limit; + address _reserved_stack_activation; // Compiler exception handling (NOTE: The _exception_oop is *NOT* the same as _pending_exception. It is // used to temp. parsing values into and out of the runtime system during exception handling for compiled @@ -1343,18 +1345,25 @@ class JavaThread: public Thread { // Stack overflow support inline size_t stack_available(address cur_sp); + address stack_reserved_zone_base() { + return stack_yellow_zone_base(); } + size_t stack_reserved_zone_size() { + return StackReservedPages * os::vm_page_size(); } address stack_yellow_zone_base() { return (address)(stack_base() - (stack_size() - (stack_red_zone_size() + stack_yellow_zone_size()))); } size_t stack_yellow_zone_size() { - return StackYellowPages * os::vm_page_size(); + return StackYellowPages * os::vm_page_size() + stack_reserved_zone_size(); } address stack_red_zone_base() { return (address)(stack_base() - (stack_size() - stack_red_zone_size())); } size_t stack_red_zone_size() { return StackRedPages * os::vm_page_size(); } + bool in_stack_reserved_zone(address a) { + return (a <= stack_reserved_zone_base()) && (a >= (address)((intptr_t)stack_reserved_zone_base() - stack_reserved_zone_size())); + } bool in_stack_yellow_zone(address a) { return (a <= stack_yellow_zone_base()) && (a >= stack_red_zone_base()); } @@ -1366,6 +1375,8 @@ class JavaThread: public Thread { void create_stack_guard_pages(); void remove_stack_guard_pages(); + void enable_stack_reserved_zone(); + void disable_stack_reserved_zone(); void enable_stack_yellow_zone(); void disable_stack_yellow_zone(); void enable_stack_red_zone(); @@ -1373,7 +1384,16 @@ class JavaThread: public Thread { inline bool stack_guard_zone_unused(); inline bool stack_yellow_zone_disabled(); - inline bool stack_yellow_zone_enabled(); + inline bool stack_reserved_zone_disabled(); + inline bool stack_guards_enabled(); + + address reserved_stack_activation() const { return _reserved_stack_activation; } + void set_reserved_stack_activation(address addr) { + assert(_reserved_stack_activation == stack_base() + || _reserved_stack_activation == NULL + || addr == stack_base(), "Must not be set twice"); + _reserved_stack_activation = addr; + } // Attempt to reguard the stack after a stack overflow may have occurred. // Returns true if (a) guard pages are not needed on this thread, (b) the @@ -1390,6 +1410,7 @@ class JavaThread: public Thread { void set_stack_overflow_limit() { _stack_overflow_limit = _stack_base - _stack_size + ((StackShadowPages + + StackReservedPages + StackYellowPages + StackRedPages) * os::vm_page_size()); } @@ -1439,6 +1460,7 @@ class JavaThread: public Thread { static ByteSize stack_overflow_limit_offset() { return byte_offset_of(JavaThread, _stack_overflow_limit); } static ByteSize is_method_handle_return_offset() { return byte_offset_of(JavaThread, _is_method_handle_return); } static ByteSize stack_guard_state_offset() { return byte_offset_of(JavaThread, _stack_guard_state); } + static ByteSize reserved_stack_activation_offset() { return byte_offset_of(JavaThread, _reserved_stack_activation); } static ByteSize suspend_flags_offset() { return byte_offset_of(JavaThread, _suspend_flags); } static ByteSize do_not_unlock_if_synchronized_offset() { return byte_offset_of(JavaThread, _do_not_unlock_if_synchronized); } diff --git a/hotspot/src/share/vm/runtime/thread.inline.hpp b/hotspot/src/share/vm/runtime/thread.inline.hpp index a6fb4a63979..213d5ecffa0 100644 --- a/hotspot/src/share/vm/runtime/thread.inline.hpp +++ b/hotspot/src/share/vm/runtime/thread.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -130,6 +130,10 @@ inline bool JavaThread::stack_yellow_zone_disabled() { return _stack_guard_state == stack_guard_yellow_disabled; } +inline bool JavaThread::stack_reserved_zone_disabled() { + return _stack_guard_state == stack_guard_reserved_disabled; +} + inline size_t JavaThread::stack_available(address cur_sp) { // This code assumes java stacks grow down address low_addr; // Limit on the address for deepest stack depth @@ -141,7 +145,7 @@ inline size_t JavaThread::stack_available(address cur_sp) { return cur_sp > low_addr ? cur_sp - low_addr : 0; } -inline bool JavaThread::stack_yellow_zone_enabled() { +inline bool JavaThread::stack_guards_enabled() { #ifdef ASSERT if (os::uses_stack_guard_pages()) { assert(_stack_guard_state != stack_guard_unused, "guard pages must be in use"); diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index 7ceb45ebd5e..5be0aaaba95 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -396,7 +396,7 @@ typedef CompactHashtable SymbolCompactHashTable; nonstatic_field(Method, _access_flags, AccessFlags) \ nonstatic_field(Method, _vtable_index, int) \ nonstatic_field(Method, _intrinsic_id, u2) \ - nonstatic_field(Method, _flags, u1) \ + nonstatic_field(Method, _flags, u2) \ nonproduct_nonstatic_field(Method, _compiled_invocation_count, int) \ volatile_nonstatic_field(Method, _code, nmethod*) \ nonstatic_field(Method, _i2i_entry, address) \ diff --git a/hotspot/src/share/vm/trace/trace.xml b/hotspot/src/share/vm/trace/trace.xml index c1f4dfb88de..d2c5625c015 100644 --- a/hotspot/src/share/vm/trace/trace.xml +++ b/hotspot/src/share/vm/trace/trace.xml @@ -1,6 +1,6 @@ Date: Sat, 19 Dec 2015 19:06:02 +0100 Subject: [PATCH 107/146] 8145566: PrintNMethods compile command broken since b89 Decremented Symbol twice Reviewed-by: thartmann, kvn --- hotspot/src/share/vm/compiler/compilerOracle.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/hotspot/src/share/vm/compiler/compilerOracle.cpp b/hotspot/src/share/vm/compiler/compilerOracle.cpp index 15d5d3a091c..4e5b240c6bc 100644 --- a/hotspot/src/share/vm/compiler/compilerOracle.cpp +++ b/hotspot/src/share/vm/compiler/compilerOracle.cpp @@ -247,15 +247,6 @@ TypedMethodOptionMatcher::~TypedMethodOptionMatcher() { if (_option != NULL) { os::free((void*)_option); } - if (_class_name != NULL) { - _class_name->decrement_refcount(); - } - if (_method_name != NULL) { - _method_name->decrement_refcount(); - } - if (_signature != NULL) { - _signature->decrement_refcount(); - } } TypedMethodOptionMatcher* TypedMethodOptionMatcher::parse_method_pattern(char*& line, const char*& error_msg) { From 60da2fdb6fca92e8e39fd5cf5f6824a64a9e4a82 Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Mon, 21 Dec 2015 10:14:26 +0100 Subject: [PATCH 108/146] 8145754: PhaseIdealLoop::is_scaled_iv_plus_offset() does not match AddI Is_scaled_iv_plus_offset() should handle AddI nodes with scaled iv as second input. Reviewed-by: kvn --- hotspot/src/share/vm/opto/loopTransform.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hotspot/src/share/vm/opto/loopTransform.cpp b/hotspot/src/share/vm/opto/loopTransform.cpp index 41ebaffc838..d1bfb801b67 100644 --- a/hotspot/src/share/vm/opto/loopTransform.cpp +++ b/hotspot/src/share/vm/opto/loopTransform.cpp @@ -1911,6 +1911,12 @@ bool PhaseIdealLoop::is_scaled_iv_plus_offset(Node* exp, Node* iv, int* p_scale, } return true; } + if (is_scaled_iv(exp->in(2), iv, p_scale)) { + if (p_offset != NULL) { + *p_offset = exp->in(1); + } + return true; + } if (exp->in(2)->is_Con()) { Node* offset2 = NULL; if (depth < 2 && From 0f67aad7af9eebec2fe278477aa84f0c8712eaa3 Mon Sep 17 00:00:00 2001 From: Tobias Hartmann Date: Mon, 21 Dec 2015 11:34:58 +0100 Subject: [PATCH 109/146] 8144487: PhaseIdealLoop::build_and_optimize() must restore major_progress flag if skip_loop_opts is true Restore the major_progress flag before calling igvn.optimize(). Reviewed-by: kvn --- hotspot/src/share/vm/opto/loopnode.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hotspot/src/share/vm/opto/loopnode.cpp b/hotspot/src/share/vm/opto/loopnode.cpp index ac82a605303..3faa0c2d319 100644 --- a/hotspot/src/share/vm/opto/loopnode.cpp +++ b/hotspot/src/share/vm/opto/loopnode.cpp @@ -2335,6 +2335,11 @@ void PhaseIdealLoop::build_and_optimize(bool do_split_ifs, bool skip_loop_opts) #endif if (skip_loop_opts) { + // restore major progress flag + for (int i = 0; i < old_progress; i++) { + C->set_major_progress(); + } + // Cleanup any modified bits _igvn.optimize(); From cd1d8e43041848170999260aa1699d9a29762996 Mon Sep 17 00:00:00 2001 From: Nils Eliasson Date: Mon, 21 Dec 2015 22:17:23 +0100 Subject: [PATCH 110/146] 8145328: SEGV in DirectivesStack::getMatchingDirective Loop until enabled directive is found Reviewed-by: kvn, twisti --- hotspot/src/share/vm/compiler/compilerDirectives.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hotspot/src/share/vm/compiler/compilerDirectives.cpp b/hotspot/src/share/vm/compiler/compilerDirectives.cpp index 6ffeaa5a6c4..ba35617fc27 100644 --- a/hotspot/src/share/vm/compiler/compilerDirectives.cpp +++ b/hotspot/src/share/vm/compiler/compilerDirectives.cpp @@ -561,10 +561,11 @@ DirectiveSet* DirectivesStack::getMatchingDirective(methodHandle method, Abstrac match = dir->_c1_store; break; } - } - if (match->EnableOption) { - // The directiveSet for this compile is also enabled -> success - break; + } else { + if (match->EnableOption) { + // The directiveSet for this compile is also enabled -> success + break; + } } } dir = dir->next(); From 066e504bbad7c40009c1c6d800db75a1d3334ce5 Mon Sep 17 00:00:00 2001 From: Christian Thalinger Date: Wed, 23 Dec 2015 07:27:42 -1000 Subject: [PATCH 111/146] 8145435: [JVMCI] some tests on Windows fail with: assert(!thread->is_Java_thread()) failed: must not be java thread Reviewed-by: never, dnsimon, dholmes, coleenp --- hotspot/src/share/vm/ci/ciReplay.cpp | 8 +--- .../src/share/vm/classfile/javaClasses.cpp | 43 ++++++++----------- .../src/share/vm/classfile/javaClasses.hpp | 3 +- hotspot/src/share/vm/jvmci/jvmciCompiler.cpp | 39 +++++++++++++++-- hotspot/src/share/vm/jvmci/jvmciCompiler.hpp | 2 + hotspot/src/share/vm/jvmci/jvmciRuntime.cpp | 33 ++------------ hotspot/src/share/vm/jvmci/jvmciRuntime.hpp | 30 +------------ hotspot/src/share/vm/runtime/java.cpp | 16 ++++--- 8 files changed, 73 insertions(+), 101 deletions(-) diff --git a/hotspot/src/share/vm/ci/ciReplay.cpp b/hotspot/src/share/vm/ci/ciReplay.cpp index 27a5c1c8c16..aee1baf56e8 100644 --- a/hotspot/src/share/vm/ci/ciReplay.cpp +++ b/hotspot/src/share/vm/ci/ciReplay.cpp @@ -1040,10 +1040,8 @@ void* ciReplay::load_inline_data(ciMethod* method, int entry_bci, int comp_level } void* data = rp.process_inline(method, method->get_Method(), entry_bci, comp_level, THREAD); if (HAS_PENDING_EXCEPTION) { - oop throwable = PENDING_EXCEPTION; + Handle throwable(THREAD, PENDING_EXCEPTION); CLEAR_PENDING_EXCEPTION; - java_lang_Throwable::print(throwable, tty); - tty->cr(); java_lang_Throwable::print_stack_trace(throwable, tty); tty->cr(); return NULL; @@ -1085,10 +1083,8 @@ int ciReplay::replay_impl(TRAPS) { } if (HAS_PENDING_EXCEPTION) { - oop throwable = PENDING_EXCEPTION; + Handle throwable(THREAD, PENDING_EXCEPTION); CLEAR_PENDING_EXCEPTION; - java_lang_Throwable::print(throwable, tty); - tty->cr(); java_lang_Throwable::print_stack_trace(throwable, tty); tty->cr(); exit_code = 2; diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp index 1d9179aa9ef..b80899d324a 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.cpp +++ b/hotspot/src/share/vm/classfile/javaClasses.cpp @@ -1493,18 +1493,6 @@ void java_lang_Throwable::clear_stacktrace(oop throwable) { } -void java_lang_Throwable::print(oop throwable, outputStream* st) { - ResourceMark rm; - Klass* k = throwable->klass(); - assert(k != NULL, "just checking"); - st->print("%s", k->external_name()); - oop msg = message(throwable); - if (msg != NULL) { - st->print(": %s", java_lang_String::as_utf8_string(msg)); - } -} - - void java_lang_Throwable::print(Handle throwable, outputStream* st) { ResourceMark rm; Klass* k = throwable->klass(); @@ -1732,20 +1720,25 @@ const char* java_lang_Throwable::no_stack_trace_message() { return "\t<>"; } +/** + * Print the throwable message and its stack trace plus all causes by walking the + * cause chain. The output looks the same as of Throwable.printStackTrace(). + */ +void java_lang_Throwable::print_stack_trace(Handle throwable, outputStream* st) { + // First, print the message. + print(throwable, st); + st->cr(); -// Currently used only for exceptions occurring during startup -void java_lang_Throwable::print_stack_trace(oop throwable, outputStream* st) { - Thread *THREAD = Thread::current(); - Handle h_throwable(THREAD, throwable); - while (h_throwable.not_null()) { - objArrayHandle result (THREAD, objArrayOop(backtrace(h_throwable()))); + // Now print the stack trace. + Thread* THREAD = Thread::current(); + while (throwable.not_null()) { + objArrayHandle result (THREAD, objArrayOop(backtrace(throwable()))); if (result.is_null()) { st->print_raw_cr(no_stack_trace_message()); return; } while (result.not_null()) { - // Get method id, bci, version and mirror from chunk typeArrayHandle methods (THREAD, BacktraceBuilder::get_methods(result)); typeArrayHandle bcis (THREAD, BacktraceBuilder::get_bcis(result)); @@ -1770,20 +1763,20 @@ void java_lang_Throwable::print_stack_trace(oop throwable, outputStream* st) { EXCEPTION_MARK; JavaValue cause(T_OBJECT); JavaCalls::call_virtual(&cause, - h_throwable, - KlassHandle(THREAD, h_throwable->klass()), + throwable, + KlassHandle(THREAD, throwable->klass()), vmSymbols::getCause_name(), vmSymbols::void_throwable_signature(), THREAD); // Ignore any exceptions. we are in the middle of exception handling. Same as classic VM. if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_EXCEPTION; - h_throwable = Handle(); + throwable = Handle(); } else { - h_throwable = Handle(THREAD, (oop) cause.get_jobject()); - if (h_throwable.not_null()) { + throwable = Handle(THREAD, (oop) cause.get_jobject()); + if (throwable.not_null()) { st->print("Caused by: "); - print(h_throwable, st); + print(throwable, st); st->cr(); } } diff --git a/hotspot/src/share/vm/classfile/javaClasses.hpp b/hotspot/src/share/vm/classfile/javaClasses.hpp index 1aa88b399db..3ac5b4191ea 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.hpp +++ b/hotspot/src/share/vm/classfile/javaClasses.hpp @@ -552,9 +552,8 @@ class java_lang_Throwable: AllStatic { static oop get_stack_trace_element(oop throwable, int index, TRAPS); static int get_stack_trace_depth(oop throwable, TRAPS); // Printing - static void print(oop throwable, outputStream* st); static void print(Handle throwable, outputStream* st); - static void print_stack_trace(oop throwable, outputStream* st); + static void print_stack_trace(Handle throwable, outputStream* st); // Debugging friend class JavaClasses; }; diff --git a/hotspot/src/share/vm/jvmci/jvmciCompiler.cpp b/hotspot/src/share/vm/jvmci/jvmciCompiler.cpp index c07f9b4c250..8e5a2ff86f7 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCompiler.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciCompiler.cpp @@ -112,6 +112,15 @@ void JVMCICompiler::bootstrap() { _bootstrapping = false; } +#define CHECK_ABORT THREAD); \ +if (HAS_PENDING_EXCEPTION) { \ + char buf[256]; \ + jio_snprintf(buf, 256, "Uncaught exception at %s:%d", __FILE__, __LINE__); \ + JVMCICompiler::abort_on_pending_exception(PENDING_EXCEPTION, buf); \ + return; \ +} \ +(void)(0 + void JVMCICompiler::compile_method(const methodHandle& method, int entry_bci, JVMCIEnv* env) { JVMCI_EXCEPTION_CONTEXT @@ -150,12 +159,12 @@ void JVMCICompiler::compile_method(const methodHandle& method, int entry_bci, JV // should be handled by the Java code in some useful way but if they leak // through to here report them instead of dying or silently ignoring them. if (HAS_PENDING_EXCEPTION) { - Handle throwable = PENDING_EXCEPTION; + Handle exception(THREAD, PENDING_EXCEPTION); CLEAR_PENDING_EXCEPTION; - JVMCIRuntime::call_printStackTrace(throwable, THREAD); - if (HAS_PENDING_EXCEPTION) { - CLEAR_PENDING_EXCEPTION; + { + ttyLocker ttyl; + java_lang_Throwable::print_stack_trace(exception, tty); } // Something went wrong so disable compilation at this level @@ -165,6 +174,28 @@ void JVMCICompiler::compile_method(const methodHandle& method, int entry_bci, JV } } +/** + * Aborts the VM due to an unexpected exception. + */ +void JVMCICompiler::abort_on_pending_exception(Handle exception, const char* message, bool dump_core) { + Thread* THREAD = Thread::current(); + CLEAR_PENDING_EXCEPTION; + + { + ttyLocker ttyl; + tty->print_raw_cr(message); + java_lang_Throwable::print_stack_trace(exception, tty); + } + + // Give other aborting threads to also print their stack traces. + // This can be very useful when debugging class initialization + // failures. + assert(THREAD->is_Java_thread(), "compiler threads should be Java threads"); + const bool interruptible = true; + os::sleep(THREAD, 200, interruptible); + + vm_abort(dump_core); +} // Compilation entry point for methods void JVMCICompiler::compile_method(ciEnv* env, ciMethod* target, int entry_bci, DirectiveSet* directive) { diff --git a/hotspot/src/share/vm/jvmci/jvmciCompiler.hpp b/hotspot/src/share/vm/jvmci/jvmciCompiler.hpp index f1f5c079433..fabee997500 100644 --- a/hotspot/src/share/vm/jvmci/jvmciCompiler.hpp +++ b/hotspot/src/share/vm/jvmci/jvmciCompiler.hpp @@ -42,6 +42,8 @@ private: static elapsedTimer _codeInstallTimer; + static void abort_on_pending_exception(Handle exception, const char* message, bool dump_core = false); + public: JVMCICompiler(); diff --git a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp index 3d2463eee64..54b2e75697a 100644 --- a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp @@ -935,16 +935,15 @@ void JVMCIRuntime::save_options(SystemProperty* props) { } } -void JVMCIRuntime::shutdown() { +void JVMCIRuntime::shutdown(TRAPS) { if (_HotSpotJVMCIRuntime_instance != NULL) { _shutdown_called = true; - JavaThread* THREAD = JavaThread::current(); HandleMark hm(THREAD); - Handle receiver = get_HotSpotJVMCIRuntime(CHECK_ABORT); + Handle receiver = get_HotSpotJVMCIRuntime(CHECK); JavaValue result(T_VOID); JavaCallArguments args; args.push_oop(receiver); - JavaCalls::call_special(&result, receiver->klass(), vmSymbols::shutdown_method_name(), vmSymbols::void_method_signature(), &args, CHECK_ABORT); + JavaCalls::call_special(&result, receiver->klass(), vmSymbols::shutdown_method_name(), vmSymbols::void_method_signature(), &args, CHECK); } } @@ -962,32 +961,6 @@ bool JVMCIRuntime::treat_as_trivial(Method* method) { return false; } -void JVMCIRuntime::call_printStackTrace(Handle exception, Thread* thread) { - assert(exception->is_a(SystemDictionary::Throwable_klass()), "Throwable instance expected"); - JavaValue result(T_VOID); - JavaCalls::call_virtual(&result, - exception, - KlassHandle(thread, - SystemDictionary::Throwable_klass()), - vmSymbols::printStackTrace_name(), - vmSymbols::void_method_signature(), - thread); -} - -void JVMCIRuntime::abort_on_pending_exception(Handle exception, const char* message, bool dump_core) { - Thread* THREAD = Thread::current(); - CLEAR_PENDING_EXCEPTION; - tty->print_raw_cr(message); - call_printStackTrace(exception, THREAD); - - // Give other aborting threads to also print their stack traces. - // This can be very useful when debugging class initialization - // failures. - os::sleep(THREAD, 200, false); - - vm_abort(dump_core); -} - void JVMCIRuntime::parse_lines(char* path, ParseClosure* closure, bool warnStatFailure) { struct stat st; if (::stat(path, &st) == 0 && (st.st_mode & S_IFREG) == S_IFREG) { // exists & is regular file diff --git a/hotspot/src/share/vm/jvmci/jvmciRuntime.hpp b/hotspot/src/share/vm/jvmci/jvmciRuntime.hpp index 9e69965f19d..43ee0ad72a8 100644 --- a/hotspot/src/share/vm/jvmci/jvmciRuntime.hpp +++ b/hotspot/src/share/vm/jvmci/jvmciRuntime.hpp @@ -145,7 +145,7 @@ class JVMCIRuntime: public AllStatic { static void metadata_do(void f(Metadata*)); - static void shutdown(); + static void shutdown(TRAPS); static bool shutdown_called() { return _shutdown_called; @@ -154,34 +154,6 @@ class JVMCIRuntime: public AllStatic { static bool treat_as_trivial(Method* method); static void parse_lines(char* path, ParseClosure* closure, bool warnStatFailure); - /** - * Aborts the VM due to an unexpected exception. - */ - static void abort_on_pending_exception(Handle exception, const char* message, bool dump_core = false); - - /** - * Calls Throwable.printStackTrace() on a given exception. - */ - static void call_printStackTrace(Handle exception, Thread* thread); - -#define CHECK_ABORT THREAD); \ - if (HAS_PENDING_EXCEPTION) { \ - char buf[256]; \ - jio_snprintf(buf, 256, "Uncaught exception at %s:%d", __FILE__, __LINE__); \ - JVMCIRuntime::abort_on_pending_exception(PENDING_EXCEPTION, buf); \ - return; \ - } \ - (void)(0 - -#define CHECK_ABORT_(result) THREAD); \ - if (HAS_PENDING_EXCEPTION) { \ - char buf[256]; \ - jio_snprintf(buf, 256, "Uncaught exception at %s:%d", __FILE__, __LINE__); \ - JVMCIRuntime::abort_on_pending_exception(PENDING_EXCEPTION, buf); \ - return result; \ - } \ - (void)(0 - static BasicType kindToBasicType(Handle kind, TRAPS); // The following routines are all called from compiled JVMCI code diff --git a/hotspot/src/share/vm/runtime/java.cpp b/hotspot/src/share/vm/runtime/java.cpp index b65c2c2e1aa..aa57bbc4601 100644 --- a/hotspot/src/share/vm/runtime/java.cpp +++ b/hotspot/src/share/vm/runtime/java.cpp @@ -398,7 +398,7 @@ void print_statistics() { // Note: before_exit() can be executed only once, if more than one threads // are trying to shutdown the VM at the same time, only one thread // can run before_exit() and all other threads must wait. -void before_exit(JavaThread * thread) { +void before_exit(JavaThread* thread) { #define BEFORE_EXIT_NOT_RUN 0 #define BEFORE_EXIT_RUNNING 1 #define BEFORE_EXIT_DONE 2 @@ -426,7 +426,15 @@ void before_exit(JavaThread * thread) { } #if INCLUDE_JVMCI - JVMCIRuntime::shutdown(); + // We are not using CATCH here because we want the exit to continue normally. + Thread* THREAD = thread; + JVMCIRuntime::shutdown(THREAD); + if (HAS_PENDING_EXCEPTION) { + Handle exception(THREAD, PENDING_EXCEPTION); + CLEAR_PENDING_EXCEPTION; + ttyLocker ttyl; + java_lang_Throwable::print_stack_trace(exception, tty); + } #endif // Hang forever on exit if we're reporting an error. @@ -612,9 +620,7 @@ void vm_exit_during_initialization(Handle exception) { if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_EXCEPTION; } - java_lang_Throwable::print(exception, tty); - tty->cr(); - java_lang_Throwable::print_stack_trace(exception(), tty); + java_lang_Throwable::print_stack_trace(exception, tty); tty->cr(); vm_notify_during_shutdown(NULL, NULL); From 2c62b9355d9445d40cc8da640c60797d1070d184 Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Wed, 23 Dec 2015 23:08:16 +0300 Subject: [PATCH 112/146] 8146129: quarantine compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java Reviewed-by: twisti --- .../compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java b/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java index 4d655dee023..638321ae9d4 100644 --- a/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java +++ b/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java @@ -31,6 +31,7 @@ import jdk.test.lib.ProcessTools; * /compiler/testlibrary /compiler/codegen/7184394 * @modules java.base/sun.misc * java.management + * @ignore 8146128 * @build TestAESIntrinsicsOnSupportedConfig TestAESMain * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission From ffa21cb2b20e3b89e4cc8797122a77146976ec5f Mon Sep 17 00:00:00 2001 From: Christian Thalinger Date: Wed, 23 Dec 2015 11:36:46 -1000 Subject: [PATCH 113/146] 8146100: compiler/jvmci/code/SimpleCodeInstallationTest.java JUnit Failure: expected:<12> but was:<109710641> Reviewed-by: kvn --- .../test/compiler/jvmci/code/amd64/AMD64TestAssembler.java | 6 ++++-- .../test/compiler/jvmci/code/sparc/SPARCTestAssembler.java | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java b/hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java index b44d4af8c48..efd001c18d4 100644 --- a/hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java +++ b/hotspot/test/compiler/jvmci/code/amd64/AMD64TestAssembler.java @@ -34,8 +34,10 @@ import jdk.vm.ci.code.DebugInfo; import jdk.vm.ci.code.InfopointReason; import jdk.vm.ci.code.Register; import jdk.vm.ci.code.StackSlot; +import jdk.vm.ci.code.CallingConvention.Type; import jdk.vm.ci.hotspot.HotSpotConstant; import jdk.vm.ci.meta.JavaConstant; +import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.LIRKind; import jdk.vm.ci.meta.VMConstant; @@ -61,11 +63,11 @@ public class AMD64TestAssembler extends TestAssembler { } public Register emitIntArg0() { - return AMD64.rsi; + return codeCache.getRegisterConfig().getCallingConventionRegisters(Type.JavaCall, JavaKind.Int)[0]; } public Register emitIntArg1() { - return AMD64.rdx; + return codeCache.getRegisterConfig().getCallingConventionRegisters(Type.JavaCall, JavaKind.Int)[1]; } private void emitREX(boolean w, int r, int x, int b) { diff --git a/hotspot/test/compiler/jvmci/code/sparc/SPARCTestAssembler.java b/hotspot/test/compiler/jvmci/code/sparc/SPARCTestAssembler.java index 8430ab0e659..b37ed57c77a 100644 --- a/hotspot/test/compiler/jvmci/code/sparc/SPARCTestAssembler.java +++ b/hotspot/test/compiler/jvmci/code/sparc/SPARCTestAssembler.java @@ -32,8 +32,10 @@ import jdk.vm.ci.code.DebugInfo; import jdk.vm.ci.code.InfopointReason; import jdk.vm.ci.code.Register; import jdk.vm.ci.code.StackSlot; +import jdk.vm.ci.code.CallingConvention.Type; import jdk.vm.ci.hotspot.HotSpotConstant; import jdk.vm.ci.meta.JavaConstant; +import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.LIRKind; import jdk.vm.ci.meta.VMConstant; import jdk.vm.ci.sparc.SPARC; @@ -80,11 +82,11 @@ public class SPARCTestAssembler extends TestAssembler { } public Register emitIntArg0() { - return SPARC.i0; + return codeCache.getRegisterConfig().getCallingConventionRegisters(Type.JavaCallee, JavaKind.Int)[0]; } public Register emitIntArg1() { - return SPARC.i1; + return codeCache.getRegisterConfig().getCallingConventionRegisters(Type.JavaCallee, JavaKind.Int)[1]; } public Register emitLoadInt(int c) { From bc04deac1559f4a6a16b0853bb06b100b0ec8488 Mon Sep 17 00:00:00 2001 From: Christian Thalinger Date: Wed, 23 Dec 2015 16:24:19 -0800 Subject: [PATCH 114/146] 8146043: run JVMCI tests in JPRT Reviewed-by: iklam, ctornqvi, collins --- hotspot/test/TEST.groups | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups index 0ab5b18b6e1..c0b6324416a 100644 --- a/hotspot/test/TEST.groups +++ b/hotspot/test/TEST.groups @@ -279,6 +279,7 @@ hotspot_compiler_2 = \ compiler/inlining/ \ compiler/integerArithmetic/ \ compiler/interpreter/ \ + compiler/jvmci/ \ -compiler/codegen/7184394 \ -compiler/codecache/stress From 453650389fe24a0487de2e56428f7f4c245a59fc Mon Sep 17 00:00:00 2001 From: Vivek R Deshpande Date: Wed, 23 Dec 2015 21:09:50 -0800 Subject: [PATCH 115/146] 8145688: Update for x86 pow in the math lib Optimizes Math.pow() for 64 and 32 bit X86 architecture using Intel LIBM implementation. Reviewed-by: kvn --- hotspot/src/cpu/x86/vm/assembler_x86.cpp | 13 + hotspot/src/cpu/x86/vm/assembler_x86.hpp | 1 + .../src/cpu/x86/vm/c1_LIRAssembler_x86.cpp | 3 - .../src/cpu/x86/vm/c1_LIRGenerator_x86.cpp | 38 +- hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp | 47 - hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp | 13 +- hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp | 9 +- hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp | 232 -- hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp | 13 +- .../cpu/x86/vm/macroAssembler_x86_libm.cpp | 3581 ++++++++++++++++- .../src/cpu/x86/vm/stubGenerator_x86_32.cpp | 34 +- .../src/cpu/x86/vm/stubGenerator_x86_64.cpp | 58 +- hotspot/src/cpu/x86/vm/x86_32.ad | 33 - hotspot/src/cpu/x86/vm/x86_64.ad | 18 - hotspot/src/share/vm/adlc/formssel.cpp | 1 - hotspot/src/share/vm/c1/c1_LIR.cpp | 26 - hotspot/src/share/vm/c1/c1_LIR.hpp | 2 - hotspot/src/share/vm/c1/c1_LIRAssembler.cpp | 1 - hotspot/src/share/vm/c1/c1_LinearScan.cpp | 1 - hotspot/src/share/vm/c1/c1_Runtime1.cpp | 1 + hotspot/src/share/vm/opto/classes.hpp | 1 - hotspot/src/share/vm/opto/library_call.cpp | 245 +- hotspot/src/share/vm/opto/subnode.cpp | 14 - hotspot/src/share/vm/opto/subnode.hpp | 14 - hotspot/src/share/vm/runtime/stubRoutines.cpp | 2 +- hotspot/src/share/vm/runtime/stubRoutines.hpp | 2 + hotspot/src/share/vm/runtime/vmStructs.cpp | 2 +- 27 files changed, 3714 insertions(+), 691 deletions(-) diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.cpp b/hotspot/src/cpu/x86/vm/assembler_x86.cpp index e55fd56e78d..65451309b28 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.cpp @@ -772,6 +772,7 @@ address Assembler::locate_operand(address inst, WhichOperand which) { case 0x55: // andnps case 0x56: // orps case 0x57: // xorps + case 0x58: // addpd case 0x59: // mulpd case 0x6E: // movd case 0x7E: // movd @@ -3363,6 +3364,7 @@ void Assembler::pextrq(Register dst, XMMRegister src, int imm8) { emit_int8(imm8); } +// The encoding for pextrw is SSE2 to support the LIBM implementation. void Assembler::pextrw(Register dst, XMMRegister src, int imm8) { assert(VM_Version::supports_sse2(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); @@ -4361,6 +4363,17 @@ void Assembler::addpd(XMMRegister dst, XMMRegister src) { emit_int8((unsigned char)(0xC0 | encode)); } +void Assembler::addpd(XMMRegister dst, Address src) { + NOT_LP64(assert(VM_Version::supports_sse2(), "")); + InstructionMark im(this); + InstructionAttr attributes(AVX_128bit, /* rex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_address_attributes(/* tuple_type */ EVEX_FV, /* input_size_in_bits */ EVEX_64bit); + simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8(0x58); + emit_operand(dst, src); +} + + void Assembler::addps(XMMRegister dst, XMMRegister src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.hpp b/hotspot/src/cpu/x86/vm/assembler_x86.hpp index 4b6dcf4a028..380447b5d24 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.hpp @@ -1791,6 +1791,7 @@ private: // Add Packed Floating-Point Values void addpd(XMMRegister dst, XMMRegister src); + void addpd(XMMRegister dst, Address src); void addps(XMMRegister dst, XMMRegister src); void vaddpd(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); void vaddps(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); diff --git a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp index bfe8b8c86e9..963c1b77df1 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp @@ -2381,9 +2381,6 @@ void LIR_Assembler::intrinsic_op(LIR_Code code, LIR_Opr value, LIR_Opr unused, L // Should consider not saving rbx, if not necessary __ trigfunc('t', op->as_Op2()->fpu_stack_size()); break; - case lir_pow : - __ pow_with_fallback(op->as_Op2()->fpu_stack_size()); - break; default : ShouldNotReachHere(); } } else { diff --git a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp index e7ba64b69e6..63073ac4648 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp @@ -810,7 +810,8 @@ void LIRGenerator::do_CompareAndSwap(Intrinsic* x, ValueType* type) { void LIRGenerator::do_MathIntrinsic(Intrinsic* x) { assert(x->number_of_arguments() == 1 || (x->number_of_arguments() == 2 && x->id() == vmIntrinsics::_dpow), "wrong type"); - if (x->id() == vmIntrinsics::_dexp || x->id() == vmIntrinsics::_dlog) { + if (x->id() == vmIntrinsics::_dexp || x->id() == vmIntrinsics::_dlog || + x->id() == vmIntrinsics::_dpow) { do_LibmIntrinsic(x); return; } @@ -824,7 +825,6 @@ void LIRGenerator::do_MathIntrinsic(Intrinsic* x) { case vmIntrinsics::_dcos: case vmIntrinsics::_dtan: case vmIntrinsics::_dlog10: - case vmIntrinsics::_dpow: use_fpu = true; } } else { @@ -874,7 +874,6 @@ void LIRGenerator::do_MathIntrinsic(Intrinsic* x) { case vmIntrinsics::_dcos: __ cos (calc_input, calc_result, tmp1, tmp2); break; case vmIntrinsics::_dtan: __ tan (calc_input, calc_result, tmp1, tmp2); break; case vmIntrinsics::_dlog10: __ log10(calc_input, calc_result, tmp1); break; - case vmIntrinsics::_dpow: __ pow (calc_input, calc_input2, calc_result, tmp1, tmp2, FrameMap::rax_opr, FrameMap::rcx_opr, FrameMap::rdx_opr); break; default: ShouldNotReachHere(); } @@ -890,11 +889,25 @@ void LIRGenerator::do_LibmIntrinsic(Intrinsic* x) { LIR_Opr calc_result = rlock_result(x); LIR_Opr result_reg = result_register_for(x->type()); - BasicTypeList signature(1); - signature.append(T_DOUBLE); - CallingConvention* cc = frame_map()->c_calling_convention(&signature); + CallingConvention* cc = NULL; - value.load_item_force(cc->at(0)); + if (x->id() == vmIntrinsics::_dpow) { + LIRItem value1(x->argument_at(1), this); + + value1.set_destroys_register(); + + BasicTypeList signature(2); + signature.append(T_DOUBLE); + signature.append(T_DOUBLE); + cc = frame_map()->c_calling_convention(&signature); + value.load_item_force(cc->at(0)); + value1.load_item_force(cc->at(1)); + } else { + BasicTypeList signature(1); + signature.append(T_DOUBLE); + cc = frame_map()->c_calling_convention(&signature); + value.load_item_force(cc->at(0)); + } #ifndef _LP64 LIR_Opr tmp = FrameMap::fpu0_double_opr; @@ -915,6 +928,14 @@ void LIRGenerator::do_LibmIntrinsic(Intrinsic* x) { __ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dlog), getThreadTemp(), result_reg, cc->args()); } break; + case vmIntrinsics::_dpow: + if (VM_Version::supports_sse2()) { + __ call_runtime_leaf(StubRoutines::dpow(), getThreadTemp(), result_reg, cc->args()); + } + else { + __ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dpow), getThreadTemp(), result_reg, cc->args()); + } + break; default: ShouldNotReachHere(); } #else @@ -925,6 +946,9 @@ void LIRGenerator::do_LibmIntrinsic(Intrinsic* x) { case vmIntrinsics::_dlog: __ call_runtime_leaf(StubRoutines::dlog(), getThreadTemp(), result_reg, cc->args()); break; + case vmIntrinsics::_dpow: + __ call_runtime_leaf(StubRoutines::dpow(), getThreadTemp(), result_reg, cc->args()); + break; } #endif __ move(result_reg, calc_result); diff --git a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp index 462aa855c5f..52924b6e8dc 100644 --- a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp @@ -840,53 +840,6 @@ void FpuStackAllocator::handle_op2(LIR_Op2* op2) { break; } - case lir_pow: { - // pow needs two temporary fpu stack slots, so there are two temporary - // registers (stored in tmp1 and tmp2 of the operation). - // the stack allocator must guarantee that the stack slots are really free, - // otherwise there might be a stack overflow. - assert(left->is_fpu_register(), "must be"); - assert(right->is_fpu_register(), "must be"); - assert(res->is_fpu_register(), "must be"); - - assert(op2->tmp1_opr()->is_fpu_register(), "tmp1 is the first temporary register"); - assert(op2->tmp2_opr()->is_fpu_register(), "tmp2 is the second temporary register"); - assert(fpu_num(left) != fpu_num(right) && fpu_num(left) != fpu_num(op2->tmp1_opr()) && fpu_num(left) != fpu_num(op2->tmp2_opr()) && fpu_num(left) != fpu_num(res), "need distinct temp registers"); - assert(fpu_num(right) != fpu_num(op2->tmp1_opr()) && fpu_num(right) != fpu_num(op2->tmp2_opr()) && fpu_num(right) != fpu_num(res), "need distinct temp registers"); - assert(fpu_num(op2->tmp1_opr()) != fpu_num(op2->tmp2_opr()) && fpu_num(op2->tmp1_opr()) != fpu_num(res), "need distinct temp registers"); - assert(fpu_num(op2->tmp2_opr()) != fpu_num(res), "need distinct temp registers"); - - insert_free_if_dead(op2->tmp1_opr()); - insert_free_if_dead(op2->tmp2_opr()); - - // Must bring both operands to top of stack with following operand ordering: - // * fpu stack before pow: ... right left - // * fpu stack after pow: ... left - - insert_free_if_dead(res, right); - - if (tos_offset(right) != 1) { - insert_exchange(right); - insert_exchange(1); - } - insert_exchange(left); - assert(tos_offset(right) == 1, "check"); - assert(tos_offset(left) == 0, "check"); - - new_left = to_fpu_stack_top(left); - new_right = to_fpu_stack(right); - - op2->set_fpu_stack_size(sim()->stack_size()); - assert(sim()->stack_size() <= 6, "at least two stack slots must be free"); - - sim()->pop(); - - do_rename(right, res); - - new_res = to_fpu_stack_top(res); - break; - } - default: { assert(false, "missed a fpu-operation"); } diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp index a0e3f0685b6..6fee997e7a6 100644 --- a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp @@ -149,10 +149,15 @@ address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKin break; case Interpreter::java_lang_math_pow: __ fld_d(Address(rsp, 3*wordSize)); // second argument - __ pow_with_fallback(0); - // Store to stack to convert 80bit precision back to 64bits - __ push_fTOS(); - __ pop_fTOS(); + __ subptr(rsp, 4 * wordSize); + __ fstp_d(Address(rsp, 0)); + __ fstp_d(Address(rsp, 2 * wordSize)); + if (VM_Version::supports_sse2()) { + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dpow()))); + } else { + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dpow))); + } + __ addptr(rsp, 4 * wordSize); break; case Interpreter::java_lang_math_exp: __ subptr(rsp, 2*wordSize); diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp index 42d7fecb8b1..fc783f1182b 100644 --- a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp @@ -255,6 +255,10 @@ address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKin } else if (kind == Interpreter::java_lang_math_log) { __ movdbl(xmm0, Address(rsp, wordSize)); __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dlog()))); + } else if (kind == Interpreter::java_lang_math_pow) { + __ movdbl(xmm1, Address(rsp, wordSize)); + __ movdbl(xmm0, Address(rsp, 3 * wordSize)); + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::dpow()))); } else { __ fld_d(Address(rsp, wordSize)); switch (kind) { @@ -273,11 +277,6 @@ address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKin case Interpreter::java_lang_math_log10: __ flog10(); break; - case Interpreter::java_lang_math_pow: - __ fld_d(Address(rsp, 3*wordSize)); // second argument (one - // empty stack slot) - __ pow_with_fallback(0); - break; default : ShouldNotReachHere(); } diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp index af31a1ec3c2..0f869d6bdf6 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp @@ -3060,50 +3060,6 @@ void MacroAssembler::mulpd(XMMRegister dst, AddressLiteral src) { } } -void MacroAssembler::pow_exp_core_encoding() { - // kills rax, rcx, rdx - subptr(rsp,sizeof(jdouble)); - // computes 2^X. Stack: X ... - // f2xm1 computes 2^X-1 but only operates on -1<=X<=1. Get int(X) and - // keep it on the thread's stack to compute 2^int(X) later - // then compute 2^(X-int(X)) as (2^(X-int(X)-1+1) - // final result is obtained with: 2^X = 2^int(X) * 2^(X-int(X)) - fld_s(0); // Stack: X X ... - frndint(); // Stack: int(X) X ... - fsuba(1); // Stack: int(X) X-int(X) ... - fistp_s(Address(rsp,0)); // move int(X) as integer to thread's stack. Stack: X-int(X) ... - f2xm1(); // Stack: 2^(X-int(X))-1 ... - fld1(); // Stack: 1 2^(X-int(X))-1 ... - faddp(1); // Stack: 2^(X-int(X)) - // computes 2^(int(X)): add exponent bias (1023) to int(X), then - // shift int(X)+1023 to exponent position. - // Exponent is limited to 11 bits if int(X)+1023 does not fit in 11 - // bits, set result to NaN. 0x000 and 0x7FF are reserved exponent - // values so detect them and set result to NaN. - movl(rax,Address(rsp,0)); - movl(rcx, -2048); // 11 bit mask and valid NaN binary encoding - addl(rax, 1023); - movl(rdx,rax); - shll(rax,20); - // Check that 0 < int(X)+1023 < 2047. Otherwise set rax to NaN. - addl(rdx,1); - // Check that 1 < int(X)+1023+1 < 2048 - // in 3 steps: - // 1- (int(X)+1023+1)&-2048 == 0 => 0 <= int(X)+1023+1 < 2048 - // 2- (int(X)+1023+1)&-2048 != 0 - // 3- (int(X)+1023+1)&-2048 != 1 - // Do 2- first because addl just updated the flags. - cmov32(Assembler::equal,rax,rcx); - cmpl(rdx,1); - cmov32(Assembler::equal,rax,rcx); - testl(rdx,rcx); - cmov32(Assembler::notEqual,rax,rcx); - movl(Address(rsp,4),rax); - movl(Address(rsp,0),0); - fmul_d(Address(rsp,0)); // Stack: 2^X ... - addptr(rsp,sizeof(jdouble)); -} - void MacroAssembler::increase_precision() { subptr(rsp, BytesPerWord); fnstcw(Address(rsp, 0)); @@ -3119,194 +3075,6 @@ void MacroAssembler::restore_precision() { addptr(rsp, BytesPerWord); } -void MacroAssembler::fast_pow() { - // computes X^Y = 2^(Y * log2(X)) - // if fast computation is not possible, result is NaN. Requires - // fallback from user of this macro. - // increase precision for intermediate steps of the computation - BLOCK_COMMENT("fast_pow {"); - increase_precision(); - fyl2x(); // Stack: (Y*log2(X)) ... - pow_exp_core_encoding(); // Stack: exp(X) ... - restore_precision(); - BLOCK_COMMENT("} fast_pow"); -} - -void MacroAssembler::pow_or_exp(int num_fpu_regs_in_use) { - // kills rax, rcx, rdx - // pow and exp needs 2 extra registers on the fpu stack. - Label slow_case, done; - Register tmp = noreg; - if (!VM_Version::supports_cmov()) { - // fcmp needs a temporary so preserve rdx, - tmp = rdx; - } - Register tmp2 = rax; - Register tmp3 = rcx; - - // Stack: X Y - Label x_negative, y_not_2; - - static double two = 2.0; - ExternalAddress two_addr((address)&two); - - // constant maybe too far on 64 bit - lea(tmp2, two_addr); - fld_d(Address(tmp2, 0)); // Stack: 2 X Y - fcmp(tmp, 2, true, false); // Stack: X Y - jcc(Assembler::parity, y_not_2); - jcc(Assembler::notEqual, y_not_2); - - fxch(); fpop(); // Stack: X - fmul(0); // Stack: X*X - - jmp(done); - - bind(y_not_2); - - fldz(); // Stack: 0 X Y - fcmp(tmp, 1, true, false); // Stack: X Y - jcc(Assembler::above, x_negative); - - // X >= 0 - - fld_s(1); // duplicate arguments for runtime call. Stack: Y X Y - fld_s(1); // Stack: X Y X Y - fast_pow(); // Stack: X^Y X Y - fcmp(tmp, 0, false, false); // Stack: X^Y X Y - // X^Y not equal to itself: X^Y is NaN go to slow case. - jcc(Assembler::parity, slow_case); - // get rid of duplicate arguments. Stack: X^Y - if (num_fpu_regs_in_use > 0) { - fxch(); fpop(); - fxch(); fpop(); - } else { - ffree(2); - ffree(1); - } - jmp(done); - - // X <= 0 - bind(x_negative); - - fld_s(1); // Stack: Y X Y - frndint(); // Stack: int(Y) X Y - fcmp(tmp, 2, false, false); // Stack: int(Y) X Y - jcc(Assembler::notEqual, slow_case); - - subptr(rsp, 8); - - // For X^Y, when X < 0, Y has to be an integer and the final - // result depends on whether it's odd or even. We just checked - // that int(Y) == Y. We move int(Y) to gp registers as a 64 bit - // integer to test its parity. If int(Y) is huge and doesn't fit - // in the 64 bit integer range, the integer indefinite value will - // end up in the gp registers. Huge numbers are all even, the - // integer indefinite number is even so it's fine. - -#ifdef ASSERT - // Let's check we don't end up with an integer indefinite number - // when not expected. First test for huge numbers: check whether - // int(Y)+1 == int(Y) which is true for very large numbers and - // those are all even. A 64 bit integer is guaranteed to not - // overflow for numbers where y+1 != y (when precision is set to - // double precision). - Label y_not_huge; - - fld1(); // Stack: 1 int(Y) X Y - fadd(1); // Stack: 1+int(Y) int(Y) X Y - -#ifdef _LP64 - // trip to memory to force the precision down from double extended - // precision - fstp_d(Address(rsp, 0)); - fld_d(Address(rsp, 0)); -#endif - - fcmp(tmp, 1, true, false); // Stack: int(Y) X Y -#endif - - // move int(Y) as 64 bit integer to thread's stack - fistp_d(Address(rsp,0)); // Stack: X Y - -#ifdef ASSERT - jcc(Assembler::notEqual, y_not_huge); - - // Y is huge so we know it's even. It may not fit in a 64 bit - // integer and we don't want the debug code below to see the - // integer indefinite value so overwrite int(Y) on the thread's - // stack with 0. - movl(Address(rsp, 0), 0); - movl(Address(rsp, 4), 0); - - bind(y_not_huge); -#endif - - fld_s(1); // duplicate arguments for runtime call. Stack: Y X Y - fld_s(1); // Stack: X Y X Y - fabs(); // Stack: abs(X) Y X Y - fast_pow(); // Stack: abs(X)^Y X Y - fcmp(tmp, 0, false, false); // Stack: abs(X)^Y X Y - // abs(X)^Y not equal to itself: abs(X)^Y is NaN go to slow case. - - pop(tmp2); - NOT_LP64(pop(tmp3)); - jcc(Assembler::parity, slow_case); - -#ifdef ASSERT - // Check that int(Y) is not integer indefinite value (int - // overflow). Shouldn't happen because for values that would - // overflow, 1+int(Y)==Y which was tested earlier. -#ifndef _LP64 - { - Label integer; - testl(tmp2, tmp2); - jcc(Assembler::notZero, integer); - cmpl(tmp3, 0x80000000); - jcc(Assembler::notZero, integer); - STOP("integer indefinite value shouldn't be seen here"); - bind(integer); - } -#else - { - Label integer; - mov(tmp3, tmp2); // preserve tmp2 for parity check below - shlq(tmp3, 1); - jcc(Assembler::carryClear, integer); - jcc(Assembler::notZero, integer); - STOP("integer indefinite value shouldn't be seen here"); - bind(integer); - } -#endif -#endif - - // get rid of duplicate arguments. Stack: X^Y - if (num_fpu_regs_in_use > 0) { - fxch(); fpop(); - fxch(); fpop(); - } else { - ffree(2); - ffree(1); - } - - testl(tmp2, 1); - jcc(Assembler::zero, done); // X <= 0, Y even: X^Y = abs(X)^Y - // X <= 0, Y even: X^Y = -abs(X)^Y - - fchs(); // Stack: -abs(X)^Y Y - jmp(done); - - // slow case: runtime call - bind(slow_case); - - fpop(); // pop incorrect result or int(Y) - - fp_runtime_fallback(CAST_FROM_FN_PTR(address, SharedRuntime::dpow), 2, num_fpu_regs_in_use); - - // Come here with result in F-TOS - bind(done); -} - void MacroAssembler::fpop() { ffree(); fincstp(); diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp index f9037c993f1..0b7fc6d90c0 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp @@ -918,24 +918,19 @@ class MacroAssembler: public Assembler { void fast_log(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register rax, Register rcx, Register rdx, Register tmp1 LP64_ONLY(COMMA Register tmp2)); + void fast_pow(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, + XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register rax, Register rcx, + Register rdx NOT_LP64(COMMA Register tmp) LP64_ONLY(COMMA Register tmp1) + LP64_ONLY(COMMA Register tmp2) LP64_ONLY(COMMA Register tmp3) LP64_ONLY(COMMA Register tmp4)); void increase_precision(); void restore_precision(); - // computes pow(x,y). Fallback to runtime call included. - void pow_with_fallback(int num_fpu_regs_in_use) { pow_or_exp(num_fpu_regs_in_use); } - private: // call runtime as a fallback for trig functions and pow/exp. void fp_runtime_fallback(address runtime_entry, int nb_args, int num_fpu_regs_in_use); - // computes 2^(Ylog2X); Ylog2X in ST(0) - void pow_exp_core_encoding(); - - // computes pow(x,y) or exp(x). Fallback to runtime call included. - void pow_or_exp(int num_fpu_regs_in_use); - // these are private because users should be doing movflt/movdbl void movss(Address dst, XMMRegister src) { Assembler::movss(dst, src); } diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86_libm.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86_libm.cpp index 860f2bcd26d..e94f1d7136f 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86_libm.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86_libm.cpp @@ -35,6 +35,8 @@ #define ALIGNED_(x) __attribute__ ((aligned(x))) #endif +// The 32 bit and 64 bit code is at most SSE2 compliant + /******************************************************************************/ // ALGORITHM DESCRIPTION - EXP() // --------------------- @@ -409,7 +411,7 @@ void MacroAssembler::fast_exp(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xm addq(rsp, 24); } -#endif +#endif // _LP64 #ifndef _LP64 @@ -674,7 +676,7 @@ void MacroAssembler::fast_exp(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xm movl(tmp, Address(rsp, 64)); } -#endif +#endif // !_LP64 /******************************************************************************/ // ALGORITHM DESCRIPTION - LOG() @@ -889,13 +891,23 @@ void MacroAssembler::fast_log(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xm addsd(xmm1, xmm5); movdqu(xmm2, ExternalAddress(32 + coeff)); // 0x9999999aUL, 0x3fc99999UL, 0x00000000UL, 0xbfe00000UL mulsd(xmm6, xmm7); - movddup(xmm5, xmm1); + if (VM_Version::supports_sse3()) { + movddup(xmm5, xmm1); + } else { + movdqu(xmm5, xmm1); + movlhps(xmm5, xmm5); + } mulsd(xmm7, ExternalAddress(8 + log2)); // 0x93c76730UL, 0x3ceef357UL mulsd(xmm3, xmm1); addsd(xmm0, xmm6); mulpd(xmm4, xmm5); mulpd(xmm5, xmm5); - movddup(xmm6, xmm0); + if (VM_Version::supports_sse3()) { + movddup(xmm6, xmm0); + } else { + movdqu(xmm6, xmm0); + movlhps(xmm6, xmm6); + } addsd(xmm0, xmm1); addpd(xmm4, xmm2); mulpd(xmm3, xmm5); @@ -995,7 +1007,7 @@ void MacroAssembler::fast_log(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xm addq(rsp, 24); } -#endif +#endif // _LP64 #ifndef _LP64 @@ -1285,4 +1297,3561 @@ void MacroAssembler::fast_log(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xm movl(tmp, Address(rsp, 40)); } -#endif +#endif // !_LP64 + +/******************************************************************************/ +// ALGORITHM DESCRIPTION - POW() +// --------------------- +// +// Let x=2^k * mx, mx in [1,2) +// +// log2(x) calculation: +// +// Get B~1/mx based on the output of rcpps instruction (B0) +// B = int((B0*LH*2^9+0.5))/2^9 +// LH is a short approximation for log2(e) +// +// Reduced argument, scaled by LH: +// r=B*mx-LH (computed accurately in high and low parts) +// +// log2(x) result: k - log2(B) + p(r) +// p(r) is a degree 8 polynomial +// -log2(B) read from data table (high, low parts) +// log2(x) is formed from high and low parts +// For |x| in [1-1/32, 1+1/16), a slower but more accurate computation +// based om the same table design is performed. +// +// Main path is taken if | floor(log2(|log2(|x|)|) + floor(log2|y|) | < 8, +// to filter out all potential OF/UF cases. +// exp2(y*log2(x)) is computed using an 8-bit index table and a degree 5 +// polynomial +// +// Special cases: +// pow(-0,y) = -INF and raises the divide-by-zero exception for y an odd +// integer < 0. +// pow(-0,y) = +INF and raises the divide-by-zero exception for y < 0 and +// not an odd integer. +// pow(-0,y) = -0 for y an odd integer > 0. +// pow(-0,y) = +0 for y > 0 and not an odd integer. +// pow(-1,-INF) = NaN. +// pow(+1,y) = NaN for any y, even a NaN. +// pow(x,-0) = 1 for any x, even a NaN. +// pow(x,y) = a NaN and raises the invalid exception for finite x < 0 and +// finite non-integer y. +// pow(x,-INF) = +INF for |x|<1. +// pow(x,-INF) = +0 for |x|>1. +// pow(x,+INF) = +0 for |x|<1. +// pow(x,+INF) = +INF for |x|>1. +// pow(-INF,y) = -0 for y an odd integer < 0. +// pow(-INF,y) = +0 for y < 0 and not an odd integer. +// pow(-INF,y) = -INF for y an odd integer > 0. +// pow(-INF,y) = +INF for y > 0 and not an odd integer. +// pow(+INF,y) = +0 for y <0. +// pow(+INF,y) = +INF for y >0. +// +/******************************************************************************/ + +#ifdef _LP64 +ALIGNED_(16) juint _HIGHSIGMASK[] = +{ + 0x00000000UL, 0xfffff800UL, 0x00000000UL, 0xfffff800UL +}; + +ALIGNED_(16) juint _LOG2_E[] = +{ + 0x00000000UL, 0x3ff72000UL, 0x161bb241UL, 0xbf5dabe1UL +}; + +ALIGNED_(16) juint _HIGHMASK_Y[] = +{ + 0x00000000UL, 0xfffffff8UL, 0x00000000UL, 0xffffffffUL +}; + +ALIGNED_(16) juint _T_exp[] = +{ + 0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0x3b700000UL, 0xfa5abcbfUL, + 0x3ff00b1aUL, 0xa7609f71UL, 0xbc84f6b2UL, 0xa9fb3335UL, 0x3ff0163dUL, + 0x9ab8cdb7UL, 0x3c9b6129UL, 0x143b0281UL, 0x3ff02168UL, 0x0fc54eb6UL, + 0xbc82bf31UL, 0x3e778061UL, 0x3ff02c9aUL, 0x535b085dUL, 0xbc719083UL, + 0x2e11bbccUL, 0x3ff037d4UL, 0xeeade11aUL, 0x3c656811UL, 0xe86e7f85UL, + 0x3ff04315UL, 0x1977c96eUL, 0xbc90a31cUL, 0x72f654b1UL, 0x3ff04e5fUL, + 0x3aa0d08cUL, 0x3c84c379UL, 0xd3158574UL, 0x3ff059b0UL, 0xa475b465UL, + 0x3c8d73e2UL, 0x0e3c1f89UL, 0x3ff0650aUL, 0x5799c397UL, 0xbc95cb7bUL, + 0x29ddf6deUL, 0x3ff0706bUL, 0xe2b13c27UL, 0xbc8c91dfUL, 0x2b72a836UL, + 0x3ff07bd4UL, 0x54458700UL, 0x3c832334UL, 0x18759bc8UL, 0x3ff08745UL, + 0x4bb284ffUL, 0x3c6186beUL, 0xf66607e0UL, 0x3ff092bdUL, 0x800a3fd1UL, + 0xbc968063UL, 0xcac6f383UL, 0x3ff09e3eUL, 0x18316136UL, 0x3c914878UL, + 0x9b1f3919UL, 0x3ff0a9c7UL, 0x873d1d38UL, 0x3c85d16cUL, 0x6cf9890fUL, + 0x3ff0b558UL, 0x4adc610bUL, 0x3c98a62eUL, 0x45e46c85UL, 0x3ff0c0f1UL, + 0x06d21cefUL, 0x3c94f989UL, 0x2b7247f7UL, 0x3ff0cc92UL, 0x16e24f71UL, + 0x3c901edcUL, 0x23395decUL, 0x3ff0d83bUL, 0xe43f316aUL, 0xbc9bc14dUL, + 0x32d3d1a2UL, 0x3ff0e3ecUL, 0x27c57b52UL, 0x3c403a17UL, 0x5fdfa9c5UL, + 0x3ff0efa5UL, 0xbc54021bUL, 0xbc949db9UL, 0xaffed31bUL, 0x3ff0fb66UL, + 0xc44ebd7bUL, 0xbc6b9bedUL, 0x28d7233eUL, 0x3ff10730UL, 0x1692fdd5UL, + 0x3c8d46ebUL, 0xd0125b51UL, 0x3ff11301UL, 0x39449b3aUL, 0xbc96c510UL, + 0xab5e2ab6UL, 0x3ff11edbUL, 0xf703fb72UL, 0xbc9ca454UL, 0xc06c31ccUL, + 0x3ff12abdUL, 0xb36ca5c7UL, 0xbc51b514UL, 0x14f204abUL, 0x3ff136a8UL, + 0xba48dcf0UL, 0xbc67108fUL, 0xaea92de0UL, 0x3ff1429aUL, 0x9af1369eUL, + 0xbc932fbfUL, 0x934f312eUL, 0x3ff14e95UL, 0x39bf44abUL, 0xbc8b91e8UL, + 0xc8a58e51UL, 0x3ff15a98UL, 0xb9eeab0aUL, 0x3c82406aUL, 0x5471c3c2UL, + 0x3ff166a4UL, 0x82ea1a32UL, 0x3c58f23bUL, 0x3c7d517bUL, 0x3ff172b8UL, + 0xb9d78a76UL, 0xbc819041UL, 0x8695bbc0UL, 0x3ff17ed4UL, 0xe2ac5a64UL, + 0x3c709e3fUL, 0x388c8deaUL, 0x3ff18af9UL, 0xd1970f6cUL, 0xbc911023UL, + 0x58375d2fUL, 0x3ff19726UL, 0x85f17e08UL, 0x3c94aaddUL, 0xeb6fcb75UL, + 0x3ff1a35bUL, 0x7b4968e4UL, 0x3c8e5b4cUL, 0xf8138a1cUL, 0x3ff1af99UL, + 0xa4b69280UL, 0x3c97bf85UL, 0x84045cd4UL, 0x3ff1bbe0UL, 0x352ef607UL, + 0xbc995386UL, 0x95281c6bUL, 0x3ff1c82fUL, 0x8010f8c9UL, 0x3c900977UL, + 0x3168b9aaUL, 0x3ff1d487UL, 0x00a2643cUL, 0x3c9e016eUL, 0x5eb44027UL, + 0x3ff1e0e7UL, 0x088cb6deUL, 0xbc96fdd8UL, 0x22fcd91dUL, 0x3ff1ed50UL, + 0x027bb78cUL, 0xbc91df98UL, 0x8438ce4dUL, 0x3ff1f9c1UL, 0xa097af5cUL, + 0xbc9bf524UL, 0x88628cd6UL, 0x3ff2063bUL, 0x814a8495UL, 0x3c8dc775UL, + 0x3578a819UL, 0x3ff212beUL, 0x2cfcaac9UL, 0x3c93592dUL, 0x917ddc96UL, + 0x3ff21f49UL, 0x9494a5eeUL, 0x3c82a97eUL, 0xa27912d1UL, 0x3ff22bddUL, + 0x5577d69fUL, 0x3c8d34fbUL, 0x6e756238UL, 0x3ff2387aUL, 0xb6c70573UL, + 0x3c99b07eUL, 0xfb82140aUL, 0x3ff2451fUL, 0x911ca996UL, 0x3c8acfccUL, + 0x4fb2a63fUL, 0x3ff251ceUL, 0xbef4f4a4UL, 0x3c8ac155UL, 0x711ece75UL, + 0x3ff25e85UL, 0x4ac31b2cUL, 0x3c93e1a2UL, 0x65e27cddUL, 0x3ff26b45UL, + 0x9940e9d9UL, 0x3c82bd33UL, 0x341ddf29UL, 0x3ff2780eUL, 0x05f9e76cUL, + 0x3c9e067cUL, 0xe1f56381UL, 0x3ff284dfUL, 0x8c3f0d7eUL, 0xbc9a4c3aUL, + 0x7591bb70UL, 0x3ff291baUL, 0x28401cbdUL, 0xbc82cc72UL, 0xf51fdee1UL, + 0x3ff29e9dUL, 0xafad1255UL, 0x3c8612e8UL, 0x66d10f13UL, 0x3ff2ab8aUL, + 0x191690a7UL, 0xbc995743UL, 0xd0dad990UL, 0x3ff2b87fUL, 0xd6381aa4UL, + 0xbc410adcUL, 0x39771b2fUL, 0x3ff2c57eUL, 0xa6eb5124UL, 0xbc950145UL, + 0xa6e4030bUL, 0x3ff2d285UL, 0x54db41d5UL, 0x3c900247UL, 0x1f641589UL, + 0x3ff2df96UL, 0xfbbce198UL, 0x3c9d16cfUL, 0xa93e2f56UL, 0x3ff2ecafUL, + 0x45d52383UL, 0x3c71ca0fUL, 0x4abd886bUL, 0x3ff2f9d2UL, 0x532bda93UL, + 0xbc653c55UL, 0x0a31b715UL, 0x3ff306feUL, 0xd23182e4UL, 0x3c86f46aUL, + 0xedeeb2fdUL, 0x3ff31432UL, 0xf3f3fcd1UL, 0x3c8959a3UL, 0xfc4cd831UL, + 0x3ff32170UL, 0x8e18047cUL, 0x3c8a9ce7UL, 0x3ba8ea32UL, 0x3ff32eb8UL, + 0x3cb4f318UL, 0xbc9c45e8UL, 0xb26416ffUL, 0x3ff33c08UL, 0x843659a6UL, + 0x3c932721UL, 0x66e3fa2dUL, 0x3ff34962UL, 0x930881a4UL, 0xbc835a75UL, + 0x5f929ff1UL, 0x3ff356c5UL, 0x5c4e4628UL, 0xbc8b5ceeUL, 0xa2de883bUL, + 0x3ff36431UL, 0xa06cb85eUL, 0xbc8c3144UL, 0x373aa9cbUL, 0x3ff371a7UL, + 0xbf42eae2UL, 0xbc963aeaUL, 0x231e754aUL, 0x3ff37f26UL, 0x9eceb23cUL, + 0xbc99f5caUL, 0x6d05d866UL, 0x3ff38caeUL, 0x3c9904bdUL, 0xbc9e958dUL, + 0x1b7140efUL, 0x3ff39a40UL, 0xfc8e2934UL, 0xbc99a9a5UL, 0x34e59ff7UL, + 0x3ff3a7dbUL, 0xd661f5e3UL, 0xbc75e436UL, 0xbfec6cf4UL, 0x3ff3b57fUL, + 0xe26fff18UL, 0x3c954c66UL, 0xc313a8e5UL, 0x3ff3c32dUL, 0x375d29c3UL, + 0xbc9efff8UL, 0x44ede173UL, 0x3ff3d0e5UL, 0x8c284c71UL, 0x3c7fe8d0UL, + 0x4c123422UL, 0x3ff3dea6UL, 0x11f09ebcUL, 0x3c8ada09UL, 0xdf1c5175UL, + 0x3ff3ec70UL, 0x7b8c9bcaUL, 0xbc8af663UL, 0x04ac801cUL, 0x3ff3fa45UL, + 0xf956f9f3UL, 0xbc97d023UL, 0xc367a024UL, 0x3ff40822UL, 0xb6f4d048UL, + 0x3c8bddf8UL, 0x21f72e2aUL, 0x3ff4160aUL, 0x1c309278UL, 0xbc5ef369UL, + 0x2709468aUL, 0x3ff423fbUL, 0xc0b314ddUL, 0xbc98462dUL, 0xd950a897UL, + 0x3ff431f5UL, 0xe35f7999UL, 0xbc81c7ddUL, 0x3f84b9d4UL, 0x3ff43ffaUL, + 0x9704c003UL, 0x3c8880beUL, 0x6061892dUL, 0x3ff44e08UL, 0x04ef80d0UL, + 0x3c489b7aUL, 0x42a7d232UL, 0x3ff45c20UL, 0x82fb1f8eUL, 0xbc686419UL, + 0xed1d0057UL, 0x3ff46a41UL, 0xd1648a76UL, 0x3c9c944bUL, 0x668b3237UL, + 0x3ff4786dUL, 0xed445733UL, 0xbc9c20f0UL, 0xb5c13cd0UL, 0x3ff486a2UL, + 0xb69062f0UL, 0x3c73c1a3UL, 0xe192aed2UL, 0x3ff494e1UL, 0x5e499ea0UL, + 0xbc83b289UL, 0xf0d7d3deUL, 0x3ff4a32aUL, 0xf3d1be56UL, 0x3c99cb62UL, + 0xea6db7d7UL, 0x3ff4b17dUL, 0x7f2897f0UL, 0xbc8125b8UL, 0xd5362a27UL, + 0x3ff4bfdaUL, 0xafec42e2UL, 0x3c7d4397UL, 0xb817c114UL, 0x3ff4ce41UL, + 0x690abd5dUL, 0x3c905e29UL, 0x99fddd0dUL, 0x3ff4dcb2UL, 0xbc6a7833UL, + 0x3c98ecdbUL, 0x81d8abffUL, 0x3ff4eb2dUL, 0x2e5d7a52UL, 0xbc95257dUL, + 0x769d2ca7UL, 0x3ff4f9b2UL, 0xd25957e3UL, 0xbc94b309UL, 0x7f4531eeUL, + 0x3ff50841UL, 0x49b7465fUL, 0x3c7a249bUL, 0xa2cf6642UL, 0x3ff516daUL, + 0x69bd93efUL, 0xbc8f7685UL, 0xe83f4eefUL, 0x3ff5257dUL, 0x43efef71UL, + 0xbc7c998dUL, 0x569d4f82UL, 0x3ff5342bUL, 0x1db13cadUL, 0xbc807abeUL, + 0xf4f6ad27UL, 0x3ff542e2UL, 0x192d5f7eUL, 0x3c87926dUL, 0xca5d920fUL, + 0x3ff551a4UL, 0xefede59bUL, 0xbc8d689cUL, 0xdde910d2UL, 0x3ff56070UL, + 0x168eebf0UL, 0xbc90fb6eUL, 0x36b527daUL, 0x3ff56f47UL, 0x011d93adUL, + 0x3c99bb2cUL, 0xdbe2c4cfUL, 0x3ff57e27UL, 0x8a57b9c4UL, 0xbc90b98cUL, + 0xd497c7fdUL, 0x3ff58d12UL, 0x5b9a1de8UL, 0x3c8295e1UL, 0x27ff07ccUL, + 0x3ff59c08UL, 0xe467e60fUL, 0xbc97e2ceUL, 0xdd485429UL, 0x3ff5ab07UL, + 0x054647adUL, 0x3c96324cUL, 0xfba87a03UL, 0x3ff5ba11UL, 0x4c233e1aUL, + 0xbc9b77a1UL, 0x8a5946b7UL, 0x3ff5c926UL, 0x816986a2UL, 0x3c3c4b1bUL, + 0x90998b93UL, 0x3ff5d845UL, 0xa8b45643UL, 0xbc9cd6a7UL, 0x15ad2148UL, + 0x3ff5e76fUL, 0x3080e65eUL, 0x3c9ba6f9UL, 0x20dceb71UL, 0x3ff5f6a3UL, + 0xe3cdcf92UL, 0xbc89eaddUL, 0xb976dc09UL, 0x3ff605e1UL, 0x9b56de47UL, + 0xbc93e242UL, 0xe6cdf6f4UL, 0x3ff6152aUL, 0x4ab84c27UL, 0x3c9e4b3eUL, + 0xb03a5585UL, 0x3ff6247eUL, 0x7e40b497UL, 0xbc9383c1UL, 0x1d1929fdUL, + 0x3ff633ddUL, 0xbeb964e5UL, 0x3c984710UL, 0x34ccc320UL, 0x3ff64346UL, + 0x759d8933UL, 0xbc8c483cUL, 0xfebc8fb7UL, 0x3ff652b9UL, 0xc9a73e09UL, + 0xbc9ae3d5UL, 0x82552225UL, 0x3ff66238UL, 0x87591c34UL, 0xbc9bb609UL, + 0xc70833f6UL, 0x3ff671c1UL, 0x586c6134UL, 0xbc8e8732UL, 0xd44ca973UL, + 0x3ff68155UL, 0x44f73e65UL, 0x3c6038aeUL, 0xb19e9538UL, 0x3ff690f4UL, + 0x9aeb445dUL, 0x3c8804bdUL, 0x667f3bcdUL, 0x3ff6a09eUL, 0x13b26456UL, + 0xbc9bdd34UL, 0xfa75173eUL, 0x3ff6b052UL, 0x2c9a9d0eUL, 0x3c7a38f5UL, + 0x750bdabfUL, 0x3ff6c012UL, 0x67ff0b0dUL, 0xbc728956UL, 0xddd47645UL, + 0x3ff6cfdcUL, 0xb6f17309UL, 0x3c9c7aa9UL, 0x3c651a2fUL, 0x3ff6dfb2UL, + 0x683c88abUL, 0xbc6bbe3aUL, 0x98593ae5UL, 0x3ff6ef92UL, 0x9e1ac8b2UL, + 0xbc90b974UL, 0xf9519484UL, 0x3ff6ff7dUL, 0x25860ef6UL, 0xbc883c0fUL, + 0x66f42e87UL, 0x3ff70f74UL, 0xd45aa65fUL, 0x3c59d644UL, 0xe8ec5f74UL, + 0x3ff71f75UL, 0x86887a99UL, 0xbc816e47UL, 0x86ead08aUL, 0x3ff72f82UL, + 0x2cd62c72UL, 0xbc920aa0UL, 0x48a58174UL, 0x3ff73f9aUL, 0x6c65d53cUL, + 0xbc90a8d9UL, 0x35d7cbfdUL, 0x3ff74fbdUL, 0x618a6e1cUL, 0x3c9047fdUL, + 0x564267c9UL, 0x3ff75febUL, 0x57316dd3UL, 0xbc902459UL, 0xb1ab6e09UL, + 0x3ff77024UL, 0x169147f8UL, 0x3c9b7877UL, 0x4fde5d3fUL, 0x3ff78069UL, + 0x0a02162dUL, 0x3c9866b8UL, 0x38ac1cf6UL, 0x3ff790b9UL, 0x62aadd3eUL, + 0x3c9349a8UL, 0x73eb0187UL, 0x3ff7a114UL, 0xee04992fUL, 0xbc841577UL, + 0x0976cfdbUL, 0x3ff7b17bUL, 0x8468dc88UL, 0xbc9bebb5UL, 0x0130c132UL, + 0x3ff7c1edUL, 0xd1164dd6UL, 0x3c9f124cUL, 0x62ff86f0UL, 0x3ff7d26aUL, + 0xfb72b8b4UL, 0x3c91bddbUL, 0x36cf4e62UL, 0x3ff7e2f3UL, 0xba15797eUL, + 0x3c705d02UL, 0x8491c491UL, 0x3ff7f387UL, 0xcf9311aeUL, 0xbc807f11UL, + 0x543e1a12UL, 0x3ff80427UL, 0x626d972bUL, 0xbc927c86UL, 0xadd106d9UL, + 0x3ff814d2UL, 0x0d151d4dUL, 0x3c946437UL, 0x994cce13UL, 0x3ff82589UL, + 0xd41532d8UL, 0xbc9d4c1dUL, 0x1eb941f7UL, 0x3ff8364cUL, 0x31df2bd5UL, + 0x3c999b9aUL, 0x4623c7adUL, 0x3ff8471aUL, 0xa341cdfbUL, 0xbc88d684UL, + 0x179f5b21UL, 0x3ff857f4UL, 0xf8b216d0UL, 0xbc5ba748UL, 0x9b4492edUL, + 0x3ff868d9UL, 0x9bd4f6baUL, 0xbc9fc6f8UL, 0xd931a436UL, 0x3ff879caUL, + 0xd2db47bdUL, 0x3c85d2d7UL, 0xd98a6699UL, 0x3ff88ac7UL, 0xf37cb53aUL, + 0x3c9994c2UL, 0xa478580fUL, 0x3ff89bd0UL, 0x4475202aUL, 0x3c9d5395UL, + 0x422aa0dbUL, 0x3ff8ace5UL, 0x56864b27UL, 0x3c96e9f1UL, 0xbad61778UL, + 0x3ff8be05UL, 0xfc43446eUL, 0x3c9ecb5eUL, 0x16b5448cUL, 0x3ff8cf32UL, + 0x32e9e3aaUL, 0xbc70d55eUL, 0x5e0866d9UL, 0x3ff8e06aUL, 0x6fc9b2e6UL, + 0xbc97114aUL, 0x99157736UL, 0x3ff8f1aeUL, 0xa2e3976cUL, 0x3c85cc13UL, + 0xd0282c8aUL, 0x3ff902feUL, 0x85fe3fd2UL, 0x3c9592caUL, 0x0b91ffc6UL, + 0x3ff9145bUL, 0x2e582524UL, 0xbc9dd679UL, 0x53aa2fe2UL, 0x3ff925c3UL, + 0xa639db7fUL, 0xbc83455fUL, 0xb0cdc5e5UL, 0x3ff93737UL, 0x81b57ebcUL, + 0xbc675fc7UL, 0x2b5f98e5UL, 0x3ff948b8UL, 0x797d2d99UL, 0xbc8dc3d6UL, + 0xcbc8520fUL, 0x3ff95a44UL, 0x96a5f039UL, 0xbc764b7cUL, 0x9a7670b3UL, + 0x3ff96bddUL, 0x7f19c896UL, 0xbc5ba596UL, 0x9fde4e50UL, 0x3ff97d82UL, + 0x7c1b85d1UL, 0xbc9d185bUL, 0xe47a22a2UL, 0x3ff98f33UL, 0xa24c78ecUL, + 0x3c7cabdaUL, 0x70ca07baUL, 0x3ff9a0f1UL, 0x91cee632UL, 0xbc9173bdUL, + 0x4d53fe0dUL, 0x3ff9b2bbUL, 0x4df6d518UL, 0xbc9dd84eUL, 0x82a3f090UL, + 0x3ff9c491UL, 0xb071f2beUL, 0x3c7c7c46UL, 0x194bb8d5UL, 0x3ff9d674UL, + 0xa3dd8233UL, 0xbc9516beUL, 0x19e32323UL, 0x3ff9e863UL, 0x78e64c6eUL, + 0x3c7824caUL, 0x8d07f29eUL, 0x3ff9fa5eUL, 0xaaf1faceUL, 0xbc84a9ceUL, + 0x7b5de565UL, 0x3ffa0c66UL, 0x5d1cd533UL, 0xbc935949UL, 0xed8eb8bbUL, + 0x3ffa1e7aUL, 0xee8be70eUL, 0x3c9c6618UL, 0xec4a2d33UL, 0x3ffa309bUL, + 0x7ddc36abUL, 0x3c96305cUL, 0x80460ad8UL, 0x3ffa42c9UL, 0x589fb120UL, + 0xbc9aa780UL, 0xb23e255dUL, 0x3ffa5503UL, 0xdb8d41e1UL, 0xbc9d2f6eUL, + 0x8af46052UL, 0x3ffa674aUL, 0x30670366UL, 0x3c650f56UL, 0x1330b358UL, + 0x3ffa799eUL, 0xcac563c7UL, 0x3c9bcb7eUL, 0x53c12e59UL, 0x3ffa8bfeUL, + 0xb2ba15a9UL, 0xbc94f867UL, 0x5579fdbfUL, 0x3ffa9e6bUL, 0x0ef7fd31UL, + 0x3c90fac9UL, 0x21356ebaUL, 0x3ffab0e5UL, 0xdae94545UL, 0x3c889c31UL, + 0xbfd3f37aUL, 0x3ffac36bUL, 0xcae76cd0UL, 0xbc8f9234UL, 0x3a3c2774UL, + 0x3ffad5ffUL, 0xb6b1b8e5UL, 0x3c97ef3bUL, 0x995ad3adUL, 0x3ffae89fUL, + 0x345dcc81UL, 0x3c97a1cdUL, 0xe622f2ffUL, 0x3ffafb4cUL, 0x0f315ecdUL, + 0xbc94b2fcUL, 0x298db666UL, 0x3ffb0e07UL, 0x4c80e425UL, 0xbc9bdef5UL, + 0x6c9a8952UL, 0x3ffb20ceUL, 0x4a0756ccUL, 0x3c94dd02UL, 0xb84f15fbUL, + 0x3ffb33a2UL, 0x3084d708UL, 0xbc62805eUL, 0x15b749b1UL, 0x3ffb4684UL, + 0xe9df7c90UL, 0xbc7f763dUL, 0x8de5593aUL, 0x3ffb5972UL, 0xbbba6de3UL, + 0xbc9c71dfUL, 0x29f1c52aUL, 0x3ffb6c6eUL, 0x52883f6eUL, 0x3c92a8f3UL, + 0xf2fb5e47UL, 0x3ffb7f76UL, 0x7e54ac3bUL, 0xbc75584fUL, 0xf22749e4UL, + 0x3ffb928cUL, 0x54cb65c6UL, 0xbc9b7216UL, 0x30a1064aUL, 0x3ffba5b0UL, + 0x0e54292eUL, 0xbc9efcd3UL, 0xb79a6f1fUL, 0x3ffbb8e0UL, 0xc9696205UL, + 0xbc3f52d1UL, 0x904bc1d2UL, 0x3ffbcc1eUL, 0x7a2d9e84UL, 0x3c823dd0UL, + 0xc3f3a207UL, 0x3ffbdf69UL, 0x60ea5b53UL, 0xbc3c2623UL, 0x5bd71e09UL, + 0x3ffbf2c2UL, 0x3f6b9c73UL, 0xbc9efdcaUL, 0x6141b33dUL, 0x3ffc0628UL, + 0xa1fbca34UL, 0xbc8d8a5aUL, 0xdd85529cUL, 0x3ffc199bUL, 0x895048ddUL, + 0x3c811065UL, 0xd9fa652cUL, 0x3ffc2d1cUL, 0x17c8a5d7UL, 0xbc96e516UL, + 0x5fffd07aUL, 0x3ffc40abUL, 0xe083c60aUL, 0x3c9b4537UL, 0x78fafb22UL, + 0x3ffc5447UL, 0x2493b5afUL, 0x3c912f07UL, 0x2e57d14bUL, 0x3ffc67f1UL, + 0xff483cadUL, 0x3c92884dUL, 0x8988c933UL, 0x3ffc7ba8UL, 0xbe255559UL, + 0xbc8e76bbUL, 0x9406e7b5UL, 0x3ffc8f6dUL, 0x48805c44UL, 0x3c71acbcUL, + 0x5751c4dbUL, 0x3ffca340UL, 0xd10d08f5UL, 0xbc87f2beUL, 0xdcef9069UL, + 0x3ffcb720UL, 0xd1e949dbUL, 0x3c7503cbUL, 0x2e6d1675UL, 0x3ffccb0fUL, + 0x86009092UL, 0xbc7d220fUL, 0x555dc3faUL, 0x3ffcdf0bUL, 0x53829d72UL, + 0xbc8dd83bUL, 0x5b5bab74UL, 0x3ffcf315UL, 0xb86dff57UL, 0xbc9a08e9UL, + 0x4a07897cUL, 0x3ffd072dUL, 0x43797a9cUL, 0xbc9cbc37UL, 0x2b08c968UL, + 0x3ffd1b53UL, 0x219a36eeUL, 0x3c955636UL, 0x080d89f2UL, 0x3ffd2f87UL, + 0x719d8578UL, 0xbc9d487bUL, 0xeacaa1d6UL, 0x3ffd43c8UL, 0xbf5a1614UL, + 0x3c93db53UL, 0xdcfba487UL, 0x3ffd5818UL, 0xd75b3707UL, 0x3c82ed02UL, + 0xe862e6d3UL, 0x3ffd6c76UL, 0x4a8165a0UL, 0x3c5fe87aUL, 0x16c98398UL, + 0x3ffd80e3UL, 0x8beddfe8UL, 0xbc911ec1UL, 0x71ff6075UL, 0x3ffd955dUL, + 0xbb9af6beUL, 0x3c9a052dUL, 0x03db3285UL, 0x3ffda9e6UL, 0x696db532UL, + 0x3c9c2300UL, 0xd63a8315UL, 0x3ffdbe7cUL, 0x926b8be4UL, 0xbc9b76f1UL, + 0xf301b460UL, 0x3ffdd321UL, 0x78f018c3UL, 0x3c92da57UL, 0x641c0658UL, + 0x3ffde7d5UL, 0x8e79ba8fUL, 0xbc9ca552UL, 0x337b9b5fUL, 0x3ffdfc97UL, + 0x4f184b5cUL, 0xbc91a5cdUL, 0x6b197d17UL, 0x3ffe1167UL, 0xbd5c7f44UL, + 0xbc72b529UL, 0x14f5a129UL, 0x3ffe2646UL, 0x817a1496UL, 0xbc97b627UL, + 0x3b16ee12UL, 0x3ffe3b33UL, 0x31fdc68bUL, 0xbc99f4a4UL, 0xe78b3ff6UL, + 0x3ffe502eUL, 0x80a9cc8fUL, 0x3c839e89UL, 0x24676d76UL, 0x3ffe6539UL, + 0x7522b735UL, 0xbc863ff8UL, 0xfbc74c83UL, 0x3ffe7a51UL, 0xca0c8de2UL, + 0x3c92d522UL, 0x77cdb740UL, 0x3ffe8f79UL, 0x80b054b1UL, 0xbc910894UL, + 0xa2a490daUL, 0x3ffea4afUL, 0x179c2893UL, 0xbc9e9c23UL, 0x867cca6eUL, + 0x3ffeb9f4UL, 0x2293e4f2UL, 0x3c94832fUL, 0x2d8e67f1UL, 0x3ffecf48UL, + 0xb411ad8cUL, 0xbc9c93f3UL, 0xa2188510UL, 0x3ffee4aaUL, 0xa487568dUL, + 0x3c91c68dUL, 0xee615a27UL, 0x3ffefa1bUL, 0x86a4b6b0UL, 0x3c9dc7f4UL, + 0x1cb6412aUL, 0x3fff0f9cUL, 0x65181d45UL, 0xbc932200UL, 0x376bba97UL, + 0x3fff252bUL, 0xbf0d8e43UL, 0x3c93a1a5UL, 0x48dd7274UL, 0x3fff3ac9UL, + 0x3ed837deUL, 0xbc795a5aUL, 0x5b6e4540UL, 0x3fff5076UL, 0x2dd8a18bUL, + 0x3c99d3e1UL, 0x798844f8UL, 0x3fff6632UL, 0x3539343eUL, 0x3c9fa37bUL, + 0xad9cbe14UL, 0x3fff7bfdUL, 0xd006350aUL, 0xbc9dbb12UL, 0x02243c89UL, + 0x3fff91d8UL, 0xa779f689UL, 0xbc612ea8UL, 0x819e90d8UL, 0x3fffa7c1UL, + 0xf3a5931eUL, 0x3c874853UL, 0x3692d514UL, 0x3fffbdbaUL, 0x15098eb6UL, + 0xbc796773UL, 0x2b8f71f1UL, 0x3fffd3c2UL, 0x966579e7UL, 0x3c62eb74UL, + 0x6b2a23d9UL, 0x3fffe9d9UL, 0x7442fde3UL, 0x3c74a603UL +}; + +ALIGNED_(16) juint _e_coeff[] = +{ + 0xe78a6731UL, 0x3f55d87fUL, 0xd704a0c0UL, 0x3fac6b08UL, 0x6fba4e77UL, + 0x3f83b2abUL, 0xff82c58fUL, 0x3fcebfbdUL, 0xfefa39efUL, 0x3fe62e42UL, + 0x00000000UL, 0x00000000UL +}; + +ALIGNED_(16) juint _coeff_h[] = +{ + 0x00000000UL, 0xbfd61a00UL, 0x00000000UL, 0xbf5dabe1UL +}; + +ALIGNED_(16) juint _HIGHMASK_LOG_X[] = +{ + 0xf8000000UL, 0xffffffffUL, 0x00000000UL, 0xfffff800UL +}; + +ALIGNED_(8) juint _HALFMASK[] = +{ + 0xf8000000UL, 0xffffffffUL, 0xf8000000UL, 0xffffffffUL +}; + +ALIGNED_(16) juint _coeff_pow[] = +{ + 0x6dc96112UL, 0xbf836578UL, 0xee241472UL, 0xbf9b0301UL, 0x9f95985aUL, + 0xbfb528dbUL, 0xb3841d2aUL, 0xbfd619b6UL, 0x518775e3UL, 0x3f9004f2UL, + 0xac8349bbUL, 0x3fa76c9bUL, 0x486ececcUL, 0x3fc4635eUL, 0x161bb241UL, + 0xbf5dabe1UL, 0x9f95985aUL, 0xbfb528dbUL, 0xf8b5787dUL, 0x3ef2531eUL, + 0x486ececbUL, 0x3fc4635eUL, 0x412055ccUL, 0xbdd61bb2UL +}; + +ALIGNED_(16) juint _L_tbl_pow[] = +{ + 0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0x00000000UL, 0x20000000UL, + 0x3feff00aUL, 0x96621f95UL, 0x3e5b1856UL, 0xe0000000UL, 0x3fefe019UL, + 0xe5916f9eUL, 0xbe325278UL, 0x00000000UL, 0x3fefd02fUL, 0x859a1062UL, + 0x3e595fb7UL, 0xc0000000UL, 0x3fefc049UL, 0xb245f18fUL, 0xbe529c38UL, + 0xe0000000UL, 0x3fefb069UL, 0xad2880a7UL, 0xbe501230UL, 0x60000000UL, + 0x3fefa08fUL, 0xc8e72420UL, 0x3e597bd1UL, 0x80000000UL, 0x3fef90baUL, + 0xc30c4500UL, 0xbe5d6c75UL, 0xe0000000UL, 0x3fef80eaUL, 0x02c63f43UL, + 0x3e2e1318UL, 0xc0000000UL, 0x3fef7120UL, 0xb3d4ccccUL, 0xbe44c52aUL, + 0x00000000UL, 0x3fef615cUL, 0xdbd91397UL, 0xbe4e7d6cUL, 0xa0000000UL, + 0x3fef519cUL, 0x65c5cd68UL, 0xbe522dc8UL, 0xa0000000UL, 0x3fef41e2UL, + 0x46d1306cUL, 0xbe5a840eUL, 0xe0000000UL, 0x3fef322dUL, 0xd2980e94UL, + 0x3e5071afUL, 0xa0000000UL, 0x3fef227eUL, 0x773abadeUL, 0xbe5891e5UL, + 0xa0000000UL, 0x3fef12d4UL, 0xdc6bf46bUL, 0xbe5cccbeUL, 0xe0000000UL, + 0x3fef032fUL, 0xbc7247faUL, 0xbe2bab83UL, 0x80000000UL, 0x3feef390UL, + 0xbcaa1e46UL, 0xbe53bb3bUL, 0x60000000UL, 0x3feee3f6UL, 0x5f6c682dUL, + 0xbe54c619UL, 0x80000000UL, 0x3feed461UL, 0x5141e368UL, 0xbe4b6d86UL, + 0xe0000000UL, 0x3feec4d1UL, 0xec678f76UL, 0xbe369af6UL, 0x80000000UL, + 0x3feeb547UL, 0x41301f55UL, 0xbe2d4312UL, 0x60000000UL, 0x3feea5c2UL, + 0x676da6bdUL, 0xbe4d8dd0UL, 0x60000000UL, 0x3fee9642UL, 0x57a891c4UL, + 0x3e51f991UL, 0xa0000000UL, 0x3fee86c7UL, 0xe4eb491eUL, 0x3e579bf9UL, + 0x20000000UL, 0x3fee7752UL, 0xfddc4a2cUL, 0xbe3356e6UL, 0xc0000000UL, + 0x3fee67e1UL, 0xd75b5bf1UL, 0xbe449531UL, 0x80000000UL, 0x3fee5876UL, + 0xbd423b8eUL, 0x3df54fe4UL, 0x60000000UL, 0x3fee4910UL, 0x330e51b9UL, + 0x3e54289cUL, 0x80000000UL, 0x3fee39afUL, 0x8651a95fUL, 0xbe55aad6UL, + 0xa0000000UL, 0x3fee2a53UL, 0x5e98c708UL, 0xbe2fc4a9UL, 0xe0000000UL, + 0x3fee1afcUL, 0x0989328dUL, 0x3e23958cUL, 0x40000000UL, 0x3fee0babUL, + 0xee642abdUL, 0xbe425dd8UL, 0xa0000000UL, 0x3fedfc5eUL, 0xc394d236UL, + 0x3e526362UL, 0x20000000UL, 0x3feded17UL, 0xe104aa8eUL, 0x3e4ce247UL, + 0xc0000000UL, 0x3fedddd4UL, 0x265a9be4UL, 0xbe5bb77aUL, 0x40000000UL, + 0x3fedce97UL, 0x0ecac52fUL, 0x3e4a7cb1UL, 0xe0000000UL, 0x3fedbf5eUL, + 0x124cb3b8UL, 0x3e257024UL, 0x80000000UL, 0x3fedb02bUL, 0xe6d4febeUL, + 0xbe2033eeUL, 0x20000000UL, 0x3feda0fdUL, 0x39cca00eUL, 0xbe3ddabcUL, + 0xc0000000UL, 0x3fed91d3UL, 0xef8a552aUL, 0xbe543390UL, 0x40000000UL, + 0x3fed82afUL, 0xb8e85204UL, 0x3e513850UL, 0xe0000000UL, 0x3fed738fUL, + 0x3d59fe08UL, 0xbe5db728UL, 0x40000000UL, 0x3fed6475UL, 0x3aa7ead1UL, + 0x3e58804bUL, 0xc0000000UL, 0x3fed555fUL, 0xf8a35ba9UL, 0xbe5298b0UL, + 0x00000000UL, 0x3fed464fUL, 0x9a88dd15UL, 0x3e5a8cdbUL, 0x40000000UL, + 0x3fed3743UL, 0xb0b0a190UL, 0x3e598635UL, 0x80000000UL, 0x3fed283cUL, + 0xe2113295UL, 0xbe5c1119UL, 0x80000000UL, 0x3fed193aUL, 0xafbf1728UL, + 0xbe492e9cUL, 0x60000000UL, 0x3fed0a3dUL, 0xe4a4ccf3UL, 0x3e19b90eUL, + 0x20000000UL, 0x3fecfb45UL, 0xba3cbeb8UL, 0x3e406b50UL, 0xc0000000UL, + 0x3fecec51UL, 0x110f7dddUL, 0x3e0d6806UL, 0x40000000UL, 0x3fecdd63UL, + 0x7dd7d508UL, 0xbe5a8943UL, 0x80000000UL, 0x3fecce79UL, 0x9b60f271UL, + 0xbe50676aUL, 0x80000000UL, 0x3fecbf94UL, 0x0b9ad660UL, 0x3e59174fUL, + 0x60000000UL, 0x3fecb0b4UL, 0x00823d9cUL, 0x3e5bbf72UL, 0x20000000UL, + 0x3feca1d9UL, 0x38a6ec89UL, 0xbe4d38f9UL, 0x80000000UL, 0x3fec9302UL, + 0x3a0b7d8eUL, 0x3e53dbfdUL, 0xc0000000UL, 0x3fec8430UL, 0xc6826b34UL, + 0xbe27c5c9UL, 0xc0000000UL, 0x3fec7563UL, 0x0c706381UL, 0xbe593653UL, + 0x60000000UL, 0x3fec669bUL, 0x7df34ec7UL, 0x3e461ab5UL, 0xe0000000UL, + 0x3fec57d7UL, 0x40e5e7e8UL, 0xbe5c3daeUL, 0x00000000UL, 0x3fec4919UL, + 0x5602770fUL, 0xbe55219dUL, 0xc0000000UL, 0x3fec3a5eUL, 0xec7911ebUL, + 0x3e5a5d25UL, 0x60000000UL, 0x3fec2ba9UL, 0xb39ea225UL, 0xbe53c00bUL, + 0x80000000UL, 0x3fec1cf8UL, 0x967a212eUL, 0x3e5a8ddfUL, 0x60000000UL, + 0x3fec0e4cUL, 0x580798bdUL, 0x3e5f53abUL, 0x00000000UL, 0x3febffa5UL, + 0xb8282df6UL, 0xbe46b874UL, 0x20000000UL, 0x3febf102UL, 0xe33a6729UL, + 0x3e54963fUL, 0x00000000UL, 0x3febe264UL, 0x3b53e88aUL, 0xbe3adce1UL, + 0x60000000UL, 0x3febd3caUL, 0xc2585084UL, 0x3e5cde9fUL, 0x80000000UL, + 0x3febc535UL, 0xa335c5eeUL, 0xbe39fd9cUL, 0x20000000UL, 0x3febb6a5UL, + 0x7325b04dUL, 0x3e42ba15UL, 0x60000000UL, 0x3feba819UL, 0x1564540fUL, + 0x3e3a9f35UL, 0x40000000UL, 0x3feb9992UL, 0x83fff592UL, 0xbe5465ceUL, + 0xa0000000UL, 0x3feb8b0fUL, 0xb9da63d3UL, 0xbe4b1a0aUL, 0x80000000UL, + 0x3feb7c91UL, 0x6d6f1ea4UL, 0x3e557657UL, 0x00000000UL, 0x3feb6e18UL, + 0x5e80a1bfUL, 0x3e4ddbb6UL, 0x00000000UL, 0x3feb5fa3UL, 0x1c9eacb5UL, + 0x3e592877UL, 0xa0000000UL, 0x3feb5132UL, 0x6d40beb3UL, 0xbe51858cUL, + 0xa0000000UL, 0x3feb42c6UL, 0xd740c67bUL, 0x3e427ad2UL, 0x40000000UL, + 0x3feb345fUL, 0xa3e0cceeUL, 0xbe5c2fc4UL, 0x40000000UL, 0x3feb25fcUL, + 0x8e752b50UL, 0xbe3da3c2UL, 0xc0000000UL, 0x3feb179dUL, 0xa892e7deUL, + 0x3e1fb481UL, 0xc0000000UL, 0x3feb0943UL, 0x21ed71e9UL, 0xbe365206UL, + 0x20000000UL, 0x3feafaeeUL, 0x0e1380a3UL, 0x3e5c5b7bUL, 0x20000000UL, + 0x3feaec9dUL, 0x3c3d640eUL, 0xbe5dbbd0UL, 0x60000000UL, 0x3feade50UL, + 0x8f97a715UL, 0x3e3a8ec5UL, 0x20000000UL, 0x3fead008UL, 0x23ab2839UL, + 0x3e2fe98aUL, 0x40000000UL, 0x3feac1c4UL, 0xf4bbd50fUL, 0x3e54d8f6UL, + 0xe0000000UL, 0x3feab384UL, 0x14757c4dUL, 0xbe48774cUL, 0xc0000000UL, + 0x3feaa549UL, 0x7c7b0eeaUL, 0x3e5b51bbUL, 0x20000000UL, 0x3fea9713UL, + 0xf56f7013UL, 0x3e386200UL, 0xe0000000UL, 0x3fea88e0UL, 0xbe428ebeUL, + 0xbe514af5UL, 0xe0000000UL, 0x3fea7ab2UL, 0x8d0e4496UL, 0x3e4f9165UL, + 0x60000000UL, 0x3fea6c89UL, 0xdbacc5d5UL, 0xbe5c063bUL, 0x20000000UL, + 0x3fea5e64UL, 0x3f19d970UL, 0xbe5a0c8cUL, 0x20000000UL, 0x3fea5043UL, + 0x09ea3e6bUL, 0x3e5065dcUL, 0x80000000UL, 0x3fea4226UL, 0x78df246cUL, + 0x3e5e05f6UL, 0x40000000UL, 0x3fea340eUL, 0x4057d4a0UL, 0x3e431b2bUL, + 0x40000000UL, 0x3fea25faUL, 0x82867bb5UL, 0x3e4b76beUL, 0xa0000000UL, + 0x3fea17eaUL, 0x9436f40aUL, 0xbe5aad39UL, 0x20000000UL, 0x3fea09dfUL, + 0x4b5253b3UL, 0x3e46380bUL, 0x00000000UL, 0x3fe9fbd8UL, 0x8fc52466UL, + 0xbe386f9bUL, 0x20000000UL, 0x3fe9edd5UL, 0x22d3f344UL, 0xbe538347UL, + 0x60000000UL, 0x3fe9dfd6UL, 0x1ac33522UL, 0x3e5dbc53UL, 0x00000000UL, + 0x3fe9d1dcUL, 0xeabdff1dUL, 0x3e40fc0cUL, 0xe0000000UL, 0x3fe9c3e5UL, + 0xafd30e73UL, 0xbe585e63UL, 0xe0000000UL, 0x3fe9b5f3UL, 0xa52f226aUL, + 0xbe43e8f9UL, 0x20000000UL, 0x3fe9a806UL, 0xecb8698dUL, 0xbe515b36UL, + 0x80000000UL, 0x3fe99a1cUL, 0xf2b4e89dUL, 0x3e48b62bUL, 0x20000000UL, + 0x3fe98c37UL, 0x7c9a88fbUL, 0x3e44414cUL, 0x00000000UL, 0x3fe97e56UL, + 0xda015741UL, 0xbe5d13baUL, 0xe0000000UL, 0x3fe97078UL, 0x5fdace06UL, + 0x3e51b947UL, 0x00000000UL, 0x3fe962a0UL, 0x956ca094UL, 0x3e518785UL, + 0x40000000UL, 0x3fe954cbUL, 0x01164c1dUL, 0x3e5d5b57UL, 0xc0000000UL, + 0x3fe946faUL, 0xe63b3767UL, 0xbe4f84e7UL, 0x40000000UL, 0x3fe9392eUL, + 0xe57cc2a9UL, 0x3e34eda3UL, 0xe0000000UL, 0x3fe92b65UL, 0x8c75b544UL, + 0x3e5766a0UL, 0xc0000000UL, 0x3fe91da1UL, 0x37d1d087UL, 0xbe5e2ab1UL, + 0x80000000UL, 0x3fe90fe1UL, 0xa953dc20UL, 0x3e5fa1f3UL, 0x80000000UL, + 0x3fe90225UL, 0xdbd3f369UL, 0x3e47d6dbUL, 0xa0000000UL, 0x3fe8f46dUL, + 0x1c9be989UL, 0xbe5e2b0aUL, 0xa0000000UL, 0x3fe8e6b9UL, 0x3c93d76aUL, + 0x3e5c8618UL, 0xe0000000UL, 0x3fe8d909UL, 0x2182fc9aUL, 0xbe41aa9eUL, + 0x20000000UL, 0x3fe8cb5eUL, 0xe6b3539dUL, 0xbe530d19UL, 0x60000000UL, + 0x3fe8bdb6UL, 0x49e58cc3UL, 0xbe3bb374UL, 0xa0000000UL, 0x3fe8b012UL, + 0xa7cfeb8fUL, 0x3e56c412UL, 0x00000000UL, 0x3fe8a273UL, 0x8d52bc19UL, + 0x3e1429b8UL, 0x60000000UL, 0x3fe894d7UL, 0x4dc32c6cUL, 0xbe48604cUL, + 0xc0000000UL, 0x3fe8873fUL, 0x0c868e56UL, 0xbe564ee5UL, 0x00000000UL, + 0x3fe879acUL, 0x56aee828UL, 0x3e5e2fd8UL, 0x60000000UL, 0x3fe86c1cUL, + 0x7ceab8ecUL, 0x3e493365UL, 0xc0000000UL, 0x3fe85e90UL, 0x78d4dadcUL, + 0xbe4f7f25UL, 0x00000000UL, 0x3fe85109UL, 0x0ccd8280UL, 0x3e31e7a2UL, + 0x40000000UL, 0x3fe84385UL, 0x34ba4e15UL, 0x3e328077UL, 0x80000000UL, + 0x3fe83605UL, 0xa670975aUL, 0xbe53eee5UL, 0xa0000000UL, 0x3fe82889UL, + 0xf61b77b2UL, 0xbe43a20aUL, 0xa0000000UL, 0x3fe81b11UL, 0x13e6643bUL, + 0x3e5e5fe5UL, 0xc0000000UL, 0x3fe80d9dUL, 0x82cc94e8UL, 0xbe5ff1f9UL, + 0xa0000000UL, 0x3fe8002dUL, 0x8a0c9c5dUL, 0xbe42b0e7UL, 0x60000000UL, + 0x3fe7f2c1UL, 0x22a16f01UL, 0x3e5d9ea0UL, 0x20000000UL, 0x3fe7e559UL, + 0xc38cd451UL, 0x3e506963UL, 0xc0000000UL, 0x3fe7d7f4UL, 0x9902bc71UL, + 0x3e4503d7UL, 0x40000000UL, 0x3fe7ca94UL, 0xdef2a3c0UL, 0x3e3d98edUL, + 0xa0000000UL, 0x3fe7bd37UL, 0xed49abb0UL, 0x3e24c1ffUL, 0xe0000000UL, + 0x3fe7afdeUL, 0xe3b0be70UL, 0xbe40c467UL, 0x00000000UL, 0x3fe7a28aUL, + 0xaf9f193cUL, 0xbe5dff6cUL, 0xe0000000UL, 0x3fe79538UL, 0xb74cf6b6UL, + 0xbe258ed0UL, 0xa0000000UL, 0x3fe787ebUL, 0x1d9127c7UL, 0x3e345fb0UL, + 0x40000000UL, 0x3fe77aa2UL, 0x1028c21dUL, 0xbe4619bdUL, 0xa0000000UL, + 0x3fe76d5cUL, 0x7cb0b5e4UL, 0x3e40f1a2UL, 0xe0000000UL, 0x3fe7601aUL, + 0x2b1bc4adUL, 0xbe32e8bbUL, 0xe0000000UL, 0x3fe752dcUL, 0x6839f64eUL, + 0x3e41f57bUL, 0xc0000000UL, 0x3fe745a2UL, 0xc4121f7eUL, 0xbe52c40aUL, + 0x60000000UL, 0x3fe7386cUL, 0xd6852d72UL, 0xbe5c4e6bUL, 0xc0000000UL, + 0x3fe72b39UL, 0x91d690f7UL, 0xbe57f88fUL, 0xe0000000UL, 0x3fe71e0aUL, + 0x627a2159UL, 0xbe4425d5UL, 0xc0000000UL, 0x3fe710dfUL, 0x50a54033UL, + 0x3e422b7eUL, 0x60000000UL, 0x3fe703b8UL, 0x3b0b5f91UL, 0x3e5d3857UL, + 0xe0000000UL, 0x3fe6f694UL, 0x84d628a2UL, 0xbe51f090UL, 0x00000000UL, + 0x3fe6e975UL, 0x306d8894UL, 0xbe414d83UL, 0xe0000000UL, 0x3fe6dc58UL, + 0x30bf24aaUL, 0xbe4650caUL, 0x80000000UL, 0x3fe6cf40UL, 0xd4628d69UL, + 0xbe5db007UL, 0xc0000000UL, 0x3fe6c22bUL, 0xa2aae57bUL, 0xbe31d279UL, + 0xc0000000UL, 0x3fe6b51aUL, 0x860edf7eUL, 0xbe2d4c4aUL, 0x80000000UL, + 0x3fe6a80dUL, 0xf3559341UL, 0xbe5f7e98UL, 0xe0000000UL, 0x3fe69b03UL, + 0xa885899eUL, 0xbe5c2011UL, 0xe0000000UL, 0x3fe68dfdUL, 0x2bdc6d37UL, + 0x3e224a82UL, 0xa0000000UL, 0x3fe680fbUL, 0xc12ad1b9UL, 0xbe40cf56UL, + 0x00000000UL, 0x3fe673fdUL, 0x1bcdf659UL, 0xbdf52f2dUL, 0x00000000UL, + 0x3fe66702UL, 0x5df10408UL, 0x3e5663e0UL, 0xc0000000UL, 0x3fe65a0aUL, + 0xa4070568UL, 0xbe40b12fUL, 0x00000000UL, 0x3fe64d17UL, 0x71c54c47UL, + 0x3e5f5e8bUL, 0x00000000UL, 0x3fe64027UL, 0xbd4b7e83UL, 0x3e42ead6UL, + 0xa0000000UL, 0x3fe6333aUL, 0x61598bd2UL, 0xbe4c48d4UL, 0xc0000000UL, + 0x3fe62651UL, 0x6f538d61UL, 0x3e548401UL, 0xa0000000UL, 0x3fe6196cUL, + 0x14344120UL, 0xbe529af6UL, 0x00000000UL, 0x3fe60c8bUL, 0x5982c587UL, + 0xbe3e1e4fUL, 0x00000000UL, 0x3fe5ffadUL, 0xfe51d4eaUL, 0xbe4c897aUL, + 0x80000000UL, 0x3fe5f2d2UL, 0xfd46ebe1UL, 0x3e552e00UL, 0xa0000000UL, + 0x3fe5e5fbUL, 0xa4695699UL, 0x3e5ed471UL, 0x60000000UL, 0x3fe5d928UL, + 0x80d118aeUL, 0x3e456b61UL, 0xa0000000UL, 0x3fe5cc58UL, 0x304c330bUL, + 0x3e54dc29UL, 0x80000000UL, 0x3fe5bf8cUL, 0x0af2dedfUL, 0xbe3aa9bdUL, + 0xe0000000UL, 0x3fe5b2c3UL, 0x15fc9258UL, 0xbe479a37UL, 0xc0000000UL, + 0x3fe5a5feUL, 0x9292c7eaUL, 0x3e188650UL, 0x20000000UL, 0x3fe5993dUL, + 0x33b4d380UL, 0x3e5d6d93UL, 0x20000000UL, 0x3fe58c7fUL, 0x02fd16c7UL, + 0x3e2fe961UL, 0xa0000000UL, 0x3fe57fc4UL, 0x4a05edb6UL, 0xbe4d55b4UL, + 0xa0000000UL, 0x3fe5730dUL, 0x3d443abbUL, 0xbe5e6954UL, 0x00000000UL, + 0x3fe5665aUL, 0x024acfeaUL, 0x3e50e61bUL, 0x00000000UL, 0x3fe559aaUL, + 0xcc9edd09UL, 0xbe325403UL, 0x60000000UL, 0x3fe54cfdUL, 0x1fe26950UL, + 0x3e5d500eUL, 0x60000000UL, 0x3fe54054UL, 0x6c5ae164UL, 0xbe4a79b4UL, + 0xc0000000UL, 0x3fe533aeUL, 0x154b0287UL, 0xbe401571UL, 0xa0000000UL, + 0x3fe5270cUL, 0x0673f401UL, 0xbe56e56bUL, 0xe0000000UL, 0x3fe51a6dUL, + 0x751b639cUL, 0x3e235269UL, 0xa0000000UL, 0x3fe50dd2UL, 0x7c7b2bedUL, + 0x3ddec887UL, 0xc0000000UL, 0x3fe5013aUL, 0xafab4e17UL, 0x3e5e7575UL, + 0x60000000UL, 0x3fe4f4a6UL, 0x2e308668UL, 0x3e59aed6UL, 0x80000000UL, + 0x3fe4e815UL, 0xf33e2a76UL, 0xbe51f184UL, 0xe0000000UL, 0x3fe4db87UL, + 0x839f3e3eUL, 0x3e57db01UL, 0xc0000000UL, 0x3fe4cefdUL, 0xa9eda7bbUL, + 0x3e535e0fUL, 0x00000000UL, 0x3fe4c277UL, 0x2a8f66a5UL, 0x3e5ce451UL, + 0xc0000000UL, 0x3fe4b5f3UL, 0x05192456UL, 0xbe4e8518UL, 0xc0000000UL, + 0x3fe4a973UL, 0x4aa7cd1dUL, 0x3e46784aUL, 0x40000000UL, 0x3fe49cf7UL, + 0x8e23025eUL, 0xbe5749f2UL, 0x00000000UL, 0x3fe4907eUL, 0x18d30215UL, + 0x3e360f39UL, 0x20000000UL, 0x3fe48408UL, 0x63dcf2f3UL, 0x3e5e00feUL, + 0xc0000000UL, 0x3fe47795UL, 0x46182d09UL, 0xbe5173d9UL, 0xa0000000UL, + 0x3fe46b26UL, 0x8f0e62aaUL, 0xbe48f281UL, 0xe0000000UL, 0x3fe45ebaUL, + 0x5775c40cUL, 0xbe56aad4UL, 0x60000000UL, 0x3fe45252UL, 0x0fe25f69UL, + 0x3e48bd71UL, 0x40000000UL, 0x3fe445edUL, 0xe9989ec5UL, 0x3e590d97UL, + 0x80000000UL, 0x3fe4398bUL, 0xb3d9ffe3UL, 0x3e479dbcUL, 0x20000000UL, + 0x3fe42d2dUL, 0x388e4d2eUL, 0xbe5eed80UL, 0xe0000000UL, 0x3fe420d1UL, + 0x6f797c18UL, 0x3e554b4cUL, 0x20000000UL, 0x3fe4147aUL, 0x31048bb4UL, + 0xbe5b1112UL, 0x80000000UL, 0x3fe40825UL, 0x2efba4f9UL, 0x3e48ebc7UL, + 0x40000000UL, 0x3fe3fbd4UL, 0x50201119UL, 0x3e40b701UL, 0x40000000UL, + 0x3fe3ef86UL, 0x0a4db32cUL, 0x3e551de8UL, 0xa0000000UL, 0x3fe3e33bUL, + 0x0c9c148bUL, 0xbe50c1f6UL, 0x20000000UL, 0x3fe3d6f4UL, 0xc9129447UL, + 0x3e533fa0UL, 0x00000000UL, 0x3fe3cab0UL, 0xaae5b5a0UL, 0xbe22b68eUL, + 0x20000000UL, 0x3fe3be6fUL, 0x02305e8aUL, 0xbe54fc08UL, 0x60000000UL, + 0x3fe3b231UL, 0x7f908258UL, 0x3e57dc05UL, 0x00000000UL, 0x3fe3a5f7UL, + 0x1a09af78UL, 0x3e08038bUL, 0xe0000000UL, 0x3fe399bfUL, 0x490643c1UL, + 0xbe5dbe42UL, 0xe0000000UL, 0x3fe38d8bUL, 0x5e8ad724UL, 0xbe3c2b72UL, + 0x20000000UL, 0x3fe3815bUL, 0xc67196b6UL, 0x3e1713cfUL, 0xa0000000UL, + 0x3fe3752dUL, 0x6182e429UL, 0xbe3ec14cUL, 0x40000000UL, 0x3fe36903UL, + 0xab6eb1aeUL, 0x3e5a2cc5UL, 0x40000000UL, 0x3fe35cdcUL, 0xfe5dc064UL, + 0xbe5c5878UL, 0x40000000UL, 0x3fe350b8UL, 0x0ba6b9e4UL, 0x3e51619bUL, + 0x80000000UL, 0x3fe34497UL, 0x857761aaUL, 0x3e5fff53UL, 0x00000000UL, + 0x3fe3387aUL, 0xf872d68cUL, 0x3e484f4dUL, 0xa0000000UL, 0x3fe32c5fUL, + 0x087e97c2UL, 0x3e52842eUL, 0x80000000UL, 0x3fe32048UL, 0x73d6d0c0UL, + 0xbe503edfUL, 0x80000000UL, 0x3fe31434UL, 0x0c1456a1UL, 0xbe5f72adUL, + 0xa0000000UL, 0x3fe30823UL, 0x83a1a4d5UL, 0xbe5e65ccUL, 0xe0000000UL, + 0x3fe2fc15UL, 0x855a7390UL, 0xbe506438UL, 0x40000000UL, 0x3fe2f00bUL, + 0xa2898287UL, 0x3e3d22a2UL, 0xe0000000UL, 0x3fe2e403UL, 0x8b56f66fUL, + 0xbe5aa5fdUL, 0x80000000UL, 0x3fe2d7ffUL, 0x52db119aUL, 0x3e3a2e3dUL, + 0x60000000UL, 0x3fe2cbfeUL, 0xe2ddd4c0UL, 0xbe586469UL, 0x40000000UL, + 0x3fe2c000UL, 0x6b01bf10UL, 0x3e352b9dUL, 0x40000000UL, 0x3fe2b405UL, + 0xb07a1cdfUL, 0x3e5c5cdaUL, 0x80000000UL, 0x3fe2a80dUL, 0xc7b5f868UL, + 0xbe5668b3UL, 0xc0000000UL, 0x3fe29c18UL, 0x185edf62UL, 0xbe563d66UL, + 0x00000000UL, 0x3fe29027UL, 0xf729e1ccUL, 0x3e59a9a0UL, 0x80000000UL, + 0x3fe28438UL, 0x6433c727UL, 0xbe43cc89UL, 0x00000000UL, 0x3fe2784dUL, + 0x41782631UL, 0xbe30750cUL, 0xa0000000UL, 0x3fe26c64UL, 0x914911b7UL, + 0xbe58290eUL, 0x40000000UL, 0x3fe2607fUL, 0x3dcc73e1UL, 0xbe4269cdUL, + 0x00000000UL, 0x3fe2549dUL, 0x2751bf70UL, 0xbe5a6998UL, 0xc0000000UL, + 0x3fe248bdUL, 0x4248b9fbUL, 0xbe4ddb00UL, 0x80000000UL, 0x3fe23ce1UL, + 0xf35cf82fUL, 0x3e561b71UL, 0x60000000UL, 0x3fe23108UL, 0x8e481a2dUL, + 0x3e518fb9UL, 0x60000000UL, 0x3fe22532UL, 0x5ab96edcUL, 0xbe5fafc5UL, + 0x40000000UL, 0x3fe2195fUL, 0x80943911UL, 0xbe07f819UL, 0x40000000UL, + 0x3fe20d8fUL, 0x386f2d6cUL, 0xbe54ba8bUL, 0x40000000UL, 0x3fe201c2UL, + 0xf29664acUL, 0xbe5eb815UL, 0x20000000UL, 0x3fe1f5f8UL, 0x64f03390UL, + 0x3e5e320cUL, 0x20000000UL, 0x3fe1ea31UL, 0x747ff696UL, 0x3e5ef0a5UL, + 0x40000000UL, 0x3fe1de6dUL, 0x3e9ceb51UL, 0xbe5f8d27UL, 0x20000000UL, + 0x3fe1d2acUL, 0x4ae0b55eUL, 0x3e5faa21UL, 0x20000000UL, 0x3fe1c6eeUL, + 0x28569a5eUL, 0x3e598a4fUL, 0x20000000UL, 0x3fe1bb33UL, 0x54b33e07UL, + 0x3e46130aUL, 0x20000000UL, 0x3fe1af7bUL, 0x024f1078UL, 0xbe4dbf93UL, + 0x00000000UL, 0x3fe1a3c6UL, 0xb0783bfaUL, 0x3e419248UL, 0xe0000000UL, + 0x3fe19813UL, 0x2f02b836UL, 0x3e4e02b7UL, 0xc0000000UL, 0x3fe18c64UL, + 0x28dec9d4UL, 0x3e09064fUL, 0x80000000UL, 0x3fe180b8UL, 0x45cbf406UL, + 0x3e5b1f46UL, 0x40000000UL, 0x3fe1750fUL, 0x03d9964cUL, 0x3e5b0a79UL, + 0x00000000UL, 0x3fe16969UL, 0x8b5b882bUL, 0xbe238086UL, 0xa0000000UL, + 0x3fe15dc5UL, 0x73bad6f8UL, 0xbdf1fca4UL, 0x20000000UL, 0x3fe15225UL, + 0x5385769cUL, 0x3e5e8d76UL, 0xa0000000UL, 0x3fe14687UL, 0x1676dc6bUL, + 0x3e571d08UL, 0x20000000UL, 0x3fe13aedUL, 0xa8c41c7fUL, 0xbe598a25UL, + 0x60000000UL, 0x3fe12f55UL, 0xc4e1aaf0UL, 0x3e435277UL, 0xa0000000UL, + 0x3fe123c0UL, 0x403638e1UL, 0xbe21aa7cUL, 0xc0000000UL, 0x3fe1182eUL, + 0x557a092bUL, 0xbdd0116bUL, 0xc0000000UL, 0x3fe10c9fUL, 0x7d779f66UL, + 0x3e4a61baUL, 0xc0000000UL, 0x3fe10113UL, 0x2b09c645UL, 0xbe5d586eUL, + 0x20000000UL, 0x3fe0ea04UL, 0xea2cad46UL, 0x3e5aa97cUL, 0x20000000UL, + 0x3fe0d300UL, 0x23190e54UL, 0x3e50f1a7UL, 0xa0000000UL, 0x3fe0bc07UL, + 0x1379a5a6UL, 0xbe51619dUL, 0x60000000UL, 0x3fe0a51aUL, 0x926a3d4aUL, + 0x3e5cf019UL, 0xa0000000UL, 0x3fe08e38UL, 0xa8c24358UL, 0x3e35241eUL, + 0x20000000UL, 0x3fe07762UL, 0x24317e7aUL, 0x3e512cfaUL, 0x00000000UL, + 0x3fe06097UL, 0xfd9cf274UL, 0xbe55bef3UL, 0x00000000UL, 0x3fe049d7UL, + 0x3689b49dUL, 0xbe36d26dUL, 0x40000000UL, 0x3fe03322UL, 0xf72ef6c4UL, + 0xbe54cd08UL, 0xa0000000UL, 0x3fe01c78UL, 0x23702d2dUL, 0xbe5900bfUL, + 0x00000000UL, 0x3fe005daUL, 0x3f59c14cUL, 0x3e57d80bUL, 0x40000000UL, + 0x3fdfde8dUL, 0xad67766dUL, 0xbe57fad4UL, 0x40000000UL, 0x3fdfb17cUL, + 0x644f4ae7UL, 0x3e1ee43bUL, 0x40000000UL, 0x3fdf8481UL, 0x903234d2UL, + 0x3e501a86UL, 0x40000000UL, 0x3fdf579cUL, 0xafe9e509UL, 0xbe267c3eUL, + 0x00000000UL, 0x3fdf2acdUL, 0xb7dfda0bUL, 0xbe48149bUL, 0x40000000UL, + 0x3fdefe13UL, 0x3b94305eUL, 0x3e5f4ea7UL, 0x80000000UL, 0x3fded16fUL, + 0x5d95da61UL, 0xbe55c198UL, 0x00000000UL, 0x3fdea4e1UL, 0x406960c9UL, + 0xbdd99a19UL, 0x00000000UL, 0x3fde7868UL, 0xd22f3539UL, 0x3e470c78UL, + 0x80000000UL, 0x3fde4c04UL, 0x83eec535UL, 0xbe3e1232UL, 0x40000000UL, + 0x3fde1fb6UL, 0x3dfbffcbUL, 0xbe4b7d71UL, 0x40000000UL, 0x3fddf37dUL, + 0x7e1be4e0UL, 0xbe5b8f8fUL, 0x40000000UL, 0x3fddc759UL, 0x46dae887UL, + 0xbe350458UL, 0x80000000UL, 0x3fdd9b4aUL, 0xed6ecc49UL, 0xbe5f0045UL, + 0x80000000UL, 0x3fdd6f50UL, 0x2e9e883cUL, 0x3e2915daUL, 0x80000000UL, + 0x3fdd436bUL, 0xf0bccb32UL, 0x3e4a68c9UL, 0x80000000UL, 0x3fdd179bUL, + 0x9bbfc779UL, 0xbe54a26aUL, 0x00000000UL, 0x3fdcebe0UL, 0x7cea33abUL, + 0x3e43c6b7UL, 0x40000000UL, 0x3fdcc039UL, 0xe740fd06UL, 0x3e5526c2UL, + 0x40000000UL, 0x3fdc94a7UL, 0x9eadeb1aUL, 0xbe396d8dUL, 0xc0000000UL, + 0x3fdc6929UL, 0xf0a8f95aUL, 0xbe5c0ab2UL, 0x80000000UL, 0x3fdc3dc0UL, + 0x6ee2693bUL, 0x3e0992e6UL, 0xc0000000UL, 0x3fdc126bUL, 0x5ac6b581UL, + 0xbe2834b6UL, 0x40000000UL, 0x3fdbe72bUL, 0x8cc226ffUL, 0x3e3596a6UL, + 0x00000000UL, 0x3fdbbbffUL, 0xf92a74bbUL, 0x3e3c5813UL, 0x00000000UL, + 0x3fdb90e7UL, 0x479664c0UL, 0xbe50d644UL, 0x00000000UL, 0x3fdb65e3UL, + 0x5004975bUL, 0xbe55258fUL, 0x00000000UL, 0x3fdb3af3UL, 0xe4b23194UL, + 0xbe588407UL, 0xc0000000UL, 0x3fdb1016UL, 0xe65d4d0aUL, 0x3e527c26UL, + 0x80000000UL, 0x3fdae54eUL, 0x814fddd6UL, 0x3e5962a2UL, 0x40000000UL, + 0x3fdaba9aUL, 0xe19d0913UL, 0xbe562f4eUL, 0x80000000UL, 0x3fda8ff9UL, + 0x43cfd006UL, 0xbe4cfdebUL, 0x40000000UL, 0x3fda656cUL, 0x686f0a4eUL, + 0x3e5e47a8UL, 0xc0000000UL, 0x3fda3af2UL, 0x7200d410UL, 0x3e5e1199UL, + 0xc0000000UL, 0x3fda108cUL, 0xabd2266eUL, 0x3e5ee4d1UL, 0x40000000UL, + 0x3fd9e63aUL, 0x396f8f2cUL, 0x3e4dbffbUL, 0x00000000UL, 0x3fd9bbfbUL, + 0xe32b25ddUL, 0x3e5c3a54UL, 0x40000000UL, 0x3fd991cfUL, 0x431e4035UL, + 0xbe457925UL, 0x80000000UL, 0x3fd967b6UL, 0x7bed3dd3UL, 0x3e40c61dUL, + 0x00000000UL, 0x3fd93db1UL, 0xd7449365UL, 0x3e306419UL, 0x80000000UL, + 0x3fd913beUL, 0x1746e791UL, 0x3e56fcfcUL, 0x40000000UL, 0x3fd8e9dfUL, + 0xf3a9028bUL, 0xbe5041b9UL, 0xc0000000UL, 0x3fd8c012UL, 0x56840c50UL, + 0xbe26e20aUL, 0x40000000UL, 0x3fd89659UL, 0x19763102UL, 0xbe51f466UL, + 0x80000000UL, 0x3fd86cb2UL, 0x7032de7cUL, 0xbe4d298aUL, 0x80000000UL, + 0x3fd8431eUL, 0xdeb39fabUL, 0xbe4361ebUL, 0x40000000UL, 0x3fd8199dUL, + 0x5d01cbe0UL, 0xbe5425b3UL, 0x80000000UL, 0x3fd7f02eUL, 0x3ce99aa9UL, + 0x3e146fa8UL, 0x80000000UL, 0x3fd7c6d2UL, 0xd1a262b9UL, 0xbe5a1a69UL, + 0xc0000000UL, 0x3fd79d88UL, 0x8606c236UL, 0x3e423a08UL, 0x80000000UL, + 0x3fd77451UL, 0x8fd1e1b7UL, 0x3e5a6a63UL, 0xc0000000UL, 0x3fd74b2cUL, + 0xe491456aUL, 0x3e42c1caUL, 0x40000000UL, 0x3fd7221aUL, 0x4499a6d7UL, + 0x3e36a69aUL, 0x00000000UL, 0x3fd6f91aUL, 0x5237df94UL, 0xbe0f8f02UL, + 0x00000000UL, 0x3fd6d02cUL, 0xb6482c6eUL, 0xbe5abcf7UL, 0x00000000UL, + 0x3fd6a750UL, 0x1919fd61UL, 0xbe57ade2UL, 0x00000000UL, 0x3fd67e86UL, + 0xaa7a994dUL, 0xbe3f3fbdUL, 0x00000000UL, 0x3fd655ceUL, 0x67db014cUL, + 0x3e33c550UL, 0x00000000UL, 0x3fd62d28UL, 0xa82856b7UL, 0xbe1409d1UL, + 0xc0000000UL, 0x3fd60493UL, 0x1e6a300dUL, 0x3e55d899UL, 0x80000000UL, + 0x3fd5dc11UL, 0x1222bd5cUL, 0xbe35bfc0UL, 0xc0000000UL, 0x3fd5b3a0UL, + 0x6e8dc2d3UL, 0x3e5d4d79UL, 0x00000000UL, 0x3fd58b42UL, 0xe0e4ace6UL, + 0xbe517303UL, 0x80000000UL, 0x3fd562f4UL, 0xb306e0a8UL, 0x3e5edf0fUL, + 0xc0000000UL, 0x3fd53ab8UL, 0x6574bc54UL, 0x3e5ee859UL, 0x80000000UL, + 0x3fd5128eUL, 0xea902207UL, 0x3e5f6188UL, 0xc0000000UL, 0x3fd4ea75UL, + 0x9f911d79UL, 0x3e511735UL, 0x80000000UL, 0x3fd4c26eUL, 0xf9c77397UL, + 0xbe5b1643UL, 0x40000000UL, 0x3fd49a78UL, 0x15fc9258UL, 0x3e479a37UL, + 0x80000000UL, 0x3fd47293UL, 0xd5a04dd9UL, 0xbe426e56UL, 0xc0000000UL, + 0x3fd44abfUL, 0xe04042f5UL, 0x3e56f7c6UL, 0x40000000UL, 0x3fd422fdUL, + 0x1d8bf2c8UL, 0x3e5d8810UL, 0x00000000UL, 0x3fd3fb4cUL, 0x88a8ddeeUL, + 0xbe311454UL, 0xc0000000UL, 0x3fd3d3abUL, 0x3e3b5e47UL, 0xbe5d1b72UL, + 0x40000000UL, 0x3fd3ac1cUL, 0xc2ab5d59UL, 0x3e31b02bUL, 0xc0000000UL, + 0x3fd3849dUL, 0xd4e34b9eUL, 0x3e51cb2fUL, 0x40000000UL, 0x3fd35d30UL, + 0x177204fbUL, 0xbe2b8cd7UL, 0x80000000UL, 0x3fd335d3UL, 0xfcd38c82UL, + 0xbe4356e1UL, 0x80000000UL, 0x3fd30e87UL, 0x64f54accUL, 0xbe4e6224UL, + 0x00000000UL, 0x3fd2e74cUL, 0xaa7975d9UL, 0x3e5dc0feUL, 0x80000000UL, + 0x3fd2c021UL, 0x516dab3fUL, 0xbe50ffa3UL, 0x40000000UL, 0x3fd29907UL, + 0x2bfb7313UL, 0x3e5674a2UL, 0xc0000000UL, 0x3fd271fdUL, 0x0549fc99UL, + 0x3e385d29UL, 0xc0000000UL, 0x3fd24b04UL, 0x55b63073UL, 0xbe500c6dUL, + 0x00000000UL, 0x3fd2241cUL, 0x3f91953aUL, 0x3e389977UL, 0xc0000000UL, + 0x3fd1fd43UL, 0xa1543f71UL, 0xbe3487abUL, 0xc0000000UL, 0x3fd1d67bUL, + 0x4ec8867cUL, 0x3df6a2dcUL, 0x00000000UL, 0x3fd1afc4UL, 0x4328e3bbUL, + 0x3e41d9c0UL, 0x80000000UL, 0x3fd1891cUL, 0x2e1cda84UL, 0x3e3bdd87UL, + 0x40000000UL, 0x3fd16285UL, 0x4b5331aeUL, 0xbe53128eUL, 0x00000000UL, + 0x3fd13bfeUL, 0xb9aec164UL, 0xbe52ac98UL, 0xc0000000UL, 0x3fd11586UL, + 0xd91e1316UL, 0xbe350630UL, 0x80000000UL, 0x3fd0ef1fUL, 0x7cacc12cUL, + 0x3e3f5219UL, 0x40000000UL, 0x3fd0c8c8UL, 0xbce277b7UL, 0x3e3d30c0UL, + 0x00000000UL, 0x3fd0a281UL, 0x2a63447dUL, 0xbe541377UL, 0x80000000UL, + 0x3fd07c49UL, 0xfac483b5UL, 0xbe5772ecUL, 0xc0000000UL, 0x3fd05621UL, + 0x36b8a570UL, 0xbe4fd4bdUL, 0xc0000000UL, 0x3fd03009UL, 0xbae505f7UL, + 0xbe450388UL, 0x80000000UL, 0x3fd00a01UL, 0x3e35aeadUL, 0xbe5430fcUL, + 0x80000000UL, 0x3fcfc811UL, 0x707475acUL, 0x3e38806eUL, 0x80000000UL, + 0x3fcf7c3fUL, 0xc91817fcUL, 0xbe40cceaUL, 0x80000000UL, 0x3fcf308cUL, + 0xae05d5e9UL, 0xbe4919b8UL, 0x80000000UL, 0x3fcee4f8UL, 0xae6cc9e6UL, + 0xbe530b94UL, 0x00000000UL, 0x3fce9983UL, 0x1efe3e8eUL, 0x3e57747eUL, + 0x00000000UL, 0x3fce4e2dUL, 0xda78d9bfUL, 0xbe59a608UL, 0x00000000UL, + 0x3fce02f5UL, 0x8abe2c2eUL, 0x3e4a35adUL, 0x00000000UL, 0x3fcdb7dcUL, + 0x1495450dUL, 0xbe0872ccUL, 0x80000000UL, 0x3fcd6ce1UL, 0x86ee0ba0UL, + 0xbe4f59a0UL, 0x00000000UL, 0x3fcd2205UL, 0xe81ca888UL, 0x3e5402c3UL, + 0x00000000UL, 0x3fccd747UL, 0x3b4424b9UL, 0x3e5dfdc3UL, 0x80000000UL, + 0x3fcc8ca7UL, 0xd305b56cUL, 0x3e202da6UL, 0x00000000UL, 0x3fcc4226UL, + 0x399a6910UL, 0xbe482a1cUL, 0x80000000UL, 0x3fcbf7c2UL, 0x747f7938UL, + 0xbe587372UL, 0x80000000UL, 0x3fcbad7cUL, 0x6fc246a0UL, 0x3e50d83dUL, + 0x00000000UL, 0x3fcb6355UL, 0xee9e9be5UL, 0xbe5c35bdUL, 0x80000000UL, + 0x3fcb194aUL, 0x8416c0bcUL, 0x3e546d4fUL, 0x00000000UL, 0x3fcacf5eUL, + 0x49f7f08fUL, 0x3e56da76UL, 0x00000000UL, 0x3fca858fUL, 0x5dc30de2UL, + 0x3e5f390cUL, 0x00000000UL, 0x3fca3bdeUL, 0x950583b6UL, 0xbe5e4169UL, + 0x80000000UL, 0x3fc9f249UL, 0x33631553UL, 0x3e52aeb1UL, 0x00000000UL, + 0x3fc9a8d3UL, 0xde8795a6UL, 0xbe59a504UL, 0x00000000UL, 0x3fc95f79UL, + 0x076bf41eUL, 0x3e5122feUL, 0x80000000UL, 0x3fc9163cUL, 0x2914c8e7UL, + 0x3e3dd064UL, 0x00000000UL, 0x3fc8cd1dUL, 0x3a30eca3UL, 0xbe21b4aaUL, + 0x80000000UL, 0x3fc8841aUL, 0xb2a96650UL, 0xbe575444UL, 0x80000000UL, + 0x3fc83b34UL, 0x2376c0cbUL, 0xbe2a74c7UL, 0x80000000UL, 0x3fc7f26bUL, + 0xd8a0b653UL, 0xbe5181b6UL, 0x00000000UL, 0x3fc7a9bfUL, 0x32257882UL, + 0xbe4a78b4UL, 0x00000000UL, 0x3fc7612fUL, 0x1eee8bd9UL, 0xbe1bfe9dUL, + 0x80000000UL, 0x3fc718bbUL, 0x0c603cc4UL, 0x3e36fdc9UL, 0x80000000UL, + 0x3fc6d064UL, 0x3728b8cfUL, 0xbe1e542eUL, 0x80000000UL, 0x3fc68829UL, + 0xc79a4067UL, 0x3e5c380fUL, 0x00000000UL, 0x3fc6400bUL, 0xf69eac69UL, + 0x3e550a84UL, 0x80000000UL, 0x3fc5f808UL, 0xb7a780a4UL, 0x3e5d9224UL, + 0x80000000UL, 0x3fc5b022UL, 0xad9dfb1eUL, 0xbe55242fUL, 0x00000000UL, + 0x3fc56858UL, 0x659b18beUL, 0xbe4bfda3UL, 0x80000000UL, 0x3fc520a9UL, + 0x66ee3631UL, 0xbe57d769UL, 0x80000000UL, 0x3fc4d916UL, 0x1ec62819UL, + 0x3e2427f7UL, 0x80000000UL, 0x3fc4919fUL, 0xdec25369UL, 0xbe435431UL, + 0x00000000UL, 0x3fc44a44UL, 0xa8acfc4bUL, 0xbe3c62e8UL, 0x00000000UL, + 0x3fc40304UL, 0xcf1d3eabUL, 0xbdfba29fUL, 0x80000000UL, 0x3fc3bbdfUL, + 0x79aba3eaUL, 0xbdf1b7c8UL, 0x80000000UL, 0x3fc374d6UL, 0xb8d186daUL, + 0xbe5130cfUL, 0x80000000UL, 0x3fc32de8UL, 0x9d74f152UL, 0x3e2285b6UL, + 0x00000000UL, 0x3fc2e716UL, 0x50ae7ca9UL, 0xbe503920UL, 0x80000000UL, + 0x3fc2a05eUL, 0x6caed92eUL, 0xbe533924UL, 0x00000000UL, 0x3fc259c2UL, + 0x9cb5034eUL, 0xbe510e31UL, 0x80000000UL, 0x3fc21340UL, 0x12c4d378UL, + 0xbe540b43UL, 0x80000000UL, 0x3fc1ccd9UL, 0xcc418706UL, 0x3e59887aUL, + 0x00000000UL, 0x3fc1868eUL, 0x921f4106UL, 0xbe528e67UL, 0x80000000UL, + 0x3fc1405cUL, 0x3969441eUL, 0x3e5d8051UL, 0x00000000UL, 0x3fc0fa46UL, + 0xd941ef5bUL, 0x3e5f9079UL, 0x80000000UL, 0x3fc0b44aUL, 0x5a3e81b2UL, + 0xbe567691UL, 0x00000000UL, 0x3fc06e69UL, 0x9d66afe7UL, 0xbe4d43fbUL, + 0x00000000UL, 0x3fc028a2UL, 0x0a92a162UL, 0xbe52f394UL, 0x00000000UL, + 0x3fbfc5eaUL, 0x209897e5UL, 0x3e529e37UL, 0x00000000UL, 0x3fbf3ac5UL, + 0x8458bd7bUL, 0x3e582831UL, 0x00000000UL, 0x3fbeafd5UL, 0xb8d8b4b8UL, + 0xbe486b4aUL, 0x00000000UL, 0x3fbe2518UL, 0xe0a3b7b6UL, 0x3e5bafd2UL, + 0x00000000UL, 0x3fbd9a90UL, 0x2bf2710eUL, 0x3e383b2bUL, 0x00000000UL, + 0x3fbd103cUL, 0x73eb6ab7UL, 0xbe56d78dUL, 0x00000000UL, 0x3fbc861bUL, + 0x32ceaff5UL, 0xbe32dc5aUL, 0x00000000UL, 0x3fbbfc2eUL, 0xbee04cb7UL, + 0xbe4a71a4UL, 0x00000000UL, 0x3fbb7274UL, 0x35ae9577UL, 0x3e38142fUL, + 0x00000000UL, 0x3fbae8eeUL, 0xcbaddab4UL, 0xbe5490f0UL, 0x00000000UL, + 0x3fba5f9aUL, 0x95ce1114UL, 0x3e597c71UL, 0x00000000UL, 0x3fb9d67aUL, + 0x6d7c0f78UL, 0x3e3abc2dUL, 0x00000000UL, 0x3fb94d8dUL, 0x2841a782UL, + 0xbe566cbcUL, 0x00000000UL, 0x3fb8c4d2UL, 0x6ed429c6UL, 0xbe3cfff9UL, + 0x00000000UL, 0x3fb83c4aUL, 0xe4a49fbbUL, 0xbe552964UL, 0x00000000UL, + 0x3fb7b3f4UL, 0x2193d81eUL, 0xbe42fa72UL, 0x00000000UL, 0x3fb72bd0UL, + 0xdd70c122UL, 0x3e527a8cUL, 0x00000000UL, 0x3fb6a3dfUL, 0x03108a54UL, + 0xbe450393UL, 0x00000000UL, 0x3fb61c1fUL, 0x30ff7954UL, 0x3e565840UL, + 0x00000000UL, 0x3fb59492UL, 0xdedd460cUL, 0xbe5422b5UL, 0x00000000UL, + 0x3fb50d36UL, 0x950f9f45UL, 0xbe5313f6UL, 0x00000000UL, 0x3fb4860bUL, + 0x582cdcb1UL, 0x3e506d39UL, 0x00000000UL, 0x3fb3ff12UL, 0x7216d3a6UL, + 0x3e4aa719UL, 0x00000000UL, 0x3fb3784aUL, 0x57a423fdUL, 0x3e5a9b9fUL, + 0x00000000UL, 0x3fb2f1b4UL, 0x7a138b41UL, 0xbe50b418UL, 0x00000000UL, + 0x3fb26b4eUL, 0x2fbfd7eaUL, 0x3e23a53eUL, 0x00000000UL, 0x3fb1e519UL, + 0x18913ccbUL, 0x3e465fc1UL, 0x00000000UL, 0x3fb15f15UL, 0x7ea24e21UL, + 0x3e042843UL, 0x00000000UL, 0x3fb0d941UL, 0x7c6d9c77UL, 0x3e59f61eUL, + 0x00000000UL, 0x3fb0539eUL, 0x114efd44UL, 0x3e4ccab7UL, 0x00000000UL, + 0x3faf9c56UL, 0x1777f657UL, 0x3e552f65UL, 0x00000000UL, 0x3fae91d2UL, + 0xc317b86aUL, 0xbe5a61e0UL, 0x00000000UL, 0x3fad87acUL, 0xb7664efbUL, + 0xbe41f64eUL, 0x00000000UL, 0x3fac7de6UL, 0x5d3d03a9UL, 0x3e0807a0UL, + 0x00000000UL, 0x3fab7480UL, 0x743c38ebUL, 0xbe3726e1UL, 0x00000000UL, + 0x3faa6b78UL, 0x06a253f1UL, 0x3e5ad636UL, 0x00000000UL, 0x3fa962d0UL, + 0xa35f541bUL, 0x3e5a187aUL, 0x00000000UL, 0x3fa85a88UL, 0x4b86e446UL, + 0xbe508150UL, 0x00000000UL, 0x3fa7529cUL, 0x2589cacfUL, 0x3e52938aUL, + 0x00000000UL, 0x3fa64b10UL, 0xaf6b11f2UL, 0xbe3454cdUL, 0x00000000UL, + 0x3fa543e2UL, 0x97506fefUL, 0xbe5fdec5UL, 0x00000000UL, 0x3fa43d10UL, + 0xe75f7dd9UL, 0xbe388dd3UL, 0x00000000UL, 0x3fa3369cUL, 0xa4139632UL, + 0xbdea5177UL, 0x00000000UL, 0x3fa23086UL, 0x352d6f1eUL, 0xbe565ad6UL, + 0x00000000UL, 0x3fa12accUL, 0x77449eb7UL, 0xbe50d5c7UL, 0x00000000UL, + 0x3fa0256eUL, 0x7478da78UL, 0x3e404724UL, 0x00000000UL, 0x3f9e40dcUL, + 0xf59cef7fUL, 0xbe539d0aUL, 0x00000000UL, 0x3f9c3790UL, 0x1511d43cUL, + 0x3e53c2c8UL, 0x00000000UL, 0x3f9a2f00UL, 0x9b8bff3cUL, 0xbe43b3e1UL, + 0x00000000UL, 0x3f982724UL, 0xad1e22a5UL, 0x3e46f0bdUL, 0x00000000UL, + 0x3f962000UL, 0x130d9356UL, 0x3e475ba0UL, 0x00000000UL, 0x3f941994UL, + 0x8f86f883UL, 0xbe513d0bUL, 0x00000000UL, 0x3f9213dcUL, 0x914d0dc8UL, + 0xbe534335UL, 0x00000000UL, 0x3f900ed8UL, 0x2d73e5e7UL, 0xbe22ba75UL, + 0x00000000UL, 0x3f8c1510UL, 0xc5b7d70eUL, 0x3e599c5dUL, 0x00000000UL, + 0x3f880de0UL, 0x8a27857eUL, 0xbe3d28c8UL, 0x00000000UL, 0x3f840810UL, + 0xda767328UL, 0x3e531b3dUL, 0x00000000UL, 0x3f8003b0UL, 0x77bacaf3UL, + 0xbe5f04e3UL, 0x00000000UL, 0x3f780150UL, 0xdf4b0720UL, 0x3e5a8bffUL, + 0x00000000UL, 0x3f6ffc40UL, 0x34c48e71UL, 0xbe3fcd99UL, 0x00000000UL, + 0x3f5ff6c0UL, 0x1ad218afUL, 0xbe4c78a7UL, 0x00000000UL, 0x00000000UL, + 0x00000000UL, 0x80000000UL +}; + +ALIGNED_(8) juint _log2_pow[] = +{ + 0xfefa39efUL, 0x3fe62e42UL, 0xfefa39efUL, 0xbfe62e42UL +}; + +//registers, +// input: xmm0, xmm1 +// scratch: xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7 +// rax, rdx, rcx, r8, r11 + +// Code generated by Intel C compiler for LIBM library + +void MacroAssembler::fast_pow(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register eax, Register ecx, Register edx, Register tmp1, Register tmp2, Register tmp3, Register tmp4) { + Label L_2TAG_PACKET_0_0_2, L_2TAG_PACKET_1_0_2, L_2TAG_PACKET_2_0_2, L_2TAG_PACKET_3_0_2; + Label L_2TAG_PACKET_4_0_2, L_2TAG_PACKET_5_0_2, L_2TAG_PACKET_6_0_2, L_2TAG_PACKET_7_0_2; + Label L_2TAG_PACKET_8_0_2, L_2TAG_PACKET_9_0_2, L_2TAG_PACKET_10_0_2, L_2TAG_PACKET_11_0_2; + Label L_2TAG_PACKET_12_0_2, L_2TAG_PACKET_13_0_2, L_2TAG_PACKET_14_0_2, L_2TAG_PACKET_15_0_2; + Label L_2TAG_PACKET_16_0_2, L_2TAG_PACKET_17_0_2, L_2TAG_PACKET_18_0_2, L_2TAG_PACKET_19_0_2; + Label L_2TAG_PACKET_20_0_2, L_2TAG_PACKET_21_0_2, L_2TAG_PACKET_22_0_2, L_2TAG_PACKET_23_0_2; + Label L_2TAG_PACKET_24_0_2, L_2TAG_PACKET_25_0_2, L_2TAG_PACKET_26_0_2, L_2TAG_PACKET_27_0_2; + Label L_2TAG_PACKET_28_0_2, L_2TAG_PACKET_29_0_2, L_2TAG_PACKET_30_0_2, L_2TAG_PACKET_31_0_2; + Label L_2TAG_PACKET_32_0_2, L_2TAG_PACKET_33_0_2, L_2TAG_PACKET_34_0_2, L_2TAG_PACKET_35_0_2; + Label L_2TAG_PACKET_36_0_2, L_2TAG_PACKET_37_0_2, L_2TAG_PACKET_38_0_2, L_2TAG_PACKET_39_0_2; + Label L_2TAG_PACKET_40_0_2, L_2TAG_PACKET_41_0_2, L_2TAG_PACKET_42_0_2, L_2TAG_PACKET_43_0_2; + Label L_2TAG_PACKET_44_0_2, L_2TAG_PACKET_45_0_2, L_2TAG_PACKET_46_0_2, L_2TAG_PACKET_47_0_2; + Label L_2TAG_PACKET_48_0_2, L_2TAG_PACKET_49_0_2, L_2TAG_PACKET_50_0_2, L_2TAG_PACKET_51_0_2; + Label L_2TAG_PACKET_52_0_2, L_2TAG_PACKET_53_0_2, L_2TAG_PACKET_54_0_2, L_2TAG_PACKET_55_0_2; + Label L_2TAG_PACKET_56_0_2; + Label B1_2, B1_3, B1_5, start; + + assert_different_registers(tmp1, tmp2, eax, ecx, edx); + jmp(start); + address HIGHSIGMASK = (address)_HIGHSIGMASK; + address LOG2_E = (address)_LOG2_E; + address coeff = (address)_coeff_pow; + address L_tbl = (address)_L_tbl_pow; + address HIGHMASK_Y = (address)_HIGHMASK_Y; + address T_exp = (address)_T_exp; + address e_coeff = (address)_e_coeff; + address coeff_h = (address)_coeff_h; + address HIGHMASK_LOG_X = (address)_HIGHMASK_LOG_X; + address HALFMASK = (address)_HALFMASK; + address log2 = (address)_log2_pow; + + + bind(start); + subq(rsp, 40); + movsd(Address(rsp, 8), xmm0); + movsd(Address(rsp, 16), xmm1); + + bind(B1_2); + pextrw(eax, xmm0, 3); + xorpd(xmm2, xmm2); + mov64(tmp2, 0x3ff0000000000000); + movdq(xmm2, tmp2); + movl(tmp1, 1069088768); + movdq(xmm7, tmp1); + xorpd(xmm1, xmm1); + mov64(tmp3, 0x77f0000000000000); + movdq(xmm1, tmp3); + movdqu(xmm3, xmm0); + movl(edx, 32752); + andl(edx, eax); + subl(edx, 16368); + movl(ecx, edx); + sarl(edx, 31); + addl(ecx, edx); + xorl(ecx, edx); + por(xmm0, xmm2); + movdqu(xmm6, ExternalAddress(HIGHSIGMASK)); //0x00000000UL, 0xfffff800UL, 0x00000000UL, 0xfffff800UL + psrlq(xmm0, 27); + movq(xmm2, ExternalAddress(LOG2_E)); //0x00000000UL, 0x3ff72000UL, 0x161bb241UL, 0xbf5dabe1UL + psrld(xmm0, 2); + addl(ecx, 16); + bsrl(ecx, ecx); + rcpps(xmm0, xmm0); + psllq(xmm3, 12); + movl(tmp4, 8192); + movdq(xmm4, tmp4); + psrlq(xmm3, 12); + subl(eax, 16); + cmpl(eax, 32736); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_0_0_2); + movl(tmp1, 0); + + bind(L_2TAG_PACKET_1_0_2); + mulss(xmm0, xmm7); + movl(edx, -1); + subl(ecx, 4); + shll(edx); + shlq(edx, 32); + movdq(xmm5, edx); + por(xmm3, xmm1); + subl(eax, 16351); + cmpl(eax, 1); + jcc(Assembler::belowEqual, L_2TAG_PACKET_2_0_2); + paddd(xmm0, xmm4); + pand(xmm5, xmm3); + movdl(edx, xmm0); + psllq(xmm0, 29); + + bind(L_2TAG_PACKET_3_0_2); + subsd(xmm3, xmm5); + pand(xmm0, xmm6); + subl(eax, 1); + sarl(eax, 4); + cvtsi2sdl(xmm7, eax); + mulpd(xmm5, xmm0); + + bind(L_2TAG_PACKET_4_0_2); + mulsd(xmm3, xmm0); + movdqu(xmm1, ExternalAddress(coeff)); //0x6dc96112UL, 0xbf836578UL, 0xee241472UL, 0xbf9b0301UL + lea(tmp4, ExternalAddress(L_tbl)); + subsd(xmm5, xmm2); + movdqu(xmm4, ExternalAddress(16 + coeff)); //0x9f95985aUL, 0xbfb528dbUL, 0xb3841d2aUL, 0xbfd619b6UL + movl(ecx, eax); + sarl(eax, 31); + addl(ecx, eax); + xorl(eax, ecx); + addl(eax, 1); + bsrl(eax, eax); + unpcklpd(xmm5, xmm3); + movdqu(xmm6, ExternalAddress(32 + coeff)); //0x518775e3UL, 0x3f9004f2UL, 0xac8349bbUL, 0x3fa76c9bUL + addsd(xmm3, xmm5); + andl(edx, 16760832); + shrl(edx, 10); + addpd(xmm5, Address(tmp4, edx, Address::times_1, -3648)); + movdqu(xmm0, ExternalAddress(48 + coeff)); //0x486ececcUL, 0x3fc4635eUL, 0x161bb241UL, 0xbf5dabe1UL + pshufd(xmm2, xmm3, 68); + mulsd(xmm3, xmm3); + mulpd(xmm1, xmm2); + mulpd(xmm4, xmm2); + addsd(xmm5, xmm7); + mulsd(xmm2, xmm3); + addpd(xmm6, xmm1); + mulsd(xmm3, xmm3); + addpd(xmm0, xmm4); + movq(xmm1, Address(rsp, 16)); + movw(ecx, Address(rsp, 22)); + pshufd(xmm7, xmm5, 238); + movq(xmm4, ExternalAddress(HIGHMASK_Y)); //0x00000000UL, 0xfffffff8UL, 0x00000000UL, 0xffffffffUL + mulpd(xmm6, xmm2); + pshufd(xmm3, xmm3, 68); + mulpd(xmm0, xmm2); + shll(eax, 4); + subl(eax, 15872); + andl(ecx, 32752); + addl(eax, ecx); + mulpd(xmm3, xmm6); + cmpl(eax, 624); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_5_0_2); + xorpd(xmm6, xmm6); + movl(edx, 17080); + pinsrw(xmm6, edx, 3); + movdqu(xmm2, xmm1); + pand(xmm4, xmm1); + subsd(xmm1, xmm4); + mulsd(xmm4, xmm5); + addsd(xmm0, xmm7); + mulsd(xmm1, xmm5); + movdqu(xmm7, xmm6); + addsd(xmm6, xmm4); + lea(tmp4, ExternalAddress(T_exp)); + addpd(xmm3, xmm0); + movdl(edx, xmm6); + subsd(xmm6, xmm7); + pshufd(xmm0, xmm3, 238); + subsd(xmm4, xmm6); + addsd(xmm0, xmm3); + movl(ecx, edx); + andl(edx, 255); + addl(edx, edx); + movdqu(xmm5, Address(tmp4, edx, Address::times_8, 0)); + addsd(xmm4, xmm1); + mulsd(xmm2, xmm0); + movdqu(xmm7, ExternalAddress(e_coeff)); //0xe78a6731UL, 0x3f55d87fUL, 0xd704a0c0UL, 0x3fac6b08UL + movdqu(xmm3, ExternalAddress(16 + e_coeff)); //0x6fba4e77UL, 0x3f83b2abUL, 0xff82c58fUL, 0x3fcebfbdUL + shll(ecx, 12); + xorl(ecx, tmp1); + andl(rcx, -1048576); + movdq(xmm6, rcx); + addsd(xmm2, xmm4); + mov64(tmp2, 0x3fe62e42fefa39ef); + movdq(xmm1, tmp2); + pshufd(xmm0, xmm2, 68); + pshufd(xmm4, xmm2, 68); + mulsd(xmm1, xmm2); + pshufd(xmm6, xmm6, 17); + mulpd(xmm0, xmm0); + mulpd(xmm7, xmm4); + paddd(xmm5, xmm6); + mulsd(xmm1, xmm5); + pshufd(xmm6, xmm5, 238); + mulsd(xmm0, xmm0); + addpd(xmm3, xmm7); + addsd(xmm1, xmm6); + mulpd(xmm0, xmm3); + pshufd(xmm3, xmm0, 238); + mulsd(xmm0, xmm5); + mulsd(xmm3, xmm5); + addsd(xmm0, xmm1); + addsd(xmm0, xmm3); + addsd(xmm0, xmm5); + jmp(B1_5); + + bind(L_2TAG_PACKET_0_0_2); + addl(eax, 16); + movl(edx, 32752); + andl(edx, eax); + cmpl(edx, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_6_0_2); + testl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_7_0_2); + + bind(L_2TAG_PACKET_8_0_2); + movq(xmm0, Address(rsp, 8)); + movq(xmm3, Address(rsp, 8)); + movdl(edx, xmm3); + psrlq(xmm3, 32); + movdl(ecx, xmm3); + orl(edx, ecx); + cmpl(edx, 0); + jcc(Assembler::equal, L_2TAG_PACKET_9_0_2); + xorpd(xmm3, xmm3); + movl(eax, 18416); + pinsrw(xmm3, eax, 3); + mulsd(xmm0, xmm3); + xorpd(xmm2, xmm2); + movl(eax, 16368); + pinsrw(xmm2, eax, 3); + movdqu(xmm3, xmm0); + pextrw(eax, xmm0, 3); + por(xmm0, xmm2); + movl(ecx, 18416); + psrlq(xmm0, 27); + movq(xmm2, ExternalAddress(LOG2_E)); //0x00000000UL, 0x3ff72000UL, 0x161bb241UL, 0xbf5dabe1UL + psrld(xmm0, 2); + rcpps(xmm0, xmm0); + psllq(xmm3, 12); + movdqu(xmm6, ExternalAddress(HIGHSIGMASK)); //0x00000000UL, 0xfffff800UL, 0x00000000UL, 0xfffff800UL + psrlq(xmm3, 12); + mulss(xmm0, xmm7); + movl(edx, -1024); + movdl(xmm5, edx); + por(xmm3, xmm1); + paddd(xmm0, xmm4); + psllq(xmm5, 32); + movdl(edx, xmm0); + psllq(xmm0, 29); + pand(xmm5, xmm3); + movl(tmp1, 0); + pand(xmm0, xmm6); + subsd(xmm3, xmm5); + andl(eax, 32752); + subl(eax, 18416); + sarl(eax, 4); + cvtsi2sdl(xmm7, eax); + mulpd(xmm5, xmm0); + jmp(L_2TAG_PACKET_4_0_2); + + bind(L_2TAG_PACKET_10_0_2); + movq(xmm0, Address(rsp, 8)); + movq(xmm3, Address(rsp, 8)); + movdl(edx, xmm3); + psrlq(xmm3, 32); + movdl(ecx, xmm3); + orl(edx, ecx); + cmpl(edx, 0); + jcc(Assembler::equal, L_2TAG_PACKET_9_0_2); + xorpd(xmm3, xmm3); + movl(eax, 18416); + pinsrw(xmm3, eax, 3); + mulsd(xmm0, xmm3); + xorpd(xmm2, xmm2); + movl(eax, 16368); + pinsrw(xmm2, eax, 3); + movdqu(xmm3, xmm0); + pextrw(eax, xmm0, 3); + por(xmm0, xmm2); + movl(ecx, 18416); + psrlq(xmm0, 27); + movq(xmm2, ExternalAddress(LOG2_E)); //0x00000000UL, 0x3ff72000UL, 0x161bb241UL, 0xbf5dabe1UL + psrld(xmm0, 2); + rcpps(xmm0, xmm0); + psllq(xmm3, 12); + movdqu(xmm6, ExternalAddress(HIGHSIGMASK)); //0x00000000UL, 0xfffff800UL, 0x00000000UL, 0xfffff800UL + psrlq(xmm3, 12); + mulss(xmm0, xmm7); + movl(edx, -1024); + movdl(xmm5, edx); + por(xmm3, xmm1); + paddd(xmm0, xmm4); + psllq(xmm5, 32); + movdl(edx, xmm0); + psllq(xmm0, 29); + pand(xmm5, xmm3); + movl(tmp1, INT_MIN); + pand(xmm0, xmm6); + subsd(xmm3, xmm5); + andl(eax, 32752); + subl(eax, 18416); + sarl(eax, 4); + cvtsi2sdl(xmm7, eax); + mulpd(xmm5, xmm0); + jmp(L_2TAG_PACKET_4_0_2); + + bind(L_2TAG_PACKET_5_0_2); + cmpl(eax, 0); + jcc(Assembler::less, L_2TAG_PACKET_11_0_2); + cmpl(eax, 752); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_12_0_2); + addsd(xmm0, xmm7); + movq(xmm2, ExternalAddress(HALFMASK)); //0xf8000000UL, 0xffffffffUL, 0xf8000000UL, 0xffffffffUL + addpd(xmm3, xmm0); + xorpd(xmm6, xmm6); + movl(eax, 17080); + pinsrw(xmm6, eax, 3); + pshufd(xmm0, xmm3, 238); + addsd(xmm0, xmm3); + movdqu(xmm3, xmm5); + addsd(xmm5, xmm0); + movdqu(xmm4, xmm2); + subsd(xmm3, xmm5); + movdqu(xmm7, xmm5); + pand(xmm5, xmm2); + movdqu(xmm2, xmm1); + pand(xmm4, xmm1); + subsd(xmm7, xmm5); + addsd(xmm0, xmm3); + subsd(xmm1, xmm4); + mulsd(xmm4, xmm5); + addsd(xmm0, xmm7); + mulsd(xmm2, xmm0); + movdqu(xmm7, xmm6); + mulsd(xmm1, xmm5); + addsd(xmm6, xmm4); + movdl(eax, xmm6); + subsd(xmm6, xmm7); + lea(tmp4, ExternalAddress(T_exp)); + addsd(xmm2, xmm1); + movdqu(xmm7, ExternalAddress(e_coeff)); //0xe78a6731UL, 0x3f55d87fUL, 0xd704a0c0UL, 0x3fac6b08UL + movdqu(xmm3, ExternalAddress(16 + e_coeff)); //0x6fba4e77UL, 0x3f83b2abUL, 0xff82c58fUL, 0x3fcebfbdUL + subsd(xmm4, xmm6); + pextrw(edx, xmm6, 3); + movl(ecx, eax); + andl(eax, 255); + addl(eax, eax); + movdqu(xmm5, Address(tmp4, rax, Address::times_8, 0)); + addsd(xmm2, xmm4); + sarl(ecx, 8); + movl(eax, ecx); + sarl(ecx, 1); + subl(eax, ecx); + shll(ecx, 20); + xorl(ecx, tmp1); + movdl(xmm6, ecx); + movq(xmm1, ExternalAddress(32 + e_coeff)); //0xfefa39efUL, 0x3fe62e42UL, 0x00000000UL, 0x00000000UL + andl(edx, 32767); + cmpl(edx, 16529); + jcc(Assembler::above, L_2TAG_PACKET_12_0_2); + pshufd(xmm0, xmm2, 68); + pshufd(xmm4, xmm2, 68); + mulpd(xmm0, xmm0); + mulpd(xmm7, xmm4); + pshufd(xmm6, xmm6, 17); + mulsd(xmm1, xmm2); + mulsd(xmm0, xmm0); + paddd(xmm5, xmm6); + addpd(xmm3, xmm7); + mulsd(xmm1, xmm5); + pshufd(xmm6, xmm5, 238); + mulpd(xmm0, xmm3); + addsd(xmm1, xmm6); + pshufd(xmm3, xmm0, 238); + mulsd(xmm0, xmm5); + mulsd(xmm3, xmm5); + shll(eax, 4); + xorpd(xmm4, xmm4); + addl(eax, 16368); + pinsrw(xmm4, eax, 3); + addsd(xmm0, xmm1); + addsd(xmm0, xmm3); + movdqu(xmm1, xmm0); + addsd(xmm0, xmm5); + mulsd(xmm0, xmm4); + pextrw(eax, xmm0, 3); + andl(eax, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_13_0_2); + cmpl(eax, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_14_0_2); + jmp(B1_5); + + bind(L_2TAG_PACKET_6_0_2); + movq(xmm1, Address(rsp, 16)); + movq(xmm0, Address(rsp, 8)); + movdqu(xmm2, xmm0); + movdl(eax, xmm2); + psrlq(xmm2, 20); + movdl(edx, xmm2); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_15_0_2); + movdl(eax, xmm1); + psrlq(xmm1, 32); + movdl(edx, xmm1); + movl(ecx, edx); + addl(edx, edx); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_16_0_2); + addsd(xmm0, xmm0); + jmp(B1_5); + + bind(L_2TAG_PACKET_16_0_2); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + movl(Address(rsp, 0), 29); + jmp(L_2TAG_PACKET_17_0_2); + + bind(L_2TAG_PACKET_18_0_2); + movq(xmm0, Address(rsp, 16)); + addpd(xmm0, xmm0); + jmp(B1_5); + + bind(L_2TAG_PACKET_15_0_2); + movdl(eax, xmm1); + movdqu(xmm2, xmm1); + psrlq(xmm1, 32); + movdl(edx, xmm1); + movl(ecx, edx); + addl(edx, edx); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_19_0_2); + pextrw(eax, xmm2, 3); + andl(eax, 32752); + cmpl(eax, 32752); + jcc(Assembler::notEqual, L_2TAG_PACKET_20_0_2); + movdl(eax, xmm2); + psrlq(xmm2, 20); + movdl(edx, xmm2); + orl(eax, edx); + jcc(Assembler::notEqual, L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_20_0_2); + pextrw(eax, xmm0, 3); + testl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_21_0_2); + testl(ecx, INT_MIN); + jcc(Assembler::notEqual, L_2TAG_PACKET_22_0_2); + jmp(B1_5); + + bind(L_2TAG_PACKET_23_0_2); + movq(xmm1, Address(rsp, 16)); + movdl(eax, xmm1); + testl(eax, 1); + jcc(Assembler::notEqual, L_2TAG_PACKET_24_0_2); + testl(eax, 2); + jcc(Assembler::notEqual, L_2TAG_PACKET_25_0_2); + jmp(L_2TAG_PACKET_24_0_2); + + bind(L_2TAG_PACKET_21_0_2); + shrl(ecx, 20); + andl(ecx, 2047); + cmpl(ecx, 1075); + jcc(Assembler::above, L_2TAG_PACKET_24_0_2); + jcc(Assembler::equal, L_2TAG_PACKET_26_0_2); + cmpl(ecx, 1074); + jcc(Assembler::above, L_2TAG_PACKET_23_0_2); + cmpl(ecx, 1023); + jcc(Assembler::below, L_2TAG_PACKET_24_0_2); + movq(xmm1, Address(rsp, 16)); + movl(eax, 17208); + xorpd(xmm3, xmm3); + pinsrw(xmm3, eax, 3); + movdqu(xmm4, xmm3); + addsd(xmm3, xmm1); + subsd(xmm4, xmm3); + addsd(xmm1, xmm4); + pextrw(eax, xmm1, 3); + andl(eax, 32752); + jcc(Assembler::notEqual, L_2TAG_PACKET_24_0_2); + movdl(eax, xmm3); + andl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_24_0_2); + + bind(L_2TAG_PACKET_25_0_2); + movq(xmm1, Address(rsp, 16)); + pextrw(eax, xmm1, 3); + andl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_27_0_2); + jmp(B1_5); + + bind(L_2TAG_PACKET_27_0_2); + xorpd(xmm0, xmm0); + movl(eax, 32768); + pinsrw(xmm0, eax, 3); + jmp(B1_5); + + bind(L_2TAG_PACKET_24_0_2); + movq(xmm1, Address(rsp, 16)); + pextrw(eax, xmm1, 3); + andl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_22_0_2); + xorpd(xmm0, xmm0); + movl(eax, 32752); + pinsrw(xmm0, eax, 3); + jmp(B1_5); + + bind(L_2TAG_PACKET_26_0_2); + movq(xmm1, Address(rsp, 16)); + movdl(eax, xmm1); + andl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_24_0_2); + jmp(L_2TAG_PACKET_25_0_2); + + bind(L_2TAG_PACKET_28_0_2); + movdl(eax, xmm1); + psrlq(xmm1, 20); + movdl(edx, xmm1); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_29_0_2); + movq(xmm0, Address(rsp, 16)); + addsd(xmm0, xmm0); + jmp(B1_5); + + bind(L_2TAG_PACKET_29_0_2); + movq(xmm0, Address(rsp, 8)); + pextrw(eax, xmm0, 3); + cmpl(eax, 49136); + jcc(Assembler::notEqual, L_2TAG_PACKET_30_0_2); + movdl(ecx, xmm0); + psrlq(xmm0, 20); + movdl(edx, xmm0); + orl(ecx, edx); + jcc(Assembler::notEqual, L_2TAG_PACKET_30_0_2); + xorpd(xmm0, xmm0); + movl(eax, 32760); + pinsrw(xmm0, eax, 3); + jmp(B1_5); + + bind(L_2TAG_PACKET_30_0_2); + movq(xmm1, Address(rsp, 16)); + andl(eax, 32752); + subl(eax, 16368); + pextrw(edx, xmm1, 3); + xorpd(xmm0, xmm0); + xorl(eax, edx); + andl(eax, 32768); + jcc(Assembler::equal, L_2TAG_PACKET_31_0_2); + jmp(B1_5); + + bind(L_2TAG_PACKET_31_0_2); + movl(ecx, 32752); + pinsrw(xmm0, ecx, 3); + jmp(B1_5); + + bind(L_2TAG_PACKET_32_0_2); + movdl(eax, xmm1); + cmpl(edx, 17184); + jcc(Assembler::above, L_2TAG_PACKET_33_0_2); + testl(eax, 1); + jcc(Assembler::notEqual, L_2TAG_PACKET_34_0_2); + testl(eax, 2); + jcc(Assembler::equal, L_2TAG_PACKET_35_0_2); + jmp(L_2TAG_PACKET_36_0_2); + + bind(L_2TAG_PACKET_33_0_2); + testl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_35_0_2); + jmp(L_2TAG_PACKET_36_0_2); + + bind(L_2TAG_PACKET_7_0_2); + movq(xmm2, Address(rsp, 8)); + movdl(eax, xmm2); + psrlq(xmm2, 31); + movdl(ecx, xmm2); + orl(eax, ecx); + jcc(Assembler::equal, L_2TAG_PACKET_9_0_2); + movq(xmm1, Address(rsp, 16)); + pextrw(edx, xmm1, 3); + movdl(eax, xmm1); + movdqu(xmm2, xmm1); + psrlq(xmm2, 32); + movdl(ecx, xmm2); + addl(ecx, ecx); + orl(ecx, eax); + jcc(Assembler::equal, L_2TAG_PACKET_37_0_2); + andl(edx, 32752); + cmpl(edx, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_28_0_2); + cmpl(edx, 17200); + jcc(Assembler::above, L_2TAG_PACKET_35_0_2); + cmpl(edx, 17184); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_32_0_2); + cmpl(edx, 16368); + jcc(Assembler::below, L_2TAG_PACKET_34_0_2); + movl(eax, 17208); + xorpd(xmm2, xmm2); + pinsrw(xmm2, eax, 3); + movdqu(xmm4, xmm2); + addsd(xmm2, xmm1); + subsd(xmm4, xmm2); + addsd(xmm1, xmm4); + pextrw(eax, xmm1, 3); + andl(eax, 32767); + jcc(Assembler::notEqual, L_2TAG_PACKET_34_0_2); + movdl(eax, xmm2); + andl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_35_0_2); + + bind(L_2TAG_PACKET_36_0_2); + xorpd(xmm1, xmm1); + movl(edx, 30704); + pinsrw(xmm1, edx, 3); + movq(xmm2, ExternalAddress(LOG2_E)); //0x00000000UL, 0x3ff72000UL, 0x161bb241UL, 0xbf5dabe1UL + movq(xmm4, Address(rsp, 8)); + pextrw(eax, xmm4, 3); + movl(edx, 8192); + movdl(xmm4, edx); + andl(eax, 32767); + subl(eax, 16); + jcc(Assembler::less, L_2TAG_PACKET_10_0_2); + movl(edx, eax); + andl(edx, 32752); + subl(edx, 16368); + movl(ecx, edx); + sarl(edx, 31); + addl(ecx, edx); + xorl(ecx, edx); + addl(ecx, 16); + bsrl(ecx, ecx); + movl(tmp1, INT_MIN); + jmp(L_2TAG_PACKET_1_0_2); + + bind(L_2TAG_PACKET_34_0_2); + xorpd(xmm1, xmm1); + movl(eax, 32752); + pinsrw(xmm1, eax, 3); + xorpd(xmm0, xmm0); + mulsd(xmm0, xmm1); + movl(Address(rsp, 0), 28); + jmp(L_2TAG_PACKET_17_0_2); + + bind(L_2TAG_PACKET_35_0_2); + xorpd(xmm1, xmm1); + movl(edx, 30704); + pinsrw(xmm1, edx, 3); + movq(xmm2, ExternalAddress(LOG2_E)); //0x00000000UL, 0x3ff72000UL, 0x161bb241UL, 0xbf5dabe1UL + movq(xmm4, Address(rsp, 8)); + pextrw(eax, xmm4, 3); + movl(edx, 8192); + movdl(xmm4, edx); + andl(eax, 32767); + subl(eax, 16); + jcc(Assembler::less, L_2TAG_PACKET_8_0_2); + movl(edx, eax); + andl(edx, 32752); + subl(edx, 16368); + movl(ecx, edx); + sarl(edx, 31); + addl(ecx, edx); + xorl(ecx, edx); + addl(ecx, 16); + bsrl(ecx, ecx); + movl(tmp1, 0); + jmp(L_2TAG_PACKET_1_0_2); + + bind(L_2TAG_PACKET_19_0_2); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + jmp(B1_5); + + bind(L_2TAG_PACKET_22_0_2); + xorpd(xmm0, xmm0); + jmp(B1_5); + + bind(L_2TAG_PACKET_11_0_2); + addl(eax, 384); + cmpl(eax, 0); + jcc(Assembler::less, L_2TAG_PACKET_38_0_2); + mulsd(xmm5, xmm1); + addsd(xmm0, xmm7); + shrl(tmp1, 31); + addpd(xmm3, xmm0); + pshufd(xmm0, xmm3, 238); + addsd(xmm3, xmm0); + lea(tmp4, ExternalAddress(log2)); //0xfefa39efUL, 0x3fe62e42UL, 0xfefa39efUL, 0xbfe62e42UL + movq(xmm4, Address(tmp4, tmp1, Address::times_8, 0)); + mulsd(xmm1, xmm3); + xorpd(xmm0, xmm0); + movl(eax, 16368); + shll(tmp1, 15); + orl(eax, tmp1); + pinsrw(xmm0, eax, 3); + addsd(xmm5, xmm1); + mulsd(xmm5, xmm4); + addsd(xmm0, xmm5); + jmp(B1_5); + + bind(L_2TAG_PACKET_38_0_2); + + bind(L_2TAG_PACKET_37_0_2); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + jmp(B1_5); + + bind(L_2TAG_PACKET_39_0_2); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + movl(Address(rsp, 0), 26); + jmp(L_2TAG_PACKET_17_0_2); + + bind(L_2TAG_PACKET_9_0_2); + movq(xmm1, Address(rsp, 16)); + movdqu(xmm2, xmm1); + pextrw(eax, xmm1, 3); + andl(eax, 32752); + cmpl(eax, 32752); + jcc(Assembler::notEqual, L_2TAG_PACKET_40_0_2); + movdl(eax, xmm2); + psrlq(xmm2, 20); + movdl(edx, xmm2); + orl(eax, edx); + jcc(Assembler::notEqual, L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_40_0_2); + movdl(eax, xmm1); + psrlq(xmm1, 32); + movdl(edx, xmm1); + movl(ecx, edx); + addl(edx, edx); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_39_0_2); + shrl(edx, 21); + cmpl(edx, 1075); + jcc(Assembler::above, L_2TAG_PACKET_41_0_2); + jcc(Assembler::equal, L_2TAG_PACKET_42_0_2); + cmpl(edx, 1023); + jcc(Assembler::below, L_2TAG_PACKET_41_0_2); + movq(xmm1, Address(rsp, 16)); + movl(eax, 17208); + xorpd(xmm3, xmm3); + pinsrw(xmm3, eax, 3); + movdqu(xmm4, xmm3); + addsd(xmm3, xmm1); + subsd(xmm4, xmm3); + addsd(xmm1, xmm4); + pextrw(eax, xmm1, 3); + andl(eax, 32752); + jcc(Assembler::notEqual, L_2TAG_PACKET_41_0_2); + movdl(eax, xmm3); + andl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_41_0_2); + + bind(L_2TAG_PACKET_43_0_2); + movq(xmm0, Address(rsp, 8)); + testl(ecx, INT_MIN); + jcc(Assembler::notEqual, L_2TAG_PACKET_44_0_2); + jmp(B1_5); + + bind(L_2TAG_PACKET_42_0_2); + movq(xmm1, Address(rsp, 16)); + movdl(eax, xmm1); + testl(eax, 1); + jcc(Assembler::notEqual, L_2TAG_PACKET_43_0_2); + + bind(L_2TAG_PACKET_41_0_2); + testl(ecx, INT_MIN); + jcc(Assembler::equal, L_2TAG_PACKET_22_0_2); + xorpd(xmm0, xmm0); + + bind(L_2TAG_PACKET_44_0_2); + movl(eax, 16368); + xorpd(xmm1, xmm1); + pinsrw(xmm1, eax, 3); + divsd(xmm1, xmm0); + movdqu(xmm0, xmm1); + movl(Address(rsp, 0), 27); + jmp(L_2TAG_PACKET_17_0_2); + + bind(L_2TAG_PACKET_12_0_2); + movq(xmm2, Address(rsp, 8)); + movq(xmm6, Address(rsp, 16)); + pextrw(eax, xmm2, 3); + pextrw(edx, xmm6, 3); + movl(ecx, 32752); + andl(ecx, edx); + cmpl(ecx, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_45_0_2); + andl(eax, 32752); + subl(eax, 16368); + xorl(edx, eax); + testl(edx, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_46_0_2); + + bind(L_2TAG_PACKET_47_0_2); + movl(eax, 32736); + pinsrw(xmm0, eax, 3); + shrl(tmp1, 16); + orl(eax, tmp1); + pinsrw(xmm1, eax, 3); + mulsd(xmm0, xmm1); + + bind(L_2TAG_PACKET_14_0_2); + movl(Address(rsp, 0), 24); + jmp(L_2TAG_PACKET_17_0_2); + + bind(L_2TAG_PACKET_46_0_2); + movl(eax, 16); + pinsrw(xmm0, eax, 3); + mulsd(xmm0, xmm0); + testl(tmp1, INT_MIN); + jcc(Assembler::equal, L_2TAG_PACKET_48_0_2); + mov64(tmp2, 0x8000000000000000); + movdq(xmm2, tmp2); + xorpd(xmm0, xmm2); + + bind(L_2TAG_PACKET_48_0_2); + movl(Address(rsp, 0), 25); + jmp(L_2TAG_PACKET_17_0_2); + + bind(L_2TAG_PACKET_13_0_2); + pextrw(ecx, xmm5, 3); + pextrw(edx, xmm4, 3); + movl(eax, -1); + andl(ecx, 32752); + subl(ecx, 16368); + andl(edx, 32752); + addl(edx, ecx); + movl(ecx, -31); + sarl(edx, 4); + subl(ecx, edx); + jcc(Assembler::lessEqual, L_2TAG_PACKET_49_0_2); + cmpl(ecx, 20); + jcc(Assembler::above, L_2TAG_PACKET_50_0_2); + shll(eax); + + bind(L_2TAG_PACKET_49_0_2); + movdl(xmm0, eax); + psllq(xmm0, 32); + pand(xmm0, xmm5); + subsd(xmm5, xmm0); + addsd(xmm5, xmm1); + mulsd(xmm0, xmm4); + mulsd(xmm5, xmm4); + addsd(xmm0, xmm5); + + bind(L_2TAG_PACKET_50_0_2); + jmp(L_2TAG_PACKET_48_0_2); + + bind(L_2TAG_PACKET_2_0_2); + movw(ecx, Address(rsp, 22)); + movl(edx, INT_MIN); + movdl(xmm1, rdx); + xorpd(xmm7, xmm7); + paddd(xmm0, xmm4); + movdl(edx, xmm0); + psllq(xmm0, 29); + paddq(xmm1, xmm3); + pand(xmm5, xmm1); + andl(ecx, 32752); + cmpl(ecx, 16560); + jcc(Assembler::less, L_2TAG_PACKET_3_0_2); + pand(xmm0, xmm6); + subsd(xmm3, xmm5); + addl(eax, 16351); + shrl(eax, 4); + subl(eax, 1022); + cvtsi2sdl(xmm7, eax); + mulpd(xmm5, xmm0); + lea(r11, ExternalAddress(L_tbl)); + movq(xmm4, ExternalAddress(coeff_h)); //0x00000000UL, 0xbfd61a00UL, 0x00000000UL, 0xbf5dabe1UL + mulsd(xmm3, xmm0); + movq(xmm6, ExternalAddress(coeff_h)); //0x00000000UL, 0xbfd61a00UL, 0x00000000UL, 0xbf5dabe1UL + subsd(xmm5, xmm2); + movq(xmm1, ExternalAddress(8 + coeff_h)); //0x00000000UL, 0xbf5dabe1UL + pshufd(xmm2, xmm3, 68); + unpcklpd(xmm5, xmm3); + addsd(xmm3, xmm5); + movq(xmm0, ExternalAddress(8 + coeff_h)); //0x00000000UL, 0xbf5dabe1UL + andl(edx, 16760832); + shrl(edx, 10); + addpd(xmm7, Address(tmp4, edx, Address::times_1, -3648)); + mulsd(xmm4, xmm5); + mulsd(xmm0, xmm5); + mulsd(xmm6, xmm2); + mulsd(xmm1, xmm2); + movdqu(xmm2, xmm5); + mulsd(xmm4, xmm5); + addsd(xmm5, xmm0); + movdqu(xmm0, xmm7); + addsd(xmm2, xmm3); + addsd(xmm7, xmm5); + mulsd(xmm6, xmm2); + subsd(xmm0, xmm7); + movdqu(xmm2, xmm7); + addsd(xmm7, xmm4); + addsd(xmm0, xmm5); + subsd(xmm2, xmm7); + addsd(xmm4, xmm2); + pshufd(xmm2, xmm5, 238); + movdqu(xmm5, xmm7); + addsd(xmm7, xmm2); + addsd(xmm4, xmm0); + movdqu(xmm0, ExternalAddress(coeff)); //0x6dc96112UL, 0xbf836578UL, 0xee241472UL, 0xbf9b0301UL + subsd(xmm5, xmm7); + addsd(xmm6, xmm4); + movdqu(xmm4, xmm7); + addsd(xmm5, xmm2); + addsd(xmm7, xmm1); + movdqu(xmm2, ExternalAddress(64 + coeff)); //0x486ececcUL, 0x3fc4635eUL, 0x161bb241UL, 0xbf5dabe1UL + subsd(xmm4, xmm7); + addsd(xmm6, xmm5); + addsd(xmm4, xmm1); + pshufd(xmm5, xmm7, 238); + movapd(xmm1, xmm7); + addsd(xmm7, xmm5); + subsd(xmm1, xmm7); + addsd(xmm1, xmm5); + movdqu(xmm5, ExternalAddress(80 + coeff)); //0x9f95985aUL, 0xbfb528dbUL, 0xf8b5787dUL, 0x3ef2531eUL + pshufd(xmm3, xmm3, 68); + addsd(xmm6, xmm4); + addsd(xmm6, xmm1); + movdqu(xmm1, ExternalAddress(32 + coeff)); //0x9f95985aUL, 0xbfb528dbUL, 0xb3841d2aUL, 0xbfd619b6UL + mulpd(xmm0, xmm3); + mulpd(xmm2, xmm3); + pshufd(xmm4, xmm3, 68); + mulpd(xmm3, xmm3); + addpd(xmm0, xmm1); + addpd(xmm5, xmm2); + mulsd(xmm4, xmm3); + movq(xmm2, ExternalAddress(HIGHMASK_LOG_X)); //0xf8000000UL, 0xffffffffUL, 0x00000000UL, 0xfffff800UL + mulpd(xmm3, xmm3); + movq(xmm1, Address(rsp, 16)); + movw(ecx, Address(rsp, 22)); + mulpd(xmm0, xmm4); + pextrw(eax, xmm7, 3); + mulpd(xmm5, xmm4); + mulpd(xmm0, xmm3); + movq(xmm4, ExternalAddress(8 + HIGHMASK_Y)); //0x00000000UL, 0xffffffffUL + pand(xmm2, xmm7); + addsd(xmm5, xmm6); + subsd(xmm7, xmm2); + addpd(xmm5, xmm0); + andl(eax, 32752); + subl(eax, 16368); + andl(ecx, 32752); + cmpl(ecx, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_45_0_2); + addl(ecx, eax); + cmpl(ecx, 16576); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_51_0_2); + pshufd(xmm0, xmm5, 238); + pand(xmm4, xmm1); + movdqu(xmm3, xmm1); + addsd(xmm5, xmm0); + subsd(xmm1, xmm4); + xorpd(xmm6, xmm6); + movl(edx, 17080); + pinsrw(xmm6, edx, 3); + addsd(xmm7, xmm5); + mulsd(xmm4, xmm2); + mulsd(xmm1, xmm2); + movdqu(xmm5, xmm6); + mulsd(xmm3, xmm7); + addsd(xmm6, xmm4); + addsd(xmm1, xmm3); + movdqu(xmm7, ExternalAddress(e_coeff)); //0xe78a6731UL, 0x3f55d87fUL, 0xd704a0c0UL, 0x3fac6b08UL + movdl(edx, xmm6); + subsd(xmm6, xmm5); + lea(tmp4, ExternalAddress(T_exp)); + movdqu(xmm3, ExternalAddress(16 + e_coeff)); //0x6fba4e77UL, 0x3f83b2abUL, 0xff82c58fUL, 0x3fcebfbdUL + movq(xmm2, ExternalAddress(32 + e_coeff)); //0xfefa39efUL, 0x3fe62e42UL, 0x00000000UL, 0x00000000UL + subsd(xmm4, xmm6); + movl(ecx, edx); + andl(edx, 255); + addl(edx, edx); + movdqu(xmm5, Address(tmp4, edx, Address::times_8, 0)); + addsd(xmm4, xmm1); + pextrw(edx, xmm6, 3); + shrl(ecx, 8); + movl(eax, ecx); + shrl(ecx, 1); + subl(eax, ecx); + shll(ecx, 20); + movdl(xmm6, ecx); + pshufd(xmm0, xmm4, 68); + pshufd(xmm1, xmm4, 68); + mulpd(xmm0, xmm0); + mulpd(xmm7, xmm1); + pshufd(xmm6, xmm6, 17); + mulsd(xmm2, xmm4); + andl(edx, 32767); + cmpl(edx, 16529); + jcc(Assembler::above, L_2TAG_PACKET_12_0_2); + mulsd(xmm0, xmm0); + paddd(xmm5, xmm6); + addpd(xmm3, xmm7); + mulsd(xmm2, xmm5); + pshufd(xmm6, xmm5, 238); + mulpd(xmm0, xmm3); + addsd(xmm2, xmm6); + pshufd(xmm3, xmm0, 238); + addl(eax, 1023); + shll(eax, 20); + orl(eax, tmp1); + movdl(xmm4, eax); + mulsd(xmm0, xmm5); + mulsd(xmm3, xmm5); + addsd(xmm0, xmm2); + psllq(xmm4, 32); + addsd(xmm0, xmm3); + movdqu(xmm1, xmm0); + addsd(xmm0, xmm5); + mulsd(xmm0, xmm4); + pextrw(eax, xmm0, 3); + andl(eax, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_13_0_2); + cmpl(eax, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_14_0_2); + + bind(L_2TAG_PACKET_52_0_2); + jmp(B1_5); + + bind(L_2TAG_PACKET_45_0_2); + movq(xmm0, Address(rsp, 8)); + xorpd(xmm2, xmm2); + movl(eax, 49136); + pinsrw(xmm2, eax, 3); + addsd(xmm2, xmm0); + pextrw(eax, xmm2, 3); + cmpl(eax, 0); + jcc(Assembler::notEqual, L_2TAG_PACKET_53_0_2); + xorpd(xmm0, xmm0); + movl(eax, 32760); + pinsrw(xmm0, eax, 3); + jmp(B1_5); + + bind(L_2TAG_PACKET_53_0_2); + movq(xmm1, Address(rsp, 16)); + movdl(edx, xmm1); + movdqu(xmm3, xmm1); + psrlq(xmm3, 20); + movdl(ecx, xmm3); + orl(ecx, edx); + jcc(Assembler::equal, L_2TAG_PACKET_54_0_2); + addsd(xmm1, xmm1); + movdqu(xmm0, xmm1); + jmp(B1_5); + + bind(L_2TAG_PACKET_51_0_2); + pextrw(eax, xmm1, 3); + pextrw(ecx, xmm2, 3); + xorl(eax, ecx); + testl(eax, 32768); + jcc(Assembler::equal, L_2TAG_PACKET_47_0_2); + jmp(L_2TAG_PACKET_46_0_2); + + bind(L_2TAG_PACKET_54_0_2); + pextrw(eax, xmm0, 3); + andl(eax, 32752); + pextrw(edx, xmm1, 3); + xorpd(xmm0, xmm0); + subl(eax, 16368); + xorl(eax, edx); + testl(eax, 32768); + jcc(Assembler::equal, L_2TAG_PACKET_55_0_2); + jmp(B1_5); + + bind(L_2TAG_PACKET_55_0_2); + movl(edx, 32752); + pinsrw(xmm0, edx, 3); + jmp(B1_5); + + bind(L_2TAG_PACKET_17_0_2); + movq(Address(rsp, 24), xmm0); + + bind(B1_3); + movq(xmm0, Address(rsp, 24)); + + bind(L_2TAG_PACKET_56_0_2); + + bind(B1_5); + addq(rsp, 40); +} +#endif // _LP64 + +#ifndef _LP64 + +ALIGNED_(16) juint _static_const_table_pow[] = +{ + 0x00000000UL, 0xbfd61a00UL, 0x00000000UL, 0xbf5dabe1UL, 0xf8000000UL, + 0xffffffffUL, 0x00000000UL, 0xfffff800UL, 0x00000000UL, 0x3ff00000UL, + 0x00000000UL, 0x00000000UL, 0x20000000UL, 0x3feff00aUL, 0x96621f95UL, + 0x3e5b1856UL, 0xe0000000UL, 0x3fefe019UL, 0xe5916f9eUL, 0xbe325278UL, + 0x00000000UL, 0x3fefd02fUL, 0x859a1062UL, 0x3e595fb7UL, 0xc0000000UL, + 0x3fefc049UL, 0xb245f18fUL, 0xbe529c38UL, 0xe0000000UL, 0x3fefb069UL, + 0xad2880a7UL, 0xbe501230UL, 0x60000000UL, 0x3fefa08fUL, 0xc8e72420UL, + 0x3e597bd1UL, 0x80000000UL, 0x3fef90baUL, 0xc30c4500UL, 0xbe5d6c75UL, + 0xe0000000UL, 0x3fef80eaUL, 0x02c63f43UL, 0x3e2e1318UL, 0xc0000000UL, + 0x3fef7120UL, 0xb3d4ccccUL, 0xbe44c52aUL, 0x00000000UL, 0x3fef615cUL, + 0xdbd91397UL, 0xbe4e7d6cUL, 0xa0000000UL, 0x3fef519cUL, 0x65c5cd68UL, + 0xbe522dc8UL, 0xa0000000UL, 0x3fef41e2UL, 0x46d1306cUL, 0xbe5a840eUL, + 0xe0000000UL, 0x3fef322dUL, 0xd2980e94UL, 0x3e5071afUL, 0xa0000000UL, + 0x3fef227eUL, 0x773abadeUL, 0xbe5891e5UL, 0xa0000000UL, 0x3fef12d4UL, + 0xdc6bf46bUL, 0xbe5cccbeUL, 0xe0000000UL, 0x3fef032fUL, 0xbc7247faUL, + 0xbe2bab83UL, 0x80000000UL, 0x3feef390UL, 0xbcaa1e46UL, 0xbe53bb3bUL, + 0x60000000UL, 0x3feee3f6UL, 0x5f6c682dUL, 0xbe54c619UL, 0x80000000UL, + 0x3feed461UL, 0x5141e368UL, 0xbe4b6d86UL, 0xe0000000UL, 0x3feec4d1UL, + 0xec678f76UL, 0xbe369af6UL, 0x80000000UL, 0x3feeb547UL, 0x41301f55UL, + 0xbe2d4312UL, 0x60000000UL, 0x3feea5c2UL, 0x676da6bdUL, 0xbe4d8dd0UL, + 0x60000000UL, 0x3fee9642UL, 0x57a891c4UL, 0x3e51f991UL, 0xa0000000UL, + 0x3fee86c7UL, 0xe4eb491eUL, 0x3e579bf9UL, 0x20000000UL, 0x3fee7752UL, + 0xfddc4a2cUL, 0xbe3356e6UL, 0xc0000000UL, 0x3fee67e1UL, 0xd75b5bf1UL, + 0xbe449531UL, 0x80000000UL, 0x3fee5876UL, 0xbd423b8eUL, 0x3df54fe4UL, + 0x60000000UL, 0x3fee4910UL, 0x330e51b9UL, 0x3e54289cUL, 0x80000000UL, + 0x3fee39afUL, 0x8651a95fUL, 0xbe55aad6UL, 0xa0000000UL, 0x3fee2a53UL, + 0x5e98c708UL, 0xbe2fc4a9UL, 0xe0000000UL, 0x3fee1afcUL, 0x0989328dUL, + 0x3e23958cUL, 0x40000000UL, 0x3fee0babUL, 0xee642abdUL, 0xbe425dd8UL, + 0xa0000000UL, 0x3fedfc5eUL, 0xc394d236UL, 0x3e526362UL, 0x20000000UL, + 0x3feded17UL, 0xe104aa8eUL, 0x3e4ce247UL, 0xc0000000UL, 0x3fedddd4UL, + 0x265a9be4UL, 0xbe5bb77aUL, 0x40000000UL, 0x3fedce97UL, 0x0ecac52fUL, + 0x3e4a7cb1UL, 0xe0000000UL, 0x3fedbf5eUL, 0x124cb3b8UL, 0x3e257024UL, + 0x80000000UL, 0x3fedb02bUL, 0xe6d4febeUL, 0xbe2033eeUL, 0x20000000UL, + 0x3feda0fdUL, 0x39cca00eUL, 0xbe3ddabcUL, 0xc0000000UL, 0x3fed91d3UL, + 0xef8a552aUL, 0xbe543390UL, 0x40000000UL, 0x3fed82afUL, 0xb8e85204UL, + 0x3e513850UL, 0xe0000000UL, 0x3fed738fUL, 0x3d59fe08UL, 0xbe5db728UL, + 0x40000000UL, 0x3fed6475UL, 0x3aa7ead1UL, 0x3e58804bUL, 0xc0000000UL, + 0x3fed555fUL, 0xf8a35ba9UL, 0xbe5298b0UL, 0x00000000UL, 0x3fed464fUL, + 0x9a88dd15UL, 0x3e5a8cdbUL, 0x40000000UL, 0x3fed3743UL, 0xb0b0a190UL, + 0x3e598635UL, 0x80000000UL, 0x3fed283cUL, 0xe2113295UL, 0xbe5c1119UL, + 0x80000000UL, 0x3fed193aUL, 0xafbf1728UL, 0xbe492e9cUL, 0x60000000UL, + 0x3fed0a3dUL, 0xe4a4ccf3UL, 0x3e19b90eUL, 0x20000000UL, 0x3fecfb45UL, + 0xba3cbeb8UL, 0x3e406b50UL, 0xc0000000UL, 0x3fecec51UL, 0x110f7dddUL, + 0x3e0d6806UL, 0x40000000UL, 0x3fecdd63UL, 0x7dd7d508UL, 0xbe5a8943UL, + 0x80000000UL, 0x3fecce79UL, 0x9b60f271UL, 0xbe50676aUL, 0x80000000UL, + 0x3fecbf94UL, 0x0b9ad660UL, 0x3e59174fUL, 0x60000000UL, 0x3fecb0b4UL, + 0x00823d9cUL, 0x3e5bbf72UL, 0x20000000UL, 0x3feca1d9UL, 0x38a6ec89UL, + 0xbe4d38f9UL, 0x80000000UL, 0x3fec9302UL, 0x3a0b7d8eUL, 0x3e53dbfdUL, + 0xc0000000UL, 0x3fec8430UL, 0xc6826b34UL, 0xbe27c5c9UL, 0xc0000000UL, + 0x3fec7563UL, 0x0c706381UL, 0xbe593653UL, 0x60000000UL, 0x3fec669bUL, + 0x7df34ec7UL, 0x3e461ab5UL, 0xe0000000UL, 0x3fec57d7UL, 0x40e5e7e8UL, + 0xbe5c3daeUL, 0x00000000UL, 0x3fec4919UL, 0x5602770fUL, 0xbe55219dUL, + 0xc0000000UL, 0x3fec3a5eUL, 0xec7911ebUL, 0x3e5a5d25UL, 0x60000000UL, + 0x3fec2ba9UL, 0xb39ea225UL, 0xbe53c00bUL, 0x80000000UL, 0x3fec1cf8UL, + 0x967a212eUL, 0x3e5a8ddfUL, 0x60000000UL, 0x3fec0e4cUL, 0x580798bdUL, + 0x3e5f53abUL, 0x00000000UL, 0x3febffa5UL, 0xb8282df6UL, 0xbe46b874UL, + 0x20000000UL, 0x3febf102UL, 0xe33a6729UL, 0x3e54963fUL, 0x00000000UL, + 0x3febe264UL, 0x3b53e88aUL, 0xbe3adce1UL, 0x60000000UL, 0x3febd3caUL, + 0xc2585084UL, 0x3e5cde9fUL, 0x80000000UL, 0x3febc535UL, 0xa335c5eeUL, + 0xbe39fd9cUL, 0x20000000UL, 0x3febb6a5UL, 0x7325b04dUL, 0x3e42ba15UL, + 0x60000000UL, 0x3feba819UL, 0x1564540fUL, 0x3e3a9f35UL, 0x40000000UL, + 0x3feb9992UL, 0x83fff592UL, 0xbe5465ceUL, 0xa0000000UL, 0x3feb8b0fUL, + 0xb9da63d3UL, 0xbe4b1a0aUL, 0x80000000UL, 0x3feb7c91UL, 0x6d6f1ea4UL, + 0x3e557657UL, 0x00000000UL, 0x3feb6e18UL, 0x5e80a1bfUL, 0x3e4ddbb6UL, + 0x00000000UL, 0x3feb5fa3UL, 0x1c9eacb5UL, 0x3e592877UL, 0xa0000000UL, + 0x3feb5132UL, 0x6d40beb3UL, 0xbe51858cUL, 0xa0000000UL, 0x3feb42c6UL, + 0xd740c67bUL, 0x3e427ad2UL, 0x40000000UL, 0x3feb345fUL, 0xa3e0cceeUL, + 0xbe5c2fc4UL, 0x40000000UL, 0x3feb25fcUL, 0x8e752b50UL, 0xbe3da3c2UL, + 0xc0000000UL, 0x3feb179dUL, 0xa892e7deUL, 0x3e1fb481UL, 0xc0000000UL, + 0x3feb0943UL, 0x21ed71e9UL, 0xbe365206UL, 0x20000000UL, 0x3feafaeeUL, + 0x0e1380a3UL, 0x3e5c5b7bUL, 0x20000000UL, 0x3feaec9dUL, 0x3c3d640eUL, + 0xbe5dbbd0UL, 0x60000000UL, 0x3feade50UL, 0x8f97a715UL, 0x3e3a8ec5UL, + 0x20000000UL, 0x3fead008UL, 0x23ab2839UL, 0x3e2fe98aUL, 0x40000000UL, + 0x3feac1c4UL, 0xf4bbd50fUL, 0x3e54d8f6UL, 0xe0000000UL, 0x3feab384UL, + 0x14757c4dUL, 0xbe48774cUL, 0xc0000000UL, 0x3feaa549UL, 0x7c7b0eeaUL, + 0x3e5b51bbUL, 0x20000000UL, 0x3fea9713UL, 0xf56f7013UL, 0x3e386200UL, + 0xe0000000UL, 0x3fea88e0UL, 0xbe428ebeUL, 0xbe514af5UL, 0xe0000000UL, + 0x3fea7ab2UL, 0x8d0e4496UL, 0x3e4f9165UL, 0x60000000UL, 0x3fea6c89UL, + 0xdbacc5d5UL, 0xbe5c063bUL, 0x20000000UL, 0x3fea5e64UL, 0x3f19d970UL, + 0xbe5a0c8cUL, 0x20000000UL, 0x3fea5043UL, 0x09ea3e6bUL, 0x3e5065dcUL, + 0x80000000UL, 0x3fea4226UL, 0x78df246cUL, 0x3e5e05f6UL, 0x40000000UL, + 0x3fea340eUL, 0x4057d4a0UL, 0x3e431b2bUL, 0x40000000UL, 0x3fea25faUL, + 0x82867bb5UL, 0x3e4b76beUL, 0xa0000000UL, 0x3fea17eaUL, 0x9436f40aUL, + 0xbe5aad39UL, 0x20000000UL, 0x3fea09dfUL, 0x4b5253b3UL, 0x3e46380bUL, + 0x00000000UL, 0x3fe9fbd8UL, 0x8fc52466UL, 0xbe386f9bUL, 0x20000000UL, + 0x3fe9edd5UL, 0x22d3f344UL, 0xbe538347UL, 0x60000000UL, 0x3fe9dfd6UL, + 0x1ac33522UL, 0x3e5dbc53UL, 0x00000000UL, 0x3fe9d1dcUL, 0xeabdff1dUL, + 0x3e40fc0cUL, 0xe0000000UL, 0x3fe9c3e5UL, 0xafd30e73UL, 0xbe585e63UL, + 0xe0000000UL, 0x3fe9b5f3UL, 0xa52f226aUL, 0xbe43e8f9UL, 0x20000000UL, + 0x3fe9a806UL, 0xecb8698dUL, 0xbe515b36UL, 0x80000000UL, 0x3fe99a1cUL, + 0xf2b4e89dUL, 0x3e48b62bUL, 0x20000000UL, 0x3fe98c37UL, 0x7c9a88fbUL, + 0x3e44414cUL, 0x00000000UL, 0x3fe97e56UL, 0xda015741UL, 0xbe5d13baUL, + 0xe0000000UL, 0x3fe97078UL, 0x5fdace06UL, 0x3e51b947UL, 0x00000000UL, + 0x3fe962a0UL, 0x956ca094UL, 0x3e518785UL, 0x40000000UL, 0x3fe954cbUL, + 0x01164c1dUL, 0x3e5d5b57UL, 0xc0000000UL, 0x3fe946faUL, 0xe63b3767UL, + 0xbe4f84e7UL, 0x40000000UL, 0x3fe9392eUL, 0xe57cc2a9UL, 0x3e34eda3UL, + 0xe0000000UL, 0x3fe92b65UL, 0x8c75b544UL, 0x3e5766a0UL, 0xc0000000UL, + 0x3fe91da1UL, 0x37d1d087UL, 0xbe5e2ab1UL, 0x80000000UL, 0x3fe90fe1UL, + 0xa953dc20UL, 0x3e5fa1f3UL, 0x80000000UL, 0x3fe90225UL, 0xdbd3f369UL, + 0x3e47d6dbUL, 0xa0000000UL, 0x3fe8f46dUL, 0x1c9be989UL, 0xbe5e2b0aUL, + 0xa0000000UL, 0x3fe8e6b9UL, 0x3c93d76aUL, 0x3e5c8618UL, 0xe0000000UL, + 0x3fe8d909UL, 0x2182fc9aUL, 0xbe41aa9eUL, 0x20000000UL, 0x3fe8cb5eUL, + 0xe6b3539dUL, 0xbe530d19UL, 0x60000000UL, 0x3fe8bdb6UL, 0x49e58cc3UL, + 0xbe3bb374UL, 0xa0000000UL, 0x3fe8b012UL, 0xa7cfeb8fUL, 0x3e56c412UL, + 0x00000000UL, 0x3fe8a273UL, 0x8d52bc19UL, 0x3e1429b8UL, 0x60000000UL, + 0x3fe894d7UL, 0x4dc32c6cUL, 0xbe48604cUL, 0xc0000000UL, 0x3fe8873fUL, + 0x0c868e56UL, 0xbe564ee5UL, 0x00000000UL, 0x3fe879acUL, 0x56aee828UL, + 0x3e5e2fd8UL, 0x60000000UL, 0x3fe86c1cUL, 0x7ceab8ecUL, 0x3e493365UL, + 0xc0000000UL, 0x3fe85e90UL, 0x78d4dadcUL, 0xbe4f7f25UL, 0x00000000UL, + 0x3fe85109UL, 0x0ccd8280UL, 0x3e31e7a2UL, 0x40000000UL, 0x3fe84385UL, + 0x34ba4e15UL, 0x3e328077UL, 0x80000000UL, 0x3fe83605UL, 0xa670975aUL, + 0xbe53eee5UL, 0xa0000000UL, 0x3fe82889UL, 0xf61b77b2UL, 0xbe43a20aUL, + 0xa0000000UL, 0x3fe81b11UL, 0x13e6643bUL, 0x3e5e5fe5UL, 0xc0000000UL, + 0x3fe80d9dUL, 0x82cc94e8UL, 0xbe5ff1f9UL, 0xa0000000UL, 0x3fe8002dUL, + 0x8a0c9c5dUL, 0xbe42b0e7UL, 0x60000000UL, 0x3fe7f2c1UL, 0x22a16f01UL, + 0x3e5d9ea0UL, 0x20000000UL, 0x3fe7e559UL, 0xc38cd451UL, 0x3e506963UL, + 0xc0000000UL, 0x3fe7d7f4UL, 0x9902bc71UL, 0x3e4503d7UL, 0x40000000UL, + 0x3fe7ca94UL, 0xdef2a3c0UL, 0x3e3d98edUL, 0xa0000000UL, 0x3fe7bd37UL, + 0xed49abb0UL, 0x3e24c1ffUL, 0xe0000000UL, 0x3fe7afdeUL, 0xe3b0be70UL, + 0xbe40c467UL, 0x00000000UL, 0x3fe7a28aUL, 0xaf9f193cUL, 0xbe5dff6cUL, + 0xe0000000UL, 0x3fe79538UL, 0xb74cf6b6UL, 0xbe258ed0UL, 0xa0000000UL, + 0x3fe787ebUL, 0x1d9127c7UL, 0x3e345fb0UL, 0x40000000UL, 0x3fe77aa2UL, + 0x1028c21dUL, 0xbe4619bdUL, 0xa0000000UL, 0x3fe76d5cUL, 0x7cb0b5e4UL, + 0x3e40f1a2UL, 0xe0000000UL, 0x3fe7601aUL, 0x2b1bc4adUL, 0xbe32e8bbUL, + 0xe0000000UL, 0x3fe752dcUL, 0x6839f64eUL, 0x3e41f57bUL, 0xc0000000UL, + 0x3fe745a2UL, 0xc4121f7eUL, 0xbe52c40aUL, 0x60000000UL, 0x3fe7386cUL, + 0xd6852d72UL, 0xbe5c4e6bUL, 0xc0000000UL, 0x3fe72b39UL, 0x91d690f7UL, + 0xbe57f88fUL, 0xe0000000UL, 0x3fe71e0aUL, 0x627a2159UL, 0xbe4425d5UL, + 0xc0000000UL, 0x3fe710dfUL, 0x50a54033UL, 0x3e422b7eUL, 0x60000000UL, + 0x3fe703b8UL, 0x3b0b5f91UL, 0x3e5d3857UL, 0xe0000000UL, 0x3fe6f694UL, + 0x84d628a2UL, 0xbe51f090UL, 0x00000000UL, 0x3fe6e975UL, 0x306d8894UL, + 0xbe414d83UL, 0xe0000000UL, 0x3fe6dc58UL, 0x30bf24aaUL, 0xbe4650caUL, + 0x80000000UL, 0x3fe6cf40UL, 0xd4628d69UL, 0xbe5db007UL, 0xc0000000UL, + 0x3fe6c22bUL, 0xa2aae57bUL, 0xbe31d279UL, 0xc0000000UL, 0x3fe6b51aUL, + 0x860edf7eUL, 0xbe2d4c4aUL, 0x80000000UL, 0x3fe6a80dUL, 0xf3559341UL, + 0xbe5f7e98UL, 0xe0000000UL, 0x3fe69b03UL, 0xa885899eUL, 0xbe5c2011UL, + 0xe0000000UL, 0x3fe68dfdUL, 0x2bdc6d37UL, 0x3e224a82UL, 0xa0000000UL, + 0x3fe680fbUL, 0xc12ad1b9UL, 0xbe40cf56UL, 0x00000000UL, 0x3fe673fdUL, + 0x1bcdf659UL, 0xbdf52f2dUL, 0x00000000UL, 0x3fe66702UL, 0x5df10408UL, + 0x3e5663e0UL, 0xc0000000UL, 0x3fe65a0aUL, 0xa4070568UL, 0xbe40b12fUL, + 0x00000000UL, 0x3fe64d17UL, 0x71c54c47UL, 0x3e5f5e8bUL, 0x00000000UL, + 0x3fe64027UL, 0xbd4b7e83UL, 0x3e42ead6UL, 0xa0000000UL, 0x3fe6333aUL, + 0x61598bd2UL, 0xbe4c48d4UL, 0xc0000000UL, 0x3fe62651UL, 0x6f538d61UL, + 0x3e548401UL, 0xa0000000UL, 0x3fe6196cUL, 0x14344120UL, 0xbe529af6UL, + 0x00000000UL, 0x3fe60c8bUL, 0x5982c587UL, 0xbe3e1e4fUL, 0x00000000UL, + 0x3fe5ffadUL, 0xfe51d4eaUL, 0xbe4c897aUL, 0x80000000UL, 0x3fe5f2d2UL, + 0xfd46ebe1UL, 0x3e552e00UL, 0xa0000000UL, 0x3fe5e5fbUL, 0xa4695699UL, + 0x3e5ed471UL, 0x60000000UL, 0x3fe5d928UL, 0x80d118aeUL, 0x3e456b61UL, + 0xa0000000UL, 0x3fe5cc58UL, 0x304c330bUL, 0x3e54dc29UL, 0x80000000UL, + 0x3fe5bf8cUL, 0x0af2dedfUL, 0xbe3aa9bdUL, 0xe0000000UL, 0x3fe5b2c3UL, + 0x15fc9258UL, 0xbe479a37UL, 0xc0000000UL, 0x3fe5a5feUL, 0x9292c7eaUL, + 0x3e188650UL, 0x20000000UL, 0x3fe5993dUL, 0x33b4d380UL, 0x3e5d6d93UL, + 0x20000000UL, 0x3fe58c7fUL, 0x02fd16c7UL, 0x3e2fe961UL, 0xa0000000UL, + 0x3fe57fc4UL, 0x4a05edb6UL, 0xbe4d55b4UL, 0xa0000000UL, 0x3fe5730dUL, + 0x3d443abbUL, 0xbe5e6954UL, 0x00000000UL, 0x3fe5665aUL, 0x024acfeaUL, + 0x3e50e61bUL, 0x00000000UL, 0x3fe559aaUL, 0xcc9edd09UL, 0xbe325403UL, + 0x60000000UL, 0x3fe54cfdUL, 0x1fe26950UL, 0x3e5d500eUL, 0x60000000UL, + 0x3fe54054UL, 0x6c5ae164UL, 0xbe4a79b4UL, 0xc0000000UL, 0x3fe533aeUL, + 0x154b0287UL, 0xbe401571UL, 0xa0000000UL, 0x3fe5270cUL, 0x0673f401UL, + 0xbe56e56bUL, 0xe0000000UL, 0x3fe51a6dUL, 0x751b639cUL, 0x3e235269UL, + 0xa0000000UL, 0x3fe50dd2UL, 0x7c7b2bedUL, 0x3ddec887UL, 0xc0000000UL, + 0x3fe5013aUL, 0xafab4e17UL, 0x3e5e7575UL, 0x60000000UL, 0x3fe4f4a6UL, + 0x2e308668UL, 0x3e59aed6UL, 0x80000000UL, 0x3fe4e815UL, 0xf33e2a76UL, + 0xbe51f184UL, 0xe0000000UL, 0x3fe4db87UL, 0x839f3e3eUL, 0x3e57db01UL, + 0xc0000000UL, 0x3fe4cefdUL, 0xa9eda7bbUL, 0x3e535e0fUL, 0x00000000UL, + 0x3fe4c277UL, 0x2a8f66a5UL, 0x3e5ce451UL, 0xc0000000UL, 0x3fe4b5f3UL, + 0x05192456UL, 0xbe4e8518UL, 0xc0000000UL, 0x3fe4a973UL, 0x4aa7cd1dUL, + 0x3e46784aUL, 0x40000000UL, 0x3fe49cf7UL, 0x8e23025eUL, 0xbe5749f2UL, + 0x00000000UL, 0x3fe4907eUL, 0x18d30215UL, 0x3e360f39UL, 0x20000000UL, + 0x3fe48408UL, 0x63dcf2f3UL, 0x3e5e00feUL, 0xc0000000UL, 0x3fe47795UL, + 0x46182d09UL, 0xbe5173d9UL, 0xa0000000UL, 0x3fe46b26UL, 0x8f0e62aaUL, + 0xbe48f281UL, 0xe0000000UL, 0x3fe45ebaUL, 0x5775c40cUL, 0xbe56aad4UL, + 0x60000000UL, 0x3fe45252UL, 0x0fe25f69UL, 0x3e48bd71UL, 0x40000000UL, + 0x3fe445edUL, 0xe9989ec5UL, 0x3e590d97UL, 0x80000000UL, 0x3fe4398bUL, + 0xb3d9ffe3UL, 0x3e479dbcUL, 0x20000000UL, 0x3fe42d2dUL, 0x388e4d2eUL, + 0xbe5eed80UL, 0xe0000000UL, 0x3fe420d1UL, 0x6f797c18UL, 0x3e554b4cUL, + 0x20000000UL, 0x3fe4147aUL, 0x31048bb4UL, 0xbe5b1112UL, 0x80000000UL, + 0x3fe40825UL, 0x2efba4f9UL, 0x3e48ebc7UL, 0x40000000UL, 0x3fe3fbd4UL, + 0x50201119UL, 0x3e40b701UL, 0x40000000UL, 0x3fe3ef86UL, 0x0a4db32cUL, + 0x3e551de8UL, 0xa0000000UL, 0x3fe3e33bUL, 0x0c9c148bUL, 0xbe50c1f6UL, + 0x20000000UL, 0x3fe3d6f4UL, 0xc9129447UL, 0x3e533fa0UL, 0x00000000UL, + 0x3fe3cab0UL, 0xaae5b5a0UL, 0xbe22b68eUL, 0x20000000UL, 0x3fe3be6fUL, + 0x02305e8aUL, 0xbe54fc08UL, 0x60000000UL, 0x3fe3b231UL, 0x7f908258UL, + 0x3e57dc05UL, 0x00000000UL, 0x3fe3a5f7UL, 0x1a09af78UL, 0x3e08038bUL, + 0xe0000000UL, 0x3fe399bfUL, 0x490643c1UL, 0xbe5dbe42UL, 0xe0000000UL, + 0x3fe38d8bUL, 0x5e8ad724UL, 0xbe3c2b72UL, 0x20000000UL, 0x3fe3815bUL, + 0xc67196b6UL, 0x3e1713cfUL, 0xa0000000UL, 0x3fe3752dUL, 0x6182e429UL, + 0xbe3ec14cUL, 0x40000000UL, 0x3fe36903UL, 0xab6eb1aeUL, 0x3e5a2cc5UL, + 0x40000000UL, 0x3fe35cdcUL, 0xfe5dc064UL, 0xbe5c5878UL, 0x40000000UL, + 0x3fe350b8UL, 0x0ba6b9e4UL, 0x3e51619bUL, 0x80000000UL, 0x3fe34497UL, + 0x857761aaUL, 0x3e5fff53UL, 0x00000000UL, 0x3fe3387aUL, 0xf872d68cUL, + 0x3e484f4dUL, 0xa0000000UL, 0x3fe32c5fUL, 0x087e97c2UL, 0x3e52842eUL, + 0x80000000UL, 0x3fe32048UL, 0x73d6d0c0UL, 0xbe503edfUL, 0x80000000UL, + 0x3fe31434UL, 0x0c1456a1UL, 0xbe5f72adUL, 0xa0000000UL, 0x3fe30823UL, + 0x83a1a4d5UL, 0xbe5e65ccUL, 0xe0000000UL, 0x3fe2fc15UL, 0x855a7390UL, + 0xbe506438UL, 0x40000000UL, 0x3fe2f00bUL, 0xa2898287UL, 0x3e3d22a2UL, + 0xe0000000UL, 0x3fe2e403UL, 0x8b56f66fUL, 0xbe5aa5fdUL, 0x80000000UL, + 0x3fe2d7ffUL, 0x52db119aUL, 0x3e3a2e3dUL, 0x60000000UL, 0x3fe2cbfeUL, + 0xe2ddd4c0UL, 0xbe586469UL, 0x40000000UL, 0x3fe2c000UL, 0x6b01bf10UL, + 0x3e352b9dUL, 0x40000000UL, 0x3fe2b405UL, 0xb07a1cdfUL, 0x3e5c5cdaUL, + 0x80000000UL, 0x3fe2a80dUL, 0xc7b5f868UL, 0xbe5668b3UL, 0xc0000000UL, + 0x3fe29c18UL, 0x185edf62UL, 0xbe563d66UL, 0x00000000UL, 0x3fe29027UL, + 0xf729e1ccUL, 0x3e59a9a0UL, 0x80000000UL, 0x3fe28438UL, 0x6433c727UL, + 0xbe43cc89UL, 0x00000000UL, 0x3fe2784dUL, 0x41782631UL, 0xbe30750cUL, + 0xa0000000UL, 0x3fe26c64UL, 0x914911b7UL, 0xbe58290eUL, 0x40000000UL, + 0x3fe2607fUL, 0x3dcc73e1UL, 0xbe4269cdUL, 0x00000000UL, 0x3fe2549dUL, + 0x2751bf70UL, 0xbe5a6998UL, 0xc0000000UL, 0x3fe248bdUL, 0x4248b9fbUL, + 0xbe4ddb00UL, 0x80000000UL, 0x3fe23ce1UL, 0xf35cf82fUL, 0x3e561b71UL, + 0x60000000UL, 0x3fe23108UL, 0x8e481a2dUL, 0x3e518fb9UL, 0x60000000UL, + 0x3fe22532UL, 0x5ab96edcUL, 0xbe5fafc5UL, 0x40000000UL, 0x3fe2195fUL, + 0x80943911UL, 0xbe07f819UL, 0x40000000UL, 0x3fe20d8fUL, 0x386f2d6cUL, + 0xbe54ba8bUL, 0x40000000UL, 0x3fe201c2UL, 0xf29664acUL, 0xbe5eb815UL, + 0x20000000UL, 0x3fe1f5f8UL, 0x64f03390UL, 0x3e5e320cUL, 0x20000000UL, + 0x3fe1ea31UL, 0x747ff696UL, 0x3e5ef0a5UL, 0x40000000UL, 0x3fe1de6dUL, + 0x3e9ceb51UL, 0xbe5f8d27UL, 0x20000000UL, 0x3fe1d2acUL, 0x4ae0b55eUL, + 0x3e5faa21UL, 0x20000000UL, 0x3fe1c6eeUL, 0x28569a5eUL, 0x3e598a4fUL, + 0x20000000UL, 0x3fe1bb33UL, 0x54b33e07UL, 0x3e46130aUL, 0x20000000UL, + 0x3fe1af7bUL, 0x024f1078UL, 0xbe4dbf93UL, 0x00000000UL, 0x3fe1a3c6UL, + 0xb0783bfaUL, 0x3e419248UL, 0xe0000000UL, 0x3fe19813UL, 0x2f02b836UL, + 0x3e4e02b7UL, 0xc0000000UL, 0x3fe18c64UL, 0x28dec9d4UL, 0x3e09064fUL, + 0x80000000UL, 0x3fe180b8UL, 0x45cbf406UL, 0x3e5b1f46UL, 0x40000000UL, + 0x3fe1750fUL, 0x03d9964cUL, 0x3e5b0a79UL, 0x00000000UL, 0x3fe16969UL, + 0x8b5b882bUL, 0xbe238086UL, 0xa0000000UL, 0x3fe15dc5UL, 0x73bad6f8UL, + 0xbdf1fca4UL, 0x20000000UL, 0x3fe15225UL, 0x5385769cUL, 0x3e5e8d76UL, + 0xa0000000UL, 0x3fe14687UL, 0x1676dc6bUL, 0x3e571d08UL, 0x20000000UL, + 0x3fe13aedUL, 0xa8c41c7fUL, 0xbe598a25UL, 0x60000000UL, 0x3fe12f55UL, + 0xc4e1aaf0UL, 0x3e435277UL, 0xa0000000UL, 0x3fe123c0UL, 0x403638e1UL, + 0xbe21aa7cUL, 0xc0000000UL, 0x3fe1182eUL, 0x557a092bUL, 0xbdd0116bUL, + 0xc0000000UL, 0x3fe10c9fUL, 0x7d779f66UL, 0x3e4a61baUL, 0xc0000000UL, + 0x3fe10113UL, 0x2b09c645UL, 0xbe5d586eUL, 0x20000000UL, 0x3fe0ea04UL, + 0xea2cad46UL, 0x3e5aa97cUL, 0x20000000UL, 0x3fe0d300UL, 0x23190e54UL, + 0x3e50f1a7UL, 0xa0000000UL, 0x3fe0bc07UL, 0x1379a5a6UL, 0xbe51619dUL, + 0x60000000UL, 0x3fe0a51aUL, 0x926a3d4aUL, 0x3e5cf019UL, 0xa0000000UL, + 0x3fe08e38UL, 0xa8c24358UL, 0x3e35241eUL, 0x20000000UL, 0x3fe07762UL, + 0x24317e7aUL, 0x3e512cfaUL, 0x00000000UL, 0x3fe06097UL, 0xfd9cf274UL, + 0xbe55bef3UL, 0x00000000UL, 0x3fe049d7UL, 0x3689b49dUL, 0xbe36d26dUL, + 0x40000000UL, 0x3fe03322UL, 0xf72ef6c4UL, 0xbe54cd08UL, 0xa0000000UL, + 0x3fe01c78UL, 0x23702d2dUL, 0xbe5900bfUL, 0x00000000UL, 0x3fe005daUL, + 0x3f59c14cUL, 0x3e57d80bUL, 0x40000000UL, 0x3fdfde8dUL, 0xad67766dUL, + 0xbe57fad4UL, 0x40000000UL, 0x3fdfb17cUL, 0x644f4ae7UL, 0x3e1ee43bUL, + 0x40000000UL, 0x3fdf8481UL, 0x903234d2UL, 0x3e501a86UL, 0x40000000UL, + 0x3fdf579cUL, 0xafe9e509UL, 0xbe267c3eUL, 0x00000000UL, 0x3fdf2acdUL, + 0xb7dfda0bUL, 0xbe48149bUL, 0x40000000UL, 0x3fdefe13UL, 0x3b94305eUL, + 0x3e5f4ea7UL, 0x80000000UL, 0x3fded16fUL, 0x5d95da61UL, 0xbe55c198UL, + 0x00000000UL, 0x3fdea4e1UL, 0x406960c9UL, 0xbdd99a19UL, 0x00000000UL, + 0x3fde7868UL, 0xd22f3539UL, 0x3e470c78UL, 0x80000000UL, 0x3fde4c04UL, + 0x83eec535UL, 0xbe3e1232UL, 0x40000000UL, 0x3fde1fb6UL, 0x3dfbffcbUL, + 0xbe4b7d71UL, 0x40000000UL, 0x3fddf37dUL, 0x7e1be4e0UL, 0xbe5b8f8fUL, + 0x40000000UL, 0x3fddc759UL, 0x46dae887UL, 0xbe350458UL, 0x80000000UL, + 0x3fdd9b4aUL, 0xed6ecc49UL, 0xbe5f0045UL, 0x80000000UL, 0x3fdd6f50UL, + 0x2e9e883cUL, 0x3e2915daUL, 0x80000000UL, 0x3fdd436bUL, 0xf0bccb32UL, + 0x3e4a68c9UL, 0x80000000UL, 0x3fdd179bUL, 0x9bbfc779UL, 0xbe54a26aUL, + 0x00000000UL, 0x3fdcebe0UL, 0x7cea33abUL, 0x3e43c6b7UL, 0x40000000UL, + 0x3fdcc039UL, 0xe740fd06UL, 0x3e5526c2UL, 0x40000000UL, 0x3fdc94a7UL, + 0x9eadeb1aUL, 0xbe396d8dUL, 0xc0000000UL, 0x3fdc6929UL, 0xf0a8f95aUL, + 0xbe5c0ab2UL, 0x80000000UL, 0x3fdc3dc0UL, 0x6ee2693bUL, 0x3e0992e6UL, + 0xc0000000UL, 0x3fdc126bUL, 0x5ac6b581UL, 0xbe2834b6UL, 0x40000000UL, + 0x3fdbe72bUL, 0x8cc226ffUL, 0x3e3596a6UL, 0x00000000UL, 0x3fdbbbffUL, + 0xf92a74bbUL, 0x3e3c5813UL, 0x00000000UL, 0x3fdb90e7UL, 0x479664c0UL, + 0xbe50d644UL, 0x00000000UL, 0x3fdb65e3UL, 0x5004975bUL, 0xbe55258fUL, + 0x00000000UL, 0x3fdb3af3UL, 0xe4b23194UL, 0xbe588407UL, 0xc0000000UL, + 0x3fdb1016UL, 0xe65d4d0aUL, 0x3e527c26UL, 0x80000000UL, 0x3fdae54eUL, + 0x814fddd6UL, 0x3e5962a2UL, 0x40000000UL, 0x3fdaba9aUL, 0xe19d0913UL, + 0xbe562f4eUL, 0x80000000UL, 0x3fda8ff9UL, 0x43cfd006UL, 0xbe4cfdebUL, + 0x40000000UL, 0x3fda656cUL, 0x686f0a4eUL, 0x3e5e47a8UL, 0xc0000000UL, + 0x3fda3af2UL, 0x7200d410UL, 0x3e5e1199UL, 0xc0000000UL, 0x3fda108cUL, + 0xabd2266eUL, 0x3e5ee4d1UL, 0x40000000UL, 0x3fd9e63aUL, 0x396f8f2cUL, + 0x3e4dbffbUL, 0x00000000UL, 0x3fd9bbfbUL, 0xe32b25ddUL, 0x3e5c3a54UL, + 0x40000000UL, 0x3fd991cfUL, 0x431e4035UL, 0xbe457925UL, 0x80000000UL, + 0x3fd967b6UL, 0x7bed3dd3UL, 0x3e40c61dUL, 0x00000000UL, 0x3fd93db1UL, + 0xd7449365UL, 0x3e306419UL, 0x80000000UL, 0x3fd913beUL, 0x1746e791UL, + 0x3e56fcfcUL, 0x40000000UL, 0x3fd8e9dfUL, 0xf3a9028bUL, 0xbe5041b9UL, + 0xc0000000UL, 0x3fd8c012UL, 0x56840c50UL, 0xbe26e20aUL, 0x40000000UL, + 0x3fd89659UL, 0x19763102UL, 0xbe51f466UL, 0x80000000UL, 0x3fd86cb2UL, + 0x7032de7cUL, 0xbe4d298aUL, 0x80000000UL, 0x3fd8431eUL, 0xdeb39fabUL, + 0xbe4361ebUL, 0x40000000UL, 0x3fd8199dUL, 0x5d01cbe0UL, 0xbe5425b3UL, + 0x80000000UL, 0x3fd7f02eUL, 0x3ce99aa9UL, 0x3e146fa8UL, 0x80000000UL, + 0x3fd7c6d2UL, 0xd1a262b9UL, 0xbe5a1a69UL, 0xc0000000UL, 0x3fd79d88UL, + 0x8606c236UL, 0x3e423a08UL, 0x80000000UL, 0x3fd77451UL, 0x8fd1e1b7UL, + 0x3e5a6a63UL, 0xc0000000UL, 0x3fd74b2cUL, 0xe491456aUL, 0x3e42c1caUL, + 0x40000000UL, 0x3fd7221aUL, 0x4499a6d7UL, 0x3e36a69aUL, 0x00000000UL, + 0x3fd6f91aUL, 0x5237df94UL, 0xbe0f8f02UL, 0x00000000UL, 0x3fd6d02cUL, + 0xb6482c6eUL, 0xbe5abcf7UL, 0x00000000UL, 0x3fd6a750UL, 0x1919fd61UL, + 0xbe57ade2UL, 0x00000000UL, 0x3fd67e86UL, 0xaa7a994dUL, 0xbe3f3fbdUL, + 0x00000000UL, 0x3fd655ceUL, 0x67db014cUL, 0x3e33c550UL, 0x00000000UL, + 0x3fd62d28UL, 0xa82856b7UL, 0xbe1409d1UL, 0xc0000000UL, 0x3fd60493UL, + 0x1e6a300dUL, 0x3e55d899UL, 0x80000000UL, 0x3fd5dc11UL, 0x1222bd5cUL, + 0xbe35bfc0UL, 0xc0000000UL, 0x3fd5b3a0UL, 0x6e8dc2d3UL, 0x3e5d4d79UL, + 0x00000000UL, 0x3fd58b42UL, 0xe0e4ace6UL, 0xbe517303UL, 0x80000000UL, + 0x3fd562f4UL, 0xb306e0a8UL, 0x3e5edf0fUL, 0xc0000000UL, 0x3fd53ab8UL, + 0x6574bc54UL, 0x3e5ee859UL, 0x80000000UL, 0x3fd5128eUL, 0xea902207UL, + 0x3e5f6188UL, 0xc0000000UL, 0x3fd4ea75UL, 0x9f911d79UL, 0x3e511735UL, + 0x80000000UL, 0x3fd4c26eUL, 0xf9c77397UL, 0xbe5b1643UL, 0x40000000UL, + 0x3fd49a78UL, 0x15fc9258UL, 0x3e479a37UL, 0x80000000UL, 0x3fd47293UL, + 0xd5a04dd9UL, 0xbe426e56UL, 0xc0000000UL, 0x3fd44abfUL, 0xe04042f5UL, + 0x3e56f7c6UL, 0x40000000UL, 0x3fd422fdUL, 0x1d8bf2c8UL, 0x3e5d8810UL, + 0x00000000UL, 0x3fd3fb4cUL, 0x88a8ddeeUL, 0xbe311454UL, 0xc0000000UL, + 0x3fd3d3abUL, 0x3e3b5e47UL, 0xbe5d1b72UL, 0x40000000UL, 0x3fd3ac1cUL, + 0xc2ab5d59UL, 0x3e31b02bUL, 0xc0000000UL, 0x3fd3849dUL, 0xd4e34b9eUL, + 0x3e51cb2fUL, 0x40000000UL, 0x3fd35d30UL, 0x177204fbUL, 0xbe2b8cd7UL, + 0x80000000UL, 0x3fd335d3UL, 0xfcd38c82UL, 0xbe4356e1UL, 0x80000000UL, + 0x3fd30e87UL, 0x64f54accUL, 0xbe4e6224UL, 0x00000000UL, 0x3fd2e74cUL, + 0xaa7975d9UL, 0x3e5dc0feUL, 0x80000000UL, 0x3fd2c021UL, 0x516dab3fUL, + 0xbe50ffa3UL, 0x40000000UL, 0x3fd29907UL, 0x2bfb7313UL, 0x3e5674a2UL, + 0xc0000000UL, 0x3fd271fdUL, 0x0549fc99UL, 0x3e385d29UL, 0xc0000000UL, + 0x3fd24b04UL, 0x55b63073UL, 0xbe500c6dUL, 0x00000000UL, 0x3fd2241cUL, + 0x3f91953aUL, 0x3e389977UL, 0xc0000000UL, 0x3fd1fd43UL, 0xa1543f71UL, + 0xbe3487abUL, 0xc0000000UL, 0x3fd1d67bUL, 0x4ec8867cUL, 0x3df6a2dcUL, + 0x00000000UL, 0x3fd1afc4UL, 0x4328e3bbUL, 0x3e41d9c0UL, 0x80000000UL, + 0x3fd1891cUL, 0x2e1cda84UL, 0x3e3bdd87UL, 0x40000000UL, 0x3fd16285UL, + 0x4b5331aeUL, 0xbe53128eUL, 0x00000000UL, 0x3fd13bfeUL, 0xb9aec164UL, + 0xbe52ac98UL, 0xc0000000UL, 0x3fd11586UL, 0xd91e1316UL, 0xbe350630UL, + 0x80000000UL, 0x3fd0ef1fUL, 0x7cacc12cUL, 0x3e3f5219UL, 0x40000000UL, + 0x3fd0c8c8UL, 0xbce277b7UL, 0x3e3d30c0UL, 0x00000000UL, 0x3fd0a281UL, + 0x2a63447dUL, 0xbe541377UL, 0x80000000UL, 0x3fd07c49UL, 0xfac483b5UL, + 0xbe5772ecUL, 0xc0000000UL, 0x3fd05621UL, 0x36b8a570UL, 0xbe4fd4bdUL, + 0xc0000000UL, 0x3fd03009UL, 0xbae505f7UL, 0xbe450388UL, 0x80000000UL, + 0x3fd00a01UL, 0x3e35aeadUL, 0xbe5430fcUL, 0x80000000UL, 0x3fcfc811UL, + 0x707475acUL, 0x3e38806eUL, 0x80000000UL, 0x3fcf7c3fUL, 0xc91817fcUL, + 0xbe40cceaUL, 0x80000000UL, 0x3fcf308cUL, 0xae05d5e9UL, 0xbe4919b8UL, + 0x80000000UL, 0x3fcee4f8UL, 0xae6cc9e6UL, 0xbe530b94UL, 0x00000000UL, + 0x3fce9983UL, 0x1efe3e8eUL, 0x3e57747eUL, 0x00000000UL, 0x3fce4e2dUL, + 0xda78d9bfUL, 0xbe59a608UL, 0x00000000UL, 0x3fce02f5UL, 0x8abe2c2eUL, + 0x3e4a35adUL, 0x00000000UL, 0x3fcdb7dcUL, 0x1495450dUL, 0xbe0872ccUL, + 0x80000000UL, 0x3fcd6ce1UL, 0x86ee0ba0UL, 0xbe4f59a0UL, 0x00000000UL, + 0x3fcd2205UL, 0xe81ca888UL, 0x3e5402c3UL, 0x00000000UL, 0x3fccd747UL, + 0x3b4424b9UL, 0x3e5dfdc3UL, 0x80000000UL, 0x3fcc8ca7UL, 0xd305b56cUL, + 0x3e202da6UL, 0x00000000UL, 0x3fcc4226UL, 0x399a6910UL, 0xbe482a1cUL, + 0x80000000UL, 0x3fcbf7c2UL, 0x747f7938UL, 0xbe587372UL, 0x80000000UL, + 0x3fcbad7cUL, 0x6fc246a0UL, 0x3e50d83dUL, 0x00000000UL, 0x3fcb6355UL, + 0xee9e9be5UL, 0xbe5c35bdUL, 0x80000000UL, 0x3fcb194aUL, 0x8416c0bcUL, + 0x3e546d4fUL, 0x00000000UL, 0x3fcacf5eUL, 0x49f7f08fUL, 0x3e56da76UL, + 0x00000000UL, 0x3fca858fUL, 0x5dc30de2UL, 0x3e5f390cUL, 0x00000000UL, + 0x3fca3bdeUL, 0x950583b6UL, 0xbe5e4169UL, 0x80000000UL, 0x3fc9f249UL, + 0x33631553UL, 0x3e52aeb1UL, 0x00000000UL, 0x3fc9a8d3UL, 0xde8795a6UL, + 0xbe59a504UL, 0x00000000UL, 0x3fc95f79UL, 0x076bf41eUL, 0x3e5122feUL, + 0x80000000UL, 0x3fc9163cUL, 0x2914c8e7UL, 0x3e3dd064UL, 0x00000000UL, + 0x3fc8cd1dUL, 0x3a30eca3UL, 0xbe21b4aaUL, 0x80000000UL, 0x3fc8841aUL, + 0xb2a96650UL, 0xbe575444UL, 0x80000000UL, 0x3fc83b34UL, 0x2376c0cbUL, + 0xbe2a74c7UL, 0x80000000UL, 0x3fc7f26bUL, 0xd8a0b653UL, 0xbe5181b6UL, + 0x00000000UL, 0x3fc7a9bfUL, 0x32257882UL, 0xbe4a78b4UL, 0x00000000UL, + 0x3fc7612fUL, 0x1eee8bd9UL, 0xbe1bfe9dUL, 0x80000000UL, 0x3fc718bbUL, + 0x0c603cc4UL, 0x3e36fdc9UL, 0x80000000UL, 0x3fc6d064UL, 0x3728b8cfUL, + 0xbe1e542eUL, 0x80000000UL, 0x3fc68829UL, 0xc79a4067UL, 0x3e5c380fUL, + 0x00000000UL, 0x3fc6400bUL, 0xf69eac69UL, 0x3e550a84UL, 0x80000000UL, + 0x3fc5f808UL, 0xb7a780a4UL, 0x3e5d9224UL, 0x80000000UL, 0x3fc5b022UL, + 0xad9dfb1eUL, 0xbe55242fUL, 0x00000000UL, 0x3fc56858UL, 0x659b18beUL, + 0xbe4bfda3UL, 0x80000000UL, 0x3fc520a9UL, 0x66ee3631UL, 0xbe57d769UL, + 0x80000000UL, 0x3fc4d916UL, 0x1ec62819UL, 0x3e2427f7UL, 0x80000000UL, + 0x3fc4919fUL, 0xdec25369UL, 0xbe435431UL, 0x00000000UL, 0x3fc44a44UL, + 0xa8acfc4bUL, 0xbe3c62e8UL, 0x00000000UL, 0x3fc40304UL, 0xcf1d3eabUL, + 0xbdfba29fUL, 0x80000000UL, 0x3fc3bbdfUL, 0x79aba3eaUL, 0xbdf1b7c8UL, + 0x80000000UL, 0x3fc374d6UL, 0xb8d186daUL, 0xbe5130cfUL, 0x80000000UL, + 0x3fc32de8UL, 0x9d74f152UL, 0x3e2285b6UL, 0x00000000UL, 0x3fc2e716UL, + 0x50ae7ca9UL, 0xbe503920UL, 0x80000000UL, 0x3fc2a05eUL, 0x6caed92eUL, + 0xbe533924UL, 0x00000000UL, 0x3fc259c2UL, 0x9cb5034eUL, 0xbe510e31UL, + 0x80000000UL, 0x3fc21340UL, 0x12c4d378UL, 0xbe540b43UL, 0x80000000UL, + 0x3fc1ccd9UL, 0xcc418706UL, 0x3e59887aUL, 0x00000000UL, 0x3fc1868eUL, + 0x921f4106UL, 0xbe528e67UL, 0x80000000UL, 0x3fc1405cUL, 0x3969441eUL, + 0x3e5d8051UL, 0x00000000UL, 0x3fc0fa46UL, 0xd941ef5bUL, 0x3e5f9079UL, + 0x80000000UL, 0x3fc0b44aUL, 0x5a3e81b2UL, 0xbe567691UL, 0x00000000UL, + 0x3fc06e69UL, 0x9d66afe7UL, 0xbe4d43fbUL, 0x00000000UL, 0x3fc028a2UL, + 0x0a92a162UL, 0xbe52f394UL, 0x00000000UL, 0x3fbfc5eaUL, 0x209897e5UL, + 0x3e529e37UL, 0x00000000UL, 0x3fbf3ac5UL, 0x8458bd7bUL, 0x3e582831UL, + 0x00000000UL, 0x3fbeafd5UL, 0xb8d8b4b8UL, 0xbe486b4aUL, 0x00000000UL, + 0x3fbe2518UL, 0xe0a3b7b6UL, 0x3e5bafd2UL, 0x00000000UL, 0x3fbd9a90UL, + 0x2bf2710eUL, 0x3e383b2bUL, 0x00000000UL, 0x3fbd103cUL, 0x73eb6ab7UL, + 0xbe56d78dUL, 0x00000000UL, 0x3fbc861bUL, 0x32ceaff5UL, 0xbe32dc5aUL, + 0x00000000UL, 0x3fbbfc2eUL, 0xbee04cb7UL, 0xbe4a71a4UL, 0x00000000UL, + 0x3fbb7274UL, 0x35ae9577UL, 0x3e38142fUL, 0x00000000UL, 0x3fbae8eeUL, + 0xcbaddab4UL, 0xbe5490f0UL, 0x00000000UL, 0x3fba5f9aUL, 0x95ce1114UL, + 0x3e597c71UL, 0x00000000UL, 0x3fb9d67aUL, 0x6d7c0f78UL, 0x3e3abc2dUL, + 0x00000000UL, 0x3fb94d8dUL, 0x2841a782UL, 0xbe566cbcUL, 0x00000000UL, + 0x3fb8c4d2UL, 0x6ed429c6UL, 0xbe3cfff9UL, 0x00000000UL, 0x3fb83c4aUL, + 0xe4a49fbbUL, 0xbe552964UL, 0x00000000UL, 0x3fb7b3f4UL, 0x2193d81eUL, + 0xbe42fa72UL, 0x00000000UL, 0x3fb72bd0UL, 0xdd70c122UL, 0x3e527a8cUL, + 0x00000000UL, 0x3fb6a3dfUL, 0x03108a54UL, 0xbe450393UL, 0x00000000UL, + 0x3fb61c1fUL, 0x30ff7954UL, 0x3e565840UL, 0x00000000UL, 0x3fb59492UL, + 0xdedd460cUL, 0xbe5422b5UL, 0x00000000UL, 0x3fb50d36UL, 0x950f9f45UL, + 0xbe5313f6UL, 0x00000000UL, 0x3fb4860bUL, 0x582cdcb1UL, 0x3e506d39UL, + 0x00000000UL, 0x3fb3ff12UL, 0x7216d3a6UL, 0x3e4aa719UL, 0x00000000UL, + 0x3fb3784aUL, 0x57a423fdUL, 0x3e5a9b9fUL, 0x00000000UL, 0x3fb2f1b4UL, + 0x7a138b41UL, 0xbe50b418UL, 0x00000000UL, 0x3fb26b4eUL, 0x2fbfd7eaUL, + 0x3e23a53eUL, 0x00000000UL, 0x3fb1e519UL, 0x18913ccbUL, 0x3e465fc1UL, + 0x00000000UL, 0x3fb15f15UL, 0x7ea24e21UL, 0x3e042843UL, 0x00000000UL, + 0x3fb0d941UL, 0x7c6d9c77UL, 0x3e59f61eUL, 0x00000000UL, 0x3fb0539eUL, + 0x114efd44UL, 0x3e4ccab7UL, 0x00000000UL, 0x3faf9c56UL, 0x1777f657UL, + 0x3e552f65UL, 0x00000000UL, 0x3fae91d2UL, 0xc317b86aUL, 0xbe5a61e0UL, + 0x00000000UL, 0x3fad87acUL, 0xb7664efbUL, 0xbe41f64eUL, 0x00000000UL, + 0x3fac7de6UL, 0x5d3d03a9UL, 0x3e0807a0UL, 0x00000000UL, 0x3fab7480UL, + 0x743c38ebUL, 0xbe3726e1UL, 0x00000000UL, 0x3faa6b78UL, 0x06a253f1UL, + 0x3e5ad636UL, 0x00000000UL, 0x3fa962d0UL, 0xa35f541bUL, 0x3e5a187aUL, + 0x00000000UL, 0x3fa85a88UL, 0x4b86e446UL, 0xbe508150UL, 0x00000000UL, + 0x3fa7529cUL, 0x2589cacfUL, 0x3e52938aUL, 0x00000000UL, 0x3fa64b10UL, + 0xaf6b11f2UL, 0xbe3454cdUL, 0x00000000UL, 0x3fa543e2UL, 0x97506fefUL, + 0xbe5fdec5UL, 0x00000000UL, 0x3fa43d10UL, 0xe75f7dd9UL, 0xbe388dd3UL, + 0x00000000UL, 0x3fa3369cUL, 0xa4139632UL, 0xbdea5177UL, 0x00000000UL, + 0x3fa23086UL, 0x352d6f1eUL, 0xbe565ad6UL, 0x00000000UL, 0x3fa12accUL, + 0x77449eb7UL, 0xbe50d5c7UL, 0x00000000UL, 0x3fa0256eUL, 0x7478da78UL, + 0x3e404724UL, 0x00000000UL, 0x3f9e40dcUL, 0xf59cef7fUL, 0xbe539d0aUL, + 0x00000000UL, 0x3f9c3790UL, 0x1511d43cUL, 0x3e53c2c8UL, 0x00000000UL, + 0x3f9a2f00UL, 0x9b8bff3cUL, 0xbe43b3e1UL, 0x00000000UL, 0x3f982724UL, + 0xad1e22a5UL, 0x3e46f0bdUL, 0x00000000UL, 0x3f962000UL, 0x130d9356UL, + 0x3e475ba0UL, 0x00000000UL, 0x3f941994UL, 0x8f86f883UL, 0xbe513d0bUL, + 0x00000000UL, 0x3f9213dcUL, 0x914d0dc8UL, 0xbe534335UL, 0x00000000UL, + 0x3f900ed8UL, 0x2d73e5e7UL, 0xbe22ba75UL, 0x00000000UL, 0x3f8c1510UL, + 0xc5b7d70eUL, 0x3e599c5dUL, 0x00000000UL, 0x3f880de0UL, 0x8a27857eUL, + 0xbe3d28c8UL, 0x00000000UL, 0x3f840810UL, 0xda767328UL, 0x3e531b3dUL, + 0x00000000UL, 0x3f8003b0UL, 0x77bacaf3UL, 0xbe5f04e3UL, 0x00000000UL, + 0x3f780150UL, 0xdf4b0720UL, 0x3e5a8bffUL, 0x00000000UL, 0x3f6ffc40UL, + 0x34c48e71UL, 0xbe3fcd99UL, 0x00000000UL, 0x3f5ff6c0UL, 0x1ad218afUL, + 0xbe4c78a7UL, 0x00000000UL, 0x00000000UL, 0x00000000UL, 0x80000000UL, + 0x00000000UL, 0xfffff800UL, 0x00000000UL, 0xfffff800UL, 0x00000000UL, + 0x3ff72000UL, 0x161bb241UL, 0xbf5dabe1UL, 0x6dc96112UL, 0xbf836578UL, + 0xee241472UL, 0xbf9b0301UL, 0x9f95985aUL, 0xbfb528dbUL, 0xb3841d2aUL, + 0xbfd619b6UL, 0x518775e3UL, 0x3f9004f2UL, 0xac8349bbUL, 0x3fa76c9bUL, + 0x486ececcUL, 0x3fc4635eUL, 0x161bb241UL, 0xbf5dabe1UL, 0x9f95985aUL, + 0xbfb528dbUL, 0xf8b5787dUL, 0x3ef2531eUL, 0x486ececbUL, 0x3fc4635eUL, + 0x412055ccUL, 0xbdd61bb2UL, 0x00000000UL, 0xfffffff8UL, 0x00000000UL, + 0xffffffffUL, 0x00000000UL, 0x3ff00000UL, 0x00000000UL, 0x3b700000UL, + 0xfa5abcbfUL, 0x3ff00b1aUL, 0xa7609f71UL, 0xbc84f6b2UL, 0xa9fb3335UL, + 0x3ff0163dUL, 0x9ab8cdb7UL, 0x3c9b6129UL, 0x143b0281UL, 0x3ff02168UL, + 0x0fc54eb6UL, 0xbc82bf31UL, 0x3e778061UL, 0x3ff02c9aUL, 0x535b085dUL, + 0xbc719083UL, 0x2e11bbccUL, 0x3ff037d4UL, 0xeeade11aUL, 0x3c656811UL, + 0xe86e7f85UL, 0x3ff04315UL, 0x1977c96eUL, 0xbc90a31cUL, 0x72f654b1UL, + 0x3ff04e5fUL, 0x3aa0d08cUL, 0x3c84c379UL, 0xd3158574UL, 0x3ff059b0UL, + 0xa475b465UL, 0x3c8d73e2UL, 0x0e3c1f89UL, 0x3ff0650aUL, 0x5799c397UL, + 0xbc95cb7bUL, 0x29ddf6deUL, 0x3ff0706bUL, 0xe2b13c27UL, 0xbc8c91dfUL, + 0x2b72a836UL, 0x3ff07bd4UL, 0x54458700UL, 0x3c832334UL, 0x18759bc8UL, + 0x3ff08745UL, 0x4bb284ffUL, 0x3c6186beUL, 0xf66607e0UL, 0x3ff092bdUL, + 0x800a3fd1UL, 0xbc968063UL, 0xcac6f383UL, 0x3ff09e3eUL, 0x18316136UL, + 0x3c914878UL, 0x9b1f3919UL, 0x3ff0a9c7UL, 0x873d1d38UL, 0x3c85d16cUL, + 0x6cf9890fUL, 0x3ff0b558UL, 0x4adc610bUL, 0x3c98a62eUL, 0x45e46c85UL, + 0x3ff0c0f1UL, 0x06d21cefUL, 0x3c94f989UL, 0x2b7247f7UL, 0x3ff0cc92UL, + 0x16e24f71UL, 0x3c901edcUL, 0x23395decUL, 0x3ff0d83bUL, 0xe43f316aUL, + 0xbc9bc14dUL, 0x32d3d1a2UL, 0x3ff0e3ecUL, 0x27c57b52UL, 0x3c403a17UL, + 0x5fdfa9c5UL, 0x3ff0efa5UL, 0xbc54021bUL, 0xbc949db9UL, 0xaffed31bUL, + 0x3ff0fb66UL, 0xc44ebd7bUL, 0xbc6b9bedUL, 0x28d7233eUL, 0x3ff10730UL, + 0x1692fdd5UL, 0x3c8d46ebUL, 0xd0125b51UL, 0x3ff11301UL, 0x39449b3aUL, + 0xbc96c510UL, 0xab5e2ab6UL, 0x3ff11edbUL, 0xf703fb72UL, 0xbc9ca454UL, + 0xc06c31ccUL, 0x3ff12abdUL, 0xb36ca5c7UL, 0xbc51b514UL, 0x14f204abUL, + 0x3ff136a8UL, 0xba48dcf0UL, 0xbc67108fUL, 0xaea92de0UL, 0x3ff1429aUL, + 0x9af1369eUL, 0xbc932fbfUL, 0x934f312eUL, 0x3ff14e95UL, 0x39bf44abUL, + 0xbc8b91e8UL, 0xc8a58e51UL, 0x3ff15a98UL, 0xb9eeab0aUL, 0x3c82406aUL, + 0x5471c3c2UL, 0x3ff166a4UL, 0x82ea1a32UL, 0x3c58f23bUL, 0x3c7d517bUL, + 0x3ff172b8UL, 0xb9d78a76UL, 0xbc819041UL, 0x8695bbc0UL, 0x3ff17ed4UL, + 0xe2ac5a64UL, 0x3c709e3fUL, 0x388c8deaUL, 0x3ff18af9UL, 0xd1970f6cUL, + 0xbc911023UL, 0x58375d2fUL, 0x3ff19726UL, 0x85f17e08UL, 0x3c94aaddUL, + 0xeb6fcb75UL, 0x3ff1a35bUL, 0x7b4968e4UL, 0x3c8e5b4cUL, 0xf8138a1cUL, + 0x3ff1af99UL, 0xa4b69280UL, 0x3c97bf85UL, 0x84045cd4UL, 0x3ff1bbe0UL, + 0x352ef607UL, 0xbc995386UL, 0x95281c6bUL, 0x3ff1c82fUL, 0x8010f8c9UL, + 0x3c900977UL, 0x3168b9aaUL, 0x3ff1d487UL, 0x00a2643cUL, 0x3c9e016eUL, + 0x5eb44027UL, 0x3ff1e0e7UL, 0x088cb6deUL, 0xbc96fdd8UL, 0x22fcd91dUL, + 0x3ff1ed50UL, 0x027bb78cUL, 0xbc91df98UL, 0x8438ce4dUL, 0x3ff1f9c1UL, + 0xa097af5cUL, 0xbc9bf524UL, 0x88628cd6UL, 0x3ff2063bUL, 0x814a8495UL, + 0x3c8dc775UL, 0x3578a819UL, 0x3ff212beUL, 0x2cfcaac9UL, 0x3c93592dUL, + 0x917ddc96UL, 0x3ff21f49UL, 0x9494a5eeUL, 0x3c82a97eUL, 0xa27912d1UL, + 0x3ff22bddUL, 0x5577d69fUL, 0x3c8d34fbUL, 0x6e756238UL, 0x3ff2387aUL, + 0xb6c70573UL, 0x3c99b07eUL, 0xfb82140aUL, 0x3ff2451fUL, 0x911ca996UL, + 0x3c8acfccUL, 0x4fb2a63fUL, 0x3ff251ceUL, 0xbef4f4a4UL, 0x3c8ac155UL, + 0x711ece75UL, 0x3ff25e85UL, 0x4ac31b2cUL, 0x3c93e1a2UL, 0x65e27cddUL, + 0x3ff26b45UL, 0x9940e9d9UL, 0x3c82bd33UL, 0x341ddf29UL, 0x3ff2780eUL, + 0x05f9e76cUL, 0x3c9e067cUL, 0xe1f56381UL, 0x3ff284dfUL, 0x8c3f0d7eUL, + 0xbc9a4c3aUL, 0x7591bb70UL, 0x3ff291baUL, 0x28401cbdUL, 0xbc82cc72UL, + 0xf51fdee1UL, 0x3ff29e9dUL, 0xafad1255UL, 0x3c8612e8UL, 0x66d10f13UL, + 0x3ff2ab8aUL, 0x191690a7UL, 0xbc995743UL, 0xd0dad990UL, 0x3ff2b87fUL, + 0xd6381aa4UL, 0xbc410adcUL, 0x39771b2fUL, 0x3ff2c57eUL, 0xa6eb5124UL, + 0xbc950145UL, 0xa6e4030bUL, 0x3ff2d285UL, 0x54db41d5UL, 0x3c900247UL, + 0x1f641589UL, 0x3ff2df96UL, 0xfbbce198UL, 0x3c9d16cfUL, 0xa93e2f56UL, + 0x3ff2ecafUL, 0x45d52383UL, 0x3c71ca0fUL, 0x4abd886bUL, 0x3ff2f9d2UL, + 0x532bda93UL, 0xbc653c55UL, 0x0a31b715UL, 0x3ff306feUL, 0xd23182e4UL, + 0x3c86f46aUL, 0xedeeb2fdUL, 0x3ff31432UL, 0xf3f3fcd1UL, 0x3c8959a3UL, + 0xfc4cd831UL, 0x3ff32170UL, 0x8e18047cUL, 0x3c8a9ce7UL, 0x3ba8ea32UL, + 0x3ff32eb8UL, 0x3cb4f318UL, 0xbc9c45e8UL, 0xb26416ffUL, 0x3ff33c08UL, + 0x843659a6UL, 0x3c932721UL, 0x66e3fa2dUL, 0x3ff34962UL, 0x930881a4UL, + 0xbc835a75UL, 0x5f929ff1UL, 0x3ff356c5UL, 0x5c4e4628UL, 0xbc8b5ceeUL, + 0xa2de883bUL, 0x3ff36431UL, 0xa06cb85eUL, 0xbc8c3144UL, 0x373aa9cbUL, + 0x3ff371a7UL, 0xbf42eae2UL, 0xbc963aeaUL, 0x231e754aUL, 0x3ff37f26UL, + 0x9eceb23cUL, 0xbc99f5caUL, 0x6d05d866UL, 0x3ff38caeUL, 0x3c9904bdUL, + 0xbc9e958dUL, 0x1b7140efUL, 0x3ff39a40UL, 0xfc8e2934UL, 0xbc99a9a5UL, + 0x34e59ff7UL, 0x3ff3a7dbUL, 0xd661f5e3UL, 0xbc75e436UL, 0xbfec6cf4UL, + 0x3ff3b57fUL, 0xe26fff18UL, 0x3c954c66UL, 0xc313a8e5UL, 0x3ff3c32dUL, + 0x375d29c3UL, 0xbc9efff8UL, 0x44ede173UL, 0x3ff3d0e5UL, 0x8c284c71UL, + 0x3c7fe8d0UL, 0x4c123422UL, 0x3ff3dea6UL, 0x11f09ebcUL, 0x3c8ada09UL, + 0xdf1c5175UL, 0x3ff3ec70UL, 0x7b8c9bcaUL, 0xbc8af663UL, 0x04ac801cUL, + 0x3ff3fa45UL, 0xf956f9f3UL, 0xbc97d023UL, 0xc367a024UL, 0x3ff40822UL, + 0xb6f4d048UL, 0x3c8bddf8UL, 0x21f72e2aUL, 0x3ff4160aUL, 0x1c309278UL, + 0xbc5ef369UL, 0x2709468aUL, 0x3ff423fbUL, 0xc0b314ddUL, 0xbc98462dUL, + 0xd950a897UL, 0x3ff431f5UL, 0xe35f7999UL, 0xbc81c7ddUL, 0x3f84b9d4UL, + 0x3ff43ffaUL, 0x9704c003UL, 0x3c8880beUL, 0x6061892dUL, 0x3ff44e08UL, + 0x04ef80d0UL, 0x3c489b7aUL, 0x42a7d232UL, 0x3ff45c20UL, 0x82fb1f8eUL, + 0xbc686419UL, 0xed1d0057UL, 0x3ff46a41UL, 0xd1648a76UL, 0x3c9c944bUL, + 0x668b3237UL, 0x3ff4786dUL, 0xed445733UL, 0xbc9c20f0UL, 0xb5c13cd0UL, + 0x3ff486a2UL, 0xb69062f0UL, 0x3c73c1a3UL, 0xe192aed2UL, 0x3ff494e1UL, + 0x5e499ea0UL, 0xbc83b289UL, 0xf0d7d3deUL, 0x3ff4a32aUL, 0xf3d1be56UL, + 0x3c99cb62UL, 0xea6db7d7UL, 0x3ff4b17dUL, 0x7f2897f0UL, 0xbc8125b8UL, + 0xd5362a27UL, 0x3ff4bfdaUL, 0xafec42e2UL, 0x3c7d4397UL, 0xb817c114UL, + 0x3ff4ce41UL, 0x690abd5dUL, 0x3c905e29UL, 0x99fddd0dUL, 0x3ff4dcb2UL, + 0xbc6a7833UL, 0x3c98ecdbUL, 0x81d8abffUL, 0x3ff4eb2dUL, 0x2e5d7a52UL, + 0xbc95257dUL, 0x769d2ca7UL, 0x3ff4f9b2UL, 0xd25957e3UL, 0xbc94b309UL, + 0x7f4531eeUL, 0x3ff50841UL, 0x49b7465fUL, 0x3c7a249bUL, 0xa2cf6642UL, + 0x3ff516daUL, 0x69bd93efUL, 0xbc8f7685UL, 0xe83f4eefUL, 0x3ff5257dUL, + 0x43efef71UL, 0xbc7c998dUL, 0x569d4f82UL, 0x3ff5342bUL, 0x1db13cadUL, + 0xbc807abeUL, 0xf4f6ad27UL, 0x3ff542e2UL, 0x192d5f7eUL, 0x3c87926dUL, + 0xca5d920fUL, 0x3ff551a4UL, 0xefede59bUL, 0xbc8d689cUL, 0xdde910d2UL, + 0x3ff56070UL, 0x168eebf0UL, 0xbc90fb6eUL, 0x36b527daUL, 0x3ff56f47UL, + 0x011d93adUL, 0x3c99bb2cUL, 0xdbe2c4cfUL, 0x3ff57e27UL, 0x8a57b9c4UL, + 0xbc90b98cUL, 0xd497c7fdUL, 0x3ff58d12UL, 0x5b9a1de8UL, 0x3c8295e1UL, + 0x27ff07ccUL, 0x3ff59c08UL, 0xe467e60fUL, 0xbc97e2ceUL, 0xdd485429UL, + 0x3ff5ab07UL, 0x054647adUL, 0x3c96324cUL, 0xfba87a03UL, 0x3ff5ba11UL, + 0x4c233e1aUL, 0xbc9b77a1UL, 0x8a5946b7UL, 0x3ff5c926UL, 0x816986a2UL, + 0x3c3c4b1bUL, 0x90998b93UL, 0x3ff5d845UL, 0xa8b45643UL, 0xbc9cd6a7UL, + 0x15ad2148UL, 0x3ff5e76fUL, 0x3080e65eUL, 0x3c9ba6f9UL, 0x20dceb71UL, + 0x3ff5f6a3UL, 0xe3cdcf92UL, 0xbc89eaddUL, 0xb976dc09UL, 0x3ff605e1UL, + 0x9b56de47UL, 0xbc93e242UL, 0xe6cdf6f4UL, 0x3ff6152aUL, 0x4ab84c27UL, + 0x3c9e4b3eUL, 0xb03a5585UL, 0x3ff6247eUL, 0x7e40b497UL, 0xbc9383c1UL, + 0x1d1929fdUL, 0x3ff633ddUL, 0xbeb964e5UL, 0x3c984710UL, 0x34ccc320UL, + 0x3ff64346UL, 0x759d8933UL, 0xbc8c483cUL, 0xfebc8fb7UL, 0x3ff652b9UL, + 0xc9a73e09UL, 0xbc9ae3d5UL, 0x82552225UL, 0x3ff66238UL, 0x87591c34UL, + 0xbc9bb609UL, 0xc70833f6UL, 0x3ff671c1UL, 0x586c6134UL, 0xbc8e8732UL, + 0xd44ca973UL, 0x3ff68155UL, 0x44f73e65UL, 0x3c6038aeUL, 0xb19e9538UL, + 0x3ff690f4UL, 0x9aeb445dUL, 0x3c8804bdUL, 0x667f3bcdUL, 0x3ff6a09eUL, + 0x13b26456UL, 0xbc9bdd34UL, 0xfa75173eUL, 0x3ff6b052UL, 0x2c9a9d0eUL, + 0x3c7a38f5UL, 0x750bdabfUL, 0x3ff6c012UL, 0x67ff0b0dUL, 0xbc728956UL, + 0xddd47645UL, 0x3ff6cfdcUL, 0xb6f17309UL, 0x3c9c7aa9UL, 0x3c651a2fUL, + 0x3ff6dfb2UL, 0x683c88abUL, 0xbc6bbe3aUL, 0x98593ae5UL, 0x3ff6ef92UL, + 0x9e1ac8b2UL, 0xbc90b974UL, 0xf9519484UL, 0x3ff6ff7dUL, 0x25860ef6UL, + 0xbc883c0fUL, 0x66f42e87UL, 0x3ff70f74UL, 0xd45aa65fUL, 0x3c59d644UL, + 0xe8ec5f74UL, 0x3ff71f75UL, 0x86887a99UL, 0xbc816e47UL, 0x86ead08aUL, + 0x3ff72f82UL, 0x2cd62c72UL, 0xbc920aa0UL, 0x48a58174UL, 0x3ff73f9aUL, + 0x6c65d53cUL, 0xbc90a8d9UL, 0x35d7cbfdUL, 0x3ff74fbdUL, 0x618a6e1cUL, + 0x3c9047fdUL, 0x564267c9UL, 0x3ff75febUL, 0x57316dd3UL, 0xbc902459UL, + 0xb1ab6e09UL, 0x3ff77024UL, 0x169147f8UL, 0x3c9b7877UL, 0x4fde5d3fUL, + 0x3ff78069UL, 0x0a02162dUL, 0x3c9866b8UL, 0x38ac1cf6UL, 0x3ff790b9UL, + 0x62aadd3eUL, 0x3c9349a8UL, 0x73eb0187UL, 0x3ff7a114UL, 0xee04992fUL, + 0xbc841577UL, 0x0976cfdbUL, 0x3ff7b17bUL, 0x8468dc88UL, 0xbc9bebb5UL, + 0x0130c132UL, 0x3ff7c1edUL, 0xd1164dd6UL, 0x3c9f124cUL, 0x62ff86f0UL, + 0x3ff7d26aUL, 0xfb72b8b4UL, 0x3c91bddbUL, 0x36cf4e62UL, 0x3ff7e2f3UL, + 0xba15797eUL, 0x3c705d02UL, 0x8491c491UL, 0x3ff7f387UL, 0xcf9311aeUL, + 0xbc807f11UL, 0x543e1a12UL, 0x3ff80427UL, 0x626d972bUL, 0xbc927c86UL, + 0xadd106d9UL, 0x3ff814d2UL, 0x0d151d4dUL, 0x3c946437UL, 0x994cce13UL, + 0x3ff82589UL, 0xd41532d8UL, 0xbc9d4c1dUL, 0x1eb941f7UL, 0x3ff8364cUL, + 0x31df2bd5UL, 0x3c999b9aUL, 0x4623c7adUL, 0x3ff8471aUL, 0xa341cdfbUL, + 0xbc88d684UL, 0x179f5b21UL, 0x3ff857f4UL, 0xf8b216d0UL, 0xbc5ba748UL, + 0x9b4492edUL, 0x3ff868d9UL, 0x9bd4f6baUL, 0xbc9fc6f8UL, 0xd931a436UL, + 0x3ff879caUL, 0xd2db47bdUL, 0x3c85d2d7UL, 0xd98a6699UL, 0x3ff88ac7UL, + 0xf37cb53aUL, 0x3c9994c2UL, 0xa478580fUL, 0x3ff89bd0UL, 0x4475202aUL, + 0x3c9d5395UL, 0x422aa0dbUL, 0x3ff8ace5UL, 0x56864b27UL, 0x3c96e9f1UL, + 0xbad61778UL, 0x3ff8be05UL, 0xfc43446eUL, 0x3c9ecb5eUL, 0x16b5448cUL, + 0x3ff8cf32UL, 0x32e9e3aaUL, 0xbc70d55eUL, 0x5e0866d9UL, 0x3ff8e06aUL, + 0x6fc9b2e6UL, 0xbc97114aUL, 0x99157736UL, 0x3ff8f1aeUL, 0xa2e3976cUL, + 0x3c85cc13UL, 0xd0282c8aUL, 0x3ff902feUL, 0x85fe3fd2UL, 0x3c9592caUL, + 0x0b91ffc6UL, 0x3ff9145bUL, 0x2e582524UL, 0xbc9dd679UL, 0x53aa2fe2UL, + 0x3ff925c3UL, 0xa639db7fUL, 0xbc83455fUL, 0xb0cdc5e5UL, 0x3ff93737UL, + 0x81b57ebcUL, 0xbc675fc7UL, 0x2b5f98e5UL, 0x3ff948b8UL, 0x797d2d99UL, + 0xbc8dc3d6UL, 0xcbc8520fUL, 0x3ff95a44UL, 0x96a5f039UL, 0xbc764b7cUL, + 0x9a7670b3UL, 0x3ff96bddUL, 0x7f19c896UL, 0xbc5ba596UL, 0x9fde4e50UL, + 0x3ff97d82UL, 0x7c1b85d1UL, 0xbc9d185bUL, 0xe47a22a2UL, 0x3ff98f33UL, + 0xa24c78ecUL, 0x3c7cabdaUL, 0x70ca07baUL, 0x3ff9a0f1UL, 0x91cee632UL, + 0xbc9173bdUL, 0x4d53fe0dUL, 0x3ff9b2bbUL, 0x4df6d518UL, 0xbc9dd84eUL, + 0x82a3f090UL, 0x3ff9c491UL, 0xb071f2beUL, 0x3c7c7c46UL, 0x194bb8d5UL, + 0x3ff9d674UL, 0xa3dd8233UL, 0xbc9516beUL, 0x19e32323UL, 0x3ff9e863UL, + 0x78e64c6eUL, 0x3c7824caUL, 0x8d07f29eUL, 0x3ff9fa5eUL, 0xaaf1faceUL, + 0xbc84a9ceUL, 0x7b5de565UL, 0x3ffa0c66UL, 0x5d1cd533UL, 0xbc935949UL, + 0xed8eb8bbUL, 0x3ffa1e7aUL, 0xee8be70eUL, 0x3c9c6618UL, 0xec4a2d33UL, + 0x3ffa309bUL, 0x7ddc36abUL, 0x3c96305cUL, 0x80460ad8UL, 0x3ffa42c9UL, + 0x589fb120UL, 0xbc9aa780UL, 0xb23e255dUL, 0x3ffa5503UL, 0xdb8d41e1UL, + 0xbc9d2f6eUL, 0x8af46052UL, 0x3ffa674aUL, 0x30670366UL, 0x3c650f56UL, + 0x1330b358UL, 0x3ffa799eUL, 0xcac563c7UL, 0x3c9bcb7eUL, 0x53c12e59UL, + 0x3ffa8bfeUL, 0xb2ba15a9UL, 0xbc94f867UL, 0x5579fdbfUL, 0x3ffa9e6bUL, + 0x0ef7fd31UL, 0x3c90fac9UL, 0x21356ebaUL, 0x3ffab0e5UL, 0xdae94545UL, + 0x3c889c31UL, 0xbfd3f37aUL, 0x3ffac36bUL, 0xcae76cd0UL, 0xbc8f9234UL, + 0x3a3c2774UL, 0x3ffad5ffUL, 0xb6b1b8e5UL, 0x3c97ef3bUL, 0x995ad3adUL, + 0x3ffae89fUL, 0x345dcc81UL, 0x3c97a1cdUL, 0xe622f2ffUL, 0x3ffafb4cUL, + 0x0f315ecdUL, 0xbc94b2fcUL, 0x298db666UL, 0x3ffb0e07UL, 0x4c80e425UL, + 0xbc9bdef5UL, 0x6c9a8952UL, 0x3ffb20ceUL, 0x4a0756ccUL, 0x3c94dd02UL, + 0xb84f15fbUL, 0x3ffb33a2UL, 0x3084d708UL, 0xbc62805eUL, 0x15b749b1UL, + 0x3ffb4684UL, 0xe9df7c90UL, 0xbc7f763dUL, 0x8de5593aUL, 0x3ffb5972UL, + 0xbbba6de3UL, 0xbc9c71dfUL, 0x29f1c52aUL, 0x3ffb6c6eUL, 0x52883f6eUL, + 0x3c92a8f3UL, 0xf2fb5e47UL, 0x3ffb7f76UL, 0x7e54ac3bUL, 0xbc75584fUL, + 0xf22749e4UL, 0x3ffb928cUL, 0x54cb65c6UL, 0xbc9b7216UL, 0x30a1064aUL, + 0x3ffba5b0UL, 0x0e54292eUL, 0xbc9efcd3UL, 0xb79a6f1fUL, 0x3ffbb8e0UL, + 0xc9696205UL, 0xbc3f52d1UL, 0x904bc1d2UL, 0x3ffbcc1eUL, 0x7a2d9e84UL, + 0x3c823dd0UL, 0xc3f3a207UL, 0x3ffbdf69UL, 0x60ea5b53UL, 0xbc3c2623UL, + 0x5bd71e09UL, 0x3ffbf2c2UL, 0x3f6b9c73UL, 0xbc9efdcaUL, 0x6141b33dUL, + 0x3ffc0628UL, 0xa1fbca34UL, 0xbc8d8a5aUL, 0xdd85529cUL, 0x3ffc199bUL, + 0x895048ddUL, 0x3c811065UL, 0xd9fa652cUL, 0x3ffc2d1cUL, 0x17c8a5d7UL, + 0xbc96e516UL, 0x5fffd07aUL, 0x3ffc40abUL, 0xe083c60aUL, 0x3c9b4537UL, + 0x78fafb22UL, 0x3ffc5447UL, 0x2493b5afUL, 0x3c912f07UL, 0x2e57d14bUL, + 0x3ffc67f1UL, 0xff483cadUL, 0x3c92884dUL, 0x8988c933UL, 0x3ffc7ba8UL, + 0xbe255559UL, 0xbc8e76bbUL, 0x9406e7b5UL, 0x3ffc8f6dUL, 0x48805c44UL, + 0x3c71acbcUL, 0x5751c4dbUL, 0x3ffca340UL, 0xd10d08f5UL, 0xbc87f2beUL, + 0xdcef9069UL, 0x3ffcb720UL, 0xd1e949dbUL, 0x3c7503cbUL, 0x2e6d1675UL, + 0x3ffccb0fUL, 0x86009092UL, 0xbc7d220fUL, 0x555dc3faUL, 0x3ffcdf0bUL, + 0x53829d72UL, 0xbc8dd83bUL, 0x5b5bab74UL, 0x3ffcf315UL, 0xb86dff57UL, + 0xbc9a08e9UL, 0x4a07897cUL, 0x3ffd072dUL, 0x43797a9cUL, 0xbc9cbc37UL, + 0x2b08c968UL, 0x3ffd1b53UL, 0x219a36eeUL, 0x3c955636UL, 0x080d89f2UL, + 0x3ffd2f87UL, 0x719d8578UL, 0xbc9d487bUL, 0xeacaa1d6UL, 0x3ffd43c8UL, + 0xbf5a1614UL, 0x3c93db53UL, 0xdcfba487UL, 0x3ffd5818UL, 0xd75b3707UL, + 0x3c82ed02UL, 0xe862e6d3UL, 0x3ffd6c76UL, 0x4a8165a0UL, 0x3c5fe87aUL, + 0x16c98398UL, 0x3ffd80e3UL, 0x8beddfe8UL, 0xbc911ec1UL, 0x71ff6075UL, + 0x3ffd955dUL, 0xbb9af6beUL, 0x3c9a052dUL, 0x03db3285UL, 0x3ffda9e6UL, + 0x696db532UL, 0x3c9c2300UL, 0xd63a8315UL, 0x3ffdbe7cUL, 0x926b8be4UL, + 0xbc9b76f1UL, 0xf301b460UL, 0x3ffdd321UL, 0x78f018c3UL, 0x3c92da57UL, + 0x641c0658UL, 0x3ffde7d5UL, 0x8e79ba8fUL, 0xbc9ca552UL, 0x337b9b5fUL, + 0x3ffdfc97UL, 0x4f184b5cUL, 0xbc91a5cdUL, 0x6b197d17UL, 0x3ffe1167UL, + 0xbd5c7f44UL, 0xbc72b529UL, 0x14f5a129UL, 0x3ffe2646UL, 0x817a1496UL, + 0xbc97b627UL, 0x3b16ee12UL, 0x3ffe3b33UL, 0x31fdc68bUL, 0xbc99f4a4UL, + 0xe78b3ff6UL, 0x3ffe502eUL, 0x80a9cc8fUL, 0x3c839e89UL, 0x24676d76UL, + 0x3ffe6539UL, 0x7522b735UL, 0xbc863ff8UL, 0xfbc74c83UL, 0x3ffe7a51UL, + 0xca0c8de2UL, 0x3c92d522UL, 0x77cdb740UL, 0x3ffe8f79UL, 0x80b054b1UL, + 0xbc910894UL, 0xa2a490daUL, 0x3ffea4afUL, 0x179c2893UL, 0xbc9e9c23UL, + 0x867cca6eUL, 0x3ffeb9f4UL, 0x2293e4f2UL, 0x3c94832fUL, 0x2d8e67f1UL, + 0x3ffecf48UL, 0xb411ad8cUL, 0xbc9c93f3UL, 0xa2188510UL, 0x3ffee4aaUL, + 0xa487568dUL, 0x3c91c68dUL, 0xee615a27UL, 0x3ffefa1bUL, 0x86a4b6b0UL, + 0x3c9dc7f4UL, 0x1cb6412aUL, 0x3fff0f9cUL, 0x65181d45UL, 0xbc932200UL, + 0x376bba97UL, 0x3fff252bUL, 0xbf0d8e43UL, 0x3c93a1a5UL, 0x48dd7274UL, + 0x3fff3ac9UL, 0x3ed837deUL, 0xbc795a5aUL, 0x5b6e4540UL, 0x3fff5076UL, + 0x2dd8a18bUL, 0x3c99d3e1UL, 0x798844f8UL, 0x3fff6632UL, 0x3539343eUL, + 0x3c9fa37bUL, 0xad9cbe14UL, 0x3fff7bfdUL, 0xd006350aUL, 0xbc9dbb12UL, + 0x02243c89UL, 0x3fff91d8UL, 0xa779f689UL, 0xbc612ea8UL, 0x819e90d8UL, + 0x3fffa7c1UL, 0xf3a5931eUL, 0x3c874853UL, 0x3692d514UL, 0x3fffbdbaUL, + 0x15098eb6UL, 0xbc796773UL, 0x2b8f71f1UL, 0x3fffd3c2UL, 0x966579e7UL, + 0x3c62eb74UL, 0x6b2a23d9UL, 0x3fffe9d9UL, 0x7442fde3UL, 0x3c74a603UL, + 0xe78a6731UL, 0x3f55d87fUL, 0xd704a0c0UL, 0x3fac6b08UL, 0x6fba4e77UL, + 0x3f83b2abUL, 0xff82c58fUL, 0x3fcebfbdUL, 0xfefa39efUL, 0x3fe62e42UL, + 0x00000000UL, 0x00000000UL, 0xfefa39efUL, 0x3fe62e42UL, 0xfefa39efUL, + 0xbfe62e42UL, 0xf8000000UL, 0xffffffffUL, 0xf8000000UL, 0xffffffffUL, + 0x00000000UL, 0x80000000UL, 0x00000000UL, 0x00000000UL + +}; + +//registers, +// input: xmm0, xmm1 +// scratch: xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7 +// eax, edx, ecx, ebx + +// Code generated by Intel C compiler for LIBM library + +void MacroAssembler::fast_pow(XMMRegister xmm0, XMMRegister xmm1, XMMRegister xmm2, XMMRegister xmm3, XMMRegister xmm4, XMMRegister xmm5, XMMRegister xmm6, XMMRegister xmm7, Register eax, Register ecx, Register edx, Register tmp) { + Label L_2TAG_PACKET_0_0_2, L_2TAG_PACKET_1_0_2, L_2TAG_PACKET_2_0_2, L_2TAG_PACKET_3_0_2; + Label L_2TAG_PACKET_4_0_2, L_2TAG_PACKET_5_0_2, L_2TAG_PACKET_6_0_2, L_2TAG_PACKET_7_0_2; + Label L_2TAG_PACKET_8_0_2, L_2TAG_PACKET_9_0_2, L_2TAG_PACKET_10_0_2, L_2TAG_PACKET_11_0_2; + Label L_2TAG_PACKET_12_0_2, L_2TAG_PACKET_13_0_2, L_2TAG_PACKET_14_0_2, L_2TAG_PACKET_15_0_2; + Label L_2TAG_PACKET_16_0_2, L_2TAG_PACKET_17_0_2, L_2TAG_PACKET_18_0_2, L_2TAG_PACKET_19_0_2; + Label L_2TAG_PACKET_20_0_2, L_2TAG_PACKET_21_0_2, L_2TAG_PACKET_22_0_2, L_2TAG_PACKET_23_0_2; + Label L_2TAG_PACKET_24_0_2, L_2TAG_PACKET_25_0_2, L_2TAG_PACKET_26_0_2, L_2TAG_PACKET_27_0_2; + Label L_2TAG_PACKET_28_0_2, L_2TAG_PACKET_29_0_2, L_2TAG_PACKET_30_0_2, L_2TAG_PACKET_31_0_2; + Label L_2TAG_PACKET_32_0_2, L_2TAG_PACKET_33_0_2, L_2TAG_PACKET_34_0_2, L_2TAG_PACKET_35_0_2; + Label L_2TAG_PACKET_36_0_2, L_2TAG_PACKET_37_0_2, L_2TAG_PACKET_38_0_2, L_2TAG_PACKET_39_0_2; + Label L_2TAG_PACKET_40_0_2, L_2TAG_PACKET_41_0_2, L_2TAG_PACKET_42_0_2, L_2TAG_PACKET_43_0_2; + Label L_2TAG_PACKET_44_0_2, L_2TAG_PACKET_45_0_2, L_2TAG_PACKET_46_0_2, L_2TAG_PACKET_47_0_2; + Label L_2TAG_PACKET_48_0_2, L_2TAG_PACKET_49_0_2, L_2TAG_PACKET_50_0_2, L_2TAG_PACKET_51_0_2; + Label L_2TAG_PACKET_52_0_2, L_2TAG_PACKET_53_0_2, L_2TAG_PACKET_54_0_2, L_2TAG_PACKET_55_0_2; + Label L_2TAG_PACKET_56_0_2, L_2TAG_PACKET_57_0_2, L_2TAG_PACKET_58_0_2, start; + + assert_different_registers(tmp, eax, ecx, edx); + + address static_const_table_pow = (address)_static_const_table_pow; + + bind(start); + subl(rsp, 120); + movl(Address(rsp, 64), tmp); + lea(tmp, ExternalAddress(static_const_table_pow)); + movsd(xmm0, Address(rsp, 128)); + movsd(xmm1, Address(rsp, 136)); + xorpd(xmm2, xmm2); + movl(eax, 16368); + pinsrw(xmm2, eax, 3); + movl(ecx, 1069088768); + movdl(xmm7, ecx); + movsd(Address(rsp, 16), xmm1); + xorpd(xmm1, xmm1); + movl(edx, 30704); + pinsrw(xmm1, edx, 3); + movsd(Address(rsp, 8), xmm0); + movdqu(xmm3, xmm0); + movl(edx, 8192); + movdl(xmm4, edx); + movdqu(xmm6, Address(tmp, 8240)); + pextrw(eax, xmm0, 3); + por(xmm0, xmm2); + psllq(xmm0, 5); + movsd(xmm2, Address(tmp, 8256)); + psrlq(xmm0, 34); + movl(edx, eax); + andl(edx, 32752); + subl(edx, 16368); + movl(ecx, edx); + sarl(edx, 31); + addl(ecx, edx); + xorl(ecx, edx); + rcpss(xmm0, xmm0); + psllq(xmm3, 12); + addl(ecx, 16); + bsrl(ecx, ecx); + psrlq(xmm3, 12); + movl(Address(rsp, 24), rsi); + subl(eax, 16); + cmpl(eax, 32736); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_0_0_2); + movl(rsi, 0); + + bind(L_2TAG_PACKET_1_0_2); + mulss(xmm0, xmm7); + movl(edx, -1); + subl(ecx, 4); + shll(edx); + movdl(xmm5, edx); + por(xmm3, xmm1); + subl(eax, 16351); + cmpl(eax, 1); + jcc(Assembler::belowEqual, L_2TAG_PACKET_2_0_2); + paddd(xmm0, xmm4); + psllq(xmm5, 32); + movdl(edx, xmm0); + psllq(xmm0, 29); + pand(xmm5, xmm3); + + bind(L_2TAG_PACKET_3_0_2); + pand(xmm0, xmm6); + subsd(xmm3, xmm5); + subl(eax, 1); + sarl(eax, 4); + cvtsi2sdl(xmm7, eax); + mulpd(xmm5, xmm0); + + bind(L_2TAG_PACKET_4_0_2); + mulsd(xmm3, xmm0); + movdqu(xmm1, Address(tmp, 8272)); + subsd(xmm5, xmm2); + movdqu(xmm4, Address(tmp, 8288)); + movl(ecx, eax); + sarl(eax, 31); + addl(ecx, eax); + xorl(eax, ecx); + addl(eax, 1); + bsrl(eax, eax); + unpcklpd(xmm5, xmm3); + movdqu(xmm6, Address(tmp, 8304)); + addsd(xmm3, xmm5); + andl(edx, 16760832); + shrl(edx, 10); + addpd(xmm5, Address(tmp, edx, Address::times_1, -3616)); + movdqu(xmm0, Address(tmp, 8320)); + pshufd(xmm2, xmm3, 68); + mulsd(xmm3, xmm3); + mulpd(xmm1, xmm2); + mulpd(xmm4, xmm2); + addsd(xmm5, xmm7); + mulsd(xmm2, xmm3); + addpd(xmm6, xmm1); + mulsd(xmm3, xmm3); + addpd(xmm0, xmm4); + movsd(xmm1, Address(rsp, 16)); + movzwl(ecx, Address(rsp, 22)); + pshufd(xmm7, xmm5, 238); + movsd(xmm4, Address(tmp, 8368)); + mulpd(xmm6, xmm2); + pshufd(xmm3, xmm3, 68); + mulpd(xmm0, xmm2); + shll(eax, 4); + subl(eax, 15872); + andl(ecx, 32752); + addl(eax, ecx); + mulpd(xmm3, xmm6); + cmpl(eax, 624); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_5_0_2); + xorpd(xmm6, xmm6); + movl(edx, 17080); + pinsrw(xmm6, edx, 3); + movdqu(xmm2, xmm1); + pand(xmm4, xmm1); + subsd(xmm1, xmm4); + mulsd(xmm4, xmm5); + addsd(xmm0, xmm7); + mulsd(xmm1, xmm5); + movdqu(xmm7, xmm6); + addsd(xmm6, xmm4); + addpd(xmm3, xmm0); + movdl(edx, xmm6); + subsd(xmm6, xmm7); + pshufd(xmm0, xmm3, 238); + subsd(xmm4, xmm6); + addsd(xmm0, xmm3); + movl(ecx, edx); + andl(edx, 255); + addl(edx, edx); + movdqu(xmm5, Address(tmp, edx, Address::times_8, 8384)); + addsd(xmm4, xmm1); + mulsd(xmm2, xmm0); + movdqu(xmm7, Address(tmp, 12480)); + movdqu(xmm3, Address(tmp, 12496)); + shll(ecx, 12); + xorl(ecx, rsi); + andl(ecx, -1048576); + movdl(xmm6, ecx); + addsd(xmm2, xmm4); + movsd(xmm1, Address(tmp, 12512)); + pshufd(xmm0, xmm2, 68); + pshufd(xmm4, xmm2, 68); + mulpd(xmm0, xmm0); + movl(rsi, Address(rsp, 24)); + mulpd(xmm7, xmm4); + pshufd(xmm6, xmm6, 17); + mulsd(xmm1, xmm2); + mulsd(xmm0, xmm0); + paddd(xmm5, xmm6); + addpd(xmm3, xmm7); + mulsd(xmm1, xmm5); + pshufd(xmm6, xmm5, 238); + mulpd(xmm0, xmm3); + addsd(xmm1, xmm6); + pshufd(xmm3, xmm0, 238); + mulsd(xmm0, xmm5); + mulsd(xmm3, xmm5); + addsd(xmm0, xmm1); + addsd(xmm0, xmm3); + addsd(xmm0, xmm5); + movsd(Address(rsp, 0), xmm0); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_6_0_2); + + bind(L_2TAG_PACKET_7_0_2); + movsd(xmm0, Address(rsp, 128)); + movsd(xmm1, Address(rsp, 136)); + mulsd(xmm0, xmm1); + movsd(Address(rsp, 0), xmm0); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_6_0_2); + + bind(L_2TAG_PACKET_0_0_2); + addl(eax, 16); + movl(edx, 32752); + andl(edx, eax); + cmpl(edx, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_8_0_2); + testl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_9_0_2); + + bind(L_2TAG_PACKET_10_0_2); + movl(ecx, Address(rsp, 16)); + xorl(edx, edx); + testl(ecx, ecx); + movl(ecx, 1); + cmovl(Assembler::notEqual, edx, ecx); + orl(edx, Address(rsp, 20)); + cmpl(edx, 1072693248); + jcc(Assembler::equal, L_2TAG_PACKET_7_0_2); + movsd(xmm0, Address(rsp, 8)); + movsd(xmm3, Address(rsp, 8)); + movdl(edx, xmm3); + psrlq(xmm3, 32); + movdl(ecx, xmm3); + orl(edx, ecx); + cmpl(edx, 0); + jcc(Assembler::equal, L_2TAG_PACKET_11_0_2); + xorpd(xmm3, xmm3); + movl(eax, 18416); + pinsrw(xmm3, eax, 3); + mulsd(xmm0, xmm3); + xorpd(xmm2, xmm2); + movl(eax, 16368); + pinsrw(xmm2, eax, 3); + movdqu(xmm3, xmm0); + pextrw(eax, xmm0, 3); + por(xmm0, xmm2); + movl(ecx, 18416); + psllq(xmm0, 5); + movsd(xmm2, Address(tmp, 8256)); + psrlq(xmm0, 34); + rcpss(xmm0, xmm0); + psllq(xmm3, 12); + movdqu(xmm6, Address(tmp, 8240)); + psrlq(xmm3, 12); + mulss(xmm0, xmm7); + movl(edx, -1024); + movdl(xmm5, edx); + por(xmm3, xmm1); + paddd(xmm0, xmm4); + psllq(xmm5, 32); + movdl(edx, xmm0); + psllq(xmm0, 29); + pand(xmm5, xmm3); + movl(rsi, 0); + pand(xmm0, xmm6); + subsd(xmm3, xmm5); + andl(eax, 32752); + subl(eax, 18416); + sarl(eax, 4); + cvtsi2sdl(xmm7, eax); + mulpd(xmm5, xmm0); + jmp(L_2TAG_PACKET_4_0_2); + + bind(L_2TAG_PACKET_12_0_2); + movl(ecx, Address(rsp, 16)); + xorl(edx, edx); + testl(ecx, ecx); + movl(ecx, 1); + cmovl(Assembler::notEqual, edx, ecx); + orl(edx, Address(rsp, 20)); + cmpl(edx, 1072693248); + jcc(Assembler::equal, L_2TAG_PACKET_7_0_2); + movsd(xmm0, Address(rsp, 8)); + movsd(xmm3, Address(rsp, 8)); + movdl(edx, xmm3); + psrlq(xmm3, 32); + movdl(ecx, xmm3); + orl(edx, ecx); + cmpl(edx, 0); + jcc(Assembler::equal, L_2TAG_PACKET_11_0_2); + xorpd(xmm3, xmm3); + movl(eax, 18416); + pinsrw(xmm3, eax, 3); + mulsd(xmm0, xmm3); + xorpd(xmm2, xmm2); + movl(eax, 16368); + pinsrw(xmm2, eax, 3); + movdqu(xmm3, xmm0); + pextrw(eax, xmm0, 3); + por(xmm0, xmm2); + movl(ecx, 18416); + psllq(xmm0, 5); + movsd(xmm2, Address(tmp, 8256)); + psrlq(xmm0, 34); + rcpss(xmm0, xmm0); + psllq(xmm3, 12); + movdqu(xmm6, Address(tmp, 8240)); + psrlq(xmm3, 12); + mulss(xmm0, xmm7); + movl(edx, -1024); + movdl(xmm5, edx); + por(xmm3, xmm1); + paddd(xmm0, xmm4); + psllq(xmm5, 32); + movdl(edx, xmm0); + psllq(xmm0, 29); + pand(xmm5, xmm3); + movl(rsi, INT_MIN); + pand(xmm0, xmm6); + subsd(xmm3, xmm5); + andl(eax, 32752); + subl(eax, 18416); + sarl(eax, 4); + cvtsi2sdl(xmm7, eax); + mulpd(xmm5, xmm0); + jmp(L_2TAG_PACKET_4_0_2); + + bind(L_2TAG_PACKET_5_0_2); + cmpl(eax, 0); + jcc(Assembler::less, L_2TAG_PACKET_13_0_2); + cmpl(eax, 752); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_14_0_2); + + bind(L_2TAG_PACKET_15_0_2); + addsd(xmm0, xmm7); + movsd(xmm2, Address(tmp, 12544)); + addpd(xmm3, xmm0); + xorpd(xmm6, xmm6); + movl(eax, 17080); + pinsrw(xmm6, eax, 3); + pshufd(xmm0, xmm3, 238); + addsd(xmm0, xmm3); + movdqu(xmm3, xmm5); + addsd(xmm5, xmm0); + movdqu(xmm4, xmm2); + subsd(xmm3, xmm5); + movdqu(xmm7, xmm5); + pand(xmm5, xmm2); + movdqu(xmm2, xmm1); + pand(xmm4, xmm1); + subsd(xmm7, xmm5); + addsd(xmm0, xmm3); + subsd(xmm1, xmm4); + mulsd(xmm4, xmm5); + addsd(xmm0, xmm7); + mulsd(xmm2, xmm0); + movdqu(xmm7, xmm6); + mulsd(xmm1, xmm5); + addsd(xmm6, xmm4); + movdl(eax, xmm6); + subsd(xmm6, xmm7); + addsd(xmm2, xmm1); + movdqu(xmm7, Address(tmp, 12480)); + movdqu(xmm3, Address(tmp, 12496)); + subsd(xmm4, xmm6); + pextrw(edx, xmm6, 3); + movl(ecx, eax); + andl(eax, 255); + addl(eax, eax); + movdqu(xmm5, Address(tmp, eax, Address::times_8, 8384)); + addsd(xmm2, xmm4); + sarl(ecx, 8); + movl(eax, ecx); + sarl(ecx, 1); + subl(eax, ecx); + shll(ecx, 20); + xorl(ecx, rsi); + movdl(xmm6, ecx); + movsd(xmm1, Address(tmp, 12512)); + andl(edx, 32767); + cmpl(edx, 16529); + jcc(Assembler::above, L_2TAG_PACKET_14_0_2); + pshufd(xmm0, xmm2, 68); + pshufd(xmm4, xmm2, 68); + mulpd(xmm0, xmm0); + mulpd(xmm7, xmm4); + pshufd(xmm6, xmm6, 17); + mulsd(xmm1, xmm2); + mulsd(xmm0, xmm0); + paddd(xmm5, xmm6); + addpd(xmm3, xmm7); + mulsd(xmm1, xmm5); + pshufd(xmm6, xmm5, 238); + mulpd(xmm0, xmm3); + addsd(xmm1, xmm6); + pshufd(xmm3, xmm0, 238); + mulsd(xmm0, xmm5); + mulsd(xmm3, xmm5); + shll(eax, 4); + xorpd(xmm4, xmm4); + addl(eax, 16368); + pinsrw(xmm4, eax, 3); + addsd(xmm0, xmm1); + movl(rsi, Address(rsp, 24)); + addsd(xmm0, xmm3); + movdqu(xmm1, xmm0); + addsd(xmm0, xmm5); + mulsd(xmm0, xmm4); + pextrw(eax, xmm0, 3); + andl(eax, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_16_0_2); + cmpl(eax, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_17_0_2); + + bind(L_2TAG_PACKET_18_0_2); + movsd(Address(rsp, 0), xmm0); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_6_0_2); + + bind(L_2TAG_PACKET_8_0_2); + movsd(xmm1, Address(rsp, 16)); + movsd(xmm0, Address(rsp, 8)); + movdqu(xmm2, xmm0); + movdl(eax, xmm2); + psrlq(xmm2, 20); + movdl(edx, xmm2); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_19_0_2); + addsd(xmm0, xmm0); + movdl(eax, xmm1); + psrlq(xmm1, 32); + movdl(edx, xmm1); + movl(ecx, edx); + addl(edx, edx); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_20_0_2); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_20_0_2); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + movl(edx, 29); + jmp(L_2TAG_PACKET_21_0_2); + + bind(L_2TAG_PACKET_22_0_2); + movsd(xmm0, Address(rsp, 16)); + addpd(xmm0, xmm0); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_19_0_2); + movdl(eax, xmm1); + movdqu(xmm2, xmm1); + psrlq(xmm1, 32); + movdl(edx, xmm1); + movl(ecx, edx); + addl(edx, edx); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_23_0_2); + pextrw(eax, xmm2, 3); + andl(eax, 32752); + cmpl(eax, 32752); + jcc(Assembler::notEqual, L_2TAG_PACKET_24_0_2); + movdl(eax, xmm2); + psrlq(xmm2, 20); + movdl(edx, xmm2); + orl(eax, edx); + jcc(Assembler::notEqual, L_2TAG_PACKET_22_0_2); + + bind(L_2TAG_PACKET_24_0_2); + pextrw(eax, xmm0, 3); + testl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_25_0_2); + testl(ecx, INT_MIN); + jcc(Assembler::notEqual, L_2TAG_PACKET_26_0_2); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_27_0_2); + movsd(xmm1, Address(rsp, 16)); + movdl(eax, xmm1); + testl(eax, 1); + jcc(Assembler::notEqual, L_2TAG_PACKET_28_0_2); + testl(eax, 2); + jcc(Assembler::notEqual, L_2TAG_PACKET_29_0_2); + jmp(L_2TAG_PACKET_28_0_2); + + bind(L_2TAG_PACKET_25_0_2); + shrl(ecx, 20); + andl(ecx, 2047); + cmpl(ecx, 1075); + jcc(Assembler::above, L_2TAG_PACKET_28_0_2); + jcc(Assembler::equal, L_2TAG_PACKET_30_0_2); + cmpl(ecx, 1074); + jcc(Assembler::above, L_2TAG_PACKET_27_0_2); + cmpl(ecx, 1023); + jcc(Assembler::below, L_2TAG_PACKET_28_0_2); + movsd(xmm1, Address(rsp, 16)); + movl(eax, 17208); + xorpd(xmm3, xmm3); + pinsrw(xmm3, eax, 3); + movdqu(xmm4, xmm3); + addsd(xmm3, xmm1); + subsd(xmm4, xmm3); + addsd(xmm1, xmm4); + pextrw(eax, xmm1, 3); + andl(eax, 32752); + jcc(Assembler::notEqual, L_2TAG_PACKET_28_0_2); + movdl(eax, xmm3); + andl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_28_0_2); + + bind(L_2TAG_PACKET_29_0_2); + movsd(xmm1, Address(rsp, 16)); + pextrw(eax, xmm1, 3); + andl(eax, 32768); + jcc(Assembler::equal, L_2TAG_PACKET_18_0_2); + xorpd(xmm0, xmm0); + movl(eax, 32768); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_28_0_2); + movsd(xmm1, Address(rsp, 16)); + pextrw(eax, xmm1, 3); + andl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_26_0_2); + + bind(L_2TAG_PACKET_31_0_2); + xorpd(xmm0, xmm0); + movl(eax, 32752); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_30_0_2); + movsd(xmm1, Address(rsp, 16)); + movdl(eax, xmm1); + andl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_28_0_2); + jmp(L_2TAG_PACKET_29_0_2); + + bind(L_2TAG_PACKET_32_0_2); + movdl(eax, xmm1); + psrlq(xmm1, 20); + movdl(edx, xmm1); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_33_0_2); + movsd(xmm0, Address(rsp, 16)); + addsd(xmm0, xmm0); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_33_0_2); + movsd(xmm0, Address(rsp, 8)); + pextrw(eax, xmm0, 3); + cmpl(eax, 49136); + jcc(Assembler::notEqual, L_2TAG_PACKET_34_0_2); + movdl(ecx, xmm0); + psrlq(xmm0, 20); + movdl(edx, xmm0); + orl(ecx, edx); + jcc(Assembler::notEqual, L_2TAG_PACKET_34_0_2); + xorpd(xmm0, xmm0); + movl(eax, 32760); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_34_0_2); + movsd(xmm1, Address(rsp, 16)); + andl(eax, 32752); + subl(eax, 16368); + pextrw(edx, xmm1, 3); + xorpd(xmm0, xmm0); + xorl(eax, edx); + andl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_18_0_2); + movl(ecx, 32752); + pinsrw(xmm0, ecx, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_35_0_2); + movdl(eax, xmm1); + cmpl(edx, 17184); + jcc(Assembler::above, L_2TAG_PACKET_36_0_2); + testl(eax, 1); + jcc(Assembler::notEqual, L_2TAG_PACKET_37_0_2); + testl(eax, 2); + jcc(Assembler::equal, L_2TAG_PACKET_38_0_2); + jmp(L_2TAG_PACKET_39_0_2); + + bind(L_2TAG_PACKET_36_0_2); + testl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_38_0_2); + jmp(L_2TAG_PACKET_39_0_2); + + bind(L_2TAG_PACKET_9_0_2); + movsd(xmm2, Address(rsp, 8)); + movdl(eax, xmm2); + psrlq(xmm2, 31); + movdl(ecx, xmm2); + orl(eax, ecx); + jcc(Assembler::equal, L_2TAG_PACKET_11_0_2); + movsd(xmm1, Address(rsp, 16)); + pextrw(edx, xmm1, 3); + movdl(eax, xmm1); + movdqu(xmm2, xmm1); + psrlq(xmm2, 32); + movdl(ecx, xmm2); + addl(ecx, ecx); + orl(ecx, eax); + jcc(Assembler::equal, L_2TAG_PACKET_40_0_2); + andl(edx, 32752); + cmpl(edx, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_32_0_2); + cmpl(edx, 17200); + jcc(Assembler::above, L_2TAG_PACKET_38_0_2); + cmpl(edx, 17184); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_35_0_2); + cmpl(edx, 16368); + jcc(Assembler::below, L_2TAG_PACKET_37_0_2); + movl(eax, 17208); + xorpd(xmm2, xmm2); + pinsrw(xmm2, eax, 3); + movdqu(xmm4, xmm2); + addsd(xmm2, xmm1); + subsd(xmm4, xmm2); + addsd(xmm1, xmm4); + pextrw(eax, xmm1, 3); + andl(eax, 32767); + jcc(Assembler::notEqual, L_2TAG_PACKET_37_0_2); + movdl(eax, xmm2); + andl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_38_0_2); + + bind(L_2TAG_PACKET_39_0_2); + xorpd(xmm1, xmm1); + movl(edx, 30704); + pinsrw(xmm1, edx, 3); + movsd(xmm2, Address(tmp, 8256)); + movsd(xmm4, Address(rsp, 8)); + pextrw(eax, xmm4, 3); + movl(edx, 8192); + movdl(xmm4, edx); + andl(eax, 32767); + subl(eax, 16); + jcc(Assembler::less, L_2TAG_PACKET_12_0_2); + movl(edx, eax); + andl(edx, 32752); + subl(edx, 16368); + movl(ecx, edx); + sarl(edx, 31); + addl(ecx, edx); + xorl(ecx, edx); + addl(ecx, 16); + bsrl(ecx, ecx); + movl(rsi, INT_MIN); + jmp(L_2TAG_PACKET_1_0_2); + + bind(L_2TAG_PACKET_37_0_2); + xorpd(xmm1, xmm1); + movl(eax, 32752); + pinsrw(xmm1, eax, 3); + xorpd(xmm0, xmm0); + mulsd(xmm0, xmm1); + movl(edx, 28); + jmp(L_2TAG_PACKET_21_0_2); + + bind(L_2TAG_PACKET_38_0_2); + xorpd(xmm1, xmm1); + movl(edx, 30704); + pinsrw(xmm1, edx, 3); + movsd(xmm2, Address(tmp, 8256)); + movsd(xmm4, Address(rsp, 8)); + pextrw(eax, xmm4, 3); + movl(edx, 8192); + movdl(xmm4, edx); + andl(eax, 32767); + subl(eax, 16); + jcc(Assembler::less, L_2TAG_PACKET_10_0_2); + movl(edx, eax); + andl(edx, 32752); + subl(edx, 16368); + movl(ecx, edx); + sarl(edx, 31); + addl(ecx, edx); + xorl(ecx, edx); + addl(ecx, 16); + bsrl(ecx, ecx); + movl(rsi, 0); + jmp(L_2TAG_PACKET_1_0_2); + + bind(L_2TAG_PACKET_23_0_2); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_26_0_2); + xorpd(xmm0, xmm0); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_13_0_2); + addl(eax, 384); + cmpl(eax, 0); + jcc(Assembler::less, L_2TAG_PACKET_41_0_2); + mulsd(xmm5, xmm1); + addsd(xmm0, xmm7); + shrl(rsi, 31); + addpd(xmm3, xmm0); + pshufd(xmm0, xmm3, 238); + addsd(xmm3, xmm0); + movsd(xmm4, Address(tmp, rsi, Address::times_8, 12528)); + mulsd(xmm1, xmm3); + xorpd(xmm0, xmm0); + movl(eax, 16368); + shll(rsi, 15); + orl(eax, rsi); + pinsrw(xmm0, eax, 3); + addsd(xmm5, xmm1); + movl(rsi, Address(rsp, 24)); + mulsd(xmm5, xmm4); + addsd(xmm0, xmm5); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_41_0_2); + movl(rsi, Address(rsp, 24)); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_40_0_2); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_42_0_2); + xorpd(xmm0, xmm0); + movl(eax, 16368); + pinsrw(xmm0, eax, 3); + movl(edx, 26); + jmp(L_2TAG_PACKET_21_0_2); + + bind(L_2TAG_PACKET_11_0_2); + movsd(xmm1, Address(rsp, 16)); + movdqu(xmm2, xmm1); + pextrw(eax, xmm1, 3); + andl(eax, 32752); + cmpl(eax, 32752); + jcc(Assembler::notEqual, L_2TAG_PACKET_43_0_2); + movdl(eax, xmm2); + psrlq(xmm2, 20); + movdl(edx, xmm2); + orl(eax, edx); + jcc(Assembler::notEqual, L_2TAG_PACKET_22_0_2); + + bind(L_2TAG_PACKET_43_0_2); + movdl(eax, xmm1); + psrlq(xmm1, 32); + movdl(edx, xmm1); + movl(ecx, edx); + addl(edx, edx); + orl(eax, edx); + jcc(Assembler::equal, L_2TAG_PACKET_42_0_2); + shrl(edx, 21); + cmpl(edx, 1075); + jcc(Assembler::above, L_2TAG_PACKET_44_0_2); + jcc(Assembler::equal, L_2TAG_PACKET_45_0_2); + cmpl(edx, 1023); + jcc(Assembler::below, L_2TAG_PACKET_44_0_2); + movsd(xmm1, Address(rsp, 16)); + movl(eax, 17208); + xorpd(xmm3, xmm3); + pinsrw(xmm3, eax, 3); + movdqu(xmm4, xmm3); + addsd(xmm3, xmm1); + subsd(xmm4, xmm3); + addsd(xmm1, xmm4); + pextrw(eax, xmm1, 3); + andl(eax, 32752); + jcc(Assembler::notEqual, L_2TAG_PACKET_44_0_2); + movdl(eax, xmm3); + andl(eax, 1); + jcc(Assembler::equal, L_2TAG_PACKET_44_0_2); + + bind(L_2TAG_PACKET_46_0_2); + movsd(xmm0, Address(rsp, 8)); + testl(ecx, INT_MIN); + jcc(Assembler::notEqual, L_2TAG_PACKET_47_0_2); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_45_0_2); + movsd(xmm1, Address(rsp, 16)); + movdl(eax, xmm1); + testl(eax, 1); + jcc(Assembler::notEqual, L_2TAG_PACKET_46_0_2); + + bind(L_2TAG_PACKET_44_0_2); + testl(ecx, INT_MIN); + jcc(Assembler::equal, L_2TAG_PACKET_26_0_2); + xorpd(xmm0, xmm0); + + bind(L_2TAG_PACKET_47_0_2); + movl(eax, 16368); + xorpd(xmm1, xmm1); + pinsrw(xmm1, eax, 3); + divsd(xmm1, xmm0); + movdqu(xmm0, xmm1); + movl(edx, 27); + jmp(L_2TAG_PACKET_21_0_2); + + bind(L_2TAG_PACKET_14_0_2); + movsd(xmm2, Address(rsp, 8)); + movsd(xmm6, Address(rsp, 16)); + pextrw(eax, xmm2, 3); + pextrw(edx, xmm6, 3); + movl(ecx, 32752); + andl(ecx, edx); + cmpl(ecx, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_48_0_2); + andl(eax, 32752); + subl(eax, 16368); + xorl(edx, eax); + testl(edx, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_49_0_2); + + bind(L_2TAG_PACKET_50_0_2); + movl(eax, 32736); + pinsrw(xmm0, eax, 3); + shrl(rsi, 16); + orl(eax, rsi); + pinsrw(xmm1, eax, 3); + movl(rsi, Address(rsp, 24)); + mulsd(xmm0, xmm1); + + bind(L_2TAG_PACKET_17_0_2); + movl(edx, 24); + + bind(L_2TAG_PACKET_21_0_2); + movsd(Address(rsp, 0), xmm0); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_6_0_2); + + bind(L_2TAG_PACKET_49_0_2); + movl(eax, 16); + pinsrw(xmm0, eax, 3); + mulsd(xmm0, xmm0); + testl(rsi, INT_MIN); + jcc(Assembler::equal, L_2TAG_PACKET_51_0_2); + movsd(xmm2, Address(tmp, 12560)); + xorpd(xmm0, xmm2); + + bind(L_2TAG_PACKET_51_0_2); + movl(rsi, Address(rsp, 24)); + movl(edx, 25); + jmp(L_2TAG_PACKET_21_0_2); + + bind(L_2TAG_PACKET_16_0_2); + pextrw(ecx, xmm5, 3); + pextrw(edx, xmm4, 3); + movl(eax, -1); + andl(ecx, 32752); + subl(ecx, 16368); + andl(edx, 32752); + addl(edx, ecx); + movl(ecx, -31); + sarl(edx, 4); + subl(ecx, edx); + jcc(Assembler::lessEqual, L_2TAG_PACKET_52_0_2); + cmpl(ecx, 20); + jcc(Assembler::above, L_2TAG_PACKET_53_0_2); + shll(eax); + + bind(L_2TAG_PACKET_52_0_2); + movdl(xmm0, eax); + psllq(xmm0, 32); + pand(xmm0, xmm5); + subsd(xmm5, xmm0); + addsd(xmm5, xmm1); + mulsd(xmm0, xmm4); + mulsd(xmm5, xmm4); + addsd(xmm0, xmm5); + + bind(L_2TAG_PACKET_53_0_2); + movl(edx, 25); + jmp(L_2TAG_PACKET_21_0_2); + + bind(L_2TAG_PACKET_2_0_2); + movzwl(ecx, Address(rsp, 22)); + movl(edx, INT_MIN); + movdl(xmm1, edx); + xorpd(xmm7, xmm7); + paddd(xmm0, xmm4); + psllq(xmm5, 32); + movdl(edx, xmm0); + psllq(xmm0, 29); + paddq(xmm1, xmm3); + pand(xmm5, xmm1); + andl(ecx, 32752); + cmpl(ecx, 16560); + jcc(Assembler::below, L_2TAG_PACKET_3_0_2); + pand(xmm0, xmm6); + subsd(xmm3, xmm5); + addl(eax, 16351); + shrl(eax, 4); + subl(eax, 1022); + cvtsi2sdl(xmm7, eax); + mulpd(xmm5, xmm0); + movsd(xmm4, Address(tmp, 0)); + mulsd(xmm3, xmm0); + movsd(xmm6, Address(tmp, 0)); + subsd(xmm5, xmm2); + movsd(xmm1, Address(tmp, 8)); + pshufd(xmm2, xmm3, 68); + unpcklpd(xmm5, xmm3); + addsd(xmm3, xmm5); + movsd(xmm0, Address(tmp, 8)); + andl(edx, 16760832); + shrl(edx, 10); + addpd(xmm7, Address(tmp, edx, Address::times_1, -3616)); + mulsd(xmm4, xmm5); + mulsd(xmm0, xmm5); + mulsd(xmm6, xmm2); + mulsd(xmm1, xmm2); + movdqu(xmm2, xmm5); + mulsd(xmm4, xmm5); + addsd(xmm5, xmm0); + movdqu(xmm0, xmm7); + addsd(xmm2, xmm3); + addsd(xmm7, xmm5); + mulsd(xmm6, xmm2); + subsd(xmm0, xmm7); + movdqu(xmm2, xmm7); + addsd(xmm7, xmm4); + addsd(xmm0, xmm5); + subsd(xmm2, xmm7); + addsd(xmm4, xmm2); + pshufd(xmm2, xmm5, 238); + movdqu(xmm5, xmm7); + addsd(xmm7, xmm2); + addsd(xmm4, xmm0); + movdqu(xmm0, Address(tmp, 8272)); + subsd(xmm5, xmm7); + addsd(xmm6, xmm4); + movdqu(xmm4, xmm7); + addsd(xmm5, xmm2); + addsd(xmm7, xmm1); + movdqu(xmm2, Address(tmp, 8336)); + subsd(xmm4, xmm7); + addsd(xmm6, xmm5); + addsd(xmm4, xmm1); + pshufd(xmm5, xmm7, 238); + movdqu(xmm1, xmm7); + addsd(xmm7, xmm5); + subsd(xmm1, xmm7); + addsd(xmm1, xmm5); + movdqu(xmm5, Address(tmp, 8352)); + pshufd(xmm3, xmm3, 68); + addsd(xmm6, xmm4); + addsd(xmm6, xmm1); + movdqu(xmm1, Address(tmp, 8304)); + mulpd(xmm0, xmm3); + mulpd(xmm2, xmm3); + pshufd(xmm4, xmm3, 68); + mulpd(xmm3, xmm3); + addpd(xmm0, xmm1); + addpd(xmm5, xmm2); + mulsd(xmm4, xmm3); + movsd(xmm2, Address(tmp, 16)); + mulpd(xmm3, xmm3); + movsd(xmm1, Address(rsp, 16)); + movzwl(ecx, Address(rsp, 22)); + mulpd(xmm0, xmm4); + pextrw(eax, xmm7, 3); + mulpd(xmm5, xmm4); + mulpd(xmm0, xmm3); + movsd(xmm4, Address(tmp, 8376)); + pand(xmm2, xmm7); + addsd(xmm5, xmm6); + subsd(xmm7, xmm2); + addpd(xmm5, xmm0); + andl(eax, 32752); + subl(eax, 16368); + andl(ecx, 32752); + cmpl(ecx, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_48_0_2); + addl(ecx, eax); + cmpl(ecx, 16576); + jcc(Assembler::aboveEqual, L_2TAG_PACKET_54_0_2); + pshufd(xmm0, xmm5, 238); + pand(xmm4, xmm1); + movdqu(xmm3, xmm1); + addsd(xmm5, xmm0); + subsd(xmm1, xmm4); + xorpd(xmm6, xmm6); + movl(edx, 17080); + pinsrw(xmm6, edx, 3); + addsd(xmm7, xmm5); + mulsd(xmm4, xmm2); + mulsd(xmm1, xmm2); + movdqu(xmm5, xmm6); + mulsd(xmm3, xmm7); + addsd(xmm6, xmm4); + addsd(xmm1, xmm3); + movdqu(xmm7, Address(tmp, 12480)); + movdl(edx, xmm6); + subsd(xmm6, xmm5); + movdqu(xmm3, Address(tmp, 12496)); + movsd(xmm2, Address(tmp, 12512)); + subsd(xmm4, xmm6); + movl(ecx, edx); + andl(edx, 255); + addl(edx, edx); + movdqu(xmm5, Address(tmp, edx, Address::times_8, 8384)); + addsd(xmm4, xmm1); + pextrw(edx, xmm6, 3); + shrl(ecx, 8); + movl(eax, ecx); + shrl(ecx, 1); + subl(eax, ecx); + shll(ecx, 20); + movdl(xmm6, ecx); + pshufd(xmm0, xmm4, 68); + pshufd(xmm1, xmm4, 68); + mulpd(xmm0, xmm0); + mulpd(xmm7, xmm1); + pshufd(xmm6, xmm6, 17); + mulsd(xmm2, xmm4); + andl(edx, 32767); + cmpl(edx, 16529); + jcc(Assembler::above, L_2TAG_PACKET_14_0_2); + mulsd(xmm0, xmm0); + paddd(xmm5, xmm6); + addpd(xmm3, xmm7); + mulsd(xmm2, xmm5); + pshufd(xmm6, xmm5, 238); + mulpd(xmm0, xmm3); + addsd(xmm2, xmm6); + pshufd(xmm3, xmm0, 238); + addl(eax, 1023); + shll(eax, 20); + orl(eax, rsi); + movdl(xmm4, eax); + mulsd(xmm0, xmm5); + mulsd(xmm3, xmm5); + addsd(xmm0, xmm2); + psllq(xmm4, 32); + addsd(xmm0, xmm3); + movdqu(xmm1, xmm0); + addsd(xmm0, xmm5); + movl(rsi, Address(rsp, 24)); + mulsd(xmm0, xmm4); + pextrw(eax, xmm0, 3); + andl(eax, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_16_0_2); + cmpl(eax, 32752); + jcc(Assembler::equal, L_2TAG_PACKET_17_0_2); + + bind(L_2TAG_PACKET_55_0_2); + movsd(Address(rsp, 0), xmm0); + fld_d(Address(rsp, 0)); + jmp(L_2TAG_PACKET_6_0_2); + + bind(L_2TAG_PACKET_48_0_2); + movl(rsi, Address(rsp, 24)); + + bind(L_2TAG_PACKET_56_0_2); + movsd(xmm0, Address(rsp, 8)); + movsd(xmm1, Address(rsp, 16)); + addsd(xmm1, xmm1); + xorpd(xmm2, xmm2); + movl(eax, 49136); + pinsrw(xmm2, eax, 3); + addsd(xmm2, xmm0); + pextrw(eax, xmm2, 3); + cmpl(eax, 0); + jcc(Assembler::notEqual, L_2TAG_PACKET_57_0_2); + xorpd(xmm0, xmm0); + movl(eax, 32760); + pinsrw(xmm0, eax, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_57_0_2); + movdl(edx, xmm1); + movdqu(xmm3, xmm1); + psrlq(xmm3, 20); + movdl(ecx, xmm3); + orl(ecx, edx); + jcc(Assembler::equal, L_2TAG_PACKET_58_0_2); + addsd(xmm1, xmm1); + movdqu(xmm0, xmm1); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_58_0_2); + pextrw(eax, xmm0, 3); + andl(eax, 32752); + pextrw(edx, xmm1, 3); + xorpd(xmm0, xmm0); + subl(eax, 16368); + xorl(eax, edx); + testl(eax, 32768); + jcc(Assembler::notEqual, L_2TAG_PACKET_18_0_2); + movl(edx, 32752); + pinsrw(xmm0, edx, 3); + jmp(L_2TAG_PACKET_18_0_2); + + bind(L_2TAG_PACKET_54_0_2); + pextrw(eax, xmm1, 3); + pextrw(ecx, xmm2, 3); + xorl(eax, ecx); + testl(eax, 32768); + jcc(Assembler::equal, L_2TAG_PACKET_50_0_2); + jmp(L_2TAG_PACKET_49_0_2); + + bind(L_2TAG_PACKET_6_0_2); + movl(tmp, Address(rsp, 64)); + +} + +#endif // !_LP64 diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp index 5f90a2fa803..57db8eeede0 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp @@ -2126,15 +2126,6 @@ class StubGenerator: public StubCodeGenerator { __ trigfunc('t'); __ ret(0); } - { - StubCodeMark mark(this, "StubRoutines", "pow"); - StubRoutines::_intrinsic_pow = (double (*)(double,double)) __ pc(); - - __ fld_d(Address(rsp, 12)); - __ fld_d(Address(rsp, 4)); - __ pow_with_fallback(0); - __ ret(0); - } } // AES intrinsic stubs @@ -3082,6 +3073,30 @@ class StubGenerator: public StubCodeGenerator { } + address generate_libmPow() { + address start = __ pc(); + + const XMMRegister x0 = xmm0; + const XMMRegister x1 = xmm1; + const XMMRegister x2 = xmm2; + const XMMRegister x3 = xmm3; + + const XMMRegister x4 = xmm4; + const XMMRegister x5 = xmm5; + const XMMRegister x6 = xmm6; + const XMMRegister x7 = xmm7; + + const Register tmp = rbx; + + BLOCK_COMMENT("Entry:"); + __ enter(); // required for proper stackwalking of RuntimeStub frame + __ fast_pow(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp); + __ leave(); // required for proper stackwalking of RuntimeStub frame + __ ret(0); + + return start; + + } // Safefetch stubs. @@ -3310,6 +3325,7 @@ class StubGenerator: public StubCodeGenerator { if (VM_Version::supports_sse2()) { StubRoutines::_dexp = generate_libmExp(); StubRoutines::_dlog = generate_libmLog(); + StubRoutines::_dpow = generate_libmPow(); } } diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp index 5af262ad4cc..72babc6f146 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp @@ -3025,21 +3025,6 @@ class StubGenerator: public StubCodeGenerator { __ addq(rsp, 8); __ ret(0); } - { - StubCodeMark mark(this, "StubRoutines", "pow"); - StubRoutines::_intrinsic_pow = (double (*)(double,double)) __ pc(); - - __ subq(rsp, 8); - __ movdbl(Address(rsp, 0), xmm1); - __ fld_d(Address(rsp, 0)); - __ movdbl(Address(rsp, 0), xmm0); - __ fld_d(Address(rsp, 0)); - __ pow_with_fallback(0); - __ fstp_d(Address(rsp, 0)); - __ movdbl(xmm0, Address(rsp, 0)); - __ addq(rsp, 8); - __ ret(0); - } } // AES intrinsic stubs @@ -4283,6 +4268,48 @@ class StubGenerator: public StubCodeGenerator { } + address generate_libmPow() { + address start = __ pc(); + + const XMMRegister x0 = xmm0; + const XMMRegister x1 = xmm1; + const XMMRegister x2 = xmm2; + const XMMRegister x3 = xmm3; + + const XMMRegister x4 = xmm4; + const XMMRegister x5 = xmm5; + const XMMRegister x6 = xmm6; + const XMMRegister x7 = xmm7; + + const Register tmp1 = r8; + const Register tmp2 = r9; + const Register tmp3 = r10; + const Register tmp4 = r11; + + BLOCK_COMMENT("Entry:"); + __ enter(); // required for proper stackwalking of RuntimeStub frame + +#ifdef _WIN64 + // save the xmm registers which must be preserved 6-7 + __ subptr(rsp, 4 * wordSize); + __ movdqu(Address(rsp, 0), xmm6); + __ movdqu(Address(rsp, 2 * wordSize), xmm7); +#endif + __ fast_pow(x0, x1, x2, x3, x4, x5, x6, x7, rax, rcx, rdx, tmp1, tmp2, tmp3, tmp4); + +#ifdef _WIN64 + // restore xmm regs belonging to calling function + __ movdqu(xmm6, Address(rsp, 0)); + __ movdqu(xmm7, Address(rsp, 2 * wordSize)); + __ addptr(rsp, 4 * wordSize); +#endif + + __ leave(); // required for proper stackwalking of RuntimeStub frame + __ ret(0); + + return start; + + } #undef __ #define __ masm-> @@ -4478,6 +4505,7 @@ class StubGenerator: public StubCodeGenerator { if (VM_Version::supports_sse2()) { StubRoutines::_dexp = generate_libmExp(); StubRoutines::_dlog = generate_libmLog(); + StubRoutines::_dpow = generate_libmPow(); } } diff --git a/hotspot/src/cpu/x86/vm/x86_32.ad b/hotspot/src/cpu/x86/vm/x86_32.ad index b783c6cd206..cebd468acb6 100644 --- a/hotspot/src/cpu/x86/vm/x86_32.ad +++ b/hotspot/src/cpu/x86/vm/x86_32.ad @@ -9885,39 +9885,6 @@ instruct sqrtDPR_reg(regDPR dst, regDPR src) %{ ins_pipe( pipe_slow ); %} -instruct powDPR_reg(regDPR X, regDPR1 Y, eAXRegI rax, eDXRegI rdx, eCXRegI rcx, eFlagsReg cr) %{ - predicate (UseSSE<=1); - match(Set Y (PowD X Y)); // Raise X to the Yth power - effect(KILL rax, KILL rdx, KILL rcx, KILL cr); - format %{ "fast_pow $X $Y -> $Y // KILL $rax, $rcx, $rdx" %} - ins_encode %{ - __ subptr(rsp, 8); - __ fld_s($X$$reg - 1); - __ fast_pow(); - __ addptr(rsp, 8); - %} - ins_pipe( pipe_slow ); -%} - -instruct powD_reg(regD dst, regD src0, regD src1, eAXRegI rax, eDXRegI rdx, eCXRegI rcx, eFlagsReg cr) %{ - predicate (UseSSE>=2); - match(Set dst (PowD src0 src1)); // Raise src0 to the src1'th power - effect(KILL rax, KILL rdx, KILL rcx, KILL cr); - format %{ "fast_pow $src0 $src1 -> $dst // KILL $rax, $rcx, $rdx" %} - ins_encode %{ - __ subptr(rsp, 8); - __ movdbl(Address(rsp, 0), $src1$$XMMRegister); - __ fld_d(Address(rsp, 0)); - __ movdbl(Address(rsp, 0), $src0$$XMMRegister); - __ fld_d(Address(rsp, 0)); - __ fast_pow(); - __ fstp_d(Address(rsp, 0)); - __ movdbl($dst$$XMMRegister, Address(rsp, 0)); - __ addptr(rsp, 8); - %} - ins_pipe( pipe_slow ); -%} - instruct log10DPR_reg(regDPR1 dst, regDPR1 src) %{ predicate (UseSSE<=1); // The source Double operand on FPU stack diff --git a/hotspot/src/cpu/x86/vm/x86_64.ad b/hotspot/src/cpu/x86/vm/x86_64.ad index 0310acc22b6..9def843e07e 100644 --- a/hotspot/src/cpu/x86/vm/x86_64.ad +++ b/hotspot/src/cpu/x86/vm/x86_64.ad @@ -9864,24 +9864,6 @@ instruct log10D_reg(regD dst) %{ ins_pipe( pipe_slow ); %} -instruct powD_reg(regD dst, regD src0, regD src1, rax_RegI rax, rdx_RegI rdx, rcx_RegI rcx, rFlagsReg cr) %{ - match(Set dst (PowD src0 src1)); // Raise src0 to the src1'th power - effect(KILL rax, KILL rdx, KILL rcx, KILL cr); - format %{ "fast_pow $src0 $src1 -> $dst // KILL $rax, $rcx, $rdx" %} - ins_encode %{ - __ subptr(rsp, 8); - __ movdbl(Address(rsp, 0), $src1$$XMMRegister); - __ fld_d(Address(rsp, 0)); - __ movdbl(Address(rsp, 0), $src0$$XMMRegister); - __ fld_d(Address(rsp, 0)); - __ fast_pow(); - __ fstp_d(Address(rsp, 0)); - __ movdbl($dst$$XMMRegister, Address(rsp, 0)); - __ addptr(rsp, 8); - %} - ins_pipe( pipe_slow ); -%} - //----------Arithmetic Conversion Instructions--------------------------------- instruct roundFloat_nop(regF dst) diff --git a/hotspot/src/share/vm/adlc/formssel.cpp b/hotspot/src/share/vm/adlc/formssel.cpp index 90c965bfa88..4e5fe365e52 100644 --- a/hotspot/src/share/vm/adlc/formssel.cpp +++ b/hotspot/src/share/vm/adlc/formssel.cpp @@ -4018,7 +4018,6 @@ int MatchRule::is_expensive() const { strcmp(opType,"ModD")==0 || strcmp(opType,"ModF")==0 || strcmp(opType,"ModI")==0 || - strcmp(opType,"PowD")==0 || strcmp(opType,"SinD")==0 || strcmp(opType,"SqrtD")==0 || strcmp(opType,"TanD")==0 || diff --git a/hotspot/src/share/vm/c1/c1_LIR.cpp b/hotspot/src/share/vm/c1/c1_LIR.cpp index 44f7364ec5f..8397df6a048 100644 --- a/hotspot/src/share/vm/c1/c1_LIR.cpp +++ b/hotspot/src/share/vm/c1/c1_LIR.cpp @@ -754,31 +754,6 @@ void LIR_OpVisitState::visit(LIR_Op* op) { break; } - case lir_pow: { - assert(op->as_Op2() != NULL, "must be"); - LIR_Op2* op2 = (LIR_Op2*)op; - - // On x86 pow needs two temporary fpu stack slots: tmp1 and - // tmp2. Register input operands as temps to guarantee that it - // doesn't overlap with the temporary slots. - assert(op2->_info == NULL, "not used"); - assert(op2->_opr1->is_valid() && op2->_opr2->is_valid(), "used"); - assert(op2->_tmp1->is_valid() && op2->_tmp2->is_valid() && op2->_tmp3->is_valid() - && op2->_tmp4->is_valid() && op2->_tmp5->is_valid(), "used"); - assert(op2->_result->is_valid(), "used"); - - do_input(op2->_opr1); do_temp(op2->_opr1); - do_input(op2->_opr2); do_temp(op2->_opr2); - do_temp(op2->_tmp1); - do_temp(op2->_tmp2); - do_temp(op2->_tmp3); - do_temp(op2->_tmp4); - do_temp(op2->_tmp5); - do_output(op2->_result); - - break; - } - // LIR_Op3 case lir_idiv: case lir_irem: { @@ -1769,7 +1744,6 @@ const char * LIR_Op::name() const { case lir_cos: s = "cos"; break; case lir_tan: s = "tan"; break; case lir_log10: s = "log10"; break; - case lir_pow: s = "pow"; break; case lir_logic_and: s = "logic_and"; break; case lir_logic_or: s = "logic_or"; break; case lir_logic_xor: s = "logic_xor"; break; diff --git a/hotspot/src/share/vm/c1/c1_LIR.hpp b/hotspot/src/share/vm/c1/c1_LIR.hpp index 14651e14078..ade1fbd31cc 100644 --- a/hotspot/src/share/vm/c1/c1_LIR.hpp +++ b/hotspot/src/share/vm/c1/c1_LIR.hpp @@ -962,7 +962,6 @@ enum LIR_Code { , lir_cos , lir_tan , lir_log10 - , lir_pow , lir_logic_and , lir_logic_or , lir_logic_xor @@ -2198,7 +2197,6 @@ class LIR_List: public CompilationResourceObj { void sin (LIR_Opr from, LIR_Opr to, LIR_Opr tmp1, LIR_Opr tmp2) { append(new LIR_Op2(lir_sin , from, tmp1, to, tmp2)); } void cos (LIR_Opr from, LIR_Opr to, LIR_Opr tmp1, LIR_Opr tmp2) { append(new LIR_Op2(lir_cos , from, tmp1, to, tmp2)); } void tan (LIR_Opr from, LIR_Opr to, LIR_Opr tmp1, LIR_Opr tmp2) { append(new LIR_Op2(lir_tan , from, tmp1, to, tmp2)); } - void pow (LIR_Opr arg1, LIR_Opr arg2, LIR_Opr res, LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, LIR_Opr tmp4, LIR_Opr tmp5) { append(new LIR_Op2(lir_pow, arg1, arg2, res, tmp1, tmp2, tmp3, tmp4, tmp5)); } void add (LIR_Opr left, LIR_Opr right, LIR_Opr res) { append(new LIR_Op2(lir_add, left, right, res)); } void sub (LIR_Opr left, LIR_Opr right, LIR_Opr res, CodeEmitInfo* info = NULL) { append(new LIR_Op2(lir_sub, left, right, res, info)); } diff --git a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp index d6b687dc01c..4d016513ee7 100644 --- a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp @@ -740,7 +740,6 @@ void LIR_Assembler::emit_op2(LIR_Op2* op) { case lir_tan: case lir_cos: case lir_log10: - case lir_pow: intrinsic_op(op->code(), op->in_opr1(), op->in_opr2(), op->result_opr(), op); break; diff --git a/hotspot/src/share/vm/c1/c1_LinearScan.cpp b/hotspot/src/share/vm/c1/c1_LinearScan.cpp index d87862707cb..f474b00d20b 100644 --- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp +++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp @@ -6603,7 +6603,6 @@ void LinearScanStatistic::collect(LinearScan* allocator) { case lir_cos: case lir_abs: case lir_log10: - case lir_pow: case lir_logic_and: case lir_logic_or: case lir_logic_xor: diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp index bfd902c9a0b..1810017fdc8 100644 --- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp +++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp @@ -319,6 +319,7 @@ const char* Runtime1::name_for_address(address entry) { FUNCTION_CASE(entry, StubRoutines::updateBytesCRC32()); FUNCTION_CASE(entry, StubRoutines::dexp()); FUNCTION_CASE(entry, StubRoutines::dlog()); + FUNCTION_CASE(entry, StubRoutines::dpow()); #undef FUNCTION_CASE diff --git a/hotspot/src/share/vm/opto/classes.hpp b/hotspot/src/share/vm/opto/classes.hpp index 0779c3b96a8..16ccc5817b6 100644 --- a/hotspot/src/share/vm/opto/classes.hpp +++ b/hotspot/src/share/vm/opto/classes.hpp @@ -216,7 +216,6 @@ macro(PartialSubtypeCheck) macro(Phi) macro(PopCountI) macro(PopCountL) -macro(PowD) macro(PrefetchAllocation) macro(Proj) macro(RShiftI) diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index 6620e57be72..8e3b18e76d8 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -230,8 +230,6 @@ class LibraryCallKit : public GraphKit { bool inline_math_negateExactL(); bool inline_math_subtractExactI(bool is_decrement); bool inline_math_subtractExactL(bool is_decrement); - bool inline_pow(); - Node* finish_pow_exp(Node* result, Node* x, Node* y, const TypeFunc* call_type, address funcAddr, const char* funcName); bool inline_min_max(vmIntrinsics::ID id); bool inline_notify(vmIntrinsics::ID id); Node* generate_min_max(vmIntrinsics::ID id, Node* x, Node* y); @@ -1718,243 +1716,6 @@ bool LibraryCallKit::inline_trig(vmIntrinsics::ID id) { return true; } -Node* LibraryCallKit::finish_pow_exp(Node* result, Node* x, Node* y, const TypeFunc* call_type, address funcAddr, const char* funcName) { - //------------------- - //result=(result.isNaN())? funcAddr():result; - // Check: If isNaN() by checking result!=result? then either trap - // or go to runtime - Node* cmpisnan = _gvn.transform(new CmpDNode(result, result)); - // Build the boolean node - Node* bolisnum = _gvn.transform(new BoolNode(cmpisnan, BoolTest::eq)); - - if (!too_many_traps(Deoptimization::Reason_intrinsic)) { - { BuildCutout unless(this, bolisnum, PROB_STATIC_FREQUENT); - // The pow or exp intrinsic returned a NaN, which requires a call - // to the runtime. Recompile with the runtime call. - uncommon_trap(Deoptimization::Reason_intrinsic, - Deoptimization::Action_make_not_entrant); - } - return result; - } else { - // If this inlining ever returned NaN in the past, we compile a call - // to the runtime to properly handle corner cases - - IfNode* iff = create_and_xform_if(control(), bolisnum, PROB_STATIC_FREQUENT, COUNT_UNKNOWN); - Node* if_slow = _gvn.transform(new IfFalseNode(iff)); - Node* if_fast = _gvn.transform(new IfTrueNode(iff)); - - if (!if_slow->is_top()) { - RegionNode* result_region = new RegionNode(3); - PhiNode* result_val = new PhiNode(result_region, Type::DOUBLE); - - result_region->init_req(1, if_fast); - result_val->init_req(1, result); - - set_control(if_slow); - - const TypePtr* no_memory_effects = NULL; - Node* rt = make_runtime_call(RC_LEAF, call_type, funcAddr, funcName, - no_memory_effects, - x, top(), y, y ? top() : NULL); - Node* value = _gvn.transform(new ProjNode(rt, TypeFunc::Parms+0)); -#ifdef ASSERT - Node* value_top = _gvn.transform(new ProjNode(rt, TypeFunc::Parms+1)); - assert(value_top == top(), "second value must be top"); -#endif - - result_region->init_req(2, control()); - result_val->init_req(2, value); - set_control(_gvn.transform(result_region)); - return _gvn.transform(result_val); - } else { - return result; - } - } -} - -//------------------------------inline_pow------------------------------------- -// Inline power instructions, if possible. -bool LibraryCallKit::inline_pow() { - // Pseudocode for pow - // if (y == 2) { - // return x * x; - // } else { - // if (x <= 0.0) { - // long longy = (long)y; - // if ((double)longy == y) { // if y is long - // if (y + 1 == y) longy = 0; // huge number: even - // result = ((1&longy) == 0)?-DPow(abs(x), y):DPow(abs(x), y); - // } else { - // result = NaN; - // } - // } else { - // result = DPow(x,y); - // } - // if (result != result)? { - // result = uncommon_trap() or runtime_call(); - // } - // return result; - // } - - Node* x = round_double_node(argument(0)); - Node* y = round_double_node(argument(2)); - - Node* result = NULL; - - Node* const_two_node = makecon(TypeD::make(2.0)); - Node* cmp_node = _gvn.transform(new CmpDNode(y, const_two_node)); - Node* bool_node = _gvn.transform(new BoolNode(cmp_node, BoolTest::eq)); - IfNode* if_node = create_and_xform_if(control(), bool_node, PROB_STATIC_INFREQUENT, COUNT_UNKNOWN); - Node* if_true = _gvn.transform(new IfTrueNode(if_node)); - Node* if_false = _gvn.transform(new IfFalseNode(if_node)); - - RegionNode* region_node = new RegionNode(3); - region_node->init_req(1, if_true); - - Node* phi_node = new PhiNode(region_node, Type::DOUBLE); - // special case for x^y where y == 2, we can convert it to x * x - phi_node->init_req(1, _gvn.transform(new MulDNode(x, x))); - - // set control to if_false since we will now process the false branch - set_control(if_false); - - if (!too_many_traps(Deoptimization::Reason_intrinsic)) { - // Short form: skip the fancy tests and just check for NaN result. - result = _gvn.transform(new PowDNode(C, control(), x, y)); - } else { - // If this inlining ever returned NaN in the past, include all - // checks + call to the runtime. - - // Set the merge point for If node with condition of (x <= 0.0) - // There are four possible paths to region node and phi node - RegionNode *r = new RegionNode(4); - Node *phi = new PhiNode(r, Type::DOUBLE); - - // Build the first if node: if (x <= 0.0) - // Node for 0 constant - Node *zeronode = makecon(TypeD::ZERO); - // Check x:0 - Node *cmp = _gvn.transform(new CmpDNode(x, zeronode)); - // Check: If (x<=0) then go complex path - Node *bol1 = _gvn.transform(new BoolNode( cmp, BoolTest::le )); - // Branch either way - IfNode *if1 = create_and_xform_if(control(),bol1, PROB_STATIC_INFREQUENT, COUNT_UNKNOWN); - // Fast path taken; set region slot 3 - Node *fast_taken = _gvn.transform(new IfFalseNode(if1)); - r->init_req(3,fast_taken); // Capture fast-control - - // Fast path not-taken, i.e. slow path - Node *complex_path = _gvn.transform(new IfTrueNode(if1)); - - // Set fast path result - Node *fast_result = _gvn.transform(new PowDNode(C, control(), x, y)); - phi->init_req(3, fast_result); - - // Complex path - // Build the second if node (if y is long) - // Node for (long)y - Node *longy = _gvn.transform(new ConvD2LNode(y)); - // Node for (double)((long) y) - Node *doublelongy= _gvn.transform(new ConvL2DNode(longy)); - // Check (double)((long) y) : y - Node *cmplongy= _gvn.transform(new CmpDNode(doublelongy, y)); - // Check if (y isn't long) then go to slow path - - Node *bol2 = _gvn.transform(new BoolNode( cmplongy, BoolTest::ne )); - // Branch either way - IfNode *if2 = create_and_xform_if(complex_path,bol2, PROB_STATIC_INFREQUENT, COUNT_UNKNOWN); - Node* ylong_path = _gvn.transform(new IfFalseNode(if2)); - - Node *slow_path = _gvn.transform(new IfTrueNode(if2)); - - // Calculate DPow(abs(x), y)*(1 & (long)y) - // Node for constant 1 - Node *conone = longcon(1); - // 1& (long)y - Node *signnode= _gvn.transform(new AndLNode(conone, longy)); - - // A huge number is always even. Detect a huge number by checking - // if y + 1 == y and set integer to be tested for parity to 0. - // Required for corner case: - // (long)9.223372036854776E18 = max_jlong - // (double)(long)9.223372036854776E18 = 9.223372036854776E18 - // max_jlong is odd but 9.223372036854776E18 is even - Node* yplus1 = _gvn.transform(new AddDNode(y, makecon(TypeD::make(1)))); - Node *cmpyplus1= _gvn.transform(new CmpDNode(yplus1, y)); - Node *bolyplus1 = _gvn.transform(new BoolNode( cmpyplus1, BoolTest::eq )); - Node* correctedsign = NULL; - if (ConditionalMoveLimit != 0) { - correctedsign = _gvn.transform(CMoveNode::make(NULL, bolyplus1, signnode, longcon(0), TypeLong::LONG)); - } else { - IfNode *ifyplus1 = create_and_xform_if(ylong_path,bolyplus1, PROB_FAIR, COUNT_UNKNOWN); - RegionNode *r = new RegionNode(3); - Node *phi = new PhiNode(r, TypeLong::LONG); - r->init_req(1, _gvn.transform(new IfFalseNode(ifyplus1))); - r->init_req(2, _gvn.transform(new IfTrueNode(ifyplus1))); - phi->init_req(1, signnode); - phi->init_req(2, longcon(0)); - correctedsign = _gvn.transform(phi); - ylong_path = _gvn.transform(r); - record_for_igvn(r); - } - - // zero node - Node *conzero = longcon(0); - // Check (1&(long)y)==0? - Node *cmpeq1 = _gvn.transform(new CmpLNode(correctedsign, conzero)); - // Check if (1&(long)y)!=0?, if so the result is negative - Node *bol3 = _gvn.transform(new BoolNode( cmpeq1, BoolTest::ne )); - // abs(x) - Node *absx=_gvn.transform(new AbsDNode(x)); - // abs(x)^y - Node *absxpowy = _gvn.transform(new PowDNode(C, control(), absx, y)); - // -abs(x)^y - Node *negabsxpowy = _gvn.transform(new NegDNode (absxpowy)); - // (1&(long)y)==1?-DPow(abs(x), y):DPow(abs(x), y) - Node *signresult = NULL; - if (ConditionalMoveLimit != 0) { - signresult = _gvn.transform(CMoveNode::make(NULL, bol3, absxpowy, negabsxpowy, Type::DOUBLE)); - } else { - IfNode *ifyeven = create_and_xform_if(ylong_path,bol3, PROB_FAIR, COUNT_UNKNOWN); - RegionNode *r = new RegionNode(3); - Node *phi = new PhiNode(r, Type::DOUBLE); - r->init_req(1, _gvn.transform(new IfFalseNode(ifyeven))); - r->init_req(2, _gvn.transform(new IfTrueNode(ifyeven))); - phi->init_req(1, absxpowy); - phi->init_req(2, negabsxpowy); - signresult = _gvn.transform(phi); - ylong_path = _gvn.transform(r); - record_for_igvn(r); - } - // Set complex path fast result - r->init_req(2, ylong_path); - phi->init_req(2, signresult); - - static const jlong nan_bits = CONST64(0x7ff8000000000000); - Node *slow_result = makecon(TypeD::make(*(double*)&nan_bits)); // return NaN - r->init_req(1,slow_path); - phi->init_req(1,slow_result); - - // Post merge - set_control(_gvn.transform(r)); - record_for_igvn(r); - result = _gvn.transform(phi); - } - - result = finish_pow_exp(result, x, y, OptoRuntime::Math_DD_D_Type(), CAST_FROM_FN_PTR(address, SharedRuntime::dpow), "POW"); - - // control from finish_pow_exp is now input to the region node - region_node->set_req(2, control()); - // the result from finish_pow_exp is now input to the phi node - phi_node->init_req(2, result); - set_control(_gvn.transform(region_node)); - record_for_igvn(region_node); - set_result(_gvn.transform(phi_node)); - - C->set_has_split_ifs(true); // Has chance for split-if optimization - return true; -} - //------------------------------runtime_math----------------------------- bool LibraryCallKit::runtime_math(const TypeFunc* call_type, address funcAddr, const char* funcName) { assert(call_type == OptoRuntime::Math_DD_D_Type() || call_type == OptoRuntime::Math_D_D_Type(), @@ -2005,8 +1766,10 @@ bool LibraryCallKit::inline_math_native(vmIntrinsics::ID id) { return StubRoutines::dexp() != NULL ? runtime_math(OptoRuntime::Math_D_D_Type(), StubRoutines::dexp(), "dexp") : runtime_math(OptoRuntime::Math_D_D_Type(), FN_PTR(SharedRuntime::dexp), "EXP"); - case vmIntrinsics::_dpow: return Matcher::has_match_rule(Op_PowD) ? inline_pow() : - runtime_math(OptoRuntime::Math_DD_D_Type(), FN_PTR(SharedRuntime::dpow), "POW"); + case vmIntrinsics::_dpow: + return StubRoutines::dpow() != NULL ? + runtime_math(OptoRuntime::Math_DD_D_Type(), StubRoutines::dpow(), "dpow") : + runtime_math(OptoRuntime::Math_DD_D_Type(), FN_PTR(SharedRuntime::dpow), "POW"); #undef FN_PTR // These intrinsics are not yet correctly implemented diff --git a/hotspot/src/share/vm/opto/subnode.cpp b/hotspot/src/share/vm/opto/subnode.cpp index 4eb9dc9e2af..5429d5d4274 100644 --- a/hotspot/src/share/vm/opto/subnode.cpp +++ b/hotspot/src/share/vm/opto/subnode.cpp @@ -1519,17 +1519,3 @@ const Type *Log10DNode::Value( PhaseTransform *phase ) const { return TypeD::make( StubRoutines::intrinsic_log10( d ) ); } -//============================================================================= -//------------------------------Value------------------------------------------ -// Compute pow -const Type *PowDNode::Value( PhaseTransform *phase ) const { - const Type *t1 = phase->type( in(1) ); - if( t1 == Type::TOP ) return Type::TOP; - if( t1->base() != Type::DoubleCon ) return Type::DOUBLE; - const Type *t2 = phase->type( in(2) ); - if( t2 == Type::TOP ) return Type::TOP; - if( t2->base() != Type::DoubleCon ) return Type::DOUBLE; - double d1 = t1->getd(); - double d2 = t2->getd(); - return TypeD::make( StubRoutines::intrinsic_pow( d1, d2 ) ); -} diff --git a/hotspot/src/share/vm/opto/subnode.hpp b/hotspot/src/share/vm/opto/subnode.hpp index caeaae93a42..3ee7b4763b1 100644 --- a/hotspot/src/share/vm/opto/subnode.hpp +++ b/hotspot/src/share/vm/opto/subnode.hpp @@ -491,20 +491,6 @@ public: virtual const Type *Value( PhaseTransform *phase ) const; }; -//------------------------------PowDNode--------------------------------------- -// Raise a double to a double power -class PowDNode : public Node { -public: - PowDNode(Compile* C, Node *c, Node *in1, Node *in2 ) : Node(c, in1, in2) { - init_flags(Flag_is_expensive); - C->add_expensive_node(this); - } - virtual int Opcode() const; - const Type *bottom_type() const { return Type::DOUBLE; } - virtual uint ideal_reg() const { return Op_RegD; } - virtual const Type *Value( PhaseTransform *phase ) const; -}; - //-------------------------------ReverseBytesINode-------------------------------- // reverse bytes of an integer class ReverseBytesINode : public Node { diff --git a/hotspot/src/share/vm/runtime/stubRoutines.cpp b/hotspot/src/share/vm/runtime/stubRoutines.cpp index 11b304f3410..21fe0c6054f 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.cpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.cpp @@ -153,9 +153,9 @@ address StubRoutines::_vectorizedMismatch = NULL; address StubRoutines::_dexp = NULL; address StubRoutines::_dlog = NULL; +address StubRoutines::_dpow = NULL; double (* StubRoutines::_intrinsic_log10 )(double) = NULL; -double (* StubRoutines::_intrinsic_pow )(double, double) = NULL; double (* StubRoutines::_intrinsic_sin )(double) = NULL; double (* StubRoutines::_intrinsic_cos )(double) = NULL; double (* StubRoutines::_intrinsic_tan )(double) = NULL; diff --git a/hotspot/src/share/vm/runtime/stubRoutines.hpp b/hotspot/src/share/vm/runtime/stubRoutines.hpp index c224cd3a994..aff8ad0a0cf 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.hpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp @@ -212,6 +212,7 @@ class StubRoutines: AllStatic { static address _dexp; static address _dlog; + static address _dpow; // These are versions of the java.lang.Math methods which perform // the same operations as the intrinsic version. They are used for @@ -384,6 +385,7 @@ class StubRoutines: AllStatic { static address dexp() { return _dexp; } static address dlog() { return _dlog; } + static address dpow() { return _dpow; } static address select_fill_function(BasicType t, bool aligned, const char* &name); diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index 44f459fdafd..dafa827c6c6 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -860,6 +860,7 @@ typedef CompactHashtable SymbolCompactHashTable; static_field(StubRoutines, _mulAdd, address) \ static_field(StubRoutines, _dexp, address) \ static_field(StubRoutines, _dlog, address) \ + static_field(StubRoutines, _dpow, address) \ static_field(StubRoutines, _vectorizedMismatch, address) \ static_field(StubRoutines, _jbyte_arraycopy, address) \ static_field(StubRoutines, _jshort_arraycopy, address) \ @@ -2058,7 +2059,6 @@ typedef CompactHashtable SymbolCompactHashTable; declare_c2_type(AtanDNode, Node) \ declare_c2_type(SqrtDNode, Node) \ declare_c2_type(Log10DNode, Node) \ - declare_c2_type(PowDNode, Node) \ declare_c2_type(ReverseBytesINode, Node) \ declare_c2_type(ReverseBytesLNode, Node) \ declare_c2_type(ReductionNode, Node) \ From cee2a179e6a3c656707a045fe540da7f724b7405 Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Wed, 23 Dec 2015 20:19:42 -1000 Subject: [PATCH 116/146] 8143072: [JVMCI] Port JVMCI to AArch64 Reviewed-by: gdub, rschatz, twisti, kvn --- hotspot/.mx.jvmci/suite.py | 28 ++ hotspot/make/excludeSrc.make | 4 +- hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk | 1 + hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp | 4 +- .../src/cpu/aarch64/vm/globals_aarch64.hpp | 9 +- .../cpu/aarch64/vm/interp_masm_aarch64.cpp | 99 ++++-- .../cpu/aarch64/vm/interp_masm_aarch64.hpp | 6 + .../cpu/aarch64/vm/macroAssembler_aarch64.hpp | 2 +- .../src/cpu/aarch64/vm/nativeInst_aarch64.hpp | 14 +- .../cpu/aarch64/vm/sharedRuntime_aarch64.cpp | 94 +++++- .../templateInterpreterGenerator_aarch64.cpp | 13 + .../src/cpu/aarch64/vm/vmStructs_aarch64.hpp | 14 +- .../src/cpu/aarch64/vm/vm_version_aarch64.cpp | 14 +- .../src/cpu/aarch64/vm/vm_version_aarch64.hpp | 17 +- hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp | 8 +- hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp | 5 +- hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp | 17 +- hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp | 11 +- hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp | 6 +- hotspot/src/cpu/x86/vm/vmStructs_x86.hpp | 15 +- hotspot/src/cpu/x86/vm/vm_version_x86.cpp | 44 ++- hotspot/src/cpu/x86/vm/vm_version_x86.hpp | 90 +++--- hotspot/src/cpu/zero/vm/vm_version_zero.hpp | 3 - .../src/jdk/vm/ci/aarch64/AArch64.java | 237 ++++++++++++++ .../src/jdk/vm/ci/aarch64/AArch64Kind.java | 171 ++++++++++ .../AArch64HotSpotJVMCIBackendFactory.java | 131 ++++++++ .../aarch64/AArch64HotSpotRegisterConfig.java | 298 ++++++++++++++++++ .../AMD64HotSpotJVMCIBackendFactory.java | 48 +-- .../SPARCHotSpotJVMCIBackendFactory.java | 46 +-- .../jdk/vm/ci/hotspot/HotSpotVMConfig.java | 118 +++---- hotspot/src/os/aix/vm/os_aix.cpp | 2 +- .../src/share/vm/jvmci/vmStructs_jvmci.cpp | 14 +- hotspot/src/share/vm/prims/whitebox.cpp | 4 +- hotspot/src/share/vm/runtime/os.cpp | 2 +- hotspot/src/share/vm/runtime/vmStructs.cpp | 2 + hotspot/src/share/vm/runtime/vm_version.cpp | 4 + hotspot/src/share/vm/runtime/vm_version.hpp | 17 +- .../jvmci/JVM_GetJVMCIRuntimeTest.java | 2 +- .../jvmci/SecurityRestrictionsTest.java | 2 +- .../compilerToVM/AllocateCompileIdTest.java | 2 +- .../compilerToVM/CanInlineMethodTest.java | 2 +- .../compilerToVM/CollectCountersTest.java | 2 +- .../jvmci/compilerToVM/DebugOutputTest.java | 2 +- .../compilerToVM/DisassembleCodeBlobTest.java | 2 +- .../DoNotInlineOrCompileTest.java | 2 +- .../ExecuteInstalledCodeTest.java | 2 +- .../FindUniqueConcreteMethodTest.java | 2 +- .../jvmci/compilerToVM/GetBytecodeTest.java | 2 +- .../compilerToVM/GetClassInitializerTest.java | 2 +- .../compilerToVM/GetConstantPoolTest.java | 2 +- .../compilerToVM/GetExceptionTableTest.java | 2 +- .../compilerToVM/GetImplementorTest.java | 2 +- .../compilerToVM/GetLineNumberTableTest.java | 2 +- .../GetLocalVariableTableTest.java | 2 +- .../GetMaxCallTargetOffsetTest.java | 2 +- .../compilerToVM/GetNextStackFrameTest.java | 2 +- .../GetResolvedJavaMethodAtSlotTest.java | 2 +- .../GetResolvedJavaMethodTest.java | 2 +- .../compilerToVM/GetResolvedJavaTypeTest.java | 2 +- .../GetStackTraceElementTest.java | 2 +- .../jvmci/compilerToVM/GetSymbolTest.java | 2 +- .../GetVtableIndexForInterfaceTest.java | 2 +- .../HasCompiledCodeForOSRTest.java | 2 +- .../HasFinalizableSubclassTest.java | 2 +- .../InitializeConfigurationTest.java | 2 +- .../InvalidateInstalledCodeTest.java | 2 +- .../jvmci/compilerToVM/IsMatureTest.java | 2 +- .../JVM_RegisterJVMCINatives.java | 2 +- .../compilerToVM/LookupKlassInPoolTest.java | 2 +- .../jvmci/compilerToVM/LookupTypeTest.java | 2 +- .../MaterializeVirtualObjectTest.java | 2 +- ...ethodIsIgnoredBySecurityStackWalkTest.java | 2 +- .../compilerToVM/ReadUncompressedOopTest.java | 2 +- .../jvmci/compilerToVM/ReprofileTest.java | 2 +- .../ResolveConstantInPoolTest.java | 2 +- .../jvmci/compilerToVM/ResolveMethodTest.java | 2 +- .../compilerToVM/ResolveTypeInPoolTest.java | 2 +- .../ShouldDebugNonSafepointsTest.java | 2 +- .../compilerToVM/ShouldInlineMethodTest.java | 2 +- .../errors/TestInvalidCompilationResult.java | 2 +- .../jvmci/errors/TestInvalidDebugInfo.java | 2 +- .../jvmci/errors/TestInvalidOopMap.java | 2 +- .../JvmciCreateMetaAccessContextTest.java | 2 +- .../events/JvmciNotifyInstallEventTest.java | 2 +- .../jvmci/events/JvmciShutdownEventTest.java | 2 +- .../test/NestedBooleanOptionValueTest.java | 2 +- .../vm/ci/options/test/TestOptionValue.java | 2 +- .../jdk/vm/ci/runtime/test/ConstantTest.java | 2 +- .../vm/ci/runtime/test/RedefineClassTest.java | 2 +- ...lvedJavaTypeResolveConcreteMethodTest.java | 2 +- .../ResolvedJavaTypeResolveMethodTest.java | 2 +- .../test/TestConstantReflectionProvider.java | 2 +- .../jdk/vm/ci/runtime/test/TestJavaField.java | 2 +- .../vm/ci/runtime/test/TestJavaMethod.java | 2 +- .../jdk/vm/ci/runtime/test/TestJavaType.java | 2 +- .../runtime/test/TestMetaAccessProvider.java | 2 +- .../runtime/test/TestResolvedJavaField.java | 2 +- .../runtime/test/TestResolvedJavaMethod.java | 2 +- .../ci/runtime/test/TestResolvedJavaType.java | 2 +- 99 files changed, 1350 insertions(+), 386 deletions(-) create mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64.java create mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64Kind.java create mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java create mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java diff --git a/hotspot/.mx.jvmci/suite.py b/hotspot/.mx.jvmci/suite.py index 3fd3a3cddc1..cd6eac41bd1 100644 --- a/hotspot/.mx.jvmci/suite.py +++ b/hotspot/.mx.jvmci/suite.py @@ -169,6 +169,15 @@ suite = { # ------------- JVMCI:HotSpot ------------- + "jdk.vm.ci.aarch64" : { + "subDir" : "src/jdk.vm.ci/share/classes", + "sourceDirs" : ["src"], + "dependencies" : ["jdk.vm.ci.code"], + "checkstyle" : "jdk.vm.ci.service", + "javaCompliance" : "1.8", + "workingSets" : "JVMCI,AArch64", + }, + "jdk.vm.ci.amd64" : { "subDir" : "src/jdk.vm.ci/share/classes", "sourceDirs" : ["src"], @@ -213,6 +222,21 @@ suite = { "workingSets" : "JVMCI,HotSpot", }, + "jdk.vm.ci.hotspot.aarch64" : { + "subDir" : "src/jdk.vm.ci/share/classes", + "sourceDirs" : ["src"], + "dependencies" : [ + "jdk.vm.ci.aarch64", + "jdk.vm.ci.hotspot", + ], + "checkstyle" : "jdk.vm.ci.service", + "annotationProcessors" : [ + "JVMCI_SERVICE_PROCESSOR", + ], + "javaCompliance" : "1.8", + "workingSets" : "JVMCI,HotSpot,AArch64", + }, + "jdk.vm.ci.hotspot.amd64" : { "subDir" : "src/jdk.vm.ci/share/classes", "sourceDirs" : ["src"], @@ -269,6 +293,7 @@ suite = { "jdk.vm.ci.inittimer", "jdk.vm.ci.runtime", "jdk.vm.ci.common", + "jdk.vm.ci.aarch64", "jdk.vm.ci.amd64", "jdk.vm.ci.sparc", ], @@ -288,6 +313,7 @@ suite = { "JVMCI_HOTSPOT" : { "subDir" : "src/jdk.vm.ci/share/classes", "dependencies" : [ + "jdk.vm.ci.hotspot.aarch64", "jdk.vm.ci.hotspot.amd64", "jdk.vm.ci.hotspot.sparc", ], @@ -345,9 +371,11 @@ suite = { "jdk.vm.ci.inittimer", "jdk.vm.ci.runtime", "jdk.vm.ci.common", + "jdk.vm.ci.aarch64", "jdk.vm.ci.amd64", "jdk.vm.ci.sparc", "jdk.vm.ci.hotspotvmconfig", + "jdk.vm.ci.hotspot.aarch64", "jdk.vm.ci.hotspot.amd64", "jdk.vm.ci.hotspot.sparc", "jdk.vm.ci.options.processor", diff --git a/hotspot/make/excludeSrc.make b/hotspot/make/excludeSrc.make index 9feb96861ee..cab00edf842 100644 --- a/hotspot/make/excludeSrc.make +++ b/hotspot/make/excludeSrc.make @@ -107,8 +107,8 @@ ifeq ($(INCLUDE_NMT), false) memTracker.cpp nmtDCmd.cpp mallocSiteTable.cpp endif -ifneq (,$(findstring $(Platform_arch_model), x86_64, sparc)) - # JVMCI is supported only on x86_64 and SPARC. +ifneq (,$(findstring $(Platform_arch_model), aarch64, arm_64, sparc, x86_64)) + # JVMCI is supported else INCLUDE_JVMCI := false endif diff --git a/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk b/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk index 654a7f8fd32..1d9fd149467 100644 --- a/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk +++ b/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk @@ -57,6 +57,7 @@ $(eval $(call SetupJavaCompilation, BUILD_JVMCI_SERVICE, \ PROC_SRC_SUBDIRS := \ jdk.vm.ci.hotspot \ + jdk.vm.ci.hotspot.aarch64 \ jdk.vm.ci.hotspot.amd64 \ jdk.vm.ci.hotspot.sparc \ jdk.vm.ci.runtime \ diff --git a/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp index 52a0bb25c47..fc96c347d00 100644 --- a/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp @@ -454,11 +454,11 @@ frame frame::sender_for_interpreter_frame(RegisterMap* map) const { // This is the sp before any possible extension (adapter/locals). intptr_t* unextended_sp = interpreter_frame_sender_sp(); -#ifdef COMPILER2 +#if defined(COMPILER2) || INCLUDE_JVMCI if (map->update_map()) { update_map_with_saved_link(map, (intptr_t**) addr_at(link_offset)); } -#endif // COMPILER2 +#endif // COMPILER2 || INCLUDE_JVMCI return frame(sender_sp, unextended_sp, link(), sender_pc()); } diff --git a/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp index 8e5ed8c43f0..b6a58d9a371 100644 --- a/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/globals_aarch64.hpp @@ -40,14 +40,7 @@ define_pd_global(bool, ImplicitNullChecks, true); // Generate code for im define_pd_global(bool, TrapBasedNullChecks, false); define_pd_global(bool, UncommonNullCast, true); // Uncommon-trap NULLs past to check cast -// See 4827828 for this change. There is no globals_core_i486.hpp. I can't -// assign a different value for C2 without touching a number of files. Use -// #ifdef to minimize the change as it's late in Mantis. -- FIXME. -// c1 doesn't have this problem because the fix to 4858033 assures us -// the the vep is aligned at CodeEntryAlignment whereas c2 only aligns -// the uep and the vep doesn't get real alignment but just slops on by -// only assured that the entry instruction meets the 5 byte size requirement. -#ifdef COMPILER2 +#if defined(COMPILER2) || INCLUDE_JVMCI define_pd_global(intx, CodeEntryAlignment, 64); #else define_pd_global(intx, CodeEntryAlignment, 16); diff --git a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp index 73f35a6bb44..b65a76aaf99 100644 --- a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp @@ -1060,13 +1060,39 @@ void InterpreterMacroAssembler::profile_virtual_call(Register receiver, bind(skip_receiver_profile); // The method data pointer needs to be updated to reflect the new target. +#if INCLUDE_JVMCI + if (MethodProfileWidth == 0) { + update_mdp_by_constant(mdp, in_bytes(VirtualCallData::virtual_call_data_size())); + } +#else // INCLUDE_JVMCI update_mdp_by_constant(mdp, in_bytes(VirtualCallData:: virtual_call_data_size())); +#endif // INCLUDE_JVMCI bind(profile_continue); } } +#if INCLUDE_JVMCI +void InterpreterMacroAssembler::profile_called_method(Register method, Register mdp, Register reg2) { + assert_different_registers(method, mdp, reg2); + if (ProfileInterpreter && MethodProfileWidth > 0) { + Label profile_continue; + + // If no method data exists, go to profile_continue. + test_method_data_pointer(mdp, profile_continue); + + Label done; + record_item_in_profile_helper(method, mdp, reg2, 0, done, MethodProfileWidth, + &VirtualCallData::method_offset, &VirtualCallData::method_count_offset, in_bytes(VirtualCallData::nonprofiled_receiver_count_offset())); + bind(done); + + update_mdp_by_constant(mdp, in_bytes(VirtualCallData::virtual_call_data_size())); + bind(profile_continue); + } +} +#endif // INCLUDE_JVMCI + // This routine creates a state machine for updating the multi-row // type profile at a virtual call site (or other type-sensitive bytecode). // The machine visits each row (of receiver/count) until the receiver type @@ -1086,14 +1112,36 @@ void InterpreterMacroAssembler::record_klass_in_profile_helper( if (is_virtual_call) { increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset())); } - return; - } +#if INCLUDE_JVMCI + else if (EnableJVMCI) { + increment_mdp_data_at(mdp, in_bytes(ReceiverTypeData::nonprofiled_receiver_count_offset())); + } +#endif // INCLUDE_JVMCI + } else { + int non_profiled_offset = -1; + if (is_virtual_call) { + non_profiled_offset = in_bytes(CounterData::count_offset()); + } +#if INCLUDE_JVMCI + else if (EnableJVMCI) { + non_profiled_offset = in_bytes(ReceiverTypeData::nonprofiled_receiver_count_offset()); + } +#endif // INCLUDE_JVMCI - int last_row = VirtualCallData::row_limit() - 1; + record_item_in_profile_helper(receiver, mdp, reg2, 0, done, TypeProfileWidth, + &VirtualCallData::receiver_offset, &VirtualCallData::receiver_count_offset, non_profiled_offset); + } +} + +void InterpreterMacroAssembler::record_item_in_profile_helper(Register item, Register mdp, + Register reg2, int start_row, Label& done, int total_rows, + OffsetFunction item_offset_fn, OffsetFunction item_count_offset_fn, + int non_profiled_offset) { + int last_row = total_rows - 1; assert(start_row <= last_row, "must be work left to do"); - // Test this row for both the receiver and for null. + // Test this row for both the item and for null. // Take any of three different outcomes: - // 1. found receiver => increment count and goto done + // 1. found item => increment count and goto done // 2. found null => keep looking for case 1, maybe allocate this cell // 3. found something else => keep looking for cases 1 and 2 // Case 3 is handled by a recursive call. @@ -1101,55 +1149,56 @@ void InterpreterMacroAssembler::record_klass_in_profile_helper( Label next_test; bool test_for_null_also = (row == start_row); - // See if the receiver is receiver[n]. - int recvr_offset = in_bytes(VirtualCallData::receiver_offset(row)); - test_mdp_data_at(mdp, recvr_offset, receiver, + // See if the item is item[n]. + int item_offset = in_bytes(item_offset_fn(row)); + test_mdp_data_at(mdp, item_offset, item, (test_for_null_also ? reg2 : noreg), next_test); - // (Reg2 now contains the receiver from the CallData.) + // (Reg2 now contains the item from the CallData.) - // The receiver is receiver[n]. Increment count[n]. - int count_offset = in_bytes(VirtualCallData::receiver_count_offset(row)); + // The item is item[n]. Increment count[n]. + int count_offset = in_bytes(item_count_offset_fn(row)); increment_mdp_data_at(mdp, count_offset); b(done); bind(next_test); if (test_for_null_also) { Label found_null; - // Failed the equality check on receiver[n]... Test for null. + // Failed the equality check on item[n]... Test for null. if (start_row == last_row) { // The only thing left to do is handle the null case. - if (is_virtual_call) { + if (non_profiled_offset >= 0) { cbz(reg2, found_null); - // Receiver did not match any saved receiver and there is no empty row for it. + // Item did not match any saved item and there is no empty row for it. // Increment total counter to indicate polymorphic case. - increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset())); + increment_mdp_data_at(mdp, non_profiled_offset); b(done); bind(found_null); } else { - cbz(reg2, done); + cbnz(reg2, done); } break; } // Since null is rare, make it be the branch-taken case. - cbz(reg2,found_null); + cbz(reg2, found_null); // Put all the "Case 3" tests here. - record_klass_in_profile_helper(receiver, mdp, reg2, start_row + 1, done, is_virtual_call); + record_item_in_profile_helper(item, mdp, reg2, start_row + 1, done, total_rows, + item_offset_fn, item_count_offset_fn, non_profiled_offset); - // Found a null. Keep searching for a matching receiver, + // Found a null. Keep searching for a matching item, // but remember that this is an empty (unused) slot. bind(found_null); } } - // In the fall-through case, we found no matching receiver, but we - // observed the receiver[start_row] is NULL. + // In the fall-through case, we found no matching item, but we + // observed the item[start_row] is NULL. - // Fill in the receiver field and increment the count. - int recvr_offset = in_bytes(VirtualCallData::receiver_offset(start_row)); - set_mdp_data_at(mdp, recvr_offset, receiver); - int count_offset = in_bytes(VirtualCallData::receiver_count_offset(start_row)); + // Fill in the item field and increment the count. + int item_offset = in_bytes(item_offset_fn(start_row)); + set_mdp_data_at(mdp, item_offset, item); + int count_offset = in_bytes(item_count_offset_fn(start_row)); mov(reg2, DataLayout::counter_increment); set_mdp_data_at(mdp, count_offset, reg2); if (start_row > 0) { diff --git a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp index 5cdfdecf2d3..2dbe364dfa1 100644 --- a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp @@ -33,6 +33,7 @@ // This file specializes the assember with interpreter-specific macros +typedef ByteSize (*OffsetFunction)(uint); class InterpreterMacroAssembler: public MacroAssembler { #ifndef CC_INTERP @@ -248,6 +249,10 @@ class InterpreterMacroAssembler: public MacroAssembler { void record_klass_in_profile_helper(Register receiver, Register mdp, Register reg2, int start_row, Label& done, bool is_virtual_call); + void record_item_in_profile_helper(Register item, Register mdp, + Register reg2, int start_row, Label& done, int total_rows, + OffsetFunction item_offset_fn, OffsetFunction item_count_offset_fn, + int non_profiled_offset); void update_mdp_by_offset(Register mdp_in, int offset_of_offset); void update_mdp_by_offset(Register mdp_in, Register reg, int offset_of_disp); @@ -261,6 +266,7 @@ class InterpreterMacroAssembler: public MacroAssembler { void profile_virtual_call(Register receiver, Register mdp, Register scratch2, bool receiver_can_be_null = false); + void profile_called_method(Register method, Register mdp, Register reg2) NOT_JVMCI_RETURN; void profile_ret(Register return_bci, Register mdp); void profile_null_seen(Register mdp); void profile_typecheck(Register mdp, Register klass, Register scratch); diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp index ade0ba0eb97..b9274510563 100644 --- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp @@ -417,7 +417,7 @@ class MacroAssembler: public Assembler { #define WRAP(INSN) \ void INSN(Register Rd, Register Rn, Register Rm, Register Ra) { \ - if ((VM_Version::cpu_cpuFeatures() & VM_Version::CPU_A53MAC) && Ra != zr) \ + if ((VM_Version::features() & VM_Version::CPU_A53MAC) && Ra != zr) \ nop(); \ Assembler::INSN(Rd, Rn, Rm, Ra); \ } diff --git a/hotspot/src/cpu/aarch64/vm/nativeInst_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/nativeInst_aarch64.hpp index 60e26e08270..d6b0cb84298 100644 --- a/hotspot/src/cpu/aarch64/vm/nativeInst_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/nativeInst_aarch64.hpp @@ -62,7 +62,6 @@ class NativeInstruction VALUE_OBJ_CLASS_SPEC { inline bool is_jump_or_nop(); inline bool is_cond_jump(); bool is_safepoint_poll(); - inline bool is_mov_literal64(); bool is_movz(); bool is_movk(); bool is_sigill_zombie_not_entrant(); @@ -98,6 +97,14 @@ class NativeInstruction VALUE_OBJ_CLASS_SPEC { static bool is_ldr_literal_at(address instr); static bool is_ldrw_to_zr(address instr); + static bool is_call_at(address instr) { + const uint32_t insn = (*(uint32_t*)instr); + return (insn >> 26) == 0b100101; + } + bool is_call() { + return is_call_at(addr_at(0)); + } + static bool maybe_cpool_ref(address instr) { return is_adrp_at(instr) || is_ldr_literal_at(instr); } @@ -157,11 +164,6 @@ class NativeCall: public NativeInstruction { inline friend NativeCall* nativeCall_at(address address); inline friend NativeCall* nativeCall_before(address return_address); - static bool is_call_at(address instr) { - const uint32_t insn = (*(uint32_t*)instr); - return (insn >> 26) == 0b100101; - } - static bool is_call_before(address return_address) { return is_call_at(return_address - NativeCall::return_address_offset); } diff --git a/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp index 1533c8d024e..629eb6e560d 100644 --- a/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp @@ -39,10 +39,13 @@ #ifdef COMPILER1 #include "c1/c1_Runtime1.hpp" #endif -#ifdef COMPILER2 +#if defined(COMPILER2) || INCLUDE_JVMCI #include "adfiles/ad_aarch64.hpp" #include "opto/runtime.hpp" #endif +#if INCLUDE_JVMCI +#include "jvmci/jvmciJavaClasses.hpp" +#endif #ifdef BUILTIN_SIM #include "../../../../../../simulator/simulator.hpp" @@ -109,14 +112,14 @@ class RegisterSaver { }; OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_frame_words, int* total_frame_words, bool save_vectors) { -#ifdef COMPILER2 +#if defined(COMPILER2) || INCLUDE_JVMCI if (save_vectors) { // Save upper half of vector registers int vect_words = 32 * 8 / wordSize; additional_frame_words += vect_words; } #else - assert(!save_vectors, "vectors are generated only by C2"); + assert(!save_vectors, "vectors are generated only by C2 and JVMCI"); #endif int frame_size_in_bytes = round_to(additional_frame_words*wordSize + @@ -166,7 +169,7 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_ void RegisterSaver::restore_live_registers(MacroAssembler* masm, bool restore_vectors) { #ifndef COMPILER2 - assert(!restore_vectors, "vectors are generated only by C2"); + assert(!restore_vectors, "vectors are generated only by C2 and JVMCI"); #endif __ pop_CPU_state(restore_vectors); __ leave(); @@ -547,6 +550,18 @@ void SharedRuntime::gen_i2c_adapter(MacroAssembler *masm, // Pre-load the register-jump target early, to schedule it better. __ ldr(rscratch1, Address(rmethod, in_bytes(Method::from_compiled_offset()))); +#if INCLUDE_JVMCI + if (EnableJVMCI) { + // check if this call should be routed towards a specific entry point + __ ldr(rscratch2, Address(rthread, in_bytes(JavaThread::jvmci_alternate_call_target_offset()))); + Label no_alternative_target; + __ cbz(rscratch2, no_alternative_target); + __ mov(rscratch1, rscratch2); + __ str(zr, Address(rthread, in_bytes(JavaThread::jvmci_alternate_call_target_offset()))); + __ bind(no_alternative_target); + } +#endif // INCLUDE_JVMCI + // Now generate the shuffle code. for (int i = 0; i < total_args_passed; i++) { if (sig_bt[i] == T_VOID) { @@ -2237,7 +2252,13 @@ void SharedRuntime::generate_deopt_blob() { // Allocate space for the code ResourceMark rm; // Setup code generation tools - CodeBuffer buffer("deopt_blob", 2048, 1024); + int pad = 0; +#if INCLUDE_JVMCI + if (EnableJVMCI) { + pad += 512; // Increase the buffer size when compiling for JVMCI + } +#endif + CodeBuffer buffer("deopt_blob", 2048+pad, 1024); MacroAssembler* masm = new MacroAssembler(&buffer); int frame_size_in_words; OopMap* map = NULL; @@ -2294,6 +2315,12 @@ void SharedRuntime::generate_deopt_blob() { __ b(cont); int reexecute_offset = __ pc() - start; +#if defined(INCLUDE_JVMCI) && !defined(COMPILER1) + if (EnableJVMCI && UseJVMCICompiler) { + // JVMCI does not use this kind of deoptimization + __ should_not_reach_here(); + } +#endif // Reexecute case // return address is the pc describes what bci to do re-execute at @@ -2304,6 +2331,44 @@ void SharedRuntime::generate_deopt_blob() { __ movw(rcpool, Deoptimization::Unpack_reexecute); // callee-saved __ b(cont); +#if INCLUDE_JVMCI + Label after_fetch_unroll_info_call; + int implicit_exception_uncommon_trap_offset = 0; + int uncommon_trap_offset = 0; + + if (EnableJVMCI) { + implicit_exception_uncommon_trap_offset = __ pc() - start; + + __ ldr(lr, Address(rthread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset()))); + __ str(zr, Address(rthread, in_bytes(JavaThread::jvmci_implicit_exception_pc_offset()))); + + uncommon_trap_offset = __ pc() - start; + + // Save everything in sight. + RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words); + // fetch_unroll_info needs to call last_java_frame() + Label retaddr; + __ set_last_Java_frame(sp, noreg, retaddr, rscratch1); + + __ ldrw(c_rarg1, Address(rthread, in_bytes(JavaThread::pending_deoptimization_offset()))); + __ movw(rscratch1, -1); + __ strw(rscratch1, Address(rthread, in_bytes(JavaThread::pending_deoptimization_offset()))); + + __ movw(rcpool, (int32_t)Deoptimization::Unpack_reexecute); + __ mov(c_rarg0, rthread); + __ lea(rscratch1, + RuntimeAddress(CAST_FROM_FN_PTR(address, + Deoptimization::uncommon_trap))); + __ blrt(rscratch1, 2, 0, MacroAssembler::ret_type_integral); + __ bind(retaddr); + oop_maps->add_gc_map( __ pc()-start, map->deep_copy()); + + __ reset_last_Java_frame(false, false); + + __ b(after_fetch_unroll_info_call); + } // EnableJVMCI +#endif // INCLUDE_JVMCI + int exception_offset = __ pc() - start; // Prolog for exception case @@ -2395,7 +2460,13 @@ void SharedRuntime::generate_deopt_blob() { __ reset_last_Java_frame(false, true); - // Load UnrollBlock* into rdi +#if INCLUDE_JVMCI + if (EnableJVMCI) { + __ bind(after_fetch_unroll_info_call); + } +#endif + + // Load UnrollBlock* into r5 __ mov(r5, r0); __ ldrw(rcpool, Address(r5, Deoptimization::UnrollBlock::unpack_kind_offset_in_bytes())); @@ -2547,7 +2618,12 @@ void SharedRuntime::generate_deopt_blob() { _deopt_blob = DeoptimizationBlob::create(&buffer, oop_maps, 0, exception_offset, reexecute_offset, frame_size_in_words); _deopt_blob->set_unpack_with_exception_in_tls_offset(exception_in_tls_offset); - +#if INCLUDE_JVMCI + if (EnableJVMCI) { + _deopt_blob->set_uncommon_trap_offset(uncommon_trap_offset); + _deopt_blob->set_implicit_exception_uncommon_trap_offset(implicit_exception_uncommon_trap_offset); + } +#endif #ifdef BUILTIN_SIM if (NotifySimulator) { unsigned char *base = _deopt_blob->code_begin(); @@ -2560,7 +2636,7 @@ uint SharedRuntime::out_preserve_stack_slots() { return 0; } -#ifdef COMPILER2 +#if defined(COMPILER2) || INCLUDE_JVMCI //------------------------------generate_uncommon_trap_blob-------------------- void SharedRuntime::generate_uncommon_trap_blob() { // Allocate space for the code @@ -2943,7 +3019,7 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(address destination, const cha } -#ifdef COMPILER2 +#if defined(COMPILER2) || INCLUDE_JVMCI // This is here instead of runtime_x86_64.cpp because it uses SimpleRuntimeFrame // //------------------------------generate_exception_blob--------------------------- diff --git a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp index fc1ddda99b0..5d5ccb3bc3c 100644 --- a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp @@ -225,6 +225,19 @@ address TemplateInterpreterGenerator::generate_deopt_entry_for(TosState state, __ restore_constant_pool_cache(); __ get_method(rmethod); +#if INCLUDE_JVMCI + // Check if we need to take lock at entry of synchronized method. + if (UseJVMCICompiler) { + Label L; + __ ldr(rscratch1, Address(rthread, Thread::pending_exception_offset())); + __ cbz(rscratch1, L); + // Clear flag. + __ strb(zr, Address(rthread, JavaThread::pending_monitorenter_offset())); + // Take lock. + lock_method(); + __ bind(L); + } +#endif // handle exceptions { Label L; diff --git a/hotspot/src/cpu/aarch64/vm/vmStructs_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/vmStructs_aarch64.hpp index f7acc1cc7ec..66da9564512 100644 --- a/hotspot/src/cpu/aarch64/vm/vmStructs_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/vmStructs_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -30,16 +30,8 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. -#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \ - \ - /******************************/ \ - /* JavaCallWrapper */ \ - /******************************/ \ - /******************************/ \ - /* JavaFrameAnchor */ \ - /******************************/ \ - volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) - +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \ + volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) #define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) diff --git a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp index 72cd0375f52..ddd41c3243b 100644 --- a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp @@ -67,8 +67,6 @@ int VM_Version::_model2; int VM_Version::_variant; int VM_Version::_revision; int VM_Version::_stepping; -int VM_Version::_cpuFeatures; -const char* VM_Version::_features_str = ""; static BufferBlob* stub_blob; static const int stub_size = 550; @@ -129,7 +127,7 @@ void VM_Version::get_processor_features() { char buf[512]; - _cpuFeatures = auxv; + _features = auxv; int cpu_lines = 0; if (FILE *f = fopen("/proc/cpuinfo", "r")) { @@ -154,12 +152,12 @@ void VM_Version::get_processor_features() { } // Enable vendor specific features - if (_cpu == CPU_CAVIUM && _variant == 0) _cpuFeatures |= CPU_DMB_ATOMICS; - if (_cpu == CPU_ARM && (_model == 0xd03 || _model2 == 0xd03)) _cpuFeatures |= CPU_A53MAC; + if (_cpu == CPU_CAVIUM && _variant == 0) _features |= CPU_DMB_ATOMICS; + if (_cpu == CPU_ARM && (_model == 0xd03 || _model2 == 0xd03)) _features |= CPU_A53MAC; // If an olde style /proc/cpuinfo (cpu_lines == 1) then if _model is an A57 (0xd07) // we assume the worst and assume we could be on a big little system and have // undisclosed A53 cores which we could be swapped to at any stage - if (_cpu == CPU_ARM && cpu_lines == 1 && _model == 0xd07) _cpuFeatures |= CPU_A53MAC; + if (_cpu == CPU_ARM && cpu_lines == 1 && _model == 0xd07) _features |= CPU_A53MAC; sprintf(buf, "0x%02x:0x%x:0x%03x:%d", _cpu, _variant, _model, _revision); if (_model2) sprintf(buf+strlen(buf), "(0x%03x)", _model2); @@ -169,7 +167,7 @@ void VM_Version::get_processor_features() { if (auxv & HWCAP_SHA1) strcat(buf, ", sha1"); if (auxv & HWCAP_SHA2) strcat(buf, ", sha256"); - _features_str = os::strdup(buf); + _features_string = os::strdup(buf); if (FLAG_IS_DEFAULT(UseCRC32)) { UseCRC32 = (auxv & HWCAP_CRC32) != 0; @@ -272,7 +270,7 @@ void VM_Version::get_processor_features() { } if (FLAG_IS_DEFAULT(UseBarriersForVolatile)) { - UseBarriersForVolatile = (_cpuFeatures & CPU_DMB_ATOMICS) != 0; + UseBarriersForVolatile = (_features & CPU_DMB_ATOMICS) != 0; } if (FLAG_IS_DEFAULT(UsePopCountInstruction)) { diff --git a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.hpp index f5dc414b694..7cb6fd7ce1a 100644 --- a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.hpp @@ -30,7 +30,8 @@ #include "runtime/vm_version.hpp" class VM_Version : public Abstract_VM_Version { -public: + friend class JVMCIVMStructs; + protected: static int _cpu; static int _model; @@ -38,9 +39,6 @@ protected: static int _variant; static int _revision; static int _stepping; - static int _cpuFeatures; // features returned by the "cpuid" instruction - // 0 if this instruction is not available - static const char* _features_str; static void get_processor_features(); @@ -52,7 +50,7 @@ public: static void assert_is_initialized() { } - enum { + enum Family { CPU_ARM = 'A', CPU_BROADCOM = 'B', CPU_CAVIUM = 'C', @@ -64,9 +62,9 @@ public: CPU_QUALCOM = 'Q', CPU_MARVELL = 'V', CPU_INTEL = 'i', - } cpuFamily; + }; - enum { + enum Feature_Flag { CPU_FP = (1<<0), CPU_ASIMD = (1<<1), CPU_EVTSTRM = (1<<2), @@ -77,16 +75,13 @@ public: CPU_CRC32 = (1<<7), CPU_A53MAC = (1 << 30), CPU_DMB_ATOMICS = (1 << 31), - } cpuFeatureFlags; + }; - static const char* cpu_features() { return _features_str; } static int cpu_family() { return _cpu; } static int cpu_model() { return _model; } static int cpu_model2() { return _model2; } static int cpu_variant() { return _variant; } static int cpu_revision() { return _revision; } - static int cpu_cpuFeatures() { return _cpuFeatures; } - }; #endif // CPU_AARCH64_VM_VM_VERSION_AARCH64_HPP diff --git a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp index 0aa52d81dcd..16c4db8a042 100644 --- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp @@ -37,8 +37,6 @@ # include -int VM_Version::_features = VM_Version::unknown_m; -const char* VM_Version::_features_str = ""; bool VM_Version::_is_determine_features_test_running = false; @@ -130,7 +128,7 @@ void VM_Version::initialize() { (has_tcheck() ? " tcheck" : "") // Make sure number of %s matches num_features! ); - _features_str = os::strdup(buf); + _features_string = os::strdup(buf); if (Verbose) { print_features(); } @@ -323,7 +321,7 @@ bool VM_Version::use_biased_locking() { } void VM_Version::print_features() { - tty->print_cr("Version: %s L1_data_cache_line_size=%d", cpu_features(), L1_data_cache_line_size()); + tty->print_cr("Version: %s L1_data_cache_line_size=%d", features_string(), L1_data_cache_line_size()); } #ifdef COMPILER2 @@ -722,7 +720,7 @@ void VM_Version::config_dscr() { } } -static int saved_features = 0; +static uint64_t saved_features = 0; void VM_Version::allow_all() { saved_features = _features; diff --git a/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp b/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp index d5f6dc6cc81..741618c33c8 100644 --- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp @@ -64,8 +64,7 @@ protected: tcheck_m = (1 << tcheck ), all_features_m = -1 }; - static int _features; - static const char* _features_str; + static bool _is_determine_features_test_running; static void print_features(); @@ -96,8 +95,6 @@ public: static bool has_vpmsumb() { return (_features & vpmsumb_m) != 0; } static bool has_tcheck() { return (_features & tcheck_m) != 0; } - static const char* cpu_features() { return _features_str; } - // Assembler testing static void allow_all(); static void revert(); diff --git a/hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp b/hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp index 24b008b4243..c8a8daf2844 100644 --- a/hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/vmStructs_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,21 +29,12 @@ // constants required by the Serviceability Agent. This file is // referenced by vmStructs.cpp. -#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \ - \ - /******************************/ \ - /* JavaCallWrapper */ \ - /******************************/ \ - /******************************/ \ - /* JavaFrameAnchor */ \ - /******************************/ \ - volatile_nonstatic_field(JavaFrameAnchor, _flags, int) \ - static_field(VM_Version, _features, int) +#define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \ + volatile_nonstatic_field(JavaFrameAnchor, _flags, int) #define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) \ - declare_toplevel_type(VM_Version) -#define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \ +#define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \ /******************************/ \ /* Register numbers (C2 only) */ \ /******************************/ \ diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp index 9fbc5df7e74..462ddb2ba06 100644 --- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp @@ -30,13 +30,10 @@ #include "runtime/stubCodeGenerator.hpp" #include "vm_version_sparc.hpp" -int VM_Version::_features = VM_Version::unknown_m; -const char* VM_Version::_features_str = ""; unsigned int VM_Version::_L2_data_cache_line_size = 0; void VM_Version::initialize() { - - assert(_features != VM_Version::unknown_m, "System pre-initialization is not complete."); + assert(_features != 0, "System pre-initialization is not complete."); guarantee(VM_Version::has_v9(), "only SPARC v9 is supported"); PrefetchCopyIntervalInBytes = prefetch_copy_interval_in_bytes(); @@ -214,7 +211,7 @@ void VM_Version::initialize() { (!has_hardware_fsmuld() ? ", no-fsmuld" : "")); // buf is started with ", " or is empty - _features_str = os::strdup(strlen(buf) > 2 ? buf + 2 : buf); + _features_string = os::strdup(strlen(buf) > 2 ? buf + 2 : buf); // UseVIS is set to the smallest of what hardware supports and what // the command line requires. I.e., you cannot set UseVIS to 3 on @@ -408,7 +405,7 @@ void VM_Version::initialize() { } void VM_Version::print_features() { - tty->print_cr("Version:%s", cpu_features()); + tty->print_cr("Version:%s", _features); } int VM_Version::determine_features() { @@ -444,7 +441,7 @@ int VM_Version::determine_features() { return features; } -static int saved_features = 0; +static uint64_t saved_features = 0; void VM_Version::allow_all() { saved_features = _features; diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp index cc730abf68b..0609fa8b9a0 100644 --- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp @@ -31,6 +31,7 @@ class VM_Version: public Abstract_VM_Version { friend class VMStructs; friend class JVMCIVMStructs; + protected: enum Feature_Flag { v8_instructions = 0, @@ -97,9 +98,6 @@ protected: niagara1_m = generic_v9_m | niagara1_unique_m }; - static int _features; - static const char* _features_str; - static unsigned int _L2_data_cache_line_size; static unsigned int L2_data_cache_line_size() { return _L2_data_cache_line_size; } @@ -175,8 +173,6 @@ public: // On T4 and newer Sparc BIS to the beginning of cache line always zeros it. static bool has_block_zeroing() { return has_blk_init() && is_T4(); } - static const char* cpu_features() { return _features_str; } - // default prefetch block size on sparc static intx prefetch_data_size() { return L2_data_cache_line_size(); } diff --git a/hotspot/src/cpu/x86/vm/vmStructs_x86.hpp b/hotspot/src/cpu/x86/vm/vmStructs_x86.hpp index a337ab14590..40e6e431882 100644 --- a/hotspot/src/cpu/x86/vm/vmStructs_x86.hpp +++ b/hotspot/src/cpu/x86/vm/vmStructs_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,20 +30,9 @@ // referenced by vmStructs.cpp. #define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \ - \ - /******************************/ \ - /* JavaCallWrapper */ \ - /******************************/ \ - /******************************/ \ - /* JavaFrameAnchor */ \ - /******************************/ \ - volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) \ - static_field(VM_Version, _cpuFeatures, uint64_t) - - + volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) #define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) \ - declare_toplevel_type(VM_Version) #define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \ LP64_ONLY(declare_constant(frame::arg_reg_save_area_bytes)) \ diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp index 63e1527f1df..b3b05547f02 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp @@ -35,9 +35,7 @@ int VM_Version::_cpu; int VM_Version::_model; int VM_Version::_stepping; -uint64_t VM_Version::_cpuFeatures; -const char* VM_Version::_features_str = ""; -VM_Version::CpuidInfo VM_Version::_cpuid_info = { 0, }; +VM_Version::CpuidInfo VM_Version::_cpuid_info = { 0, }; // Address of instruction which causes SEGV address VM_Version::_cpuinfo_segv_addr = 0; @@ -468,7 +466,7 @@ void VM_Version::get_processor_features() { _cpu = 4; // 486 by default _model = 0; _stepping = 0; - _cpuFeatures = 0; + _features = 0; _logical_processors_per_package = 1; // i486 internal cache is both I&D and has a 16-byte line size _L1_data_cache_line_size = 16; @@ -483,7 +481,7 @@ void VM_Version::get_processor_features() { _stepping = cpu_stepping(); if (cpu_family() > 4) { // it supports CPUID - _cpuFeatures = feature_flags(); + _features = feature_flags(); // Logical processors are only available on P4s and above, // and only if hyperthreading is available. _logical_processors_per_package = logical_processor_count(); @@ -522,24 +520,24 @@ void VM_Version::get_processor_features() { // If the OS doesn't support SSE, we can't use this feature even if the HW does if (!os::supports_sse()) - _cpuFeatures &= ~(CPU_SSE|CPU_SSE2|CPU_SSE3|CPU_SSSE3|CPU_SSE4A|CPU_SSE4_1|CPU_SSE4_2); + _features &= ~(CPU_SSE|CPU_SSE2|CPU_SSE3|CPU_SSSE3|CPU_SSE4A|CPU_SSE4_1|CPU_SSE4_2); if (UseSSE < 4) { - _cpuFeatures &= ~CPU_SSE4_1; - _cpuFeatures &= ~CPU_SSE4_2; + _features &= ~CPU_SSE4_1; + _features &= ~CPU_SSE4_2; } if (UseSSE < 3) { - _cpuFeatures &= ~CPU_SSE3; - _cpuFeatures &= ~CPU_SSSE3; - _cpuFeatures &= ~CPU_SSE4A; + _features &= ~CPU_SSE3; + _features &= ~CPU_SSSE3; + _features &= ~CPU_SSE4A; } if (UseSSE < 2) - _cpuFeatures &= ~CPU_SSE2; + _features &= ~CPU_SSE2; if (UseSSE < 1) - _cpuFeatures &= ~CPU_SSE; + _features &= ~CPU_SSE; // first try initial setting and detect what we can support if (UseAVX > 0) { @@ -557,25 +555,25 @@ void VM_Version::get_processor_features() { } if (UseAVX < 3) { - _cpuFeatures &= ~CPU_AVX512F; - _cpuFeatures &= ~CPU_AVX512DQ; - _cpuFeatures &= ~CPU_AVX512CD; - _cpuFeatures &= ~CPU_AVX512BW; - _cpuFeatures &= ~CPU_AVX512VL; + _features &= ~CPU_AVX512F; + _features &= ~CPU_AVX512DQ; + _features &= ~CPU_AVX512CD; + _features &= ~CPU_AVX512BW; + _features &= ~CPU_AVX512VL; } if (UseAVX < 2) - _cpuFeatures &= ~CPU_AVX2; + _features &= ~CPU_AVX2; if (UseAVX < 1) - _cpuFeatures &= ~CPU_AVX; + _features &= ~CPU_AVX; if (!UseAES && !FLAG_IS_DEFAULT(UseAES)) - _cpuFeatures &= ~CPU_AES; + _features &= ~CPU_AES; if (logical_processors_per_package() == 1) { // HT processor could be installed on a system which doesn't support HT. - _cpuFeatures &= ~CPU_HT; + _features &= ~CPU_HT; } char buf[256]; @@ -611,7 +609,7 @@ void VM_Version::get_processor_features() { (supports_bmi2() ? ", bmi2" : ""), (supports_adx() ? ", adx" : ""), (supports_evex() ? ", evex" : "")); - _features_str = os::strdup(buf); + _features_string = os::strdup(buf); // UseSSE is set to the smaller of what hardware supports and what // the command line requires. I.e., you cannot set UseSSE to 2 on diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.hpp b/hotspot/src/cpu/x86/vm/vm_version_x86.hpp index 624f138d5be..77550a96a4c 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86.hpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.hpp @@ -31,7 +31,8 @@ class VM_Version : public Abstract_VM_Version { friend class VMStructs; friend class JVMCIVMStructs; -public: + + public: // cpuid result register layouts. These are all unions of a uint32_t // (in case anyone wants access to the register as a whole) and a bitfield. @@ -245,14 +246,11 @@ protected: static int _cpu; static int _model; static int _stepping; - static uint64_t _cpuFeatures; // features returned by the "cpuid" instruction - // 0 if this instruction is not available - static const char* _features_str; static address _cpuinfo_segv_addr; // address of instruction which causes SEGV static address _cpuinfo_cont_addr; // address of instruction after the one which causes SEGV - enum { + enum Feature_Flag { CPU_CX8 = (1 << 0), // next bits are from cpuid 1 (EDX) CPU_CMOV = (1 << 1), CPU_FXSR = (1 << 2), @@ -286,11 +284,11 @@ protected: CPU_AVX512ER = (1 << 29), CPU_AVX512CD = (1 << 30), CPU_AVX512BW = (1 << 31) - } cpuFeatureFlags; + }; #define CPU_AVX512VL UCONST64(0x100000000) // EVEX instructions with smaller vector length : enums are limited to 32bit - enum { + enum Extended_Family { // AMD CPU_FAMILY_AMD_11H = 0x11, // Intel @@ -308,7 +306,7 @@ protected: CPU_MODEL_HASWELL_E7 = 0x3f, CPU_MODEL_BROADWELL = 0x3d, CPU_MODEL_SKYLAKE = CPU_MODEL_HASWELL_E3 - } cpuExtendedFamily; + }; // cpuid information block. All info derived from executing cpuid with // various function numbers is stored here. Intel and AMD info is @@ -598,9 +596,9 @@ public: static void set_cpuinfo_cont_addr(address pc) { _cpuinfo_cont_addr = pc; } static address cpuinfo_cont_addr() { return _cpuinfo_cont_addr; } - static void clean_cpuFeatures() { _cpuFeatures = 0; } - static void set_avx_cpuFeatures() { _cpuFeatures = (CPU_SSE | CPU_SSE2 | CPU_AVX); } - static void set_evex_cpuFeatures() { _cpuFeatures = (CPU_AVX512F | CPU_SSE | CPU_SSE2 ); } + static void clean_cpuFeatures() { _features = 0; } + static void set_avx_cpuFeatures() { _features = (CPU_SSE | CPU_SSE2 | CPU_AVX); } + static void set_evex_cpuFeatures() { _features = (CPU_AVX512F | CPU_SSE | CPU_SSE2 ); } // Initialization @@ -688,36 +686,36 @@ public: // // Feature identification // - static bool supports_cpuid() { return _cpuFeatures != 0; } - static bool supports_cmpxchg8() { return (_cpuFeatures & CPU_CX8) != 0; } - static bool supports_cmov() { return (_cpuFeatures & CPU_CMOV) != 0; } - static bool supports_fxsr() { return (_cpuFeatures & CPU_FXSR) != 0; } - static bool supports_ht() { return (_cpuFeatures & CPU_HT) != 0; } - static bool supports_mmx() { return (_cpuFeatures & CPU_MMX) != 0; } - static bool supports_sse() { return (_cpuFeatures & CPU_SSE) != 0; } - static bool supports_sse2() { return (_cpuFeatures & CPU_SSE2) != 0; } - static bool supports_sse3() { return (_cpuFeatures & CPU_SSE3) != 0; } - static bool supports_ssse3() { return (_cpuFeatures & CPU_SSSE3)!= 0; } - static bool supports_sse4_1() { return (_cpuFeatures & CPU_SSE4_1) != 0; } - static bool supports_sse4_2() { return (_cpuFeatures & CPU_SSE4_2) != 0; } - static bool supports_popcnt() { return (_cpuFeatures & CPU_POPCNT) != 0; } - static bool supports_avx() { return (_cpuFeatures & CPU_AVX) != 0; } - static bool supports_avx2() { return (_cpuFeatures & CPU_AVX2) != 0; } - static bool supports_tsc() { return (_cpuFeatures & CPU_TSC) != 0; } - static bool supports_aes() { return (_cpuFeatures & CPU_AES) != 0; } - static bool supports_erms() { return (_cpuFeatures & CPU_ERMS) != 0; } - static bool supports_clmul() { return (_cpuFeatures & CPU_CLMUL) != 0; } - static bool supports_rtm() { return (_cpuFeatures & CPU_RTM) != 0; } - static bool supports_bmi1() { return (_cpuFeatures & CPU_BMI1) != 0; } - static bool supports_bmi2() { return (_cpuFeatures & CPU_BMI2) != 0; } - static bool supports_adx() { return (_cpuFeatures & CPU_ADX) != 0; } - static bool supports_evex() { return (_cpuFeatures & CPU_AVX512F) != 0; } - static bool supports_avx512dq() { return (_cpuFeatures & CPU_AVX512DQ) != 0; } - static bool supports_avx512pf() { return (_cpuFeatures & CPU_AVX512PF) != 0; } - static bool supports_avx512er() { return (_cpuFeatures & CPU_AVX512ER) != 0; } - static bool supports_avx512cd() { return (_cpuFeatures & CPU_AVX512CD) != 0; } - static bool supports_avx512bw() { return (_cpuFeatures & CPU_AVX512BW) != 0; } - static bool supports_avx512vl() { return (_cpuFeatures & CPU_AVX512VL) != 0; } + static bool supports_cpuid() { return _features != 0; } + static bool supports_cmpxchg8() { return (_features & CPU_CX8) != 0; } + static bool supports_cmov() { return (_features & CPU_CMOV) != 0; } + static bool supports_fxsr() { return (_features & CPU_FXSR) != 0; } + static bool supports_ht() { return (_features & CPU_HT) != 0; } + static bool supports_mmx() { return (_features & CPU_MMX) != 0; } + static bool supports_sse() { return (_features & CPU_SSE) != 0; } + static bool supports_sse2() { return (_features & CPU_SSE2) != 0; } + static bool supports_sse3() { return (_features & CPU_SSE3) != 0; } + static bool supports_ssse3() { return (_features & CPU_SSSE3)!= 0; } + static bool supports_sse4_1() { return (_features & CPU_SSE4_1) != 0; } + static bool supports_sse4_2() { return (_features & CPU_SSE4_2) != 0; } + static bool supports_popcnt() { return (_features & CPU_POPCNT) != 0; } + static bool supports_avx() { return (_features & CPU_AVX) != 0; } + static bool supports_avx2() { return (_features & CPU_AVX2) != 0; } + static bool supports_tsc() { return (_features & CPU_TSC) != 0; } + static bool supports_aes() { return (_features & CPU_AES) != 0; } + static bool supports_erms() { return (_features & CPU_ERMS) != 0; } + static bool supports_clmul() { return (_features & CPU_CLMUL) != 0; } + static bool supports_rtm() { return (_features & CPU_RTM) != 0; } + static bool supports_bmi1() { return (_features & CPU_BMI1) != 0; } + static bool supports_bmi2() { return (_features & CPU_BMI2) != 0; } + static bool supports_adx() { return (_features & CPU_ADX) != 0; } + static bool supports_evex() { return (_features & CPU_AVX512F) != 0; } + static bool supports_avx512dq() { return (_features & CPU_AVX512DQ) != 0; } + static bool supports_avx512pf() { return (_features & CPU_AVX512PF) != 0; } + static bool supports_avx512er() { return (_features & CPU_AVX512ER) != 0; } + static bool supports_avx512cd() { return (_features & CPU_AVX512CD) != 0; } + static bool supports_avx512bw() { return (_features & CPU_AVX512BW) != 0; } + static bool supports_avx512vl() { return (_features & CPU_AVX512VL) != 0; } static bool supports_avx512vlbw() { return (supports_avx512bw() && supports_avx512vl()); } static bool supports_avx512novl() { return (supports_evex() && !supports_avx512vl()); } static bool supports_avx512nobw() { return (supports_evex() && !supports_avx512bw()); } @@ -746,17 +744,17 @@ public: } // AMD features - static bool supports_3dnow_prefetch() { return (_cpuFeatures & CPU_3DNOW_PREFETCH) != 0; } + static bool supports_3dnow_prefetch() { return (_features & CPU_3DNOW_PREFETCH) != 0; } static bool supports_mmx_ext() { return is_amd() && _cpuid_info.ext_cpuid1_edx.bits.mmx_amd != 0; } - static bool supports_lzcnt() { return (_cpuFeatures & CPU_LZCNT) != 0; } - static bool supports_sse4a() { return (_cpuFeatures & CPU_SSE4A) != 0; } + static bool supports_lzcnt() { return (_features & CPU_LZCNT) != 0; } + static bool supports_sse4a() { return (_features & CPU_SSE4A) != 0; } static bool is_amd_Barcelona() { return is_amd() && extended_cpu_family() == CPU_FAMILY_AMD_11H; } // Intel and AMD newer cores support fast timestamps well static bool supports_tscinv_bit() { - return (_cpuFeatures & CPU_TSCINV) != 0; + return (_features & CPU_TSCINV) != 0; } static bool supports_tscinv() { return supports_tscinv_bit() && @@ -770,8 +768,6 @@ public: static bool supports_compare_and_exchange() { return true; } - static const char* cpu_features() { return _features_str; } - static intx allocate_prefetch_distance() { // This method should be called before allocate_prefetch_style(). // diff --git a/hotspot/src/cpu/zero/vm/vm_version_zero.hpp b/hotspot/src/cpu/zero/vm/vm_version_zero.hpp index 68a29df3a60..51b9c5b3035 100644 --- a/hotspot/src/cpu/zero/vm/vm_version_zero.hpp +++ b/hotspot/src/cpu/zero/vm/vm_version_zero.hpp @@ -31,9 +31,6 @@ class VM_Version : public Abstract_VM_Version { public: - static const char* cpu_features() { - return ""; - } static void initialize(); }; diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64.java new file mode 100644 index 00000000000..af6f7e892af --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64.java @@ -0,0 +1,237 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.vm.ci.aarch64; + +import java.nio.ByteOrder; +import java.util.EnumSet; + +import jdk.vm.ci.code.Architecture; +import jdk.vm.ci.code.Register; +import jdk.vm.ci.code.Register.RegisterCategory; +import jdk.vm.ci.meta.JavaKind; +import jdk.vm.ci.meta.PlatformKind; + +/** + * Represents the AArch64 architecture. + */ +public class AArch64 extends Architecture { + + public static final RegisterCategory CPU = new RegisterCategory("CPU"); + + // General purpose CPU registers + public static final Register r0 = new Register(0, 0, "r0", CPU); + public static final Register r1 = new Register(1, 1, "r1", CPU); + public static final Register r2 = new Register(2, 2, "r2", CPU); + public static final Register r3 = new Register(3, 3, "r3", CPU); + public static final Register r4 = new Register(4, 4, "r4", CPU); + public static final Register r5 = new Register(5, 5, "r5", CPU); + public static final Register r6 = new Register(6, 6, "r6", CPU); + public static final Register r7 = new Register(7, 7, "r7", CPU); + public static final Register r8 = new Register(8, 8, "r8", CPU); + public static final Register r9 = new Register(9, 9, "r9", CPU); + public static final Register r10 = new Register(10, 10, "r10", CPU); + public static final Register r11 = new Register(11, 11, "r11", CPU); + public static final Register r12 = new Register(12, 12, "r12", CPU); + public static final Register r13 = new Register(13, 13, "r13", CPU); + public static final Register r14 = new Register(14, 14, "r14", CPU); + public static final Register r15 = new Register(15, 15, "r15", CPU); + public static final Register r16 = new Register(16, 16, "r16", CPU); + public static final Register r17 = new Register(17, 17, "r17", CPU); + public static final Register r18 = new Register(18, 18, "r18", CPU); + public static final Register r19 = new Register(19, 19, "r19", CPU); + public static final Register r20 = new Register(20, 20, "r20", CPU); + public static final Register r21 = new Register(21, 21, "r21", CPU); + public static final Register r22 = new Register(22, 22, "r22", CPU); + public static final Register r23 = new Register(23, 23, "r23", CPU); + public static final Register r24 = new Register(24, 24, "r24", CPU); + public static final Register r25 = new Register(25, 25, "r25", CPU); + public static final Register r26 = new Register(26, 26, "r26", CPU); + public static final Register r27 = new Register(27, 27, "r27", CPU); + public static final Register r28 = new Register(28, 28, "r28", CPU); + public static final Register r29 = new Register(29, 29, "r29", CPU); + public static final Register r30 = new Register(30, 30, "r30", CPU); + public static final Register r31 = new Register(31, 31, "r31", CPU); + + public static final Register lr = r30; + public static final Register zr = r31; + public static final Register sp = r31; + + public static final Register[] cpuRegisters = { + // @formatter:off + r0, r1, r2, r3, r4, r5, r6, r7, + r8, r9, r10, r11, r12, r13, r14, r15, + r16, r17, r18, r19, r20, r21, r22, r23, + r24, r25, r26, r27, r28, r29, r30, r31 + // @formatter:on + }; + + public static final RegisterCategory SIMD = new RegisterCategory("SIMD"); + + // Simd registers + public static final Register v0 = new Register(32, 0, "v0", SIMD); + public static final Register v1 = new Register(33, 1, "v1", SIMD); + public static final Register v2 = new Register(34, 2, "v2", SIMD); + public static final Register v3 = new Register(35, 3, "v3", SIMD); + public static final Register v4 = new Register(36, 4, "v4", SIMD); + public static final Register v5 = new Register(37, 5, "v5", SIMD); + public static final Register v6 = new Register(38, 6, "v6", SIMD); + public static final Register v7 = new Register(39, 7, "v7", SIMD); + public static final Register v8 = new Register(40, 8, "v8", SIMD); + public static final Register v9 = new Register(41, 9, "v9", SIMD); + public static final Register v10 = new Register(42, 10, "v10", SIMD); + public static final Register v11 = new Register(43, 11, "v11", SIMD); + public static final Register v12 = new Register(44, 12, "v12", SIMD); + public static final Register v13 = new Register(45, 13, "v13", SIMD); + public static final Register v14 = new Register(46, 14, "v14", SIMD); + public static final Register v15 = new Register(47, 15, "v15", SIMD); + public static final Register v16 = new Register(48, 16, "v16", SIMD); + public static final Register v17 = new Register(49, 17, "v17", SIMD); + public static final Register v18 = new Register(50, 18, "v18", SIMD); + public static final Register v19 = new Register(51, 19, "v19", SIMD); + public static final Register v20 = new Register(52, 20, "v20", SIMD); + public static final Register v21 = new Register(53, 21, "v21", SIMD); + public static final Register v22 = new Register(54, 22, "v22", SIMD); + public static final Register v23 = new Register(55, 23, "v23", SIMD); + public static final Register v24 = new Register(56, 24, "v24", SIMD); + public static final Register v25 = new Register(57, 25, "v25", SIMD); + public static final Register v26 = new Register(58, 26, "v26", SIMD); + public static final Register v27 = new Register(59, 27, "v27", SIMD); + public static final Register v28 = new Register(60, 28, "v28", SIMD); + public static final Register v29 = new Register(61, 29, "v29", SIMD); + public static final Register v30 = new Register(62, 30, "v30", SIMD); + public static final Register v31 = new Register(63, 31, "v31", SIMD); + + public static final Register[] simdRegisters = { + // @formatter:off + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10, v11, v12, v13, v14, v15, + v16, v17, v18, v19, v20, v21, v22, v23, + v24, v25, v26, v27, v28, v29, v30, v31 + // @formatter:on + }; + + public static final Register[] allRegisters = { + // @formatter:off + r0, r1, r2, r3, r4, r5, r6, r7, + r8, r9, r10, r11, r12, r13, r14, r15, + r16, r17, r18, r19, r20, r21, r22, r23, + r24, r25, r26, r27, r28, r29, r30, r31, + + v0, v1, v2, v3, v4, v5, v6, v7, + v8, v9, v10, v11, v12, v13, v14, v15, + v16, v17, v18, v19, v20, v21, v22, v23, + v24, v25, v26, v27, v28, v29, v30, v31 + // @formatter:on + }; + + /** + * Basic set of CPU features mirroring what is returned from the cpuid instruction. See: + * {@code VM_Version::cpuFeatureFlags}. + */ + public static enum CPUFeature { + FP, + ASIMD, + EVTSTRM, + AES, + PMULL, + SHA1, + SHA2, + CRC32, + A53MAC, + DMB_ATOMICS + } + + private final EnumSet features; + + /** + * Set of flags to control code emission. + */ + public static enum Flag { + UseBarriersForVolatile, + UseCRC32, + UseNeon + } + + private final EnumSet flags; + + public AArch64(EnumSet features, EnumSet flags) { + super("aarch64", AArch64Kind.QWORD, ByteOrder.LITTLE_ENDIAN, /* unalignedMemoryAccess */true, allRegisters, /* implicitMemoryBarriers */0, /* nativeCallDisplacementOffset */0, + /* returnAddressSize */0); + this.features = features; + this.flags = flags; + assert features.contains(CPUFeature.FP) : "minimum config for aarch64"; + } + + public EnumSet getFeatures() { + return features; + } + + public EnumSet getFlags() { + return flags; + } + + @Override + public PlatformKind getPlatformKind(JavaKind javaKind) { + switch (javaKind) { + case Boolean: + case Byte: + return AArch64Kind.BYTE; + case Short: + case Char: + return AArch64Kind.WORD; + case Int: + return AArch64Kind.DWORD; + case Long: + case Object: + return AArch64Kind.QWORD; + case Float: + return AArch64Kind.SINGLE; + case Double: + return AArch64Kind.DOUBLE; + default: + return null; + } + } + + @Override + public boolean canStoreValue(RegisterCategory category, PlatformKind platformKind) { + AArch64Kind kind = (AArch64Kind) platformKind; + if (kind.isInteger()) { + return category.equals(CPU); + } else if (kind.isSIMD()) { + return category.equals(SIMD); + } + return false; + } + + @Override + public AArch64Kind getLargestStorableKind(RegisterCategory category) { + if (category.equals(CPU)) { + return AArch64Kind.QWORD; + } else if (category.equals(SIMD)) { + return AArch64Kind.V128_QWORD; + } else { + return null; + } + } +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64Kind.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64Kind.java new file mode 100644 index 00000000000..1802ef7eab2 --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64Kind.java @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.vm.ci.aarch64; + +import jdk.vm.ci.meta.PlatformKind; + +public enum AArch64Kind implements PlatformKind { + + // scalar + BYTE(1), + WORD(2), + DWORD(4), + QWORD(8), + SINGLE(4), + DOUBLE(8), + + // SIMD + V32_BYTE(4, BYTE), + V32_WORD(4, WORD), + V64_BYTE(8, BYTE), + V64_WORD(8, WORD), + V64_DWORD(8, DWORD), + V128_BYTE(16, BYTE), + V128_WORD(16, WORD), + V128_DWORD(16, DWORD), + V128_QWORD(16, QWORD), + V128_SINGLE(16, SINGLE), + V128_DOUBLE(16, DOUBLE), + + MASK8(1), + MASK16(2), + MASK32(4), + MASK64(8); + + private final int size; + private final int vectorLength; + + private final AArch64Kind scalar; + private final EnumKey key = new EnumKey<>(this); + + private AArch64Kind(int size) { + this.size = size; + this.scalar = this; + this.vectorLength = 1; + } + + private AArch64Kind(int size, AArch64Kind scalar) { + this.size = size; + this.scalar = scalar; + + assert size % scalar.size == 0; + this.vectorLength = size / scalar.size; + } + + public AArch64Kind getScalar() { + return scalar; + } + + public int getSizeInBytes() { + return size; + } + + public int getVectorLength() { + return vectorLength; + } + + public Key getKey() { + return key; + } + + public boolean isInteger() { + switch (this) { + case BYTE: + case WORD: + case DWORD: + case QWORD: + return true; + default: + return false; + } + } + + public boolean isSIMD() { + switch (this) { + case SINGLE: + case DOUBLE: + case V32_BYTE: + case V32_WORD: + case V64_BYTE: + case V64_WORD: + case V64_DWORD: + case V128_BYTE: + case V128_WORD: + case V128_DWORD: + case V128_QWORD: + case V128_SINGLE: + case V128_DOUBLE: + return true; + default: + return false; + } + } + + public boolean isMask() { + switch (this) { + case MASK8: + case MASK16: + case MASK32: + case MASK64: + return true; + default: + return false; + } + } + + public char getTypeChar() { + switch (this) { + case BYTE: + return 'b'; + case WORD: + return 'w'; + case DWORD: + return 'd'; + case QWORD: + return 'q'; + case SINGLE: + return 'S'; + case DOUBLE: + return 'D'; + case V32_BYTE: + case V32_WORD: + case V64_BYTE: + case V64_WORD: + case V64_DWORD: + case V128_BYTE: + case V128_WORD: + case V128_DWORD: + case V128_QWORD: + case V128_SINGLE: + case V128_DOUBLE: + return 'v'; + case MASK8: + case MASK16: + case MASK32: + case MASK64: + return 'k'; + default: + return '-'; + } + } +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java new file mode 100644 index 00000000000..6981820018b --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.vm.ci.hotspot.aarch64; + +import static jdk.vm.ci.inittimer.InitTimer.timer; + +import java.util.EnumSet; + +import jdk.vm.ci.aarch64.AArch64; +import jdk.vm.ci.code.Architecture; +import jdk.vm.ci.code.RegisterConfig; +import jdk.vm.ci.code.TargetDescription; +import jdk.vm.ci.code.stack.StackIntrospection; +import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; +import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; +import jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory; +import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; +import jdk.vm.ci.hotspot.HotSpotMetaAccessProvider; +import jdk.vm.ci.hotspot.HotSpotStackIntrospection; +import jdk.vm.ci.hotspot.HotSpotVMConfig; +import jdk.vm.ci.inittimer.InitTimer; +import jdk.vm.ci.meta.ConstantReflectionProvider; +import jdk.vm.ci.runtime.JVMCIBackend; +import jdk.vm.ci.service.ServiceProvider; + +@ServiceProvider(HotSpotJVMCIBackendFactory.class) +public class AArch64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory { + + protected EnumSet computeFeatures(@SuppressWarnings("unused") HotSpotVMConfig config) { + // Configure the feature set using the HotSpot flag settings. + EnumSet features = EnumSet.noneOf(AArch64.CPUFeature.class); + return features; + } + + protected EnumSet computeFlags(@SuppressWarnings("unused") HotSpotVMConfig config) { + EnumSet flags = EnumSet.noneOf(AArch64.Flag.class); + return flags; + } + + protected TargetDescription createTarget(HotSpotVMConfig config) { + final int stackFrameAlignment = 16; + final int implicitNullCheckLimit = 4096; + final boolean inlineObjects = true; + Architecture arch = new AArch64(computeFeatures(config), computeFlags(config)); + return new TargetDescription(arch, true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects); + } + + protected HotSpotConstantReflectionProvider createConstantReflection(HotSpotJVMCIRuntimeProvider runtime) { + return new HotSpotConstantReflectionProvider(runtime); + } + + protected RegisterConfig createRegisterConfig(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target) { + return new AArch64HotSpotRegisterConfig(target.arch, runtime.getConfig()); + } + + protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target, RegisterConfig regConfig) { + return new HotSpotCodeCacheProvider(runtime, runtime.getConfig(), target, regConfig); + } + + protected HotSpotMetaAccessProvider createMetaAccess(HotSpotJVMCIRuntimeProvider runtime) { + return new HotSpotMetaAccessProvider(runtime); + } + + @Override + public String getArchitecture() { + return "aarch64"; + } + + @Override + public String toString() { + return "JVMCIBackend:" + getArchitecture(); + } + + @SuppressWarnings("try") + public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, JVMCIBackend host) { + + assert host == null; + TargetDescription target = createTarget(runtime.getConfig()); + + RegisterConfig regConfig; + HotSpotCodeCacheProvider codeCache; + ConstantReflectionProvider constantReflection; + HotSpotMetaAccessProvider metaAccess; + StackIntrospection stackIntrospection; + try (InitTimer t = timer("create providers")) { + try (InitTimer rt = timer("create MetaAccess provider")) { + metaAccess = createMetaAccess(runtime); + } + try (InitTimer rt = timer("create RegisterConfig")) { + regConfig = createRegisterConfig(runtime, target); + } + try (InitTimer rt = timer("create CodeCache provider")) { + codeCache = createCodeCache(runtime, target, regConfig); + } + try (InitTimer rt = timer("create ConstantReflection provider")) { + constantReflection = createConstantReflection(runtime); + } + try (InitTimer rt = timer("create StackIntrospection provider")) { + stackIntrospection = new HotSpotStackIntrospection(runtime); + } + } + try (InitTimer rt = timer("instantiate backend")) { + return createBackend(metaAccess, codeCache, constantReflection, stackIntrospection); + } + } + + protected JVMCIBackend createBackend(HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, ConstantReflectionProvider constantReflection, + StackIntrospection stackIntrospection) { + return new JVMCIBackend(metaAccess, codeCache, constantReflection, stackIntrospection); + } +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java new file mode 100644 index 00000000000..9590d2fcda4 --- /dev/null +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java @@ -0,0 +1,298 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.vm.ci.hotspot.aarch64; + +import static jdk.vm.ci.aarch64.AArch64.lr; +import static jdk.vm.ci.aarch64.AArch64.r0; +import static jdk.vm.ci.aarch64.AArch64.r1; +import static jdk.vm.ci.aarch64.AArch64.r12; +import static jdk.vm.ci.aarch64.AArch64.r2; +import static jdk.vm.ci.aarch64.AArch64.r27; +import static jdk.vm.ci.aarch64.AArch64.r28; +import static jdk.vm.ci.aarch64.AArch64.r29; +import static jdk.vm.ci.aarch64.AArch64.r3; +import static jdk.vm.ci.aarch64.AArch64.r4; +import static jdk.vm.ci.aarch64.AArch64.r5; +import static jdk.vm.ci.aarch64.AArch64.r6; +import static jdk.vm.ci.aarch64.AArch64.r7; +import static jdk.vm.ci.aarch64.AArch64.r9; +import static jdk.vm.ci.aarch64.AArch64.sp; +import static jdk.vm.ci.aarch64.AArch64.v0; +import static jdk.vm.ci.aarch64.AArch64.v1; +import static jdk.vm.ci.aarch64.AArch64.v2; +import static jdk.vm.ci.aarch64.AArch64.v3; +import static jdk.vm.ci.aarch64.AArch64.v4; +import static jdk.vm.ci.aarch64.AArch64.v5; +import static jdk.vm.ci.aarch64.AArch64.v6; +import static jdk.vm.ci.aarch64.AArch64.v7; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +import jdk.vm.ci.aarch64.AArch64; +import jdk.vm.ci.code.Architecture; +import jdk.vm.ci.code.CallingConvention; +import jdk.vm.ci.code.CallingConvention.Type; +import jdk.vm.ci.code.Register; +import jdk.vm.ci.code.RegisterAttributes; +import jdk.vm.ci.code.RegisterConfig; +import jdk.vm.ci.code.StackSlot; +import jdk.vm.ci.code.TargetDescription; +import jdk.vm.ci.common.JVMCIError; +import jdk.vm.ci.hotspot.HotSpotVMConfig; +import jdk.vm.ci.meta.AllocatableValue; +import jdk.vm.ci.meta.JavaKind; +import jdk.vm.ci.meta.JavaType; +import jdk.vm.ci.meta.LIRKind; +import jdk.vm.ci.meta.PlatformKind; +import jdk.vm.ci.meta.Value; + +public class AArch64HotSpotRegisterConfig implements RegisterConfig { + + private final Architecture architecture; + + private final Register[] allocatable; + + private final int maxFrameSize; + + /** + * The caller saved registers always include all parameter registers. + */ + private final Register[] callerSaved; + + private final boolean allAllocatableAreCallerSaved; + + private final RegisterAttributes[] attributesMap; + + public int getMaximumFrameSize() { + return maxFrameSize; + } + + @Override + public Register[] getAllocatableRegisters() { + return allocatable.clone(); + } + + public Register[] filterAllocatableRegisters(PlatformKind kind, Register[] registers) { + ArrayList list = new ArrayList<>(); + for (Register reg : registers) { + if (architecture.canStoreValue(reg.getRegisterCategory(), kind)) { + list.add(reg); + } + } + + Register[] ret = list.toArray(new Register[list.size()]); + return ret; + } + + @Override + public RegisterAttributes[] getAttributesMap() { + return attributesMap.clone(); + } + + private final Register[] javaGeneralParameterRegisters = {r1, r2, r3, r4, r5, r6, r7, r0}; + private final Register[] nativeGeneralParameterRegisters = {r0, r1, r2, r3, r4, r5, r6, r7}; + private final Register[] simdParameterRegisters = {v0, v1, v2, v3, v4, v5, v6, v7}; + + public static final Register inlineCacheRegister = r9; + + /** + * Vtable stubs expect the metaspace Method in r12. + */ + public static final Register metaspaceMethodRegister = r12; + + public static final Register heapBaseRegister = r27; + public static final Register threadRegister = r28; + public static final Register fp = r29; + + private static Register[] initAllocatable(Architecture arch, boolean reserveForHeapBase) { + Register[] allRegisters = arch.getAvailableValueRegisters(); + Register[] registers = new Register[allRegisters.length - (reserveForHeapBase ? 5 : 4)]; + + int idx = 0; + for (Register reg : allRegisters) { + if (reg.equals(threadRegister) || reg.equals(fp) || reg.equals(lr) || reg.equals(sp)) { + // skip thread register, frame pointer, link register and stack pointer + continue; + } + if (reserveForHeapBase && reg.equals(heapBaseRegister)) { + // skip heap base register + continue; + } + + registers[idx++] = reg; + } + + assert idx == registers.length; + return registers; + } + + public AArch64HotSpotRegisterConfig(Architecture architecture, HotSpotVMConfig config) { + this(architecture, config, initAllocatable(architecture, config.useCompressedOops)); + assert callerSaved.length >= allocatable.length; + } + + public AArch64HotSpotRegisterConfig(Architecture architecture, HotSpotVMConfig config, Register[] allocatable) { + this.architecture = architecture; + this.maxFrameSize = config.maxFrameSize; + + this.allocatable = allocatable.clone(); + Set callerSaveSet = new HashSet<>(); + Collections.addAll(callerSaveSet, allocatable); + Collections.addAll(callerSaveSet, simdParameterRegisters); + Collections.addAll(callerSaveSet, javaGeneralParameterRegisters); + Collections.addAll(callerSaveSet, nativeGeneralParameterRegisters); + callerSaved = callerSaveSet.toArray(new Register[callerSaveSet.size()]); + + allAllocatableAreCallerSaved = true; + attributesMap = RegisterAttributes.createMap(this, AArch64.allRegisters); + } + + @Override + public Register[] getCallerSaveRegisters() { + return callerSaved; + } + + public Register[] getCalleeSaveRegisters() { + return null; + } + + @Override + public boolean areAllAllocatableRegistersCallerSaved() { + return allAllocatableAreCallerSaved; + } + + @Override + public Register getRegisterForRole(int index) { + throw new UnsupportedOperationException(); + } + + @Override + public CallingConvention getCallingConvention(Type type, JavaType returnType, JavaType[] parameterTypes, TargetDescription target, boolean stackOnly) { + if (type == Type.NativeCall) { + return callingConvention(nativeGeneralParameterRegisters, returnType, parameterTypes, type, target, stackOnly); + } + // On x64, parameter locations are the same whether viewed + // from the caller or callee perspective + return callingConvention(javaGeneralParameterRegisters, returnType, parameterTypes, type, target, stackOnly); + } + + public Register[] getCallingConventionRegisters(Type type, JavaKind kind) { + switch (kind) { + case Boolean: + case Byte: + case Short: + case Char: + case Int: + case Long: + case Object: + return type == Type.NativeCall ? nativeGeneralParameterRegisters : javaGeneralParameterRegisters; + case Float: + case Double: + return simdParameterRegisters; + default: + throw JVMCIError.shouldNotReachHere(); + } + } + + private CallingConvention callingConvention(Register[] generalParameterRegisters, JavaType returnType, JavaType[] parameterTypes, Type type, TargetDescription target, boolean stackOnly) { + AllocatableValue[] locations = new AllocatableValue[parameterTypes.length]; + + int currentGeneral = 0; + int currentSIMD = 0; + int currentStackOffset = 0; + + for (int i = 0; i < parameterTypes.length; i++) { + final JavaKind kind = parameterTypes[i].getJavaKind().getStackKind(); + + switch (kind) { + case Byte: + case Boolean: + case Short: + case Char: + case Int: + case Long: + case Object: + if (!stackOnly && currentGeneral < generalParameterRegisters.length) { + Register register = generalParameterRegisters[currentGeneral++]; + locations[i] = register.asValue(target.getLIRKind(kind)); + } + break; + case Float: + case Double: + if (!stackOnly && currentSIMD < simdParameterRegisters.length) { + Register register = simdParameterRegisters[currentSIMD++]; + locations[i] = register.asValue(target.getLIRKind(kind)); + } + break; + default: + throw JVMCIError.shouldNotReachHere(); + } + + if (locations[i] == null) { + LIRKind lirKind = target.getLIRKind(kind); + locations[i] = StackSlot.get(lirKind, currentStackOffset, !type.out); + currentStackOffset += Math.max(lirKind.getPlatformKind().getSizeInBytes(), target.wordSize); + } + } + + JavaKind returnKind = returnType == null ? JavaKind.Void : returnType.getJavaKind(); + AllocatableValue returnLocation = returnKind == JavaKind.Void ? Value.ILLEGAL : getReturnRegister(returnKind).asValue(target.getLIRKind(returnKind.getStackKind())); + return new CallingConvention(currentStackOffset, returnLocation, locations); + } + + @Override + public Register getReturnRegister(JavaKind kind) { + switch (kind) { + case Boolean: + case Byte: + case Char: + case Short: + case Int: + case Long: + case Object: + return r0; + case Float: + case Double: + return v0; + case Void: + case Illegal: + return null; + default: + throw new UnsupportedOperationException("no return register for type " + kind); + } + } + + @Override + public Register getFrameRegister() { + return sp; + } + + @Override + public String toString() { + return String.format("Allocatable: " + Arrays.toString(getAllocatableRegisters()) + "%n" + "CallerSave: " + Arrays.toString(getCallerSaveRegisters()) + "%n"); + } +} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java index d5d31ea86e5..fb6eba20f92 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java @@ -49,79 +49,79 @@ public class AMD64HotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFacto protected EnumSet computeFeatures(HotSpotVMConfig config) { // Configure the feature set using the HotSpot flag settings. EnumSet features = EnumSet.noneOf(AMD64.CPUFeature.class); - if ((config.x86CPUFeatures & config.cpu3DNOWPREFETCH) != 0) { + if ((config.vmVersionFeatures & config.amd643DNOWPREFETCH) != 0) { features.add(AMD64.CPUFeature.AMD_3DNOW_PREFETCH); } assert config.useSSE >= 2 : "minimum config for x64"; features.add(AMD64.CPUFeature.SSE); features.add(AMD64.CPUFeature.SSE2); - if ((config.x86CPUFeatures & config.cpuSSE3) != 0) { + if ((config.vmVersionFeatures & config.amd64SSE3) != 0) { features.add(AMD64.CPUFeature.SSE3); } - if ((config.x86CPUFeatures & config.cpuSSSE3) != 0) { + if ((config.vmVersionFeatures & config.amd64SSSE3) != 0) { features.add(AMD64.CPUFeature.SSSE3); } - if ((config.x86CPUFeatures & config.cpuSSE4A) != 0) { + if ((config.vmVersionFeatures & config.amd64SSE4A) != 0) { features.add(AMD64.CPUFeature.SSE4A); } - if ((config.x86CPUFeatures & config.cpuSSE41) != 0) { + if ((config.vmVersionFeatures & config.amd64SSE41) != 0) { features.add(AMD64.CPUFeature.SSE4_1); } - if ((config.x86CPUFeatures & config.cpuSSE42) != 0) { + if ((config.vmVersionFeatures & config.amd64SSE42) != 0) { features.add(AMD64.CPUFeature.SSE4_2); } - if ((config.x86CPUFeatures & config.cpuPOPCNT) != 0) { + if ((config.vmVersionFeatures & config.amd64POPCNT) != 0) { features.add(AMD64.CPUFeature.POPCNT); } - if ((config.x86CPUFeatures & config.cpuLZCNT) != 0) { + if ((config.vmVersionFeatures & config.amd64LZCNT) != 0) { features.add(AMD64.CPUFeature.LZCNT); } - if ((config.x86CPUFeatures & config.cpuERMS) != 0) { + if ((config.vmVersionFeatures & config.amd64ERMS) != 0) { features.add(AMD64.CPUFeature.ERMS); } - if ((config.x86CPUFeatures & config.cpuAVX) != 0) { + if ((config.vmVersionFeatures & config.amd64AVX) != 0) { features.add(AMD64.CPUFeature.AVX); } - if ((config.x86CPUFeatures & config.cpuAVX2) != 0) { + if ((config.vmVersionFeatures & config.amd64AVX2) != 0) { features.add(AMD64.CPUFeature.AVX2); } - if ((config.x86CPUFeatures & config.cpuAES) != 0) { + if ((config.vmVersionFeatures & config.amd64AES) != 0) { features.add(AMD64.CPUFeature.AES); } - if ((config.x86CPUFeatures & config.cpu3DNOWPREFETCH) != 0) { + if ((config.vmVersionFeatures & config.amd643DNOWPREFETCH) != 0) { features.add(AMD64.CPUFeature.AMD_3DNOW_PREFETCH); } - if ((config.x86CPUFeatures & config.cpuBMI1) != 0) { + if ((config.vmVersionFeatures & config.amd64BMI1) != 0) { features.add(AMD64.CPUFeature.BMI1); } - if ((config.x86CPUFeatures & config.cpuBMI2) != 0) { + if ((config.vmVersionFeatures & config.amd64BMI2) != 0) { features.add(AMD64.CPUFeature.BMI2); } - if ((config.x86CPUFeatures & config.cpuRTM) != 0) { + if ((config.vmVersionFeatures & config.amd64RTM) != 0) { features.add(AMD64.CPUFeature.RTM); } - if ((config.x86CPUFeatures & config.cpuADX) != 0) { + if ((config.vmVersionFeatures & config.amd64ADX) != 0) { features.add(AMD64.CPUFeature.ADX); } - if ((config.x86CPUFeatures & config.cpuAVX512F) != 0) { + if ((config.vmVersionFeatures & config.amd64AVX512F) != 0) { features.add(AMD64.CPUFeature.AVX512F); } - if ((config.x86CPUFeatures & config.cpuAVX512DQ) != 0) { + if ((config.vmVersionFeatures & config.amd64AVX512DQ) != 0) { features.add(AMD64.CPUFeature.AVX512DQ); } - if ((config.x86CPUFeatures & config.cpuAVX512PF) != 0) { + if ((config.vmVersionFeatures & config.amd64AVX512PF) != 0) { features.add(AMD64.CPUFeature.AVX512PF); } - if ((config.x86CPUFeatures & config.cpuAVX512ER) != 0) { + if ((config.vmVersionFeatures & config.amd64AVX512ER) != 0) { features.add(AMD64.CPUFeature.AVX512ER); } - if ((config.x86CPUFeatures & config.cpuAVX512CD) != 0) { + if ((config.vmVersionFeatures & config.amd64AVX512CD) != 0) { features.add(AMD64.CPUFeature.AVX512CD); } - if ((config.x86CPUFeatures & config.cpuAVX512BW) != 0) { + if ((config.vmVersionFeatures & config.amd64AVX512BW) != 0) { features.add(AMD64.CPUFeature.AVX512BW); } - if ((config.x86CPUFeatures & config.cpuAVX512VL) != 0) { + if ((config.vmVersionFeatures & config.amd64AVX512VL) != 0) { features.add(AMD64.CPUFeature.AVX512VL); } return features; diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java index d9339c2fa7e..f0f0b05190e 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java @@ -60,73 +60,73 @@ public class SPARCHotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFacto protected EnumSet computeFeatures(HotSpotVMConfig config) { EnumSet features = EnumSet.noneOf(CPUFeature.class); - if ((config.sparcFeatures & config.vis1Instructions) != 0) { + if ((config.vmVersionFeatures & config.sparcVis1Instructions) != 0) { features.add(CPUFeature.VIS1); } - if ((config.sparcFeatures & config.vis2Instructions) != 0) { + if ((config.vmVersionFeatures & config.sparcVis2Instructions) != 0) { features.add(CPUFeature.VIS2); } - if ((config.sparcFeatures & config.vis3Instructions) != 0) { + if ((config.vmVersionFeatures & config.sparcVis3Instructions) != 0) { features.add(CPUFeature.VIS3); } - if ((config.sparcFeatures & config.cbcondInstructions) != 0) { + if ((config.vmVersionFeatures & config.sparcCbcondInstructions) != 0) { features.add(CPUFeature.CBCOND); } - if ((config.sparcFeatures & config.v8Instructions) != 0) { + if ((config.vmVersionFeatures & config.sparcV8Instructions) != 0) { features.add(CPUFeature.V8); } - if ((config.sparcFeatures & config.hardwareMul32) != 0) { + if ((config.vmVersionFeatures & config.sparcHardwareMul32) != 0) { features.add(CPUFeature.HARDWARE_MUL32); } - if ((config.sparcFeatures & config.hardwareDiv32) != 0) { + if ((config.vmVersionFeatures & config.sparcHardwareDiv32) != 0) { features.add(CPUFeature.HARDWARE_DIV32); } - if ((config.sparcFeatures & config.hardwareFsmuld) != 0) { + if ((config.vmVersionFeatures & config.sparcHardwareFsmuld) != 0) { features.add(CPUFeature.HARDWARE_FSMULD); } - if ((config.sparcFeatures & config.hardwarePopc) != 0) { + if ((config.vmVersionFeatures & config.sparcHardwarePopc) != 0) { features.add(CPUFeature.HARDWARE_POPC); } - if ((config.sparcFeatures & config.v9Instructions) != 0) { + if ((config.vmVersionFeatures & config.sparcV9Instructions) != 0) { features.add(CPUFeature.V9); } - if ((config.sparcFeatures & config.sun4v) != 0) { + if ((config.vmVersionFeatures & config.sparcSun4v) != 0) { features.add(CPUFeature.SUN4V); } - if ((config.sparcFeatures & config.blkInitInstructions) != 0) { + if ((config.vmVersionFeatures & config.sparcBlkInitInstructions) != 0) { features.add(CPUFeature.BLK_INIT_INSTRUCTIONS); } - if ((config.sparcFeatures & config.fmafInstructions) != 0) { + if ((config.vmVersionFeatures & config.sparcFmafInstructions) != 0) { features.add(CPUFeature.FMAF); } - if ((config.sparcFeatures & config.fmauInstructions) != 0) { + if ((config.vmVersionFeatures & config.sparcFmauInstructions) != 0) { features.add(CPUFeature.FMAU); } - if ((config.sparcFeatures & config.sparc64Family) != 0) { + if ((config.vmVersionFeatures & config.sparcSparc64Family) != 0) { features.add(CPUFeature.SPARC64_FAMILY); } - if ((config.sparcFeatures & config.mFamily) != 0) { + if ((config.vmVersionFeatures & config.sparcMFamily) != 0) { features.add(CPUFeature.M_FAMILY); } - if ((config.sparcFeatures & config.tFamily) != 0) { + if ((config.vmVersionFeatures & config.sparcTFamily) != 0) { features.add(CPUFeature.T_FAMILY); } - if ((config.sparcFeatures & config.t1Model) != 0) { + if ((config.vmVersionFeatures & config.sparcT1Model) != 0) { features.add(CPUFeature.T1_MODEL); } - if ((config.sparcFeatures & config.sparc5Instructions) != 0) { + if ((config.vmVersionFeatures & config.sparcSparc5Instructions) != 0) { features.add(CPUFeature.SPARC5); } - if ((config.sparcFeatures & config.aesInstructions) != 0) { + if ((config.vmVersionFeatures & config.sparcAesInstructions) != 0) { features.add(CPUFeature.SPARC64_FAMILY); } - if ((config.sparcFeatures & config.sha1Instruction) != 0) { + if ((config.vmVersionFeatures & config.sparcSha1Instruction) != 0) { features.add(CPUFeature.SHA1); } - if ((config.sparcFeatures & config.sha256Instruction) != 0) { + if ((config.vmVersionFeatures & config.sparcSha256Instruction) != 0) { features.add(CPUFeature.SHA256); } - if ((config.sparcFeatures & config.sha512Instruction) != 0) { + if ((config.vmVersionFeatures & config.sparcSha512Instruction) != 0) { features.add(CPUFeature.SHA512); } return features; diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java index 84e666ca3ad..c8113446681 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java @@ -907,67 +907,67 @@ public class HotSpotVMConfig { @HotSpotVMFlag(name = "UseSSE") @Stable public int useSSE; @HotSpotVMFlag(name = "UseAVX", archs = {"amd64"}) @Stable public int useAVX; - // X86 specific values - @HotSpotVMField(name = "VM_Version::_cpuFeatures", type = "uint64_t", get = HotSpotVMField.Type.VALUE, archs = {"amd64"}) @Stable public long x86CPUFeatures; - @HotSpotVMConstant(name = "VM_Version::CPU_CX8", archs = {"amd64"}) @Stable public long cpuCX8; - @HotSpotVMConstant(name = "VM_Version::CPU_CMOV", archs = {"amd64"}) @Stable public long cpuCMOV; - @HotSpotVMConstant(name = "VM_Version::CPU_FXSR", archs = {"amd64"}) @Stable public long cpuFXSR; - @HotSpotVMConstant(name = "VM_Version::CPU_HT", archs = {"amd64"}) @Stable public long cpuHT; - @HotSpotVMConstant(name = "VM_Version::CPU_MMX", archs = {"amd64"}) @Stable public long cpuMMX; - @HotSpotVMConstant(name = "VM_Version::CPU_3DNOW_PREFETCH", archs = {"amd64"}) @Stable public long cpu3DNOWPREFETCH; - @HotSpotVMConstant(name = "VM_Version::CPU_SSE", archs = {"amd64"}) @Stable public long cpuSSE; - @HotSpotVMConstant(name = "VM_Version::CPU_SSE2", archs = {"amd64"}) @Stable public long cpuSSE2; - @HotSpotVMConstant(name = "VM_Version::CPU_SSE3", archs = {"amd64"}) @Stable public long cpuSSE3; - @HotSpotVMConstant(name = "VM_Version::CPU_SSSE3", archs = {"amd64"}) @Stable public long cpuSSSE3; - @HotSpotVMConstant(name = "VM_Version::CPU_SSE4A", archs = {"amd64"}) @Stable public long cpuSSE4A; - @HotSpotVMConstant(name = "VM_Version::CPU_SSE4_1", archs = {"amd64"}) @Stable public long cpuSSE41; - @HotSpotVMConstant(name = "VM_Version::CPU_SSE4_2", archs = {"amd64"}) @Stable public long cpuSSE42; - @HotSpotVMConstant(name = "VM_Version::CPU_POPCNT", archs = {"amd64"}) @Stable public long cpuPOPCNT; - @HotSpotVMConstant(name = "VM_Version::CPU_LZCNT", archs = {"amd64"}) @Stable public long cpuLZCNT; - @HotSpotVMConstant(name = "VM_Version::CPU_TSC", archs = {"amd64"}) @Stable public long cpuTSC; - @HotSpotVMConstant(name = "VM_Version::CPU_TSCINV", archs = {"amd64"}) @Stable public long cpuTSCINV; - @HotSpotVMConstant(name = "VM_Version::CPU_AVX", archs = {"amd64"}) @Stable public long cpuAVX; - @HotSpotVMConstant(name = "VM_Version::CPU_AVX2", archs = {"amd64"}) @Stable public long cpuAVX2; - @HotSpotVMConstant(name = "VM_Version::CPU_AES", archs = {"amd64"}) @Stable public long cpuAES; - @HotSpotVMConstant(name = "VM_Version::CPU_ERMS", archs = {"amd64"}) @Stable public long cpuERMS; - @HotSpotVMConstant(name = "VM_Version::CPU_CLMUL", archs = {"amd64"}) @Stable public long cpuCLMUL; - @HotSpotVMConstant(name = "VM_Version::CPU_BMI1", archs = {"amd64"}) @Stable public long cpuBMI1; - @HotSpotVMConstant(name = "VM_Version::CPU_BMI2", archs = {"amd64"}) @Stable public long cpuBMI2; - @HotSpotVMConstant(name = "VM_Version::CPU_RTM", archs = {"amd64"}) @Stable public long cpuRTM; - @HotSpotVMConstant(name = "VM_Version::CPU_ADX", archs = {"amd64"}) @Stable public long cpuADX; - @HotSpotVMConstant(name = "VM_Version::CPU_AVX512F", archs = {"amd64"}) @Stable public long cpuAVX512F; - @HotSpotVMConstant(name = "VM_Version::CPU_AVX512DQ", archs = {"amd64"}) @Stable public long cpuAVX512DQ; - @HotSpotVMConstant(name = "VM_Version::CPU_AVX512PF", archs = {"amd64"}) @Stable public long cpuAVX512PF; - @HotSpotVMConstant(name = "VM_Version::CPU_AVX512ER", archs = {"amd64"}) @Stable public long cpuAVX512ER; - @HotSpotVMConstant(name = "VM_Version::CPU_AVX512CD", archs = {"amd64"}) @Stable public long cpuAVX512CD; - @HotSpotVMConstant(name = "VM_Version::CPU_AVX512BW", archs = {"amd64"}) @Stable public long cpuAVX512BW; - @HotSpotVMConstant(name = "VM_Version::CPU_AVX512VL", archs = {"amd64"}) @Stable public long cpuAVX512VL; + @HotSpotVMField(name = "Abstract_VM_Version::_features", type = "uint64_t", get = HotSpotVMField.Type.VALUE) @Stable public long vmVersionFeatures; + + // AMD64 specific values + @HotSpotVMConstant(name = "VM_Version::CPU_CX8", archs = {"amd64"}) @Stable public long amd64CX8; + @HotSpotVMConstant(name = "VM_Version::CPU_CMOV", archs = {"amd64"}) @Stable public long amd64CMOV; + @HotSpotVMConstant(name = "VM_Version::CPU_FXSR", archs = {"amd64"}) @Stable public long amd64FXSR; + @HotSpotVMConstant(name = "VM_Version::CPU_HT", archs = {"amd64"}) @Stable public long amd64HT; + @HotSpotVMConstant(name = "VM_Version::CPU_MMX", archs = {"amd64"}) @Stable public long amd64MMX; + @HotSpotVMConstant(name = "VM_Version::CPU_3DNOW_PREFETCH", archs = {"amd64"}) @Stable public long amd643DNOWPREFETCH; + @HotSpotVMConstant(name = "VM_Version::CPU_SSE", archs = {"amd64"}) @Stable public long amd64SSE; + @HotSpotVMConstant(name = "VM_Version::CPU_SSE2", archs = {"amd64"}) @Stable public long amd64SSE2; + @HotSpotVMConstant(name = "VM_Version::CPU_SSE3", archs = {"amd64"}) @Stable public long amd64SSE3; + @HotSpotVMConstant(name = "VM_Version::CPU_SSSE3", archs = {"amd64"}) @Stable public long amd64SSSE3; + @HotSpotVMConstant(name = "VM_Version::CPU_SSE4A", archs = {"amd64"}) @Stable public long amd64SSE4A; + @HotSpotVMConstant(name = "VM_Version::CPU_SSE4_1", archs = {"amd64"}) @Stable public long amd64SSE41; + @HotSpotVMConstant(name = "VM_Version::CPU_SSE4_2", archs = {"amd64"}) @Stable public long amd64SSE42; + @HotSpotVMConstant(name = "VM_Version::CPU_POPCNT", archs = {"amd64"}) @Stable public long amd64POPCNT; + @HotSpotVMConstant(name = "VM_Version::CPU_LZCNT", archs = {"amd64"}) @Stable public long amd64LZCNT; + @HotSpotVMConstant(name = "VM_Version::CPU_TSC", archs = {"amd64"}) @Stable public long amd64TSC; + @HotSpotVMConstant(name = "VM_Version::CPU_TSCINV", archs = {"amd64"}) @Stable public long amd64TSCINV; + @HotSpotVMConstant(name = "VM_Version::CPU_AVX", archs = {"amd64"}) @Stable public long amd64AVX; + @HotSpotVMConstant(name = "VM_Version::CPU_AVX2", archs = {"amd64"}) @Stable public long amd64AVX2; + @HotSpotVMConstant(name = "VM_Version::CPU_AES", archs = {"amd64"}) @Stable public long amd64AES; + @HotSpotVMConstant(name = "VM_Version::CPU_ERMS", archs = {"amd64"}) @Stable public long amd64ERMS; + @HotSpotVMConstant(name = "VM_Version::CPU_CLMUL", archs = {"amd64"}) @Stable public long amd64CLMUL; + @HotSpotVMConstant(name = "VM_Version::CPU_BMI1", archs = {"amd64"}) @Stable public long amd64BMI1; + @HotSpotVMConstant(name = "VM_Version::CPU_BMI2", archs = {"amd64"}) @Stable public long amd64BMI2; + @HotSpotVMConstant(name = "VM_Version::CPU_RTM", archs = {"amd64"}) @Stable public long amd64RTM; + @HotSpotVMConstant(name = "VM_Version::CPU_ADX", archs = {"amd64"}) @Stable public long amd64ADX; + @HotSpotVMConstant(name = "VM_Version::CPU_AVX512F", archs = {"amd64"}) @Stable public long amd64AVX512F; + @HotSpotVMConstant(name = "VM_Version::CPU_AVX512DQ", archs = {"amd64"}) @Stable public long amd64AVX512DQ; + @HotSpotVMConstant(name = "VM_Version::CPU_AVX512PF", archs = {"amd64"}) @Stable public long amd64AVX512PF; + @HotSpotVMConstant(name = "VM_Version::CPU_AVX512ER", archs = {"amd64"}) @Stable public long amd64AVX512ER; + @HotSpotVMConstant(name = "VM_Version::CPU_AVX512CD", archs = {"amd64"}) @Stable public long amd64AVX512CD; + @HotSpotVMConstant(name = "VM_Version::CPU_AVX512BW", archs = {"amd64"}) @Stable public long amd64AVX512BW; + @HotSpotVMConstant(name = "VM_Version::CPU_AVX512VL", archs = {"amd64"}) @Stable public long amd64AVX512VL; // SPARC specific values - @HotSpotVMField(name = "VM_Version::_features", type = "int", get = HotSpotVMField.Type.VALUE, archs = {"sparc"}) @Stable public int sparcFeatures; - @HotSpotVMConstant(name = "VM_Version::vis3_instructions_m", archs = {"sparc"}) @Stable public int vis3Instructions; - @HotSpotVMConstant(name = "VM_Version::vis2_instructions_m", archs = {"sparc"}) @Stable public int vis2Instructions; - @HotSpotVMConstant(name = "VM_Version::vis1_instructions_m", archs = {"sparc"}) @Stable public int vis1Instructions; - @HotSpotVMConstant(name = "VM_Version::cbcond_instructions_m", archs = {"sparc"}) @Stable public int cbcondInstructions; - @HotSpotVMConstant(name = "VM_Version::v8_instructions_m", archs = {"sparc"}) @Stable public int v8Instructions; - @HotSpotVMConstant(name = "VM_Version::hardware_mul32_m", archs = {"sparc"}) @Stable public int hardwareMul32; - @HotSpotVMConstant(name = "VM_Version::hardware_div32_m", archs = {"sparc"}) @Stable public int hardwareDiv32; - @HotSpotVMConstant(name = "VM_Version::hardware_fsmuld_m", archs = {"sparc"}) @Stable public int hardwareFsmuld; - @HotSpotVMConstant(name = "VM_Version::hardware_popc_m", archs = {"sparc"}) @Stable public int hardwarePopc; - @HotSpotVMConstant(name = "VM_Version::v9_instructions_m", archs = {"sparc"}) @Stable public int v9Instructions; - @HotSpotVMConstant(name = "VM_Version::sun4v_m", archs = {"sparc"}) @Stable public int sun4v; - @HotSpotVMConstant(name = "VM_Version::blk_init_instructions_m", archs = {"sparc"}) @Stable public int blkInitInstructions; - @HotSpotVMConstant(name = "VM_Version::fmaf_instructions_m", archs = {"sparc"}) @Stable public int fmafInstructions; - @HotSpotVMConstant(name = "VM_Version::fmau_instructions_m", archs = {"sparc"}) @Stable public int fmauInstructions; - @HotSpotVMConstant(name = "VM_Version::sparc64_family_m", archs = {"sparc"}) @Stable public int sparc64Family; - @HotSpotVMConstant(name = "VM_Version::M_family_m", archs = {"sparc"}) @Stable public int mFamily; - @HotSpotVMConstant(name = "VM_Version::T_family_m", archs = {"sparc"}) @Stable public int tFamily; - @HotSpotVMConstant(name = "VM_Version::T1_model_m", archs = {"sparc"}) @Stable public int t1Model; - @HotSpotVMConstant(name = "VM_Version::sparc5_instructions_m", archs = {"sparc"}) @Stable public int sparc5Instructions; - @HotSpotVMConstant(name = "VM_Version::aes_instructions_m", archs = {"sparc"}) @Stable public int aesInstructions; - @HotSpotVMConstant(name = "VM_Version::sha1_instruction_m", archs = {"sparc"}) @Stable public int sha1Instruction; - @HotSpotVMConstant(name = "VM_Version::sha256_instruction_m", archs = {"sparc"}) @Stable public int sha256Instruction; - @HotSpotVMConstant(name = "VM_Version::sha512_instruction_m", archs = {"sparc"}) @Stable public int sha512Instruction; + @HotSpotVMConstant(name = "VM_Version::vis3_instructions_m", archs = {"sparc"}) @Stable public int sparcVis3Instructions; + @HotSpotVMConstant(name = "VM_Version::vis2_instructions_m", archs = {"sparc"}) @Stable public int sparcVis2Instructions; + @HotSpotVMConstant(name = "VM_Version::vis1_instructions_m", archs = {"sparc"}) @Stable public int sparcVis1Instructions; + @HotSpotVMConstant(name = "VM_Version::cbcond_instructions_m", archs = {"sparc"}) @Stable public int sparcCbcondInstructions; + @HotSpotVMConstant(name = "VM_Version::v8_instructions_m", archs = {"sparc"}) @Stable public int sparcV8Instructions; + @HotSpotVMConstant(name = "VM_Version::hardware_mul32_m", archs = {"sparc"}) @Stable public int sparcHardwareMul32; + @HotSpotVMConstant(name = "VM_Version::hardware_div32_m", archs = {"sparc"}) @Stable public int sparcHardwareDiv32; + @HotSpotVMConstant(name = "VM_Version::hardware_fsmuld_m", archs = {"sparc"}) @Stable public int sparcHardwareFsmuld; + @HotSpotVMConstant(name = "VM_Version::hardware_popc_m", archs = {"sparc"}) @Stable public int sparcHardwarePopc; + @HotSpotVMConstant(name = "VM_Version::v9_instructions_m", archs = {"sparc"}) @Stable public int sparcV9Instructions; + @HotSpotVMConstant(name = "VM_Version::sun4v_m", archs = {"sparc"}) @Stable public int sparcSun4v; + @HotSpotVMConstant(name = "VM_Version::blk_init_instructions_m", archs = {"sparc"}) @Stable public int sparcBlkInitInstructions; + @HotSpotVMConstant(name = "VM_Version::fmaf_instructions_m", archs = {"sparc"}) @Stable public int sparcFmafInstructions; + @HotSpotVMConstant(name = "VM_Version::fmau_instructions_m", archs = {"sparc"}) @Stable public int sparcFmauInstructions; + @HotSpotVMConstant(name = "VM_Version::sparc64_family_m", archs = {"sparc"}) @Stable public int sparcSparc64Family; + @HotSpotVMConstant(name = "VM_Version::M_family_m", archs = {"sparc"}) @Stable public int sparcMFamily; + @HotSpotVMConstant(name = "VM_Version::T_family_m", archs = {"sparc"}) @Stable public int sparcTFamily; + @HotSpotVMConstant(name = "VM_Version::T1_model_m", archs = {"sparc"}) @Stable public int sparcT1Model; + @HotSpotVMConstant(name = "VM_Version::sparc5_instructions_m", archs = {"sparc"}) @Stable public int sparcSparc5Instructions; + @HotSpotVMConstant(name = "VM_Version::aes_instructions_m", archs = {"sparc"}) @Stable public int sparcAesInstructions; + @HotSpotVMConstant(name = "VM_Version::sha1_instruction_m", archs = {"sparc"}) @Stable public int sparcSha1Instruction; + @HotSpotVMConstant(name = "VM_Version::sha256_instruction_m", archs = {"sparc"}) @Stable public int sparcSha256Instruction; + @HotSpotVMConstant(name = "VM_Version::sha512_instruction_m", archs = {"sparc"}) @Stable public int sparcSha512Instruction; @HotSpotVMFlag(name = "UseBlockZeroing", archs = {"sparc"}) @Stable public boolean useBlockZeroing; @HotSpotVMFlag(name = "BlockZeroingLowLimit", archs = {"sparc"}) @Stable public int blockZeroingLowLimit; diff --git a/hotspot/src/os/aix/vm/os_aix.cpp b/hotspot/src/os/aix/vm/os_aix.cpp index 560fe57ea54..102ab14840f 100644 --- a/hotspot/src/os/aix/vm/os_aix.cpp +++ b/hotspot/src/os/aix/vm/os_aix.cpp @@ -1643,7 +1643,7 @@ void os::pd_print_cpu_info(outputStream* st, char* buf, size_t buflen) { st->print("total %d", os::processor_count()); // It's not safe to query number of active processors after crash. // st->print("(active %d)", os::active_processor_count()); - st->print(" %s", VM_Version::cpu_features()); + st->print(" %s", VM_Version::features()); st->cr(); } diff --git a/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp b/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp index abd02c5c46c..84f7dca06ef 100644 --- a/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp +++ b/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp @@ -74,6 +74,8 @@ static_field(CompilerToVM::Data, cardtable_start_address, jbyte*) \ static_field(CompilerToVM::Data, cardtable_shift, int) \ \ + static_field(Abstract_VM_Version, _features, uint64_t) \ + \ nonstatic_field(Array, _length, int) \ unchecked_nonstatic_field(Array, _data, sizeof(u1)) \ unchecked_nonstatic_field(Array, _data, sizeof(u2)) \ @@ -586,11 +588,7 @@ #ifdef TARGET_ARCH_x86 #define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \ - volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) \ - static_field(VM_Version, _cpuFeatures, uint64_t) - -#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) \ - declare_toplevel_type(VM_Version) + volatile_nonstatic_field(JavaFrameAnchor, _last_Java_fp, intptr_t*) #define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \ LP64_ONLY(declare_constant(frame::arg_reg_save_area_bytes)) \ @@ -638,11 +636,7 @@ #ifdef TARGET_ARCH_sparc #define VM_STRUCTS_CPU(nonstatic_field, static_field, unchecked_nonstatic_field, volatile_nonstatic_field, nonproduct_nonstatic_field, c2_nonstatic_field, unchecked_c1_static_field, unchecked_c2_static_field) \ - volatile_nonstatic_field(JavaFrameAnchor, _flags, int) \ - static_field(VM_Version, _features, int) - -#define VM_TYPES_CPU(declare_type, declare_toplevel_type, declare_oop_type, declare_integer_type, declare_unsigned_integer_type, declare_c1_toplevel_type, declare_c2_type, declare_c2_toplevel_type) \ - declare_toplevel_type(VM_Version) + volatile_nonstatic_field(JavaFrameAnchor, _flags, int) #define VM_INT_CONSTANTS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) \ declare_constant(VM_Version::vis1_instructions_m) \ diff --git a/hotspot/src/share/vm/prims/whitebox.cpp b/hotspot/src/share/vm/prims/whitebox.cpp index 557e93e36c6..db1e84dc0d7 100644 --- a/hotspot/src/share/vm/prims/whitebox.cpp +++ b/hotspot/src/share/vm/prims/whitebox.cpp @@ -1005,9 +1005,9 @@ WB_ENTRY(void, WB_ReadReservedMemory(JNIEnv* env, jobject o)) WB_END WB_ENTRY(jstring, WB_GetCPUFeatures(JNIEnv* env, jobject o)) - const char* cpu_features = VM_Version::cpu_features(); + const char* features = VM_Version::features_string(); ThreadToNativeFromVM ttn(thread); - jstring features_string = env->NewStringUTF(cpu_features); + jstring features_string = env->NewStringUTF(features); CHECK_JNI_EXCEPTION_(env, NULL); diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp index e1c71bf1406..ee9fd1d9c38 100644 --- a/hotspot/src/share/vm/runtime/os.cpp +++ b/hotspot/src/share/vm/runtime/os.cpp @@ -819,7 +819,7 @@ void os::print_cpu_info(outputStream* st, char* buf, size_t buflen) { st->print("total %d", os::processor_count()); // It's not safe to query number of active processors after crash // st->print("(active %d)", os::active_processor_count()); - st->print(" %s", VM_Version::cpu_features()); + st->print(" %s", VM_Version::features_string()); st->cr(); pd_print_cpu_info(st, buf, buflen); } diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index dafa827c6c6..f279a37bc76 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -1310,6 +1310,8 @@ typedef CompactHashtable SymbolCompactHashTable; \ static_field(Abstract_VM_Version, _s_vm_release, const char*) \ static_field(Abstract_VM_Version, _s_internal_vm_info_string, const char*) \ + static_field(Abstract_VM_Version, _features, uint64_t) \ + static_field(Abstract_VM_Version, _features_string, const char*) \ static_field(Abstract_VM_Version, _vm_major_version, int) \ static_field(Abstract_VM_Version, _vm_minor_version, int) \ static_field(Abstract_VM_Version, _vm_security_version, int) \ diff --git a/hotspot/src/share/vm/runtime/vm_version.cpp b/hotspot/src/share/vm/runtime/vm_version.cpp index fc20ee49665..1005e832cf0 100644 --- a/hotspot/src/share/vm/runtime/vm_version.cpp +++ b/hotspot/src/share/vm/runtime/vm_version.cpp @@ -31,6 +31,10 @@ const char* Abstract_VM_Version::_s_vm_release = Abstract_VM_Version::vm_release(); const char* Abstract_VM_Version::_s_internal_vm_info_string = Abstract_VM_Version::internal_vm_info_string(); + +uint64_t Abstract_VM_Version::_features = 0; +const char* Abstract_VM_Version::_features_string = ""; + bool Abstract_VM_Version::_supports_cx8 = false; bool Abstract_VM_Version::_supports_atomic_getset4 = false; bool Abstract_VM_Version::_supports_atomic_getset8 = false; diff --git a/hotspot/src/share/vm/runtime/vm_version.hpp b/hotspot/src/share/vm/runtime/vm_version.hpp index 4e12c00bba5..ee4b4ec0d64 100644 --- a/hotspot/src/share/vm/runtime/vm_version.hpp +++ b/hotspot/src/share/vm/runtime/vm_version.hpp @@ -31,10 +31,17 @@ // VM_Version provides information about the VM. class Abstract_VM_Version: AllStatic { - protected: friend class VMStructs; + friend class JVMCIVMStructs; + + protected: static const char* _s_vm_release; static const char* _s_internal_vm_info_string; + + // CPU feature flags. + static uint64_t _features; + static const char* _features_string; + // These are set by machine-dependent initializations static bool _supports_cx8; static bool _supports_atomic_getset4; @@ -100,6 +107,14 @@ class Abstract_VM_Version: AllStatic { static const char* jre_release_version(); static const char* jdk_debug_level(); + static uint64_t features() { + return _features; + } + + static const char* features_string() { + return _features_string; + } + // does HW support an 8-byte compare-exchange operation? static bool supports_cx8() { #ifdef SUPPORTS_NATIVE_CX8 diff --git a/hotspot/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java b/hotspot/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java index d31b62cf505..0d7960ee55a 100644 --- a/hotspot/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java +++ b/hotspot/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary / * @run main/othervm -XX:+UnlockExperimentalVMOptions * -Dcompiler.jvmci.JVM_GetJVMCIRuntimeTest.positive=true diff --git a/hotspot/test/compiler/jvmci/SecurityRestrictionsTest.java b/hotspot/test/compiler/jvmci/SecurityRestrictionsTest.java index 2e2618b5c44..e74fc43ca01 100644 --- a/hotspot/test/compiler/jvmci/SecurityRestrictionsTest.java +++ b/hotspot/test/compiler/jvmci/SecurityRestrictionsTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ./common/CompilerToVMHelper.java * @run main ClassFileInstaller jdk.vm.ci.hotspot.CompilerToVMHelper diff --git a/hotspot/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java b/hotspot/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java index 5e28832df8b..63c009c3df3 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java @@ -24,7 +24,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @build sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/jvmci/compilerToVM/CanInlineMethodTest.java b/hotspot/test/compiler/jvmci/compilerToVM/CanInlineMethodTest.java index 8bfd63b9193..64dca91cfb5 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/CanInlineMethodTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/CanInlineMethodTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @build sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/jvmci/compilerToVM/CollectCountersTest.java b/hotspot/test/compiler/jvmci/compilerToVM/CollectCountersTest.java index e77e06c80ab..be1d594bbd4 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/CollectCountersTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/CollectCountersTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib/ * @compile ../common/CompilerToVMHelper.java * @run main ClassFileInstaller diff --git a/hotspot/test/compiler/jvmci/compilerToVM/DebugOutputTest.java b/hotspot/test/compiler/jvmci/compilerToVM/DebugOutputTest.java index 2f0bc449986..d6c22fc5ee1 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/DebugOutputTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/DebugOutputTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib * @compile ../common/CompilerToVMHelper.java * @run main ClassFileInstaller diff --git a/hotspot/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java b/hotspot/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java index 0d4ad698738..60a734d68a5 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java @@ -25,7 +25,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @ignore 8139700 * @compile ../common/CompilerToVMHelper.java diff --git a/hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java b/hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java index de8d74aa001..a87cab4a386 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @build sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java index 10f387db30c..dccd325b1df 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java @@ -21,7 +21,7 @@ import java.util.Map; /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @build sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java b/hotspot/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java index 6405289a2a9..2b39757975c 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.compilerToVM.FindUniqueConcreteMethodTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java index 1765f1ec367..586160f58fc 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @run main ClassFileInstaller jdk.vm.ci.hotspot.CompilerToVMHelper diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java index d0a6097c035..6c731a4540f 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.compilerToVM.GetClassInitializerTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java index ae541842b6a..4c347964800 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java @@ -25,7 +25,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java ../common/PublicMetaspaceWrapperObject.java * @build sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java index 2793286ae17..e8630c10d0f 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @run main ClassFileInstaller jdk.vm.ci.hotspot.CompilerToVMHelper diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetImplementorTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetImplementorTest.java index 8055d470330..fd88f772cba 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetImplementorTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetImplementorTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib/ * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.compilerToVM.GetImplementorTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java index 9755b2a4564..8ca2f535bbc 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @run main ClassFileInstaller jdk.vm.ci.hotspot.CompilerToVMHelper diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java index d83f87b56c0..d967e60a7d1 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @clean compiler.jvmci.compilerToVM.* * @compile -g DummyInterface.java diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java index 74c2481e6bd..b803f550600 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib/ * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.compilerToVM.GetMaxCallTargetOffsetTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java index 063653b1d25..830ff7b066a 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib * @compile ../common/CompilerToVMHelper.java * @run main ClassFileInstaller diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodAtSlotTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodAtSlotTest.java index a235e683440..3f578e9883d 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodAtSlotTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodAtSlotTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @run main ClassFileInstaller jdk.vm.ci.hotspot.CompilerToVMHelper diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java index e5db902cecf..5a98e880f9c 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib * @compile ../common/CompilerToVMHelper.java * ../common/PublicMetaspaceWrapperObject.java diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java index 82561463eb4..50b1a60acb8 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib * @compile ../common/CompilerToVMHelper.java * ../common/PublicMetaspaceWrapperObject.java diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java index 9888931402a..5554bc3914b 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @run main ClassFileInstaller jdk.vm.ci.hotspot.CompilerToVMHelper diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetSymbolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetSymbolTest.java index 201faa364c7..e550282d5b0 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetSymbolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetSymbolTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.compilerToVM.GetSymbolTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java index ae68ebe2286..f97a44750a6 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.compilerToVM.GetVtableIndexForInterfaceTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java b/hotspot/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java index e772a912406..cf839d71059 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @build sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java b/hotspot/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java index 806a19e5c9c..ce6f1a830f9 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.compilerToVM.HasFinalizableSubclassTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/InitializeConfigurationTest.java b/hotspot/test/compiler/jvmci/compilerToVM/InitializeConfigurationTest.java index 35fe8d18980..2a2268ab38c 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/InitializeConfigurationTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/InitializeConfigurationTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.compilerToVM.InitializeConfigurationTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java index c76f62f28c1..a8eac1de6cd 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java @@ -25,7 +25,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @ignore 8139700 * @compile ../common/CompilerToVMHelper.java diff --git a/hotspot/test/compiler/jvmci/compilerToVM/IsMatureTest.java b/hotspot/test/compiler/jvmci/compilerToVM/IsMatureTest.java index 77f51447628..a8004268fd2 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/IsMatureTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/IsMatureTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib * @compile ../common/CompilerToVMHelper.java * @build sun.hotspot.WhiteBox IsMatureTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java b/hotspot/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java index 00378a00ed7..5a18a6ad29a 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java @@ -25,7 +25,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary / * @run main/othervm -XX:+UnlockExperimentalVMOptions * -Dcompiler.jvmci.compilerToVM.JVM_RegisterJVMCINatives.positive=true diff --git a/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java index 0451c71baa4..b3fb21028af 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java @@ -25,7 +25,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @summary Testing compiler.jvmci.CompilerToVM.lookupKlassInPool method * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java diff --git a/hotspot/test/compiler/jvmci/compilerToVM/LookupTypeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/LookupTypeTest.java index 571bf159660..2f6efe1795f 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/LookupTypeTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupTypeTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.compilerToVM.LookupTypeTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java b/hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java index fce33de6d6b..326f24e92fb 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib * @ignore 8139703 * @compile ../common/CompilerToVMHelper.java diff --git a/hotspot/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java b/hotspot/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java index 4d228cd967f..3d00dae0cd7 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @run main ClassFileInstaller jdk.vm.ci.hotspot.CompilerToVMHelper diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ReadUncompressedOopTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ReadUncompressedOopTest.java index 7b752228962..5ff5913d6fe 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ReadUncompressedOopTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ReadUncompressedOopTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib/ * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.compilerToVM.ReadUncompressedOopTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ReprofileTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ReprofileTest.java index 2a81af5bfc4..bc3e781086d 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ReprofileTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ReprofileTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @build sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java index 0735ccb154d..e72240e0316 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java @@ -25,7 +25,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.compilerToVM.ResolveConstantInPoolTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java index e9e69f470f5..ba43e6b08ff 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.compilerToVM.ResolveMethodTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java index a92800bb8dd..9b205e347ad 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java @@ -25,7 +25,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @summary Testing compiler.jvmci.CompilerToVM.resolveTypeInPool method * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java index d7a4c84caad..86f9cef8ec0 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary /test/lib/ * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.compilerToVM.ShouldDebugNonSafepointsTest diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java index e2e35719ba9..a034166604a 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java @@ -25,7 +25,7 @@ /** * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / * @compile ../common/CompilerToVMHelper.java * @build sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java b/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java index 98ad40ed2ad..f40dea820eb 100644 --- a/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java +++ b/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @compile CodeInstallerTest.java * @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI compiler.jvmci.errors.TestInvalidCompilationResult */ diff --git a/hotspot/test/compiler/jvmci/errors/TestInvalidDebugInfo.java b/hotspot/test/compiler/jvmci/errors/TestInvalidDebugInfo.java index cc387ed195f..ede956c1b82 100644 --- a/hotspot/test/compiler/jvmci/errors/TestInvalidDebugInfo.java +++ b/hotspot/test/compiler/jvmci/errors/TestInvalidDebugInfo.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @compile CodeInstallerTest.java * @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI compiler.jvmci.errors.TestInvalidDebugInfo */ diff --git a/hotspot/test/compiler/jvmci/errors/TestInvalidOopMap.java b/hotspot/test/compiler/jvmci/errors/TestInvalidOopMap.java index 6291c06a7c2..df0b60adb0f 100644 --- a/hotspot/test/compiler/jvmci/errors/TestInvalidOopMap.java +++ b/hotspot/test/compiler/jvmci/errors/TestInvalidOopMap.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @compile CodeInstallerTest.java * @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI compiler.jvmci.errors.TestInvalidOopMap */ diff --git a/hotspot/test/compiler/jvmci/events/JvmciCreateMetaAccessContextTest.java b/hotspot/test/compiler/jvmci/events/JvmciCreateMetaAccessContextTest.java index e259f24fa15..810404bf8ef 100644 --- a/hotspot/test/compiler/jvmci/events/JvmciCreateMetaAccessContextTest.java +++ b/hotspot/test/compiler/jvmci/events/JvmciCreateMetaAccessContextTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary * @compile ./MetaAccessWrapper.java * @build compiler.jvmci.common.JVMCIHelpers diff --git a/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java b/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java index cea5bafbd9b..a1dfa84924c 100644 --- a/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java +++ b/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library / /testlibrary * @compile ../common/CompilerToVMHelper.java * @build compiler.jvmci.common.JVMCIHelpers diff --git a/hotspot/test/compiler/jvmci/events/JvmciShutdownEventTest.java b/hotspot/test/compiler/jvmci/events/JvmciShutdownEventTest.java index 5b034a1a549..7dae44ee86c 100644 --- a/hotspot/test/compiler/jvmci/events/JvmciShutdownEventTest.java +++ b/hotspot/test/compiler/jvmci/events/JvmciShutdownEventTest.java @@ -24,7 +24,7 @@ /* * @test * @bug 8136421 - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary / * @build compiler.jvmci.common.JVMCIHelpers * compiler.jvmci.events.JvmciShutdownEventListener diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/NestedBooleanOptionValueTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/NestedBooleanOptionValueTest.java index 552a9937574..2da9725c0ae 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/NestedBooleanOptionValueTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/NestedBooleanOptionValueTest.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @run junit jdk.vm.ci.options.test.NestedBooleanOptionValueTest */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/TestOptionValue.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/TestOptionValue.java index b9872d76fdd..0f9d23d5a50 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/TestOptionValue.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/TestOptionValue.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @run junit jdk.vm.ci.options.test.TestOptionValue */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java index ab214fd66ad..5be56d0c33a 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @compile ConstantTest.java FieldUniverse.java TypeUniverse.java TestMetaAccessProvider.java * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.ConstantTest */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java index f7422fbce78..11392414300 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @compile RedefineClassTest.java TypeUniverse.java TestMetaAccessProvider.java * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.RedefineClassTest */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java index f6d38b44bbd..37b54a14796 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.ResolvedJavaTypeResolveConcreteMethodTest */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java index 2b5d05c60d5..043aba3d9bb 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.ResolvedJavaTypeResolveMethodTest */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java index bdb258038b8..dbde990b71c 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @compile TestConstantReflectionProvider.java TypeUniverse.java TestMetaAccessProvider.java * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestConstantReflectionProvider */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java index 1dea56cc20a..d4c3a58db5d 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @compile TestJavaField.java FieldUniverse.java TypeUniverse.java TestMetaAccessProvider.java * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestJavaField */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java index f5e5b368e3e..50e7b2ed3ee 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @compile TestJavaMethod.java MethodUniverse.java TypeUniverse.java TestMetaAccessProvider.java NameAndSignature.java * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestJavaMethod */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java index e17427bf432..311c96ac5af 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @compile TestJavaType.java TypeUniverse.java TestMetaAccessProvider.java * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestJavaType */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java index c0420f4f5e4..9c1974035cf 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @compile TestMetaAccessProvider.java TypeUniverse.java TestMetaAccessProvider.java * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestMetaAccessProvider */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java index 4b0c4df2c74..fb960c00af7 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @compile TestResolvedJavaField.java FieldUniverse.java TypeUniverse.java TestMetaAccessProvider.java * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestResolvedJavaField */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java index 39ef621f924..bb3da636e2c 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @compile TestResolvedJavaMethod.java MethodUniverse.java TypeUniverse.java TestMetaAccessProvider.java * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestResolvedJavaMethod */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java index 2ddf7797fcc..37b430ff908 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java @@ -23,7 +23,7 @@ /** * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9") & os.arch != "aarch64" + * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @compile TestResolvedJavaType.java TypeUniverse.java TestMetaAccessProvider.java NameAndSignature.java * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestResolvedJavaType */ From e227bbc9daf6a806a7b3a51af68b5ead927773cd Mon Sep 17 00:00:00 2001 From: Igor Ignatyev Date: Fri, 25 Dec 2015 03:27:06 +0300 Subject: [PATCH 117/146] 8146205: quarantine compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java Reviewed-by: kvn --- .../compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java index dccd325b1df..839b509af15 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java @@ -23,6 +23,7 @@ import java.util.Map; * @bug 8136421 * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") * @library /testlibrary /test/lib / + * @ignore 8139383 * @compile ../common/CompilerToVMHelper.java * @build sun.hotspot.WhiteBox * compiler.jvmci.compilerToVM.ExecuteInstalledCodeTest From 28154b095e346e57d3430bfae511a2bcd3898752 Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Mon, 28 Dec 2015 10:32:20 +0100 Subject: [PATCH 118/146] 8146231: ppc64/gcc 4.1.2: fix build after "8143072: [JVMCI] Port JVMCI to AArch64" Reviewed-by: goetz --- hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp b/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp index 741618c33c8..63b9ba09793 100644 --- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.hpp @@ -62,7 +62,7 @@ protected: vcipher_m = (1 << vcipher), vpmsumb_m = (1 << vpmsumb), tcheck_m = (1 << tcheck ), - all_features_m = -1 + all_features_m = (unsigned long)-1 }; static bool _is_determine_features_test_running; From ae88612f52a798e6af2bb23c758827af407d4a23 Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Sat, 26 Dec 2015 16:59:26 +0100 Subject: [PATCH 119/146] 8146157: JVMCI must not fold accesses to @Stable fields if -XX:-FoldStableValues Reviewed-by: twisti --- .../hotspot/HotSpotConstantReflectionProvider.java | 8 +++++--- .../jdk/vm/ci/hotspot/HotSpotResolvedJavaField.java | 13 +++++-------- .../src/jdk/vm/ci/hotspot/HotSpotVMConfig.java | 2 ++ 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java index a5d165feb61..ef2261de039 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java @@ -242,7 +242,7 @@ public class HotSpotConstantReflectionProvider implements ConstantReflectionProv * {@link #readConstantFieldValue(JavaField, JavaConstant)}. */ protected boolean isStaticFieldConstant(HotSpotResolvedJavaField staticField) { - if (staticField.isFinal() || staticField.isStable()) { + if (staticField.isFinal() || (staticField.isStable() && runtime.getConfig().foldStableValues)) { ResolvedJavaType holder = staticField.getDeclaringClass(); if (holder.isInitialized() && !holder.getName().equals(SystemClassName)) { return true; @@ -312,7 +312,7 @@ public class HotSpotConstantReflectionProvider implements ConstantReflectionProv return value; } } - } else if (hotspotField.isStable()) { + } else if (hotspotField.isStable() && runtime.getConfig().foldStableValues) { if (hotspotField.isInObject(object)) { JavaConstant value = readFieldValue(field, receiver); if (isStableInstanceFieldValueConstant(value, object.getClass())) { @@ -337,8 +337,10 @@ public class HotSpotConstantReflectionProvider implements ConstantReflectionProv HotSpotResolvedJavaField hotspotField = (HotSpotResolvedJavaField) field; if (!hotspotField.isStable()) { return readNonStableFieldValue(field, receiver); - } else { + } else if (runtime.getConfig().foldStableValues) { return readStableFieldValue(field, receiver, hotspotField.isDefaultStable()); + } else { + return null; } } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaField.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaField.java index 00b0c0de8c9..1fd7e48924f 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaField.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaField.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,17 +40,14 @@ public interface HotSpotResolvedJavaField extends ResolvedJavaField { int offset(); /** - * Checks if this field has the {@link Stable} annotation. - * - * @return true if field has {@link Stable} annotation, false otherwise + * Determines if this field should be treated as a constant. */ boolean isStable(); /** - * If this field is stable, checks if default values (0, null, etc.) should be considered stable - * as well. - * - * @return true if default values should be considered stable, false otherwise + * Determines if this field should be considered constant if it has the default value for its + * type (e.g, 0, null, etc.). The result of this method is undefined if this field is not + * {@linkplain #isStable() stable}. */ boolean isDefaultStable(); } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java index c8113446681..d237006dfcb 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java @@ -853,6 +853,7 @@ public class HotSpotVMConfig { @HotSpotVMFlag(name = "JVMCIUseFastLocking") @Stable public boolean useFastLocking; @HotSpotVMFlag(name = "ForceUnreachable") @Stable public boolean forceUnreachable; @HotSpotVMFlag(name = "CodeCacheSegmentSize") @Stable public int codeSegmentSize; + @HotSpotVMFlag(name = "FoldStableValues") @Stable public boolean foldStableValues; @HotSpotVMFlag(name = "UseTLAB") @Stable public boolean useTLAB; @HotSpotVMFlag(name = "UseBiasedLocking") @Stable public boolean useBiasedLocking; @@ -1683,6 +1684,7 @@ public class HotSpotVMConfig { @HotSpotVMConstant(name = "ArrayData::array_len_off_set") @Stable public int arrayDataArrayLenOffset; @HotSpotVMConstant(name = "ArrayData::array_start_off_set") @Stable public int arrayDataArrayStartOffset; @HotSpotVMConstant(name = "MultiBranchData::per_case_cell_count") @Stable public int multiBranchDataPerCaseCellCount; + // Checkstyle: resume private boolean check() { From fb318fc787a3bf941bfe4182c1f1af6a41971d05 Mon Sep 17 00:00:00 2001 From: Christian Thalinger Date: Mon, 28 Dec 2015 10:10:37 -1000 Subject: [PATCH 120/146] 8146245: compiler/jvmci/ tests fail: java.lang.AssertionError: minimum config for aarch64 Reviewed-by: kvn --- .../jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64.java index af6f7e892af..0038c161b1b 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64.java @@ -175,11 +175,9 @@ public class AArch64 extends Architecture { private final EnumSet flags; public AArch64(EnumSet features, EnumSet flags) { - super("aarch64", AArch64Kind.QWORD, ByteOrder.LITTLE_ENDIAN, /* unalignedMemoryAccess */true, allRegisters, /* implicitMemoryBarriers */0, /* nativeCallDisplacementOffset */0, - /* returnAddressSize */0); + super("aarch64", AArch64Kind.QWORD, ByteOrder.LITTLE_ENDIAN, true, allRegisters, 0, 0, 0); this.features = features; this.flags = flags; - assert features.contains(CPUFeature.FP) : "minimum config for aarch64"; } public EnumSet getFeatures() { From 790f5bded45619ff7aea5b1506e5daceac4740bf Mon Sep 17 00:00:00 2001 From: Kishor Kharbas Date: Mon, 28 Dec 2015 23:11:01 -0800 Subject: [PATCH 121/146] 8143925: Enhancing CounterMode.crypt() for AES Add intrinsic for CounterMode.crypt() to leverage the parallel nature of AES in Counter(CTR) Mode. Reviewed-by: kvn, ascarpino --- .../src/cpu/aarch64/vm/vm_version_aarch64.cpp | 5 + hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp | 5 + hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp | 5 + hotspot/src/cpu/x86/vm/assembler_x86.cpp | 91 ++++- hotspot/src/cpu/x86/vm/assembler_x86.hpp | 10 + .../src/cpu/x86/vm/stubGenerator_x86_32.cpp | 352 ++++++++++++++++++ .../src/cpu/x86/vm/stubGenerator_x86_64.cpp | 348 ++++++++++++++++- hotspot/src/cpu/x86/vm/stubRoutines_x86.cpp | 1 + hotspot/src/cpu/x86/vm/stubRoutines_x86.hpp | 6 +- .../src/cpu/x86/vm/stubRoutines_x86_32.hpp | 2 +- .../src/cpu/x86/vm/stubRoutines_x86_64.hpp | 2 +- hotspot/src/cpu/x86/vm/vm_version_x86.cpp | 36 ++ hotspot/src/share/vm/classfile/vmSymbols.cpp | 4 + hotspot/src/share/vm/classfile/vmSymbols.hpp | 4 + hotspot/src/share/vm/opto/c2compiler.cpp | 1 + hotspot/src/share/vm/opto/escape.cpp | 1 + hotspot/src/share/vm/opto/library_call.cpp | 167 +++++++++ hotspot/src/share/vm/opto/runtime.cpp | 29 ++ hotspot/src/share/vm/opto/runtime.hpp | 1 + hotspot/src/share/vm/runtime/globals.hpp | 3 + hotspot/src/share/vm/runtime/stubRoutines.cpp | 1 + hotspot/src/share/vm/runtime/stubRoutines.hpp | 2 + hotspot/src/share/vm/runtime/vmStructs.cpp | 1 + .../compiler/codegen/7184394/TestAESBase.java | 4 +- .../compiler/codegen/7184394/TestAESMain.java | 7 + 25 files changed, 1079 insertions(+), 9 deletions(-) diff --git a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp index ddd41c3243b..d48f4ee3a25 100644 --- a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp @@ -202,6 +202,11 @@ void VM_Version::get_processor_features() { } } + if (UseAESCTRIntrinsics) { + warning("AES/CTR intrinsics are not available on this CPU"); + FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false); + } + if (FLAG_IS_DEFAULT(UseCRC32Intrinsics)) { UseCRC32Intrinsics = true; } diff --git a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp index 16c4db8a042..3acbec86ad1 100644 --- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp @@ -196,6 +196,11 @@ void VM_Version::initialize() { FLAG_SET_DEFAULT(UseAESIntrinsics, false); } + if (UseAESCTRIntrinsics) { + warning("AES/CTR intrinsics are not available on this CPU"); + FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false); + } + if (UseGHASHIntrinsics) { warning("GHASH intrinsics are not available on this CPU"); FLAG_SET_DEFAULT(UseGHASHIntrinsics, false); diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp index 462ddb2ba06..fe7ce4f315e 100644 --- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp @@ -260,6 +260,11 @@ void VM_Version::initialize() { } } + if (UseAESCTRIntrinsics) { + warning("AES/CTR intrinsics are not available on this CPU"); + FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false); + } + // GHASH/GCM intrinsics if (has_vis3() && (UseVIS > 2)) { if (FLAG_IS_DEFAULT(UseGHASHIntrinsics)) { diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.cpp b/hotspot/src/cpu/x86/vm/assembler_x86.cpp index 65451309b28..9a7fd0069cf 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.cpp @@ -3349,22 +3349,41 @@ void Assembler::vpmovmskb(Register dst, XMMRegister src) { void Assembler::pextrd(Register dst, XMMRegister src, int imm8) { assert(VM_Version::supports_sse4_1(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ false); - int encode = simd_prefix_and_encode(as_XMMRegister(dst->encoding()), xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); + int encode = simd_prefix_and_encode(src, xnoreg, as_XMMRegister(dst->encoding()), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); emit_int8(0x16); emit_int8((unsigned char)(0xC0 | encode)); emit_int8(imm8); } +void Assembler::pextrd(Address dst, XMMRegister src, int imm8) { + assert(VM_Version::supports_sse4_1(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ false); + attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); + simd_prefix(src, xnoreg, dst, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); + emit_int8(0x16); + emit_operand(src, dst); + emit_int8(imm8); +} + void Assembler::pextrq(Register dst, XMMRegister src, int imm8) { assert(VM_Version::supports_sse4_1(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ false); - int encode = simd_prefix_and_encode(as_XMMRegister(dst->encoding()), xnoreg, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); + int encode = simd_prefix_and_encode(src, xnoreg, as_XMMRegister(dst->encoding()), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); emit_int8(0x16); emit_int8((unsigned char)(0xC0 | encode)); emit_int8(imm8); } -// The encoding for pextrw is SSE2 to support the LIBM implementation. +void Assembler::pextrq(Address dst, XMMRegister src, int imm8) { + assert(VM_Version::supports_sse4_1(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ false); + attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); + simd_prefix(src, xnoreg, dst, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); + emit_int8(0x16); + emit_operand(src, dst); + emit_int8(imm8); +} + void Assembler::pextrw(Register dst, XMMRegister src, int imm8) { assert(VM_Version::supports_sse2(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); @@ -3374,6 +3393,26 @@ void Assembler::pextrw(Register dst, XMMRegister src, int imm8) { emit_int8(imm8); } +void Assembler::pextrw(Address dst, XMMRegister src, int imm8) { + assert(VM_Version::supports_sse4_1(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); + attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_16bit); + simd_prefix(src, xnoreg, dst, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); + emit_int8((unsigned char)0x15); + emit_operand(src, dst); + emit_int8(imm8); +} + +void Assembler::pextrb(Address dst, XMMRegister src, int imm8) { + assert(VM_Version::supports_sse4_1(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); + attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_8bit); + simd_prefix(src, xnoreg, dst, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); + emit_int8(0x14); + emit_operand(src, dst); + emit_int8(imm8); +} + void Assembler::pinsrd(XMMRegister dst, Register src, int imm8) { assert(VM_Version::supports_sse4_1(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ false); @@ -3383,6 +3422,16 @@ void Assembler::pinsrd(XMMRegister dst, Register src, int imm8) { emit_int8(imm8); } +void Assembler::pinsrd(XMMRegister dst, Address src, int imm8) { + assert(VM_Version::supports_sse4_1(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ false); + attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_32bit); + simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); + emit_int8(0x22); + emit_operand(dst,src); + emit_int8(imm8); +} + void Assembler::pinsrq(XMMRegister dst, Register src, int imm8) { assert(VM_Version::supports_sse4_1(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ false); @@ -3392,6 +3441,16 @@ void Assembler::pinsrq(XMMRegister dst, Register src, int imm8) { emit_int8(imm8); } +void Assembler::pinsrq(XMMRegister dst, Address src, int imm8) { + assert(VM_Version::supports_sse4_1(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ _legacy_mode_dq, /* no_mask_reg */ true, /* uses_vl */ false); + attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); + simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); + emit_int8(0x22); + emit_operand(dst, src); + emit_int8(imm8); +} + void Assembler::pinsrw(XMMRegister dst, Register src, int imm8) { assert(VM_Version::supports_sse2(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); @@ -3401,6 +3460,26 @@ void Assembler::pinsrw(XMMRegister dst, Register src, int imm8) { emit_int8(imm8); } +void Assembler::pinsrw(XMMRegister dst, Address src, int imm8) { + assert(VM_Version::supports_sse2(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); + attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_16bit); + simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0xC4); + emit_operand(dst, src); + emit_int8(imm8); +} + +void Assembler::pinsrb(XMMRegister dst, Address src, int imm8) { + assert(VM_Version::supports_sse4_1(), ""); + InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); + attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_8bit); + simd_prefix(dst, dst, src, VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); + emit_int8(0x20); + emit_operand(dst, src); + emit_int8(imm8); +} + void Assembler::pmovzxbw(XMMRegister dst, Address src) { assert(VM_Version::supports_sse4_1(), ""); InstructionMark im(this); @@ -4188,6 +4267,12 @@ void Assembler::xorl(Register dst, Register src) { emit_arith(0x33, 0xC0, dst, src); } +void Assembler::xorb(Register dst, Address src) { + InstructionMark im(this); + prefix(src, dst); + emit_int8(0x32); + emit_operand(dst, src); +} // AVX 3-operands scalar float-point arithmetic instructions diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.hpp b/hotspot/src/cpu/x86/vm/assembler_x86.hpp index 380447b5d24..45ecc01f24a 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.hpp @@ -1543,14 +1543,22 @@ private: // SSE 4.1 extract void pextrd(Register dst, XMMRegister src, int imm8); void pextrq(Register dst, XMMRegister src, int imm8); + void pextrd(Address dst, XMMRegister src, int imm8); + void pextrq(Address dst, XMMRegister src, int imm8); + void pextrb(Address dst, XMMRegister src, int imm8); // SSE 2 extract void pextrw(Register dst, XMMRegister src, int imm8); + void pextrw(Address dst, XMMRegister src, int imm8); // SSE 4.1 insert void pinsrd(XMMRegister dst, Register src, int imm8); void pinsrq(XMMRegister dst, Register src, int imm8); + void pinsrd(XMMRegister dst, Address src, int imm8); + void pinsrq(XMMRegister dst, Address src, int imm8); + void pinsrb(XMMRegister dst, Address src, int imm8); // SSE 2 insert void pinsrw(XMMRegister dst, Register src, int imm8); + void pinsrw(XMMRegister dst, Address src, int imm8); // SSE4.1 packed move void pmovzxbw(XMMRegister dst, XMMRegister src); @@ -1762,6 +1770,8 @@ private: void xorl(Register dst, Address src); void xorl(Register dst, Register src); + void xorb(Register dst, Address src); + void xorq(Register dst, Address src); void xorq(Register dst, Register src); diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp index 57db8eeede0..5ac5593f1c9 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp @@ -2142,6 +2142,17 @@ class StubGenerator: public StubCodeGenerator { return start; } + address generate_counter_shuffle_mask() { + __ align(16); + StubCodeMark mark(this, "StubRoutines", "counter_shuffle_mask"); + address start = __ pc(); + __ emit_data(0x0c0d0e0f, relocInfo::none, 0); + __ emit_data(0x08090a0b, relocInfo::none, 0); + __ emit_data(0x04050607, relocInfo::none, 0); + __ emit_data(0x00010203, relocInfo::none, 0); + return start; + } + // Utility routine for loading a 128-bit key word in little endian format // can optionally specify that the shuffle mask is already in an xmmregister void load_key(XMMRegister xmmdst, Register key, int offset, XMMRegister xmm_shuf_mask=NULL) { @@ -2167,6 +2178,31 @@ class StubGenerator: public StubCodeGenerator { __ aesdec(xmmdst, xmmtmp); } + // Utility routine for increase 128bit counter (iv in CTR mode) + // XMM_128bit, D3, D2, D1, D0 + void inc_counter(Register reg, XMMRegister xmmdst, int inc_delta, Label& next_block) { + __ pextrd(reg, xmmdst, 0x0); + __ addl(reg, inc_delta); + __ pinsrd(xmmdst, reg, 0x0); + __ jcc(Assembler::carryClear, next_block); // jump if no carry + + __ pextrd(reg, xmmdst, 0x01); // Carry-> D1 + __ addl(reg, 0x01); + __ pinsrd(xmmdst, reg, 0x01); + __ jcc(Assembler::carryClear, next_block); // jump if no carry + + __ pextrd(reg, xmmdst, 0x02); // Carry-> D2 + __ addl(reg, 0x01); + __ pinsrd(xmmdst, reg, 0x02); + __ jcc(Assembler::carryClear, next_block); // jump if no carry + + __ pextrd(reg, xmmdst, 0x03); // Carry -> D3 + __ addl(reg, 0x01); + __ pinsrd(xmmdst, reg, 0x03); + + __ BIND(next_block); // next instruction + } + // Arguments: // @@ -2742,6 +2778,317 @@ class StubGenerator: public StubCodeGenerator { return start; } + + // CTR AES crypt. + // In 32-bit stub, parallelize 4 blocks at a time + // Arguments: + // + // Inputs: + // c_rarg0 - source byte array address + // c_rarg1 - destination byte array address + // c_rarg2 - K (key) in little endian int array + // c_rarg3 - counter vector byte array address + // c_rarg4 - input length + // + // Output: + // rax - input length + // + address generate_counterMode_AESCrypt_Parallel() { + assert(UseAES, "need AES instructions and misaligned SSE support"); + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", "counterMode_AESCrypt"); + address start = __ pc(); + const Register from = rsi; // source array address + const Register to = rdx; // destination array address + const Register key = rcx; // key array address + const Register counter = rdi; // counter byte array initialized from initvector array address + + // and left with the results of the last encryption block + const Register len_reg = rbx; + const Register pos = rax; + + __ enter(); // required for proper stackwalking of RuntimeStub frame + handleSOERegisters(true /*saving*/); // save rbx, rsi, rdi + + // For EVEX with VL and BW, provide a standard mask, VL = 128 will guide the merge + // context for the registers used, where all instructions below are using 128-bit mode + // On EVEX without VL and BW, these instructions will all be AVX. + if (VM_Version::supports_avx512vlbw()) { + __ movl(rdx, 0xffff); + __ kmovdl(k1, rdx); + } + + // load registers from incoming parameters + const Address from_param(rbp, 8+0); + const Address to_param (rbp, 8+4); + const Address key_param (rbp, 8+8); + const Address rvec_param (rbp, 8+12); + const Address len_param (rbp, 8+16); + const Address saved_counter_param(rbp, 8 + 20); + const Address used_addr_param(rbp, 8 + 24); + + __ movptr(from , from_param); + __ movptr(to , to_param); + //__ movptr(key, key_param); + //__ movptr(counter, rvec_param); + __ movptr(len_reg , len_param); + //__ movptr(pos, 0); + + // Use the partially used encrpyted counter from last invocation + Label L_exit_preLoop, L_preLoop_start; + + // Use the registers 'counter' and 'key' here in this preloop + // to hold of last 2 params 'used' and 'saved_encCounter_start' + Register used = counter; + Register saved_encCounter_start = key; + Register used_addr = saved_encCounter_start; + + __ movptr(used_addr, used_addr_param); + __ movptr(used, Address(used_addr, 0)); + __ movptr(saved_encCounter_start, saved_counter_param); + + __ BIND(L_preLoop_start); + __ cmpptr(used, 16); + __ jcc(Assembler::aboveEqual, L_exit_preLoop); + __ cmpptr(len_reg, 0); + __ jcc(Assembler::lessEqual, L_exit_preLoop); + __ movb(rax, Address(saved_encCounter_start, used)); + __ xorb(rax, Address(from, 0)); + __ movb(Address(to, 0), rax); + __ addptr(from, 1); + __ addptr(to, 1); + __ addptr(used, 1); + __ subptr(len_reg, 1); + + __ jmp(L_preLoop_start); + + __ BIND(L_exit_preLoop); + __ movptr(used_addr, used_addr_param); + __ movptr(used_addr, used_addr_param); + __ movl(Address(used_addr, 0), used); + + // load the parameters 'key' and 'counter' + __ movptr(key, key_param); + __ movptr(counter, rvec_param); + + // xmm register assignments for the loops below + const XMMRegister xmm_curr_counter = xmm0; + const XMMRegister xmm_counter_shuf_mask = xmm1; // need to be reloaded + const XMMRegister xmm_key_shuf_mask = xmm2; // need to be reloaded + const XMMRegister xmm_key = xmm3; + const XMMRegister xmm_result0 = xmm4; + const XMMRegister xmm_result1 = xmm5; + const XMMRegister xmm_result2 = xmm6; + const XMMRegister xmm_result3 = xmm7; + const XMMRegister xmm_from0 = xmm1; //reuse XMM register + const XMMRegister xmm_from1 = xmm2; + const XMMRegister xmm_from2 = xmm3; + const XMMRegister xmm_from3 = xmm4; + + //for key_128, key_192, key_256 + const int rounds[3] = {10, 12, 14}; + Label L_singleBlockLoopTop[3]; + Label L_multiBlock_loopTop[3]; + Label L_key192_top, L_key256_top; + Label L_incCounter[3][4]; // 3: different key length, 4: 4 blocks at a time + Label L_incCounter_single[3]; //for single block, key128, key192, key256 + Label L_processTail_insr[3], L_processTail_4_insr[3], L_processTail_2_insr[3], L_processTail_1_insr[3], L_processTail_exit_insr[3]; + Label L_processTail_extr[3], L_processTail_4_extr[3], L_processTail_2_extr[3], L_processTail_1_extr[3], L_processTail_exit_extr[3]; + + Label L_exit; + const int PARALLEL_FACTOR = 4; //because of the limited register number + + // initialize counter with initial counter + __ movdqu(xmm_curr_counter, Address(counter, 0x00)); + __ movdqu(xmm_counter_shuf_mask, ExternalAddress(StubRoutines::x86::counter_shuffle_mask_addr())); + __ pshufb(xmm_curr_counter, xmm_counter_shuf_mask); //counter is shuffled for increase + + // key length could be only {11, 13, 15} * 4 = {44, 52, 60} + __ movdqu(xmm_key_shuf_mask, ExternalAddress(StubRoutines::x86::key_shuffle_mask_addr())); + __ movl(rax, Address(key, arrayOopDesc::length_offset_in_bytes() - arrayOopDesc::base_offset_in_bytes(T_INT))); + __ cmpl(rax, 52); + __ jcc(Assembler::equal, L_key192_top); + __ cmpl(rax, 60); + __ jcc(Assembler::equal, L_key256_top); + + //key128 begins here + __ movptr(pos, 0); // init pos before L_multiBlock_loopTop + +#define CTR_DoFour(opc, src_reg) \ + __ opc(xmm_result0, src_reg); \ + __ opc(xmm_result1, src_reg); \ + __ opc(xmm_result2, src_reg); \ + __ opc(xmm_result3, src_reg); + + // k == 0 : generate code for key_128 + // k == 1 : generate code for key_192 + // k == 2 : generate code for key_256 + for (int k = 0; k < 3; ++k) { + //multi blocks starts here + __ align(OptoLoopAlignment); + __ BIND(L_multiBlock_loopTop[k]); + __ cmpptr(len_reg, PARALLEL_FACTOR * AESBlockSize); // see if at least PARALLEL_FACTOR blocks left + __ jcc(Assembler::less, L_singleBlockLoopTop[k]); + + __ movdqu(xmm_key_shuf_mask, ExternalAddress(StubRoutines::x86::key_shuffle_mask_addr())); + __ movdqu(xmm_counter_shuf_mask, ExternalAddress(StubRoutines::x86::counter_shuffle_mask_addr())); + + //load, then increase counters + CTR_DoFour(movdqa, xmm_curr_counter); + __ push(rbx); + inc_counter(rbx, xmm_result1, 0x01, L_incCounter[k][0]); + inc_counter(rbx, xmm_result2, 0x02, L_incCounter[k][1]); + inc_counter(rbx, xmm_result3, 0x03, L_incCounter[k][2]); + inc_counter(rbx, xmm_curr_counter, 0x04, L_incCounter[k][3]); + __ pop (rbx); + + load_key(xmm_key, key, 0x00, xmm_key_shuf_mask); // load Round 0 key. interleaving for better performance + + CTR_DoFour(pshufb, xmm_counter_shuf_mask); // after increased, shuffled counters back for PXOR + CTR_DoFour(pxor, xmm_key); //PXOR with Round 0 key + + for (int i = 1; i < rounds[k]; ++i) { + load_key(xmm_key, key, (0x10 * i), xmm_key_shuf_mask); + CTR_DoFour(aesenc, xmm_key); + } + load_key(xmm_key, key, (0x10 * rounds[k]), xmm_key_shuf_mask); + CTR_DoFour(aesenclast, xmm_key); + + // get next PARALLEL_FACTOR blocks into xmm_from registers + __ movdqu(xmm_from0, Address(from, pos, Address::times_1, 0 * AESBlockSize)); + __ movdqu(xmm_from1, Address(from, pos, Address::times_1, 1 * AESBlockSize)); + __ movdqu(xmm_from2, Address(from, pos, Address::times_1, 2 * AESBlockSize)); + + // PXOR with input text + __ pxor(xmm_result0, xmm_from0); //result0 is xmm4 + __ pxor(xmm_result1, xmm_from1); + __ pxor(xmm_result2, xmm_from2); + + // store PARALLEL_FACTOR results into the next 64 bytes of output + __ movdqu(Address(to, pos, Address::times_1, 0 * AESBlockSize), xmm_result0); + __ movdqu(Address(to, pos, Address::times_1, 1 * AESBlockSize), xmm_result1); + __ movdqu(Address(to, pos, Address::times_1, 2 * AESBlockSize), xmm_result2); + + // do it here after xmm_result0 is saved, because xmm_from3 reuse the same register of xmm_result0. + __ movdqu(xmm_from3, Address(from, pos, Address::times_1, 3 * AESBlockSize)); + __ pxor(xmm_result3, xmm_from3); + __ movdqu(Address(to, pos, Address::times_1, 3 * AESBlockSize), xmm_result3); + + __ addptr(pos, PARALLEL_FACTOR * AESBlockSize); // increase the length of crypt text + __ subptr(len_reg, PARALLEL_FACTOR * AESBlockSize); // decrease the remaining length + __ jmp(L_multiBlock_loopTop[k]); + + // singleBlock starts here + __ align(OptoLoopAlignment); + __ BIND(L_singleBlockLoopTop[k]); + __ cmpptr(len_reg, 0); + __ jcc(Assembler::equal, L_exit); + __ movdqu(xmm_key_shuf_mask, ExternalAddress(StubRoutines::x86::key_shuffle_mask_addr())); + __ movdqu(xmm_counter_shuf_mask, ExternalAddress(StubRoutines::x86::counter_shuffle_mask_addr())); + __ movdqa(xmm_result0, xmm_curr_counter); + load_key(xmm_key, key, 0x00, xmm_key_shuf_mask); + __ push(rbx);//rbx is used for increasing counter + inc_counter(rbx, xmm_curr_counter, 0x01, L_incCounter_single[k]); + __ pop (rbx); + __ pshufb(xmm_result0, xmm_counter_shuf_mask); + __ pxor(xmm_result0, xmm_key); + for (int i = 1; i < rounds[k]; i++) { + load_key(xmm_key, key, (0x10 * i), xmm_key_shuf_mask); + __ aesenc(xmm_result0, xmm_key); + } + load_key(xmm_key, key, (0x10 * rounds[k]), xmm_key_shuf_mask); + __ aesenclast(xmm_result0, xmm_key); + __ cmpptr(len_reg, AESBlockSize); + __ jcc(Assembler::less, L_processTail_insr[k]); + __ movdqu(xmm_from0, Address(from, pos, Address::times_1, 0 * AESBlockSize)); + __ pxor(xmm_result0, xmm_from0); + __ movdqu(Address(to, pos, Address::times_1, 0 * AESBlockSize), xmm_result0); + __ addptr(pos, AESBlockSize); + __ subptr(len_reg, AESBlockSize); + __ jmp(L_singleBlockLoopTop[k]); + + __ BIND(L_processTail_insr[k]); + __ addptr(pos, len_reg); + __ testptr(len_reg, 8); + __ jcc(Assembler::zero, L_processTail_4_insr[k]); + __ subptr(pos,8); + __ pinsrd(xmm_from0, Address(from, pos), 0); + __ pinsrd(xmm_from0, Address(from, pos, Address::times_1, 4), 1); + __ BIND(L_processTail_4_insr[k]); + __ testptr(len_reg, 4); + __ jcc(Assembler::zero, L_processTail_2_insr[k]); + __ subptr(pos,4); + __ pslldq(xmm_from0, 4); + __ pinsrd(xmm_from0, Address(from, pos), 0); + __ BIND(L_processTail_2_insr[k]); + __ testptr(len_reg, 2); + __ jcc(Assembler::zero, L_processTail_1_insr[k]); + __ subptr(pos, 2); + __ pslldq(xmm_from0, 2); + __ pinsrw(xmm_from0, Address(from, pos), 0); + __ BIND(L_processTail_1_insr[k]); + __ testptr(len_reg, 1); + __ jcc(Assembler::zero, L_processTail_exit_insr[k]); + __ subptr(pos, 1); + __ pslldq(xmm_from0, 1); + __ pinsrb(xmm_from0, Address(from, pos), 0); + __ BIND(L_processTail_exit_insr[k]); + + __ movptr(saved_encCounter_start, saved_counter_param); + __ movdqu(Address(saved_encCounter_start, 0), xmm_result0); + __ pxor(xmm_result0, xmm_from0); + + __ testptr(len_reg, 8); + __ jcc(Assembler::zero, L_processTail_4_extr[k]); + __ pextrd(Address(to, pos), xmm_result0, 0); + __ pextrd(Address(to, pos, Address::times_1, 4), xmm_result0, 1); + __ psrldq(xmm_result0, 8); + __ addptr(pos, 8); + __ BIND(L_processTail_4_extr[k]); + __ testptr(len_reg, 4); + __ jcc(Assembler::zero, L_processTail_2_extr[k]); + __ pextrd(Address(to, pos), xmm_result0, 0); + __ psrldq(xmm_result0, 4); + __ addptr(pos, 4); + __ BIND(L_processTail_2_extr[k]); + __ testptr(len_reg, 2); + __ jcc(Assembler::zero, L_processTail_1_extr[k]); + __ pextrb(Address(to, pos), xmm_result0, 0); + __ pextrb(Address(to, pos, Address::times_1, 1), xmm_result0, 1); + __ psrldq(xmm_result0, 2); + __ addptr(pos, 2); + __ BIND(L_processTail_1_extr[k]); + __ testptr(len_reg, 1); + __ jcc(Assembler::zero, L_processTail_exit_extr[k]); + __ pextrb(Address(to, pos), xmm_result0, 0); + + __ BIND(L_processTail_exit_extr[k]); + __ movptr(used_addr, used_addr_param); + __ movl(Address(used_addr, 0), len_reg); + __ jmp(L_exit); + } + + __ BIND(L_exit); + __ movdqu(xmm_counter_shuf_mask, ExternalAddress(StubRoutines::x86::counter_shuffle_mask_addr())); + __ pshufb(xmm_curr_counter, xmm_counter_shuf_mask); //counter is shuffled back. + __ movdqu(Address(counter, 0), xmm_curr_counter); //save counter back + handleSOERegisters(false /*restoring*/); + __ movptr(rax, len_param); // return length + __ leave(); // required for proper stackwalking of RuntimeStub frame + __ ret(0); + + __ BIND (L_key192_top); + __ movptr(pos, 0); // init pos before L_multiBlock_loopTop + __ jmp(L_multiBlock_loopTop[1]); //key192 + + __ BIND (L_key256_top); + __ movptr(pos, 0); // init pos before L_multiBlock_loopTop + __ jmp(L_multiBlock_loopTop[2]); //key192 + + return start; + } + + // byte swap x86 long address generate_ghash_long_swap_mask() { __ align(CodeEntryAlignment); @@ -3360,6 +3707,11 @@ class StubGenerator: public StubCodeGenerator { StubRoutines::_cipherBlockChaining_decryptAESCrypt = generate_cipherBlockChaining_decryptAESCrypt(); } + if (UseAESCTRIntrinsics) { + StubRoutines::x86::_counter_shuffle_mask_addr = generate_counter_shuffle_mask(); + StubRoutines::_counterMode_AESCrypt = generate_counterMode_AESCrypt_Parallel(); + } + // Generate GHASH intrinsics code if (UseGHASHIntrinsics) { StubRoutines::x86::_ghash_long_swap_mask_addr = generate_ghash_long_swap_mask(); diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp index 72babc6f146..b3eb330ac9b 100644 --- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp @@ -3039,6 +3039,15 @@ class StubGenerator: public StubCodeGenerator { return start; } + address generate_counter_shuffle_mask() { + __ align(16); + StubCodeMark mark(this, "StubRoutines", "counter_shuffle_mask"); + address start = __ pc(); + __ emit_data64(0x08090a0b0c0d0e0f, relocInfo::none); + __ emit_data64(0x0001020304050607, relocInfo::none); + return start; + } + // Utility routine for loading a 128-bit key word in little endian format // can optionally specify that the shuffle mask is already in an xmmregister void load_key(XMMRegister xmmdst, Register key, int offset, XMMRegister xmm_shuf_mask=NULL) { @@ -3050,6 +3059,18 @@ class StubGenerator: public StubCodeGenerator { } } + // Utility routine for increase 128bit counter (iv in CTR mode) + void inc_counter(Register reg, XMMRegister xmmdst, int inc_delta, Label& next_block) { + __ pextrq(reg, xmmdst, 0x0); + __ addq(reg, inc_delta); + __ pinsrq(xmmdst, reg, 0x0); + __ jcc(Assembler::carryClear, next_block); // jump if no carry + __ pextrq(reg, xmmdst, 0x01); // Carry + __ addq(reg, 0x01); + __ pinsrq(xmmdst, reg, 0x01); //Carry end + __ BIND(next_block); // next instruction + } + // Arguments: // // Inputs: @@ -3700,6 +3721,328 @@ class StubGenerator: public StubCodeGenerator { return start; } + // This is a version of CTR/AES crypt which does 6 blocks in a loop at a time + // to hide instruction latency + // + // Arguments: + // + // Inputs: + // c_rarg0 - source byte array address + // c_rarg1 - destination byte array address + // c_rarg2 - K (key) in little endian int array + // c_rarg3 - counter vector byte array address + // Linux + // c_rarg4 - input length + // c_rarg5 - saved encryptedCounter start + // rbp + 6 * wordSize - saved used length + // Windows + // rbp + 6 * wordSize - input length + // rbp + 7 * wordSize - saved encryptedCounter start + // rbp + 8 * wordSize - saved used length + // + // Output: + // rax - input length + // + address generate_counterMode_AESCrypt_Parallel() { + assert(UseAES, "need AES instructions and misaligned SSE support"); + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", "counterMode_AESCrypt"); + address start = __ pc(); + const Register from = c_rarg0; // source array address + const Register to = c_rarg1; // destination array address + const Register key = c_rarg2; // key array address + const Register counter = c_rarg3; // counter byte array initialized from counter array address + // and left with the results of the last encryption block +#ifndef _WIN64 + const Register len_reg = c_rarg4; + const Register saved_encCounter_start = c_rarg5; + const Register used_addr = r10; + const Address used_mem(rbp, 2 * wordSize); + const Register used = r11; +#else + const Address len_mem(rbp, 6 * wordSize); // length is on stack on Win64 + const Address saved_encCounter_mem(rbp, 7 * wordSize); // length is on stack on Win64 + const Address used_mem(rbp, 8 * wordSize); // length is on stack on Win64 + const Register len_reg = r10; // pick the first volatile windows register + const Register saved_encCounter_start = r11; + const Register used_addr = r13; + const Register used = r14; +#endif + const Register pos = rax; + + const int PARALLEL_FACTOR = 6; + const XMMRegister xmm_counter_shuf_mask = xmm0; + const XMMRegister xmm_key_shuf_mask = xmm1; // used temporarily to swap key bytes up front + const XMMRegister xmm_curr_counter = xmm2; + + const XMMRegister xmm_key_tmp0 = xmm3; + const XMMRegister xmm_key_tmp1 = xmm4; + + // registers holding the four results in the parallelized loop + const XMMRegister xmm_result0 = xmm5; + const XMMRegister xmm_result1 = xmm6; + const XMMRegister xmm_result2 = xmm7; + const XMMRegister xmm_result3 = xmm8; + const XMMRegister xmm_result4 = xmm9; + const XMMRegister xmm_result5 = xmm10; + + const XMMRegister xmm_from0 = xmm11; + const XMMRegister xmm_from1 = xmm12; + const XMMRegister xmm_from2 = xmm13; + const XMMRegister xmm_from3 = xmm14; //the last one is xmm14. we have to preserve it on WIN64. + const XMMRegister xmm_from4 = xmm3; //reuse xmm3~4. Because xmm_key_tmp0~1 are useless when loading input text + const XMMRegister xmm_from5 = xmm4; + + //for key_128, key_192, key_256 + const int rounds[3] = {10, 12, 14}; + Label L_exit_preLoop, L_preLoop_start; + Label L_multiBlock_loopTop[3]; + Label L_singleBlockLoopTop[3]; + Label L__incCounter[3][6]; //for 6 blocks + Label L__incCounter_single[3]; //for single block, key128, key192, key256 + Label L_processTail_insr[3], L_processTail_4_insr[3], L_processTail_2_insr[3], L_processTail_1_insr[3], L_processTail_exit_insr[3]; + Label L_processTail_extr[3], L_processTail_4_extr[3], L_processTail_2_extr[3], L_processTail_1_extr[3], L_processTail_exit_extr[3]; + + Label L_exit; + + __ enter(); // required for proper stackwalking of RuntimeStub frame + + // For EVEX with VL and BW, provide a standard mask, VL = 128 will guide the merge + // context for the registers used, where all instructions below are using 128-bit mode + // On EVEX without VL and BW, these instructions will all be AVX. + if (VM_Version::supports_avx512vlbw()) { + __ movl(rax, 0xffff); + __ kmovql(k1, rax); + } + +#ifdef _WIN64 + // save the xmm registers which must be preserved 6-14 + const int XMM_REG_NUM_KEY_LAST = 14; + __ subptr(rsp, -rsp_after_call_off * wordSize); + for (int i = 6; i <= XMM_REG_NUM_KEY_LAST; i++) { + __ movdqu(xmm_save(i), as_XMMRegister(i)); + } + + const Address r13_save(rbp, rdi_off * wordSize); + const Address r14_save(rbp, rsi_off * wordSize); + + __ movptr(r13_save, r13); + __ movptr(r14_save, r14); + + // on win64, fill len_reg from stack position + __ movl(len_reg, len_mem); + __ movptr(saved_encCounter_start, saved_encCounter_mem); + __ movptr(used_addr, used_mem); + __ movl(used, Address(used_addr, 0)); +#else + __ push(len_reg); // Save + __ movptr(used_addr, used_mem); + __ movl(used, Address(used_addr, 0)); +#endif + + __ push(rbx); // Save RBX + __ movdqu(xmm_curr_counter, Address(counter, 0x00)); // initialize counter with initial counter + __ movdqu(xmm_counter_shuf_mask, ExternalAddress(StubRoutines::x86::counter_shuffle_mask_addr())); + __ pshufb(xmm_curr_counter, xmm_counter_shuf_mask); //counter is shuffled + __ movptr(pos, 0); + + // Use the partially used encrpyted counter from last invocation + __ BIND(L_preLoop_start); + __ cmpptr(used, 16); + __ jcc(Assembler::aboveEqual, L_exit_preLoop); + __ cmpptr(len_reg, 0); + __ jcc(Assembler::lessEqual, L_exit_preLoop); + __ movb(rbx, Address(saved_encCounter_start, used)); + __ xorb(rbx, Address(from, pos)); + __ movb(Address(to, pos), rbx); + __ addptr(pos, 1); + __ addptr(used, 1); + __ subptr(len_reg, 1); + + __ jmp(L_preLoop_start); + + __ BIND(L_exit_preLoop); + __ movl(Address(used_addr, 0), used); + + // key length could be only {11, 13, 15} * 4 = {44, 52, 60} + __ movdqu(xmm_key_shuf_mask, ExternalAddress(StubRoutines::x86::key_shuffle_mask_addr())); + __ movl(rbx, Address(key, arrayOopDesc::length_offset_in_bytes() - arrayOopDesc::base_offset_in_bytes(T_INT))); + __ cmpl(rbx, 52); + __ jcc(Assembler::equal, L_multiBlock_loopTop[1]); + __ cmpl(rbx, 60); + __ jcc(Assembler::equal, L_multiBlock_loopTop[2]); + +#define CTR_DoSix(opc, src_reg) \ + __ opc(xmm_result0, src_reg); \ + __ opc(xmm_result1, src_reg); \ + __ opc(xmm_result2, src_reg); \ + __ opc(xmm_result3, src_reg); \ + __ opc(xmm_result4, src_reg); \ + __ opc(xmm_result5, src_reg); + + // k == 0 : generate code for key_128 + // k == 1 : generate code for key_192 + // k == 2 : generate code for key_256 + for (int k = 0; k < 3; ++k) { + //multi blocks starts here + __ align(OptoLoopAlignment); + __ BIND(L_multiBlock_loopTop[k]); + __ cmpptr(len_reg, PARALLEL_FACTOR * AESBlockSize); // see if at least PARALLEL_FACTOR blocks left + __ jcc(Assembler::less, L_singleBlockLoopTop[k]); + load_key(xmm_key_tmp0, key, 0x00, xmm_key_shuf_mask); + + //load, then increase counters + CTR_DoSix(movdqa, xmm_curr_counter); + inc_counter(rbx, xmm_result1, 0x01, L__incCounter[k][0]); + inc_counter(rbx, xmm_result2, 0x02, L__incCounter[k][1]); + inc_counter(rbx, xmm_result3, 0x03, L__incCounter[k][2]); + inc_counter(rbx, xmm_result4, 0x04, L__incCounter[k][3]); + inc_counter(rbx, xmm_result5, 0x05, L__incCounter[k][4]); + inc_counter(rbx, xmm_curr_counter, 0x06, L__incCounter[k][5]); + CTR_DoSix(pshufb, xmm_counter_shuf_mask); // after increased, shuffled counters back for PXOR + CTR_DoSix(pxor, xmm_key_tmp0); //PXOR with Round 0 key + + //load two ROUND_KEYs at a time + for (int i = 1; i < rounds[k]; ) { + load_key(xmm_key_tmp1, key, (0x10 * i), xmm_key_shuf_mask); + load_key(xmm_key_tmp0, key, (0x10 * (i+1)), xmm_key_shuf_mask); + CTR_DoSix(aesenc, xmm_key_tmp1); + i++; + if (i != rounds[k]) { + CTR_DoSix(aesenc, xmm_key_tmp0); + } else { + CTR_DoSix(aesenclast, xmm_key_tmp0); + } + i++; + } + + // get next PARALLEL_FACTOR blocks into xmm_result registers + __ movdqu(xmm_from0, Address(from, pos, Address::times_1, 0 * AESBlockSize)); + __ movdqu(xmm_from1, Address(from, pos, Address::times_1, 1 * AESBlockSize)); + __ movdqu(xmm_from2, Address(from, pos, Address::times_1, 2 * AESBlockSize)); + __ movdqu(xmm_from3, Address(from, pos, Address::times_1, 3 * AESBlockSize)); + __ movdqu(xmm_from4, Address(from, pos, Address::times_1, 4 * AESBlockSize)); + __ movdqu(xmm_from5, Address(from, pos, Address::times_1, 5 * AESBlockSize)); + + __ pxor(xmm_result0, xmm_from0); + __ pxor(xmm_result1, xmm_from1); + __ pxor(xmm_result2, xmm_from2); + __ pxor(xmm_result3, xmm_from3); + __ pxor(xmm_result4, xmm_from4); + __ pxor(xmm_result5, xmm_from5); + + // store 6 results into the next 64 bytes of output + __ movdqu(Address(to, pos, Address::times_1, 0 * AESBlockSize), xmm_result0); + __ movdqu(Address(to, pos, Address::times_1, 1 * AESBlockSize), xmm_result1); + __ movdqu(Address(to, pos, Address::times_1, 2 * AESBlockSize), xmm_result2); + __ movdqu(Address(to, pos, Address::times_1, 3 * AESBlockSize), xmm_result3); + __ movdqu(Address(to, pos, Address::times_1, 4 * AESBlockSize), xmm_result4); + __ movdqu(Address(to, pos, Address::times_1, 5 * AESBlockSize), xmm_result5); + + __ addptr(pos, PARALLEL_FACTOR * AESBlockSize); // increase the length of crypt text + __ subptr(len_reg, PARALLEL_FACTOR * AESBlockSize); // decrease the remaining length + __ jmp(L_multiBlock_loopTop[k]); + + // singleBlock starts here + __ align(OptoLoopAlignment); + __ BIND(L_singleBlockLoopTop[k]); + __ cmpptr(len_reg, 0); + __ jcc(Assembler::lessEqual, L_exit); + load_key(xmm_key_tmp0, key, 0x00, xmm_key_shuf_mask); + __ movdqa(xmm_result0, xmm_curr_counter); + inc_counter(rbx, xmm_curr_counter, 0x01, L__incCounter_single[k]); + __ pshufb(xmm_result0, xmm_counter_shuf_mask); + __ pxor(xmm_result0, xmm_key_tmp0); + for (int i = 1; i < rounds[k]; i++) { + load_key(xmm_key_tmp0, key, (0x10 * i), xmm_key_shuf_mask); + __ aesenc(xmm_result0, xmm_key_tmp0); + } + load_key(xmm_key_tmp0, key, (rounds[k] * 0x10), xmm_key_shuf_mask); + __ aesenclast(xmm_result0, xmm_key_tmp0); + __ cmpptr(len_reg, AESBlockSize); + __ jcc(Assembler::less, L_processTail_insr[k]); + __ movdqu(xmm_from0, Address(from, pos, Address::times_1, 0 * AESBlockSize)); + __ pxor(xmm_result0, xmm_from0); + __ movdqu(Address(to, pos, Address::times_1, 0 * AESBlockSize), xmm_result0); + __ addptr(pos, AESBlockSize); + __ subptr(len_reg, AESBlockSize); + __ jmp(L_singleBlockLoopTop[k]); + __ BIND(L_processTail_insr[k]); + __ addptr(pos, len_reg); + __ testptr(len_reg, 8); + __ jcc(Assembler::zero, L_processTail_4_insr[k]); + __ subptr(pos,8); + __ pinsrq(xmm_from0, Address(from, pos), 0); + __ BIND(L_processTail_4_insr[k]); + __ testptr(len_reg, 4); + __ jcc(Assembler::zero, L_processTail_2_insr[k]); + __ subptr(pos,4); + __ pslldq(xmm_from0, 4); + __ pinsrd(xmm_from0, Address(from, pos), 0); + __ BIND(L_processTail_2_insr[k]); + __ testptr(len_reg, 2); + __ jcc(Assembler::zero, L_processTail_1_insr[k]); + __ subptr(pos, 2); + __ pslldq(xmm_from0, 2); + __ pinsrw(xmm_from0, Address(from, pos), 0); + __ BIND(L_processTail_1_insr[k]); + __ testptr(len_reg, 1); + __ jcc(Assembler::zero, L_processTail_exit_insr[k]); + __ subptr(pos, 1); + __ pslldq(xmm_from0, 1); + __ pinsrb(xmm_from0, Address(from, pos), 0); + __ BIND(L_processTail_exit_insr[k]); + + __ movdqu(Address(saved_encCounter_start, 0), xmm_result0); + __ pxor(xmm_result0, xmm_from0); + + __ testptr(len_reg, 8); + __ jcc(Assembler::zero, L_processTail_4_extr[k]); + __ pextrq(Address(to, pos), xmm_result0, 0); + __ psrldq(xmm_result0, 8); + __ addptr(pos, 8); + __ BIND(L_processTail_4_extr[k]); + __ testptr(len_reg, 4); + __ jcc(Assembler::zero, L_processTail_2_extr[k]); + __ pextrd(Address(to, pos), xmm_result0, 0); + __ psrldq(xmm_result0, 4); + __ addptr(pos, 4); + __ BIND(L_processTail_2_extr[k]); + __ testptr(len_reg, 2); + __ jcc(Assembler::zero, L_processTail_1_extr[k]); + __ pextrw(Address(to, pos), xmm_result0, 0); + __ psrldq(xmm_result0, 2); + __ addptr(pos, 2); + __ BIND(L_processTail_1_extr[k]); + __ testptr(len_reg, 1); + __ jcc(Assembler::zero, L_processTail_exit_extr[k]); + __ pextrb(Address(to, pos), xmm_result0, 0); + + __ BIND(L_processTail_exit_extr[k]); + __ movl(Address(used_addr, 0), len_reg); + __ jmp(L_exit); + + } + + __ BIND(L_exit); + __ pshufb(xmm_curr_counter, xmm_counter_shuf_mask); //counter is shuffled back. + __ movdqu(Address(counter, 0), xmm_curr_counter); //save counter back + __ pop(rbx); // pop the saved RBX. +#ifdef _WIN64 + // restore regs belonging to calling function + for (int i = 6; i <= XMM_REG_NUM_KEY_LAST; i++) { + __ movdqu(as_XMMRegister(i), xmm_save(i)); + } + __ movl(rax, len_mem); + __ movptr(r13, r13_save); + __ movptr(r14, r14_save); +#else + __ pop(rax); // return 'len' +#endif + __ leave(); // required for proper stackwalking of RuntimeStub frame + __ ret(0); + return start; + } // byte swap x86 long address generate_ghash_long_swap_mask() { @@ -4555,12 +4898,15 @@ class StubGenerator: public StubCodeGenerator { // don't bother generating these AES intrinsic stubs unless global flag is set if (UseAESIntrinsics) { StubRoutines::x86::_key_shuffle_mask_addr = generate_key_shuffle_mask(); // needed by the others - StubRoutines::_aescrypt_encryptBlock = generate_aescrypt_encryptBlock(); StubRoutines::_aescrypt_decryptBlock = generate_aescrypt_decryptBlock(); StubRoutines::_cipherBlockChaining_encryptAESCrypt = generate_cipherBlockChaining_encryptAESCrypt(); StubRoutines::_cipherBlockChaining_decryptAESCrypt = generate_cipherBlockChaining_decryptAESCrypt_Parallel(); } + if (UseAESCTRIntrinsics){ + StubRoutines::x86::_counter_shuffle_mask_addr = generate_counter_shuffle_mask(); + StubRoutines::_counterMode_AESCrypt = generate_counterMode_AESCrypt_Parallel(); + } // Generate GHASH intrinsics code if (UseGHASHIntrinsics) { diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86.cpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86.cpp index d7d2ced2cf0..3bc199b1db5 100644 --- a/hotspot/src/cpu/x86/vm/stubRoutines_x86.cpp +++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86.cpp @@ -34,6 +34,7 @@ address StubRoutines::x86::_verify_mxcsr_entry = NULL; address StubRoutines::x86::_key_shuffle_mask_addr = NULL; +address StubRoutines::x86::_counter_shuffle_mask_addr = NULL; address StubRoutines::x86::_ghash_long_swap_mask_addr = NULL; address StubRoutines::x86::_ghash_byte_swap_mask_addr = NULL; diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86.hpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86.hpp index 7e236967fb8..5b2bf4bdf91 100644 --- a/hotspot/src/cpu/x86/vm/stubRoutines_x86.hpp +++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86.hpp @@ -33,6 +33,10 @@ static address _verify_mxcsr_entry; // shuffle mask for fixing up 128-bit words consisting of big-endian 32-bit integers static address _key_shuffle_mask_addr; + + //shuffle mask for big-endian 128-bit integers + static address _counter_shuffle_mask_addr; + // masks and table for CRC32 static uint64_t _crc_by128_masks[]; static juint _crc_table[]; @@ -45,9 +49,9 @@ public: static address verify_mxcsr_entry() { return _verify_mxcsr_entry; } static address key_shuffle_mask_addr() { return _key_shuffle_mask_addr; } + static address counter_shuffle_mask_addr() { return _counter_shuffle_mask_addr; } static address crc_by128_masks_addr() { return (address)_crc_by128_masks; } static address ghash_long_swap_mask_addr() { return _ghash_long_swap_mask_addr; } static address ghash_byte_swap_mask_addr() { return _ghash_byte_swap_mask_addr; } static void generate_CRC32C_table(bool is_pclmulqdq_supported); - #endif // CPU_X86_VM_STUBROUTINES_X86_32_HPP diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp index 1599939ebcf..c1ea0223389 100644 --- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp +++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86_32.hpp @@ -31,7 +31,7 @@ enum platform_dependent_constants { code_size1 = 9000, // simply increase if too small (assembler will crash if too small) - code_size2 = 30000 // simply increase if too small (assembler will crash if too small) + code_size2 = 33800 // simply increase if too small (assembler will crash if too small) }; class x86 { diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp index d8c50c82b23..6f39276dc05 100644 --- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp +++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp @@ -33,7 +33,7 @@ static bool returns_to_call_stub(address return_pc) { return return_pc == _ enum platform_dependent_constants { code_size1 = 19000, // simply increase if too small (assembler will crash if too small) - code_size2 = 32000 // simply increase if too small (assembler will crash if too small) + code_size2 = 35000 // simply increase if too small (assembler will crash if too small) }; class x86 { diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp index b3b05547f02..d31b0e5acd2 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp @@ -648,6 +648,28 @@ void VM_Version::get_processor_features() { } FLAG_SET_DEFAULT(UseAESIntrinsics, false); } + + // --AES-CTR begins-- + if (!UseAESIntrinsics) { + if (UseAESCTRIntrinsics && !FLAG_IS_DEFAULT(UseAESCTRIntrinsics)) { + warning("AES-CTR intrinsics require UseAESIntrinsics flag to be enabled. Intrinsics will be disabled."); + FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false); + } + } else { + if(supports_sse4_1() && UseSSE >= 4) { + if (FLAG_IS_DEFAULT(UseAESCTRIntrinsics)) { + FLAG_SET_DEFAULT(UseAESCTRIntrinsics, true); + } + } else { + // The AES-CTR intrinsic stubs require AES instruction support (of course) + // but also require sse4.1 mode or higher for instructions it use. + if (UseAESCTRIntrinsics && !FLAG_IS_DEFAULT(UseAESCTRIntrinsics)) { + warning("X86 AES-CTR intrinsics require SSE4.1 instructions or higher. Intrinsics will be disabled."); + } + FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false); + } + } + // --AES-CTR ends-- } } else if (UseAES || UseAESIntrinsics) { if (UseAES && !FLAG_IS_DEFAULT(UseAES)) { @@ -658,6 +680,10 @@ void VM_Version::get_processor_features() { warning("AES intrinsics are not available on this CPU"); FLAG_SET_DEFAULT(UseAESIntrinsics, false); } + if (UseAESCTRIntrinsics && !FLAG_IS_DEFAULT(UseAESCTRIntrinsics)) { + warning("AES-CTR intrinsics are not available on this CPU"); + FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false); + } } // Use CLMUL instructions if available. @@ -681,6 +707,16 @@ void VM_Version::get_processor_features() { FLAG_SET_DEFAULT(UseCRC32Intrinsics, false); } + if (UseAESIntrinsics) { + if (FLAG_IS_DEFAULT(UseAESCTRIntrinsics)) { + UseAESCTRIntrinsics = true; + } + } else if (UseAESCTRIntrinsics) { + if (!FLAG_IS_DEFAULT(UseAESCTRIntrinsics)) + warning("AES/CTR intrinsics are not available on this CPU"); + FLAG_SET_DEFAULT(UseAESCTRIntrinsics, false); + } + if (supports_sse4_2()) { if (FLAG_IS_DEFAULT(UseCRC32CIntrinsics)) { UseCRC32CIntrinsics = true; diff --git a/hotspot/src/share/vm/classfile/vmSymbols.cpp b/hotspot/src/share/vm/classfile/vmSymbols.cpp index c22979f13b6..81dda6e4fd0 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.cpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.cpp @@ -409,6 +409,7 @@ int vmIntrinsics::predicates_needed(vmIntrinsics::ID id) { switch (id) { case vmIntrinsics::_cipherBlockChaining_encryptAESCrypt: case vmIntrinsics::_cipherBlockChaining_decryptAESCrypt: + case vmIntrinsics::_counterMode_AESCrypt: return 1; case vmIntrinsics::_digestBase_implCompressMB: return 3; @@ -597,6 +598,9 @@ bool vmIntrinsics::is_disabled_by_flags(const methodHandle& method) { case vmIntrinsics::_cipherBlockChaining_decryptAESCrypt: if (!UseAESIntrinsics) return true; break; + case vmIntrinsics::_counterMode_AESCrypt: + if (!UseAESCTRIntrinsics) return true; + break; case vmIntrinsics::_sha_implCompress: if (!UseSHA1Intrinsics) return true; break; diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp index d59fa05f434..eb27ceb9498 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp @@ -981,6 +981,10 @@ do_name( decrypt_name, "implDecrypt") \ do_signature(byteArray_int_int_byteArray_int_signature, "([BII[BI)I") \ \ + do_class(com_sun_crypto_provider_counterMode, "com/sun/crypto/provider/CounterMode") \ + do_intrinsic(_counterMode_AESCrypt, com_sun_crypto_provider_counterMode, crypt_name, byteArray_int_int_byteArray_int_signature, F_R) \ + do_name( crypt_name, "implCrypt") \ + \ /* support for sun.security.provider.SHA */ \ do_class(sun_security_provider_sha, "sun/security/provider/SHA") \ do_intrinsic(_sha_implCompress, sun_security_provider_sha, implCompress_name, implCompress_signature, F_R) \ diff --git a/hotspot/src/share/vm/opto/c2compiler.cpp b/hotspot/src/share/vm/opto/c2compiler.cpp index 689147d9f97..7068b5cfb1a 100644 --- a/hotspot/src/share/vm/opto/c2compiler.cpp +++ b/hotspot/src/share/vm/opto/c2compiler.cpp @@ -432,6 +432,7 @@ bool C2Compiler::is_intrinsic_supported(const methodHandle& method, bool is_virt case vmIntrinsics::_aescrypt_decryptBlock: case vmIntrinsics::_cipherBlockChaining_encryptAESCrypt: case vmIntrinsics::_cipherBlockChaining_decryptAESCrypt: + case vmIntrinsics::_counterMode_AESCrypt: case vmIntrinsics::_sha_implCompress: case vmIntrinsics::_sha2_implCompress: case vmIntrinsics::_sha5_implCompress: diff --git a/hotspot/src/share/vm/opto/escape.cpp b/hotspot/src/share/vm/opto/escape.cpp index 169cfc0113f..98bade2457e 100644 --- a/hotspot/src/share/vm/opto/escape.cpp +++ b/hotspot/src/share/vm/opto/escape.cpp @@ -976,6 +976,7 @@ void ConnectionGraph::process_call_arguments(CallNode *call) { strcmp(call->as_CallLeaf()->_name, "aescrypt_decryptBlock") == 0 || strcmp(call->as_CallLeaf()->_name, "cipherBlockChaining_encryptAESCrypt") == 0 || strcmp(call->as_CallLeaf()->_name, "cipherBlockChaining_decryptAESCrypt") == 0 || + strcmp(call->as_CallLeaf()->_name, "counterMode_AESCrypt") == 0 || strcmp(call->as_CallLeaf()->_name, "ghash_processBlocks") == 0 || strcmp(call->as_CallLeaf()->_name, "sha1_implCompress") == 0 || strcmp(call->as_CallLeaf()->_name, "sha1_implCompressMB") == 0 || diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp index 8e3b18e76d8..5bcd0b06623 100644 --- a/hotspot/src/share/vm/opto/library_call.cpp +++ b/hotspot/src/share/vm/opto/library_call.cpp @@ -201,6 +201,7 @@ class LibraryCallKit : public GraphKit { return generate_method_call(method_id, true, false); } Node * load_field_from_object(Node * fromObj, const char * fieldName, const char * fieldTypeString, bool is_exact, bool is_static, ciInstanceKlass * fromKls); + Node * field_address_from_object(Node * fromObj, const char * fieldName, const char * fieldTypeString, bool is_exact, bool is_static, ciInstanceKlass * fromKls); Node* make_string_method_node(int opcode, Node* str1_start, Node* cnt1, Node* str2_start, Node* cnt2, StrIntrinsicNode::ArgEnc ae); bool inline_string_compareTo(StrIntrinsicNode::ArgEnc ae); @@ -283,7 +284,9 @@ class LibraryCallKit : public GraphKit { bool inline_Class_cast(); bool inline_aescrypt_Block(vmIntrinsics::ID id); bool inline_cipherBlockChaining_AESCrypt(vmIntrinsics::ID id); + bool inline_counterMode_AESCrypt(vmIntrinsics::ID id); Node* inline_cipherBlockChaining_AESCrypt_predicate(bool decrypting); + Node* inline_counterMode_AESCrypt_predicate(); Node* get_key_start_from_aescrypt_object(Node* aescrypt_object); Node* get_original_key_start_from_aescrypt_object(Node* aescrypt_object); bool inline_ghash_processBlocks(); @@ -697,6 +700,9 @@ bool LibraryCallKit::try_to_inline(int predicate) { case vmIntrinsics::_cipherBlockChaining_decryptAESCrypt: return inline_cipherBlockChaining_AESCrypt(intrinsic_id()); + case vmIntrinsics::_counterMode_AESCrypt: + return inline_counterMode_AESCrypt(intrinsic_id()); + case vmIntrinsics::_sha_implCompress: case vmIntrinsics::_sha2_implCompress: case vmIntrinsics::_sha5_implCompress: @@ -784,6 +790,8 @@ Node* LibraryCallKit::try_to_predicate(int predicate) { return inline_cipherBlockChaining_AESCrypt_predicate(false); case vmIntrinsics::_cipherBlockChaining_decryptAESCrypt: return inline_cipherBlockChaining_AESCrypt_predicate(true); + case vmIntrinsics::_counterMode_AESCrypt: + return inline_counterMode_AESCrypt_predicate(); case vmIntrinsics::_digestBase_implCompressMB: return inline_digestBase_implCompressMB_predicate(predicate); @@ -5778,6 +5786,39 @@ Node * LibraryCallKit::load_field_from_object(Node * fromObj, const char * field return loadedField; } +Node * LibraryCallKit::field_address_from_object(Node * fromObj, const char * fieldName, const char * fieldTypeString, + bool is_exact = true, bool is_static = false, + ciInstanceKlass * fromKls = NULL) { + if (fromKls == NULL) { + const TypeInstPtr* tinst = _gvn.type(fromObj)->isa_instptr(); + assert(tinst != NULL, "obj is null"); + assert(tinst->klass()->is_loaded(), "obj is not loaded"); + assert(!is_exact || tinst->klass_is_exact(), "klass not exact"); + fromKls = tinst->klass()->as_instance_klass(); + } + else { + assert(is_static, "only for static field access"); + } + ciField* field = fromKls->get_field_by_name(ciSymbol::make(fieldName), + ciSymbol::make(fieldTypeString), + is_static); + + assert(field != NULL, "undefined field"); + assert(!field->is_volatile(), "not defined for volatile fields"); + + if (is_static) { + const TypeInstPtr* tip = TypeInstPtr::make(fromKls->java_mirror()); + fromObj = makecon(tip); + } + + // Next code copied from Parse::do_get_xxx(): + + // Compute address and memory type. + int offset = field->offset_in_bytes(); + Node *adr = basic_plus_adr(fromObj, fromObj, offset); + + return adr; +} //------------------------------inline_aescrypt_Block----------------------- bool LibraryCallKit::inline_aescrypt_Block(vmIntrinsics::ID id) { @@ -5944,6 +5985,90 @@ bool LibraryCallKit::inline_cipherBlockChaining_AESCrypt(vmIntrinsics::ID id) { return true; } +//------------------------------inline_counterMode_AESCrypt----------------------- +bool LibraryCallKit::inline_counterMode_AESCrypt(vmIntrinsics::ID id) { + assert(UseAES, "need AES instruction support"); + if (!UseAESCTRIntrinsics) return false; + + address stubAddr = NULL; + const char *stubName = NULL; + if (id == vmIntrinsics::_counterMode_AESCrypt) { + stubAddr = StubRoutines::counterMode_AESCrypt(); + stubName = "counterMode_AESCrypt"; + } + if (stubAddr == NULL) return false; + + Node* counterMode_object = argument(0); + Node* src = argument(1); + Node* src_offset = argument(2); + Node* len = argument(3); + Node* dest = argument(4); + Node* dest_offset = argument(5); + + // (1) src and dest are arrays. + const Type* src_type = src->Value(&_gvn); + const Type* dest_type = dest->Value(&_gvn); + const TypeAryPtr* top_src = src_type->isa_aryptr(); + const TypeAryPtr* top_dest = dest_type->isa_aryptr(); + assert(top_src != NULL && top_src->klass() != NULL && + top_dest != NULL && top_dest->klass() != NULL, "args are strange"); + + // checks are the responsibility of the caller + Node* src_start = src; + Node* dest_start = dest; + if (src_offset != NULL || dest_offset != NULL) { + assert(src_offset != NULL && dest_offset != NULL, ""); + src_start = array_element_address(src, src_offset, T_BYTE); + dest_start = array_element_address(dest, dest_offset, T_BYTE); + } + + // if we are in this set of code, we "know" the embeddedCipher is an AESCrypt object + // (because of the predicated logic executed earlier). + // so we cast it here safely. + // this requires a newer class file that has this array as littleEndian ints, otherwise we revert to java + Node* embeddedCipherObj = load_field_from_object(counterMode_object, "embeddedCipher", "Lcom/sun/crypto/provider/SymmetricCipher;", /*is_exact*/ false); + if (embeddedCipherObj == NULL) return false; + // cast it to what we know it will be at runtime + const TypeInstPtr* tinst = _gvn.type(counterMode_object)->isa_instptr(); + assert(tinst != NULL, "CTR obj is null"); + assert(tinst->klass()->is_loaded(), "CTR obj is not loaded"); + ciKlass* klass_AESCrypt = tinst->klass()->as_instance_klass()->find_klass(ciSymbol::make("com/sun/crypto/provider/AESCrypt")); + assert(klass_AESCrypt->is_loaded(), "predicate checks that this class is loaded"); + ciInstanceKlass* instklass_AESCrypt = klass_AESCrypt->as_instance_klass(); + const TypeKlassPtr* aklass = TypeKlassPtr::make(instklass_AESCrypt); + const TypeOopPtr* xtype = aklass->as_instance_type(); + Node* aescrypt_object = new CheckCastPPNode(control(), embeddedCipherObj, xtype); + aescrypt_object = _gvn.transform(aescrypt_object); + // we need to get the start of the aescrypt_object's expanded key array + Node* k_start = get_key_start_from_aescrypt_object(aescrypt_object); + if (k_start == NULL) return false; + // similarly, get the start address of the r vector + Node* obj_counter = load_field_from_object(counterMode_object, "counter", "[B", /*is_exact*/ false); + if (obj_counter == NULL) return false; + Node* cnt_start = array_element_address(obj_counter, intcon(0), T_BYTE); + + Node* saved_encCounter = load_field_from_object(counterMode_object, "encryptedCounter", "[B", /*is_exact*/ false); + if (saved_encCounter == NULL) return false; + Node* saved_encCounter_start = array_element_address(saved_encCounter, intcon(0), T_BYTE); + Node* used = field_address_from_object(counterMode_object, "used", "I", /*is_exact*/ false); + + Node* ctrCrypt; + if (Matcher::pass_original_key_for_aes()) { + // no SPARC version for AES/CTR intrinsics now. + return false; + } + // Call the stub, passing src_start, dest_start, k_start, r_start and src_len + ctrCrypt = make_runtime_call(RC_LEAF|RC_NO_FP, + OptoRuntime::counterMode_aescrypt_Type(), + stubAddr, stubName, TypePtr::BOTTOM, + src_start, dest_start, k_start, cnt_start, len, saved_encCounter_start, used); + + // return cipher length (int) + Node* retvalue = _gvn.transform(new ProjNode(ctrCrypt, TypeFunc::Parms)); + set_result(retvalue); + return true; +} + //------------------------------get_key_start_from_aescrypt_object----------------------- Node * LibraryCallKit::get_key_start_from_aescrypt_object(Node *aescrypt_object) { Node* objAESCryptKey = load_field_from_object(aescrypt_object, "K", "[I", /*is_exact*/ false); @@ -6025,6 +6150,48 @@ Node* LibraryCallKit::inline_cipherBlockChaining_AESCrypt_predicate(bool decrypt return _gvn.transform(region); } +//----------------------------inline_counterMode_AESCrypt_predicate---------------------------- +// Return node representing slow path of predicate check. +// the pseudo code we want to emulate with this predicate is: +// for encryption: +// if (embeddedCipherObj instanceof AESCrypt) do_intrinsic, else do_javapath +// for decryption: +// if ((embeddedCipherObj instanceof AESCrypt) && (cipher!=plain)) do_intrinsic, else do_javapath +// note cipher==plain is more conservative than the original java code but that's OK +// + +Node* LibraryCallKit::inline_counterMode_AESCrypt_predicate() { + // The receiver was checked for NULL already. + Node* objCTR = argument(0); + + // Load embeddedCipher field of CipherBlockChaining object. + Node* embeddedCipherObj = load_field_from_object(objCTR, "embeddedCipher", "Lcom/sun/crypto/provider/SymmetricCipher;", /*is_exact*/ false); + + // get AESCrypt klass for instanceOf check + // AESCrypt might not be loaded yet if some other SymmetricCipher got us to this compile point + // will have same classloader as CipherBlockChaining object + const TypeInstPtr* tinst = _gvn.type(objCTR)->isa_instptr(); + assert(tinst != NULL, "CTRobj is null"); + assert(tinst->klass()->is_loaded(), "CTRobj is not loaded"); + + // we want to do an instanceof comparison against the AESCrypt class + ciKlass* klass_AESCrypt = tinst->klass()->as_instance_klass()->find_klass(ciSymbol::make("com/sun/crypto/provider/AESCrypt")); + if (!klass_AESCrypt->is_loaded()) { + // if AESCrypt is not even loaded, we never take the intrinsic fast path + Node* ctrl = control(); + set_control(top()); // no regular fast path + return ctrl; + } + + ciInstanceKlass* instklass_AESCrypt = klass_AESCrypt->as_instance_klass(); + Node* instof = gen_instanceof(embeddedCipherObj, makecon(TypeKlassPtr::make(instklass_AESCrypt))); + Node* cmp_instof = _gvn.transform(new CmpINode(instof, intcon(1))); + Node* bool_instof = _gvn.transform(new BoolNode(cmp_instof, BoolTest::ne)); + Node* instof_false = generate_guard(bool_instof, NULL, PROB_MIN); + + return instof_false; // even if it is NULL +} + //------------------------------inline_ghash_processBlocks bool LibraryCallKit::inline_ghash_processBlocks() { address stubAddr; diff --git a/hotspot/src/share/vm/opto/runtime.cpp b/hotspot/src/share/vm/opto/runtime.cpp index a42c750d465..9065c931d23 100644 --- a/hotspot/src/share/vm/opto/runtime.cpp +++ b/hotspot/src/share/vm/opto/runtime.cpp @@ -948,6 +948,35 @@ const TypeFunc* OptoRuntime::cipherBlockChaining_aescrypt_Type() { return TypeFunc::make(domain, range); } +//for counterMode calls of aescrypt encrypt/decrypt, four pointers and a length, returning int +const TypeFunc* OptoRuntime::counterMode_aescrypt_Type() { + // create input type (domain) + int num_args = 7; + if (Matcher::pass_original_key_for_aes()) { + num_args = 8; + } + int argcnt = num_args; + const Type** fields = TypeTuple::fields(argcnt); + int argp = TypeFunc::Parms; + fields[argp++] = TypePtr::NOTNULL; // src + fields[argp++] = TypePtr::NOTNULL; // dest + fields[argp++] = TypePtr::NOTNULL; // k array + fields[argp++] = TypePtr::NOTNULL; // counter array + fields[argp++] = TypeInt::INT; // src len + fields[argp++] = TypePtr::NOTNULL; // saved_encCounter + fields[argp++] = TypePtr::NOTNULL; // saved used addr + if (Matcher::pass_original_key_for_aes()) { + fields[argp++] = TypePtr::NOTNULL; // original k array + } + assert(argp == TypeFunc::Parms + argcnt, "correct decoding"); + const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms + argcnt, fields); + // returning cipher len (int) + fields = TypeTuple::fields(1); + fields[TypeFunc::Parms + 0] = TypeInt::INT; + const TypeTuple* range = TypeTuple::make(TypeFunc::Parms + 1, fields); + return TypeFunc::make(domain, range); +} + /* * void implCompress(byte[] buf, int ofs) */ diff --git a/hotspot/src/share/vm/opto/runtime.hpp b/hotspot/src/share/vm/opto/runtime.hpp index 69e78aa8ff7..91c72b2d38d 100644 --- a/hotspot/src/share/vm/opto/runtime.hpp +++ b/hotspot/src/share/vm/opto/runtime.hpp @@ -287,6 +287,7 @@ private: static const TypeFunc* aescrypt_block_Type(); static const TypeFunc* cipherBlockChaining_aescrypt_Type(); + static const TypeFunc* counterMode_aescrypt_Type(); static const TypeFunc* sha_implCompress_Type(); static const TypeFunc* digestBase_implCompressMB_Type(); diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index cbfde3e0322..eabd24512b6 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -836,6 +836,9 @@ public: product(bool, UseAESIntrinsics, false, \ "Use intrinsics for AES versions of crypto") \ \ + product(bool, UseAESCTRIntrinsics, false, \ + "Use intrinsics for the paralleled version of AES/CTR crypto") \ + \ product(bool, UseSHA1Intrinsics, false, \ "Use intrinsics for SHA-1 crypto hash function. " \ "Requires that UseSHA is enabled.") \ diff --git a/hotspot/src/share/vm/runtime/stubRoutines.cpp b/hotspot/src/share/vm/runtime/stubRoutines.cpp index 21fe0c6054f..2682be50945 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.cpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.cpp @@ -127,6 +127,7 @@ address StubRoutines::_aescrypt_encryptBlock = NULL; address StubRoutines::_aescrypt_decryptBlock = NULL; address StubRoutines::_cipherBlockChaining_encryptAESCrypt = NULL; address StubRoutines::_cipherBlockChaining_decryptAESCrypt = NULL; +address StubRoutines::_counterMode_AESCrypt = NULL; address StubRoutines::_ghash_processBlocks = NULL; address StubRoutines::_sha1_implCompress = NULL; diff --git a/hotspot/src/share/vm/runtime/stubRoutines.hpp b/hotspot/src/share/vm/runtime/stubRoutines.hpp index aff8ad0a0cf..a3f905aed11 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.hpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp @@ -186,6 +186,7 @@ class StubRoutines: AllStatic { static address _aescrypt_decryptBlock; static address _cipherBlockChaining_encryptAESCrypt; static address _cipherBlockChaining_decryptAESCrypt; + static address _counterMode_AESCrypt; static address _ghash_processBlocks; static address _sha1_implCompress; @@ -359,6 +360,7 @@ class StubRoutines: AllStatic { static address aescrypt_decryptBlock() { return _aescrypt_decryptBlock; } static address cipherBlockChaining_encryptAESCrypt() { return _cipherBlockChaining_encryptAESCrypt; } static address cipherBlockChaining_decryptAESCrypt() { return _cipherBlockChaining_decryptAESCrypt; } + static address counterMode_AESCrypt() { return _counterMode_AESCrypt; } static address ghash_processBlocks() { return _ghash_processBlocks; } static address sha1_implCompress() { return _sha1_implCompress; } diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index f279a37bc76..e20dbbbb00a 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -850,6 +850,7 @@ typedef CompactHashtable SymbolCompactHashTable; static_field(StubRoutines, _aescrypt_decryptBlock, address) \ static_field(StubRoutines, _cipherBlockChaining_encryptAESCrypt, address) \ static_field(StubRoutines, _cipherBlockChaining_decryptAESCrypt, address) \ + static_field(StubRoutines, _counterMode_AESCrypt, address) \ static_field(StubRoutines, _ghash_processBlocks, address) \ static_field(StubRoutines, _updateBytesCRC32, address) \ static_field(StubRoutines, _crc_table_adr, address) \ diff --git a/hotspot/test/compiler/codegen/7184394/TestAESBase.java b/hotspot/test/compiler/codegen/7184394/TestAESBase.java index 04edf19636f..6fa53c04a1a 100644 --- a/hotspot/test/compiler/codegen/7184394/TestAESBase.java +++ b/hotspot/test/compiler/codegen/7184394/TestAESBase.java @@ -104,8 +104,8 @@ abstract public class TestAESBase { cipher = Cipher.getInstance(algorithm + "/" + mode + "/" + paddingStr, "SunJCE"); dCipher = Cipher.getInstance(algorithm + "/" + mode + "/" + paddingStr, "SunJCE"); - // CBC init - if (mode.equals("CBC")) { + // CBC or CTR init + if (mode.equals("CBC") || mode.equals("CTR")) { IvParameterSpec initVector = new IvParameterSpec(iv); cipher.init(Cipher.ENCRYPT_MODE, key, initVector); algParams = cipher.getParameters(); diff --git a/hotspot/test/compiler/codegen/7184394/TestAESMain.java b/hotspot/test/compiler/codegen/7184394/TestAESMain.java index 6b5e072ea35..a4ed27f3bc2 100644 --- a/hotspot/test/compiler/codegen/7184394/TestAESMain.java +++ b/hotspot/test/compiler/codegen/7184394/TestAESMain.java @@ -51,6 +51,13 @@ * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=GCM -DencInputOffset=1 -DencOutputOffset=1 TestAESMain * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=GCM -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 TestAESMain * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=GCM -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 -DpaddingStr=NoPadding -DmsgSize=640 TestAESMain + * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR TestAESMain + * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR -DencInputOffset=1 TestAESMain + * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR -DencOutputOffset=1 TestAESMain + * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR -DdecOutputOffset=1 TestAESMain + * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR -DencInputOffset=1 -DencOutputOffset=1 TestAESMain + * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 TestAESMain + * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true -Dmode=CTR -DencInputOffset=1 -DencOutputOffset=1 -DdecOutputOffset=1 -DpaddingStr=NoPadding -DmsgSize=640 TestAESMain * * @author Tom Deneau */ From c4a81b327d3ae3103508e838d99f69187c4720e1 Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Mon, 21 Dec 2015 16:58:29 +0000 Subject: [PATCH 122/146] 8145096: Undefined behaviour in HotSpot Fix some integer overflows Reviewed-by: jrose, kvn, kbarrett, adinn, iklam --- hotspot/src/os/posix/vm/os_posix.cpp | 6 ++++- hotspot/src/share/vm/opto/addnode.cpp | 8 +++--- hotspot/src/share/vm/opto/loopTransform.cpp | 4 +-- hotspot/src/share/vm/opto/mulnode.cpp | 23 ++++++++-------- hotspot/src/share/vm/opto/subnode.cpp | 8 +++--- hotspot/src/share/vm/opto/type.cpp | 20 +++++++------- .../vm/runtime/advancedThresholdPolicy.cpp | 3 ++- .../share/vm/utilities/globalDefinitions.hpp | 26 +++++++++++++++++++ 8 files changed, 64 insertions(+), 34 deletions(-) diff --git a/hotspot/src/os/posix/vm/os_posix.cpp b/hotspot/src/os/posix/vm/os_posix.cpp index 8e442f3dfcd..a0bb78939c0 100644 --- a/hotspot/src/os/posix/vm/os_posix.cpp +++ b/hotspot/src/os/posix/vm/os_posix.cpp @@ -792,7 +792,11 @@ const char* os::Posix::describe_sa_flags(int flags, char* buffer, size_t size) { strncpy(buffer, "none", size); const struct { - int i; + // NB: i is an unsigned int here because SA_RESETHAND is on some + // systems 0x80000000, which is implicitly unsigned. Assignining + // it to an int field would be an overflow in unsigned-to-signed + // conversion. + unsigned int i; const char* s; } flaginfo [] = { { SA_NOCLDSTOP, "SA_NOCLDSTOP" }, diff --git a/hotspot/src/share/vm/opto/addnode.cpp b/hotspot/src/share/vm/opto/addnode.cpp index a88ee2e1d22..de7356db4b9 100644 --- a/hotspot/src/share/vm/opto/addnode.cpp +++ b/hotspot/src/share/vm/opto/addnode.cpp @@ -344,8 +344,8 @@ Node *AddINode::Identity( PhaseTransform *phase ) { const Type *AddINode::add_ring( const Type *t0, const Type *t1 ) const { const TypeInt *r0 = t0->is_int(); // Handy access const TypeInt *r1 = t1->is_int(); - int lo = r0->_lo + r1->_lo; - int hi = r0->_hi + r1->_hi; + int lo = java_add(r0->_lo, r1->_lo); + int hi = java_add(r0->_hi, r1->_hi); if( !(r0->is_con() && r1->is_con()) ) { // Not both constants, compute approximate result if( (r0->_lo & r1->_lo) < 0 && lo >= 0 ) { @@ -461,8 +461,8 @@ Node *AddLNode::Identity( PhaseTransform *phase ) { const Type *AddLNode::add_ring( const Type *t0, const Type *t1 ) const { const TypeLong *r0 = t0->is_long(); // Handy access const TypeLong *r1 = t1->is_long(); - jlong lo = r0->_lo + r1->_lo; - jlong hi = r0->_hi + r1->_hi; + jlong lo = java_add(r0->_lo, r1->_lo); + jlong hi = java_add(r0->_hi, r1->_hi); if( !(r0->is_con() && r1->is_con()) ) { // Not both constants, compute approximate result if( (r0->_lo & r1->_lo) < 0 && lo >= 0 ) { diff --git a/hotspot/src/share/vm/opto/loopTransform.cpp b/hotspot/src/share/vm/opto/loopTransform.cpp index d1bfb801b67..cbff6c2b879 100644 --- a/hotspot/src/share/vm/opto/loopTransform.cpp +++ b/hotspot/src/share/vm/opto/loopTransform.cpp @@ -1399,8 +1399,8 @@ void PhaseIdealLoop::do_unroll( IdealLoopTree *loop, Node_List &old_new, bool ad limit = new Opaque2Node( C, limit ); register_new_node( limit, opaq_ctrl ); } - if (stride_con > 0 && ((limit_type->_lo - stride_con) < limit_type->_lo) || - stride_con < 0 && ((limit_type->_hi - stride_con) > limit_type->_hi)) { + if (stride_con > 0 && (java_subtract(limit_type->_lo, stride_con) < limit_type->_lo) || + stride_con < 0 && (java_subtract(limit_type->_hi, stride_con) > limit_type->_hi)) { // No underflow. new_limit = new SubINode(limit, stride); } else { diff --git a/hotspot/src/share/vm/opto/mulnode.cpp b/hotspot/src/share/vm/opto/mulnode.cpp index d4730e978e9..4e796ce72d3 100644 --- a/hotspot/src/share/vm/opto/mulnode.cpp +++ b/hotspot/src/share/vm/opto/mulnode.cpp @@ -245,13 +245,13 @@ const Type *MulINode::mul_ring(const Type *t0, const Type *t1) const { double d = (double)hi1; // Compute all endpoints & check for overflow - int32_t A = lo0*lo1; + int32_t A = java_multiply(lo0, lo1); if( (double)A != a*c ) return TypeInt::INT; // Overflow? - int32_t B = lo0*hi1; + int32_t B = java_multiply(lo0, hi1); if( (double)B != a*d ) return TypeInt::INT; // Overflow? - int32_t C = hi0*lo1; + int32_t C = java_multiply(hi0, lo1); if( (double)C != b*c ) return TypeInt::INT; // Overflow? - int32_t D = hi0*hi1; + int32_t D = java_multiply(hi0, hi1); if( (double)D != b*d ) return TypeInt::INT; // Overflow? if( A < B ) { lo0 = A; hi0 = B; } // Sort range endpoints @@ -341,13 +341,13 @@ const Type *MulLNode::mul_ring(const Type *t0, const Type *t1) const { double d = (double)hi1; // Compute all endpoints & check for overflow - jlong A = lo0*lo1; + jlong A = java_multiply(lo0, lo1); if( (double)A != a*c ) return TypeLong::LONG; // Overflow? - jlong B = lo0*hi1; + jlong B = java_multiply(lo0, hi1); if( (double)B != a*d ) return TypeLong::LONG; // Overflow? - jlong C = hi0*lo1; + jlong C = java_multiply(hi0, lo1); if( (double)C != b*c ) return TypeLong::LONG; // Overflow? - jlong D = hi0*hi1; + jlong D = java_multiply(hi0, hi1); if( (double)D != b*d ) return TypeLong::LONG; // Overflow? if( A < B ) { lo0 = A; hi0 = B; } // Sort range endpoints @@ -574,7 +574,8 @@ Node *AndLNode::Identity( PhaseTransform *phase ) { // Masking off high bits which are always zero is useless. const TypeLong* t1 = phase->type( in(1) )->isa_long(); if (t1 != NULL && t1->_lo >= 0) { - jlong t1_support = ((jlong)1 << (1 + log2_long(t1->_hi))) - 1; + int bit_count = log2_long(t1->_hi) + 1; + jlong t1_support = jlong(max_julong >> (BitsPerJavaLong - bit_count)); if ((t1_support & con) == t1_support) return usr; } @@ -802,7 +803,7 @@ Node *LShiftLNode::Ideal(PhaseGVN *phase, bool can_reshape) { // Check for ((x & ((CONST64(1)<<(64-c0))-1)) << c0) which ANDs off high bits // before shifting them away. - const jlong bits_mask = ((jlong)CONST64(1) << (jlong)(BitsPerJavaLong - con)) - CONST64(1); + const jlong bits_mask = jlong(max_julong >> con); if( add1_op == Op_AndL && phase->type(add1->in(2)) == TypeLong::make( bits_mask ) ) return new LShiftLNode( add1->in(1), in(2) ); @@ -1254,7 +1255,7 @@ Node *URShiftLNode::Ideal(PhaseGVN *phase, bool can_reshape) { if ( con == 0 ) return NULL; // let Identity() handle a 0 shift count // note: mask computation below does not work for 0 shift count // We'll be wanting the right-shift amount as a mask of that many bits - const jlong mask = (((jlong)CONST64(1) << (jlong)(BitsPerJavaLong - con)) -1); + const jlong mask = jlong(max_julong >> con); // Check for ((x << z) + Y) >>> z. Replace with x + con>>>z // The idiom for rounding to a power of 2 is "(Q+(2^z-1)) >>> z". diff --git a/hotspot/src/share/vm/opto/subnode.cpp b/hotspot/src/share/vm/opto/subnode.cpp index 5429d5d4274..6e27f53c0a4 100644 --- a/hotspot/src/share/vm/opto/subnode.cpp +++ b/hotspot/src/share/vm/opto/subnode.cpp @@ -252,8 +252,8 @@ Node *SubINode::Ideal(PhaseGVN *phase, bool can_reshape){ const Type *SubINode::sub( const Type *t1, const Type *t2 ) const { const TypeInt *r0 = t1->is_int(); // Handy access const TypeInt *r1 = t2->is_int(); - int32_t lo = r0->_lo - r1->_hi; - int32_t hi = r0->_hi - r1->_lo; + int32_t lo = java_subtract(r0->_lo, r1->_hi); + int32_t hi = java_subtract(r0->_hi, r1->_lo); // We next check for 32-bit overflow. // If that happens, we just assume all integers are possible. @@ -361,8 +361,8 @@ Node *SubLNode::Ideal(PhaseGVN *phase, bool can_reshape) { const Type *SubLNode::sub( const Type *t1, const Type *t2 ) const { const TypeLong *r0 = t1->is_long(); // Handy access const TypeLong *r1 = t2->is_long(); - jlong lo = r0->_lo - r1->_hi; - jlong hi = r0->_hi - r1->_lo; + jlong lo = java_subtract(r0->_lo, r1->_hi); + jlong hi = java_subtract(r0->_hi, r1->_lo); // We next check for 32-bit overflow. // If that happens, we just assume all integers are possible. diff --git a/hotspot/src/share/vm/opto/type.cpp b/hotspot/src/share/vm/opto/type.cpp index ec4c898afb2..42b290bd29e 100644 --- a/hotspot/src/share/vm/opto/type.cpp +++ b/hotspot/src/share/vm/opto/type.cpp @@ -1370,8 +1370,8 @@ const Type *TypeInt::narrow( const Type *old ) const { // The new type narrows the old type, so look for a "death march". // See comments on PhaseTransform::saturate. - juint nrange = _hi - _lo; - juint orange = ohi - olo; + juint nrange = (juint)_hi - _lo; + juint orange = (juint)ohi - olo; if (nrange < max_juint - 1 && nrange > (orange >> 1) + (SMALLINT*2)) { // Use the new type only if the range shrinks a lot. // We do not want the optimizer computing 2^31 point by point. @@ -1404,7 +1404,7 @@ bool TypeInt::eq( const Type *t ) const { //------------------------------hash------------------------------------------- // Type-specific hashing function. int TypeInt::hash(void) const { - return _lo+_hi+_widen+(int)Type::Int; + return java_add(java_add(_lo, _hi), java_add(_widen, (int)Type::Int)); } //------------------------------is_finite-------------------------------------- @@ -1585,7 +1585,7 @@ const Type *TypeLong::widen( const Type *old, const Type* limit ) const { // If neither endpoint is extremal yet, push out the endpoint // which is closer to its respective limit. if (_lo >= 0 || // easy common case - (julong)(_lo - min) >= (julong)(max - _hi)) { + ((julong)_lo - min) >= ((julong)max - _hi)) { // Try to widen to an unsigned range type of 32/63 bits: if (max >= max_juint && _hi < max_juint) return make(_lo, max_juint, WidenMax); @@ -2404,7 +2404,7 @@ bool TypePtr::eq( const Type *t ) const { //------------------------------hash------------------------------------------- // Type-specific hashing function. int TypePtr::hash(void) const { - return _ptr + _offset + hash_speculative() + _inline_depth; + return java_add(java_add(_ptr, _offset), java_add( hash_speculative(), _inline_depth)); ; } @@ -3214,10 +3214,8 @@ bool TypeOopPtr::eq( const Type *t ) const { // Type-specific hashing function. int TypeOopPtr::hash(void) const { return - (const_oop() ? const_oop()->hash() : 0) + - _klass_is_exact + - _instance_id + - TypePtr::hash(); + java_add(java_add(const_oop() ? const_oop()->hash() : 0, _klass_is_exact), + java_add(_instance_id, TypePtr::hash())); } //------------------------------dump2------------------------------------------ @@ -3824,7 +3822,7 @@ bool TypeInstPtr::eq( const Type *t ) const { //------------------------------hash------------------------------------------- // Type-specific hashing function. int TypeInstPtr::hash(void) const { - int hash = klass()->hash() + TypeOopPtr::hash(); + int hash = java_add(klass()->hash(), TypeOopPtr::hash()); return hash; } @@ -4742,7 +4740,7 @@ bool TypeKlassPtr::eq( const Type *t ) const { //------------------------------hash------------------------------------------- // Type-specific hashing function. int TypeKlassPtr::hash(void) const { - return klass()->hash() + TypePtr::hash(); + return java_add(klass()->hash(), TypePtr::hash()); } //------------------------------singleton-------------------------------------- diff --git a/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp index cd73fa78559..5d9a3096787 100644 --- a/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp +++ b/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp @@ -133,7 +133,8 @@ bool AdvancedThresholdPolicy::is_old(Method* method) { } double AdvancedThresholdPolicy::weight(Method* method) { - return (method->rate() + 1) * ((method->invocation_count() + 1) * (method->backedge_count() + 1)); + return (double)(method->rate() + 1) * + (method->invocation_count() + 1) * (method->backedge_count() + 1); } // Apply heuristics and return true if x should be compiled before y diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp index 103edfa0ca4..53431e8a6b3 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp @@ -1418,6 +1418,32 @@ template static void swap(T& a, T& b) { #define ARRAY_SIZE(array) (sizeof(array)/sizeof((array)[0])) +//---------------------------------------------------------------------------------------------------- +// Sum and product which can never overflow: they wrap, just like the +// Java operations. Note that we don't intend these to be used for +// general-purpose arithmetic: their purpose is to emulate Java +// operations. + +// The goal of this code to avoid undefined or implementation-defined +// behaviour. The use of an lvalue to reference cast is explicitly +// permitted by Lvalues and rvalues [basic.lval]. [Section 3.10 Para +// 15 in C++03] +#define JAVA_INTEGER_OP(OP, NAME, TYPE, UNSIGNED_TYPE) \ +inline TYPE NAME (TYPE in1, TYPE in2) { \ + UNSIGNED_TYPE ures = static_cast(in1); \ + ures OP ## = static_cast(in2); \ + return reinterpret_cast(ures); \ +} + +JAVA_INTEGER_OP(+, java_add, jint, juint) +JAVA_INTEGER_OP(-, java_subtract, jint, juint) +JAVA_INTEGER_OP(*, java_multiply, jint, juint) +JAVA_INTEGER_OP(+, java_add, jlong, julong) +JAVA_INTEGER_OP(-, java_subtract, jlong, julong) +JAVA_INTEGER_OP(*, java_multiply, jlong, julong) + +#undef JAVA_INTEGER_OP + // Dereference vptr // All C++ compilers that we know of have the vtbl pointer in the first // word. If there are exceptions, this function needs to be made compiler From bf1b5cea33cea0c18140cf2b8aa4ba2293877d68 Mon Sep 17 00:00:00 2001 From: Ioi Lam Date: Mon, 21 Dec 2015 13:58:56 -0800 Subject: [PATCH 123/146] 8145271: stand-alone hotspot build is broken Reviewed-by: ihse --- hotspot/make/defs.make | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hotspot/make/defs.make b/hotspot/make/defs.make index b971c338e8e..e02d660f349 100644 --- a/hotspot/make/defs.make +++ b/hotspot/make/defs.make @@ -124,30 +124,30 @@ include $(GAMMADIR)/make/jdk_version # JDK_PREVIOUS_VERSION is only needed to facilitate standalone builds ifeq ($(JDK_PREVIOUS_VERSION),) - JDK_PREVIOUS_VERSION=$(STANDALONE_JDK_PREVIOUS_VERSION) + export JDK_PREVIOUS_VERSION=$(STANDALONE_JDK_PREVIOUS_VERSION) endif # Java versions needed ifeq ($(VERSION_MAJOR),) - VERSION_MAJOR=$(STANDALONE_JDK_MAJOR_VER) + export VERSION_MAJOR=$(STANDALONE_JDK_MAJOR_VER) endif ifeq ($(VERSION_MINOR),) - VERSION_MINOR=$(STANDALONE_JDK_MINOR_VER) + export VERSION_MINOR=$(STANDALONE_JDK_MINOR_VER) endif ifeq ($(VERSION_SECURITY),) - VERSION_SECURITY=$(STANDALONE_JDK_SECURITY_VER) + export VERSION_SECURITY=$(STANDALONE_JDK_SECURITY_VER) endif ifeq ($(VERSION_PATCH),) - VERSION_PATCH=$(STANDALONE_JDK_PATCH_VER) + export VERSION_PATCH=$(STANDALONE_JDK_PATCH_VER) endif ifeq ($(VERSION_BUILD),) - VERSION_BUILD=0 + export VERSION_BUILD=0 endif ifeq ($(VERSION_SHORT),) - VERSION_SHORT=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_SECURITY) + export VERSION_SHORT=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_SECURITY) endif ifeq ($(VERSION_STRING),) # Note that this is an extremely rough and incorrect approximation of a correct version string. - VERSION_STRING=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_SECURITY)-internal + export VERSION_STRING=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_SECURITY)-internal endif ifneq ($(HOTSPOT_RELEASE_VERSION),) From 056fb6bfd3a0d3c11f0d034ac1f843a34fa3ff50 Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Tue, 22 Dec 2015 11:02:04 +0100 Subject: [PATCH 124/146] 8145672: Remove dependency of G1FromCardCache to HeapRegionRemSet Move HeapRegionRemSet::num_par_rem_sets() to G1RemSet, and document it. Reviewed-by: mgerdin, jmasa --- hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp | 9 ++------- hotspot/src/share/vm/gc/g1/g1FromCardCache.cpp | 18 ++++++++++-------- hotspot/src/share/vm/gc/g1/g1FromCardCache.hpp | 2 +- hotspot/src/share/vm/gc/g1/g1RemSet.cpp | 10 ++++++++++ hotspot/src/share/vm/gc/g1/g1RemSet.hpp | 10 ++++++++++ hotspot/src/share/vm/gc/g1/heapRegion.cpp | 1 - .../src/share/vm/gc/g1/heapRegionRemSet.cpp | 7 ------- .../src/share/vm/gc/g1/heapRegionRemSet.hpp | 7 ------- 8 files changed, 33 insertions(+), 31 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp index 2da2ca3fb21..21e68b4b70a 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp @@ -1789,9 +1789,6 @@ G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* policy_) : uint n_queues = ParallelGCThreads; _task_queues = new RefToScanQueueSet(n_queues); - uint n_rem_sets = HeapRegionRemSet::num_par_rem_sets(); - assert(n_rem_sets > 0, "Invariant."); - _worker_cset_start_region = NEW_C_HEAP_ARRAY(HeapRegion*, n_queues, mtGC); _worker_cset_start_region_time_stamp = NEW_C_HEAP_ARRAY(uint, n_queues, mtGC); _evacuation_failed_info_array = NEW_C_HEAP_ARRAY(EvacuationFailedInfo, n_queues, mtGC); @@ -1891,7 +1888,6 @@ jint G1CollectedHeap::initialize() { _g1_rem_set = new G1RemSet(this, g1_barrier_set()); // Carve out the G1 part of the heap. - ReservedSpace g1_rs = heap_rs.first_part(max_byte_size); size_t page_size = UseLargePages ? os::large_page_size() : os::vm_page_size(); G1RegionToSpaceMapper* heap_storage = @@ -1940,6 +1936,8 @@ jint G1CollectedHeap::initialize() { const uint max_region_idx = (1U << (sizeof(RegionIdx_t)*BitsPerByte-1)) - 1; guarantee((max_regions() - 1) <= max_region_idx, "too many regions"); + G1RemSet::initialize(max_regions()); + size_t max_cards_per_region = ((size_t)1 << (sizeof(CardIdx_t)*BitsPerByte-1)) - 1; guarantee(HeapRegion::CardsPerRegion > 0, "make sure it's initialized"); guarantee(HeapRegion::CardsPerRegion < max_cards_per_region, @@ -1967,9 +1965,6 @@ jint G1CollectedHeap::initialize() { } _cmThread = _cm->cmThread(); - // Initialize the from_card cache structure of HeapRegionRemSet. - HeapRegionRemSet::init_heap(max_regions()); - // Now expand into the initial heap size. if (!expand(init_byte_size)) { vm_shutdown_during_initialization("Failed to allocate initial heap."); diff --git a/hotspot/src/share/vm/gc/g1/g1FromCardCache.cpp b/hotspot/src/share/vm/gc/g1/g1FromCardCache.cpp index 21367225411..41b129c2111 100644 --- a/hotspot/src/share/vm/gc/g1/g1FromCardCache.cpp +++ b/hotspot/src/share/vm/gc/g1/g1FromCardCache.cpp @@ -24,7 +24,7 @@ #include "precompiled.hpp" #include "gc/g1/g1FromCardCache.hpp" -#include "gc/g1/heapRegionRemSet.hpp" +#include "gc/g1/g1RemSet.hpp" #include "memory/padded.inline.hpp" #include "utilities/debug.hpp" @@ -32,11 +32,12 @@ int** G1FromCardCache::_cache = NULL; uint G1FromCardCache::_max_regions = 0; size_t G1FromCardCache::_static_mem_size = 0; -void G1FromCardCache::initialize(uint n_par_rs, uint max_num_regions) { +void G1FromCardCache::initialize(uint num_par_rem_sets, uint max_num_regions) { + guarantee(max_num_regions > 0, "Heap size must be valid"); guarantee(_cache == NULL, "Should not call this multiple times"); _max_regions = max_num_regions; - _cache = Padded2DArray::create_unfreeable(n_par_rs, + _cache = Padded2DArray::create_unfreeable(num_par_rem_sets, _max_regions, &_static_mem_size); @@ -47,9 +48,10 @@ void G1FromCardCache::invalidate(uint start_idx, size_t new_num_regions) { guarantee((size_t)start_idx + new_num_regions <= max_uintx, "Trying to invalidate beyond maximum region, from %u size " SIZE_FORMAT, start_idx, new_num_regions); - for (uint i = 0; i < HeapRegionRemSet::num_par_rem_sets(); i++) { - uint end_idx = (start_idx + (uint)new_num_regions); - assert(end_idx <= _max_regions, "Must be within max."); + uint end_idx = (start_idx + (uint)new_num_regions); + assert(end_idx <= _max_regions, "Must be within max."); + + for (uint i = 0; i < G1RemSet::num_par_rem_sets(); i++) { for (uint j = start_idx; j < end_idx; j++) { set(i, j, InvalidCard); } @@ -58,7 +60,7 @@ void G1FromCardCache::invalidate(uint start_idx, size_t new_num_regions) { #ifndef PRODUCT void G1FromCardCache::print(outputStream* out) { - for (uint i = 0; i < HeapRegionRemSet::num_par_rem_sets(); i++) { + for (uint i = 0; i < G1RemSet::num_par_rem_sets(); i++) { for (uint j = 0; j < _max_regions; j++) { out->print_cr("_from_card_cache[%u][%u] = %d.", i, j, at(i, j)); @@ -68,7 +70,7 @@ void G1FromCardCache::print(outputStream* out) { #endif void G1FromCardCache::clear(uint region_idx) { - uint num_par_remsets = HeapRegionRemSet::num_par_rem_sets(); + uint num_par_remsets = G1RemSet::num_par_rem_sets(); for (uint i = 0; i < num_par_remsets; i++) { set(i, region_idx, InvalidCard); } diff --git a/hotspot/src/share/vm/gc/g1/g1FromCardCache.hpp b/hotspot/src/share/vm/gc/g1/g1FromCardCache.hpp index 5515d73638e..67c8ec65a52 100644 --- a/hotspot/src/share/vm/gc/g1/g1FromCardCache.hpp +++ b/hotspot/src/share/vm/gc/g1/g1FromCardCache.hpp @@ -65,7 +65,7 @@ class G1FromCardCache : public AllStatic { _cache[worker_id][region_idx] = val; } - static void initialize(uint n_par_rs, uint max_num_regions); + static void initialize(uint num_par_rem_sets, uint max_num_regions); static void invalidate(uint start_idx, size_t num_regions); diff --git a/hotspot/src/share/vm/gc/g1/g1RemSet.cpp b/hotspot/src/share/vm/gc/g1/g1RemSet.cpp index 01493ef58e2..699388513a8 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSet.cpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSet.cpp @@ -25,9 +25,11 @@ #include "precompiled.hpp" #include "gc/g1/concurrentG1Refine.hpp" #include "gc/g1/concurrentG1RefineThread.hpp" +#include "gc/g1/dirtyCardQueue.hpp" #include "gc/g1/g1BlockOffsetTable.inline.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectorPolicy.hpp" +#include "gc/g1/g1FromCardCache.hpp" #include "gc/g1/g1GCPhaseTimes.hpp" #include "gc/g1/g1HotCardCache.hpp" #include "gc/g1/g1OopClosures.inline.hpp" @@ -76,6 +78,14 @@ G1RemSet::~G1RemSet() { FREE_C_HEAP_ARRAY(G1ParPushHeapRSClosure*, _cset_rs_update_cl); } +uint G1RemSet::num_par_rem_sets() { + return MAX2(DirtyCardQueueSet::num_par_ids() + ConcurrentG1Refine::thread_num(), ParallelGCThreads); +} + +void G1RemSet::initialize(uint max_regions) { + G1FromCardCache::initialize(num_par_rem_sets(), max_regions); +} + ScanRSClosure::ScanRSClosure(G1ParPushHeapRSClosure* oc, CodeBlobClosure* code_root_cl, uint worker_i) : diff --git a/hotspot/src/share/vm/gc/g1/g1RemSet.hpp b/hotspot/src/share/vm/gc/g1/g1RemSet.hpp index c0453a1db38..6c987945a18 100644 --- a/hotspot/src/share/vm/gc/g1/g1RemSet.hpp +++ b/hotspot/src/share/vm/gc/g1/g1RemSet.hpp @@ -75,6 +75,16 @@ protected: G1ParPushHeapRSClosure** _cset_rs_update_cl; public: + // Gives an approximation on how many threads can be expected to add records to + // a remembered set in parallel. This can be used for sizing data structures to + // decrease performance losses due to data structure sharing. + // Examples for quantities that influence this value are the maximum number of + // mutator threads, maximum number of concurrent refinement or GC threads. + static uint num_par_rem_sets(); + + // Initialize data that depends on the heap size being known. + static void initialize(uint max_regions); + // This is called to reset dual hash tables after the gc pause // is finished and the initial hash table is no longer being // scanned. diff --git a/hotspot/src/share/vm/gc/g1/heapRegion.cpp b/hotspot/src/share/vm/gc/g1/heapRegion.cpp index a393f22be9e..5ba5df6446d 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegion.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegion.cpp @@ -258,7 +258,6 @@ HeapRegion::HeapRegion(uint hrm_index, _predicted_bytes_to_copy(0) { _rem_set = new HeapRegionRemSet(sharedOffsetArray, this); - assert(HeapRegionRemSet::num_par_rem_sets() > 0, "Invariant."); initialize(mr); } diff --git a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp index 270225a7e1f..0514663b918 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp @@ -687,13 +687,6 @@ OtherRegionsTable::do_cleanup_work(HRRSCleanupTask* hrrs_cleanup_task) { _sparse_table.do_cleanup_work(hrrs_cleanup_task); } -// Determines how many threads can add records to an rset in parallel. -// This can be done by either mutator threads together with the -// concurrent refinement threads or GC threads. -uint HeapRegionRemSet::num_par_rem_sets() { - return MAX2(DirtyCardQueueSet::num_par_ids() + ConcurrentG1Refine::thread_num(), ParallelGCThreads); -} - HeapRegionRemSet::HeapRegionRemSet(G1BlockOffsetSharedArray* bosa, HeapRegion* hr) : _bosa(bosa), diff --git a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp index 3906620f7a3..369d2aaaeed 100644 --- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp +++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp @@ -191,7 +191,6 @@ private: public: HeapRegionRemSet(G1BlockOffsetSharedArray* bosa, HeapRegion* hr); - static uint num_par_rem_sets(); static void setup_remset_size(); bool is_empty() const { @@ -321,12 +320,6 @@ public: // Called during a stop-world phase to perform any deferred cleanups. static void cleanup(); - // Declare the heap size (in # of regions) to the HeapRegionRemSet(s). - // (Uses it to initialize from_card_cache). - static void init_heap(uint max_regions) { - G1FromCardCache::initialize(num_par_rem_sets(), max_regions); - } - static void invalidate_from_card_cache(uint start_idx, size_t num_regions) { G1FromCardCache::invalidate(start_idx, num_regions); } From d6e95be627adc7581699426ef0697e13880cd71c Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Tue, 22 Dec 2015 11:03:37 +0100 Subject: [PATCH 125/146] 8145774: Move scrubbing setup code away out of ConcurrentMark Remove dependency of ConcurrentMark to G1RemSet. Reviewed-by: jmasa, mgerdin --- hotspot/src/share/vm/gc/g1/concurrentMark.cpp | 28 ++----------------- .../src/share/vm/gc/g1/g1CollectedHeap.cpp | 27 ++++++++++++++++++ .../src/share/vm/gc/g1/g1CollectedHeap.hpp | 2 ++ 3 files changed, 31 insertions(+), 26 deletions(-) diff --git a/hotspot/src/share/vm/gc/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc/g1/concurrentMark.cpp index 8024a3a2b09..7c805879930 100644 --- a/hotspot/src/share/vm/gc/g1/concurrentMark.cpp +++ b/hotspot/src/share/vm/gc/g1/concurrentMark.cpp @@ -32,10 +32,8 @@ #include "gc/g1/g1CollectorPolicy.hpp" #include "gc/g1/g1CollectorState.hpp" #include "gc/g1/g1OopClosures.inline.hpp" -#include "gc/g1/g1RemSet.hpp" #include "gc/g1/g1StringDedup.hpp" #include "gc/g1/heapRegion.inline.hpp" -#include "gc/g1/heapRegionManager.inline.hpp" #include "gc/g1/heapRegionRemSet.hpp" #include "gc/g1/heapRegionSet.inline.hpp" #include "gc/g1/suspendibleThreadSet.hpp" @@ -1595,24 +1593,6 @@ public: } }; -class G1ParScrubRemSetTask: public AbstractGangTask { -protected: - G1RemSet* _g1rs; - BitMap* _region_bm; - BitMap* _card_bm; - HeapRegionClaimer _hrclaimer; - -public: - G1ParScrubRemSetTask(G1CollectedHeap* g1h, BitMap* region_bm, BitMap* card_bm, uint n_workers) : - AbstractGangTask("G1 ScrubRS"), _g1rs(g1h->g1_rem_set()), _region_bm(region_bm), _card_bm(card_bm), _hrclaimer(n_workers) { - } - - void work(uint worker_id) { - _g1rs->scrub(_region_bm, _card_bm, worker_id, &_hrclaimer); - } - -}; - void ConcurrentMark::cleanup() { // world is stopped at this checkpoint assert(SafepointSynchronize::is_at_safepoint(), @@ -1700,12 +1680,8 @@ void ConcurrentMark::cleanup() { // regions. if (G1ScrubRemSets) { double rs_scrub_start = os::elapsedTime(); - G1ParScrubRemSetTask g1_par_scrub_rs_task(g1h, &_region_bm, &_card_bm, n_workers); - g1h->workers()->run_task(&g1_par_scrub_rs_task); - - double rs_scrub_end = os::elapsedTime(); - double this_rs_scrub_time = (rs_scrub_end - rs_scrub_start); - _total_rs_scrub_time += this_rs_scrub_time; + g1h->scrub_rem_set(&_region_bm, &_card_bm); + _total_rs_scrub_time += (os::elapsedTime() - rs_scrub_start); } // this will also free any regions totally full of garbage objects, diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp index 21e68b4b70a..f8705d626bf 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp @@ -5411,6 +5411,33 @@ bool G1CollectedHeap::check_cset_fast_test() { } #endif // PRODUCT +class G1ParScrubRemSetTask: public AbstractGangTask { +protected: + G1RemSet* _g1rs; + BitMap* _region_bm; + BitMap* _card_bm; + HeapRegionClaimer _hrclaimer; + +public: + G1ParScrubRemSetTask(G1RemSet* g1_rs, BitMap* region_bm, BitMap* card_bm, uint num_workers) : + AbstractGangTask("G1 ScrubRS"), + _g1rs(g1_rs), + _region_bm(region_bm), + _card_bm(card_bm), + _hrclaimer(num_workers) { + } + + void work(uint worker_id) { + _g1rs->scrub(_region_bm, _card_bm, worker_id, &_hrclaimer); + } +}; + +void G1CollectedHeap::scrub_rem_set(BitMap* region_bm, BitMap* card_bm) { + uint num_workers = workers()->active_workers(); + G1ParScrubRemSetTask g1_par_scrub_rs_task(g1_rem_set(), region_bm, card_bm, num_workers); + workers()->run_task(&g1_par_scrub_rs_task); +} + void G1CollectedHeap::cleanUpCardTable() { G1SATBCardTableModRefBS* ct_bs = g1_barrier_set(); double start = os::elapsedTime(); diff --git a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp index b6d0dd3e762..2ba6704bf8d 100644 --- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp +++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp @@ -984,6 +984,8 @@ public: // The rem set and barrier set. G1RemSet* g1_rem_set() const { return _g1_rem_set; } + void scrub_rem_set(BitMap* region_bm, BitMap* card_bm); + unsigned get_gc_time_stamp() { return _gc_time_stamp; } From 357e0e5ff9bd05db2b2b502657f0b28b2f9398d5 Mon Sep 17 00:00:00 2001 From: Christian Tornqvist Date: Tue, 22 Dec 2015 05:26:55 -0800 Subject: [PATCH 126/146] 8048521: Remove obsolete code from os_windows.cpp/hpp Reviewed-by: coleenp, rdurbin --- .../os/windows/vm/attachListener_windows.cpp | 3 +- hotspot/src/os/windows/vm/jvm_windows.h | 12 - hotspot/src/os/windows/vm/os_windows.cpp | 602 +++++------------- hotspot/src/os/windows/vm/os_windows.hpp | 77 --- .../src/os/windows/vm/os_windows.inline.hpp | 5 +- .../src/os/windows/vm/perfMemory_windows.cpp | 30 +- 6 files changed, 158 insertions(+), 571 deletions(-) diff --git a/hotspot/src/os/windows/vm/attachListener_windows.cpp b/hotspot/src/os/windows/vm/attachListener_windows.cpp index 4550cd1eb1c..eaa46b0f776 100644 --- a/hotspot/src/os/windows/vm/attachListener_windows.cpp +++ b/hotspot/src/os/windows/vm/attachListener_windows.cpp @@ -378,9 +378,8 @@ int AttachListener::pd_init() { return Win32AttachListener::init(); } -// always startup on Windows NT/2000/XP bool AttachListener::init_at_startup() { - return os::win32::is_nt(); + return true; } // no trigger mechanism on Windows to start Attach Listener lazily diff --git a/hotspot/src/os/windows/vm/jvm_windows.h b/hotspot/src/os/windows/vm/jvm_windows.h index 183bf94ce80..e5ec82dca90 100644 --- a/hotspot/src/os/windows/vm/jvm_windows.h +++ b/hotspot/src/os/windows/vm/jvm_windows.h @@ -44,19 +44,7 @@ #include -#if _MSC_VER <= 1200 -// Psapi.h doesn't come with Visual Studio 6; it can be downloaded as Platform -// SDK from Microsoft. Here are the definitions copied from Psapi.h -typedef struct _MODULEINFO { - LPVOID lpBaseOfDll; - DWORD SizeOfImage; - LPVOID EntryPoint; -} MODULEINFO, *LPMODULEINFO; - -#else #include -#endif - #include typedef int socklen_t; diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index d384aa48df0..5229d1478bc 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -320,8 +320,7 @@ int os::get_native_stack(address* stack, int frames, int toSkip) { #ifdef _NMT_NOINLINE_ toSkip++; #endif - int captured = Kernel32Dll::RtlCaptureStackBackTrace(toSkip + 1, frames, - (PVOID*)stack, NULL); + int captured = RtlCaptureStackBackTrace(toSkip + 1, frames, (PVOID*)stack, NULL); for (int index = captured; index < frames; index ++) { stack[index] = NULL; } @@ -597,10 +596,6 @@ bool os::create_thread(Thread* thread, ThreadType thr_type, // document because JVM uses C runtime library. The good news is that the // flag appears to work with _beginthredex() as well. -#ifndef STACK_SIZE_PARAM_IS_A_RESERVATION - #define STACK_SIZE_PARAM_IS_A_RESERVATION (0x10000) -#endif - HANDLE thread_handle = (HANDLE)_beginthreadex(NULL, (unsigned)stack_size, @@ -608,17 +603,7 @@ bool os::create_thread(Thread* thread, ThreadType thr_type, thread, CREATE_SUSPENDED | STACK_SIZE_PARAM_IS_A_RESERVATION, &thread_id); - if (thread_handle == NULL) { - // perhaps STACK_SIZE_PARAM_IS_A_RESERVATION is not supported, try again - // without the flag. - thread_handle = - (HANDLE)_beginthreadex(NULL, - (unsigned)stack_size, - (unsigned (__stdcall *)(void*)) java_start, - thread, - CREATE_SUSPENDED, - &thread_id); - } + if (thread_handle == NULL) { // Need to clean up stuff we've allocated so far CloseHandle(osthread->interrupt_event()); @@ -664,24 +649,13 @@ jlong as_long(LARGE_INTEGER x) { jlong os::elapsed_counter() { LARGE_INTEGER count; - if (win32::_has_performance_count) { - QueryPerformanceCounter(&count); - return as_long(count) - initial_performance_count; - } else { - FILETIME wt; - GetSystemTimeAsFileTime(&wt); - return (jlong_from(wt.dwHighDateTime, wt.dwLowDateTime) - first_filetime); - } + QueryPerformanceCounter(&count); + return as_long(count) - initial_performance_count; } jlong os::elapsed_frequency() { - if (win32::_has_performance_count) { - return performance_frequency; - } else { - // the FILETIME time is the number of 100-nanosecond intervals since January 1,1601. - return 10000000; - } + return performance_frequency; } @@ -717,11 +691,6 @@ bool os::has_allocatable_memory_limit(julong* limit) { #endif } -// VC6 lacks DWORD_PTR -#if _MSC_VER < 1300 -typedef UINT_PTR DWORD_PTR; -#endif - int os::active_processor_count() { DWORD_PTR lpProcessAffinityMask = 0; DWORD_PTR lpSystemAffinityMask = 0; @@ -778,17 +747,10 @@ bool os::bind_to_processor(uint processor_id) { void os::win32::initialize_performance_counter() { LARGE_INTEGER count; - if (QueryPerformanceFrequency(&count)) { - win32::_has_performance_count = 1; - performance_frequency = as_long(count); - QueryPerformanceCounter(&count); - initial_performance_count = as_long(count); - } else { - win32::_has_performance_count = 0; - FILETIME wt; - GetSystemTimeAsFileTime(&wt); - first_filetime = jlong_from(wt.dwHighDateTime, wt.dwLowDateTime); - } + QueryPerformanceFrequency(&count); + performance_frequency = as_long(count); + QueryPerformanceCounter(&count); + initial_performance_count = as_long(count); } @@ -894,48 +856,35 @@ void os::javaTimeSystemUTC(jlong &seconds, jlong &nanos) { } jlong os::javaTimeNanos() { - if (!win32::_has_performance_count) { - return javaTimeMillis() * NANOSECS_PER_MILLISEC; // the best we can do. - } else { LARGE_INTEGER current_count; QueryPerformanceCounter(¤t_count); double current = as_long(current_count); double freq = performance_frequency; jlong time = (jlong)((current/freq) * NANOSECS_PER_SEC); return time; - } } void os::javaTimeNanos_info(jvmtiTimerInfo *info_ptr) { - if (!win32::_has_performance_count) { - // javaTimeMillis() doesn't have much percision, - // but it is not going to wrap -- so all 64 bits + jlong freq = performance_frequency; + if (freq < NANOSECS_PER_SEC) { + // the performance counter is 64 bits and we will + // be multiplying it -- so no wrap in 64 bits info_ptr->max_value = ALL_64_BITS; - - // this is a wall clock timer, so may skip - info_ptr->may_skip_backward = true; - info_ptr->may_skip_forward = true; + } else if (freq > NANOSECS_PER_SEC) { + // use the max value the counter can reach to + // determine the max value which could be returned + julong max_counter = (julong)ALL_64_BITS; + info_ptr->max_value = (jlong)(max_counter / (freq / NANOSECS_PER_SEC)); } else { - jlong freq = performance_frequency; - if (freq < NANOSECS_PER_SEC) { - // the performance counter is 64 bits and we will - // be multiplying it -- so no wrap in 64 bits - info_ptr->max_value = ALL_64_BITS; - } else if (freq > NANOSECS_PER_SEC) { - // use the max value the counter can reach to - // determine the max value which could be returned - julong max_counter = (julong)ALL_64_BITS; - info_ptr->max_value = (jlong)(max_counter / (freq / NANOSECS_PER_SEC)); - } else { - // the performance counter is 64 bits and we will - // be using it directly -- so no wrap in 64 bits - info_ptr->max_value = ALL_64_BITS; - } - - // using a counter, so no skipping - info_ptr->may_skip_backward = false; - info_ptr->may_skip_forward = false; + // the performance counter is 64 bits and we will + // be using it directly -- so no wrap in 64 bits + info_ptr->max_value = ALL_64_BITS; } + + // using a counter, so no skipping + info_ptr->may_skip_backward = false; + info_ptr->may_skip_forward = false; + info_ptr->kind = JVMTI_TIMER_ELAPSED; // elapsed not CPU time } @@ -1068,14 +1017,8 @@ void os::abort(bool dump_core, void* siginfo, const void* context) { win32::exit_process_or_thread(win32::EPT_PROCESS, 1); } - dumpType = (MINIDUMP_TYPE)(MiniDumpWithFullMemory | MiniDumpWithHandleData); - - // Older versions of dbghelp.h do not contain all the dumptypes we want, dbghelp.h with - // API_VERSION_NUMBER 11 or higher contains the ones we want though -#if API_VERSION_NUMBER >= 11 - dumpType = (MINIDUMP_TYPE)(dumpType | MiniDumpWithFullMemoryInfo | MiniDumpWithThreadInfo | - MiniDumpWithUnloadedModules); -#endif + dumpType = (MINIDUMP_TYPE)(MiniDumpWithFullMemory | MiniDumpWithHandleData | + MiniDumpWithFullMemoryInfo | MiniDumpWithThreadInfo | MiniDumpWithUnloadedModules); if (siginfo != NULL && context != NULL) { ep.ContextRecord = (PCONTEXT) context; @@ -1308,7 +1251,7 @@ static bool _addr_in_ntdll(address addr) { hmod = GetModuleHandle("NTDLL.DLL"); if (hmod == NULL) return false; - if (!os::PSApiDll::GetModuleInformation(GetCurrentProcess(), hmod, + if (!GetModuleInformation(GetCurrentProcess(), hmod, &minfo, sizeof(MODULEINFO))) { return false; } @@ -1552,18 +1495,13 @@ int os::get_loaded_modules_info(os::LoadedModulesCallbackFunc callback, void *pa static char filename[MAX_PATH]; int result = 0; - if (!os::PSApiDll::PSApiAvailable()) { - return 0; - } - int pid = os::current_process_id(); hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid); if (hProcess == NULL) return 0; DWORD size_needed; - if (!os::PSApiDll::EnumProcessModules(hProcess, modules, - sizeof(modules), &size_needed)) { + if (!EnumProcessModules(hProcess, modules, sizeof(modules), &size_needed)) { CloseHandle(hProcess); return 0; } @@ -1573,14 +1511,12 @@ int os::get_loaded_modules_info(os::LoadedModulesCallbackFunc callback, void *pa for (int i = 0; i < MIN2(num_modules, MAX_NUM_MODULES); i++) { // Get Full pathname: - if (!os::PSApiDll::GetModuleFileNameEx(hProcess, modules[i], - filename, sizeof(filename))) { + if (!GetModuleFileNameEx(hProcess, modules[i], filename, sizeof(filename))) { filename[0] = '\0'; } MODULEINFO modinfo; - if (!os::PSApiDll::GetModuleInformation(hProcess, modules[i], - &modinfo, sizeof(modinfo))) { + if (!GetModuleInformation(hProcess, modules[i], &modinfo, sizeof(modinfo))) { modinfo.lpBaseOfDll = NULL; modinfo.SizeOfImage = 0; } @@ -1749,7 +1685,7 @@ void os::win32::print_windows_version(outputStream* st) { // find out whether we are running on 64 bit processor or not SYSTEM_INFO si; ZeroMemory(&si, sizeof(SYSTEM_INFO)); - os::Kernel32Dll::GetNativeSystemInfo(&si); + GetNativeSystemInfo(&si); if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) { st->print(" , 64 bit"); } @@ -2536,80 +2472,68 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) { // Handle potential stack overflows up front. if (exception_code == EXCEPTION_STACK_OVERFLOW) { - if (os::uses_stack_guard_pages()) { #ifdef _M_IA64 - // Use guard page for register stack. - PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord; - address addr = (address) exceptionRecord->ExceptionInformation[1]; - // Check for a register stack overflow on Itanium - if (thread->addr_inside_register_stack_red_zone(addr)) { - // Fatal red zone violation happens if the Java program - // catches a StackOverflow error and does so much processing - // that it runs beyond the unprotected yellow guard zone. As - // a result, we are out of here. - fatal("ERROR: Unrecoverable stack overflow happened. JVM will exit."); - } else if(thread->addr_inside_register_stack(addr)) { - // Disable the yellow zone which sets the state that - // we've got a stack overflow problem. - if (thread->stack_yellow_reserved_zone_enabled()) { - thread->disable_stack_yellow_reserved_zone(); - } - // Give us some room to process the exception. - thread->disable_register_stack_guard(); - // Tracing with +Verbose. - if (Verbose) { - tty->print_cr("SOF Compiled Register Stack overflow at " INTPTR_FORMAT " (SIGSEGV)", pc); - tty->print_cr("Register Stack access at " INTPTR_FORMAT, addr); - tty->print_cr("Register Stack base " INTPTR_FORMAT, thread->register_stack_base()); - tty->print_cr("Register Stack [" INTPTR_FORMAT "," INTPTR_FORMAT "]", - thread->register_stack_base(), - thread->register_stack_base() + thread->stack_size()); - } - - // Reguard the permanent register stack red zone just to be sure. - // We saw Windows silently disabling this without telling us. - thread->enable_register_stack_red_zone(); - - return Handle_Exception(exceptionInfo, - SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW)); - } -#endif - if (thread->stack_guards_enabled()) { - if (_thread_in_Java) { - frame fr; - PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord; - address addr = (address) exceptionRecord->ExceptionInformation[1]; - if (os::win32::get_frame_at_stack_banging_point(thread, exceptionInfo, pc, &fr)) { - assert(fr.is_java_frame(), "Must be a Java frame"); - SharedRuntime::look_for_reserved_stack_annotated_method(thread, fr); - } - } - // Yellow zone violation. The o/s has unprotected the first yellow - // zone page for us. Note: must call disable_stack_yellow_zone to - // update the enabled status, even if the zone contains only one page. + // Use guard page for register stack. + PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord; + address addr = (address) exceptionRecord->ExceptionInformation[1]; + // Check for a register stack overflow on Itanium + if (thread->addr_inside_register_stack_red_zone(addr)) { + // Fatal red zone violation happens if the Java program + // catches a StackOverflow error and does so much processing + // that it runs beyond the unprotected yellow guard zone. As + // a result, we are out of here. + fatal("ERROR: Unrecoverable stack overflow happened. JVM will exit."); + } else if(thread->addr_inside_register_stack(addr)) { + // Disable the yellow zone which sets the state that + // we've got a stack overflow problem. + if (thread->stack_yellow_reserved_zone_enabled()) { thread->disable_stack_yellow_reserved_zone(); - // If not in java code, return and hope for the best. - return in_java - ? Handle_Exception(exceptionInfo, SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW)) - : EXCEPTION_CONTINUE_EXECUTION; - } else { - // Fatal red zone violation. - thread->disable_stack_red_zone(); - tty->print_raw_cr("An unrecoverable stack overflow has occurred."); - report_error(t, exception_code, pc, exceptionInfo->ExceptionRecord, - exceptionInfo->ContextRecord); - return EXCEPTION_CONTINUE_SEARCH; } - } else if (in_java) { - // JVM-managed guard pages cannot be used on win95/98. The o/s provides - // a one-time-only guard page, which it has released to us. The next - // stack overflow on this thread will result in an ACCESS_VIOLATION. + // Give us some room to process the exception. + thread->disable_register_stack_guard(); + // Tracing with +Verbose. + if (Verbose) { + tty->print_cr("SOF Compiled Register Stack overflow at " INTPTR_FORMAT " (SIGSEGV)", pc); + tty->print_cr("Register Stack access at " INTPTR_FORMAT, addr); + tty->print_cr("Register Stack base " INTPTR_FORMAT, thread->register_stack_base()); + tty->print_cr("Register Stack [" INTPTR_FORMAT "," INTPTR_FORMAT "]", + thread->register_stack_base(), + thread->register_stack_base() + thread->stack_size()); + } + + // Reguard the permanent register stack red zone just to be sure. + // We saw Windows silently disabling this without telling us. + thread->enable_register_stack_red_zone(); + return Handle_Exception(exceptionInfo, SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW)); + } +#endif + if (thread->stack_guards_enabled()) { + if (_thread_in_Java) { + frame fr; + PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord; + address addr = (address) exceptionRecord->ExceptionInformation[1]; + if (os::win32::get_frame_at_stack_banging_point(thread, exceptionInfo, pc, &fr)) { + assert(fr.is_java_frame(), "Must be a Java frame"); + SharedRuntime::look_for_reserved_stack_annotated_method(thread, fr); + } + } + // Yellow zone violation. The o/s has unprotected the first yellow + // zone page for us. Note: must call disable_stack_yellow_zone to + // update the enabled status, even if the zone contains only one page. + thread->disable_stack_yellow_reserved_zone(); + // If not in java code, return and hope for the best. + return in_java + ? Handle_Exception(exceptionInfo, SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW)) + : EXCEPTION_CONTINUE_EXECUTION; } else { - // Can only return and hope for the best. Further stack growth will - // result in an ACCESS_VIOLATION. - return EXCEPTION_CONTINUE_EXECUTION; + // Fatal red zone violation. + thread->disable_stack_red_zone(); + tty->print_raw_cr("An unrecoverable stack overflow has occurred."); + report_error(t, exception_code, pc, exceptionInfo->ExceptionRecord, + exceptionInfo->ContextRecord); + return EXCEPTION_CONTINUE_SEARCH; } } else if (exception_code == EXCEPTION_ACCESS_VIOLATION) { // Either stack overflow or null pointer exception. @@ -2679,9 +2603,7 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) { #else // !IA64 - // Windows 98 reports faulting addresses incorrectly - if (!MacroAssembler::needs_explicit_null_check((intptr_t)addr) || - !os::win32::is_nt()) { + if (!MacroAssembler::needs_explicit_null_check((intptr_t)addr)) { address stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL); if (stub != NULL) return Handle_Exception(exceptionInfo, stub); } @@ -2870,12 +2792,12 @@ class NUMANodeListHolder { DWORD_PTR sys_aff_mask; if (!GetProcessAffinityMask(GetCurrentProcess(), &proc_aff_mask, &sys_aff_mask)) return false; ULONG highest_node_number; - if (!os::Kernel32Dll::GetNumaHighestNodeNumber(&highest_node_number)) return false; + if (!GetNumaHighestNodeNumber(&highest_node_number)) return false; free_node_list(); _numa_used_node_list = NEW_C_HEAP_ARRAY(int, highest_node_number + 1, mtInternal); for (unsigned int i = 0; i <= highest_node_number; i++) { ULONGLONG proc_mask_numa_node; - if (!os::Kernel32Dll::GetNumaNodeProcessorMask(i, &proc_mask_numa_node)) return false; + if (!GetNumaNodeProcessorMask(i, &proc_mask_numa_node)) return false; if ((proc_aff_mask & proc_mask_numa_node)!=0) { _numa_used_node_list[_numa_used_node_count++] = i; } @@ -2895,19 +2817,14 @@ class NUMANodeListHolder { static size_t _large_page_size = 0; -static bool resolve_functions_for_large_page_init() { - return os::Kernel32Dll::GetLargePageMinimumAvailable() && - os::Advapi32Dll::AdvapiAvailable(); -} - static bool request_lock_memory_privilege() { _hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, os::current_process_id()); LUID luid; if (_hProcess != NULL && - os::Advapi32Dll::OpenProcessToken(_hProcess, TOKEN_ADJUST_PRIVILEGES, &_hToken) && - os::Advapi32Dll::LookupPrivilegeValue(NULL, "SeLockMemoryPrivilege", &luid)) { + OpenProcessToken(_hProcess, TOKEN_ADJUST_PRIVILEGES, &_hToken) && + LookupPrivilegeValue(NULL, "SeLockMemoryPrivilege", &luid)) { TOKEN_PRIVILEGES tp; tp.PrivilegeCount = 1; @@ -2916,7 +2833,7 @@ static bool request_lock_memory_privilege() { // AdjustTokenPrivileges() may return TRUE even when it couldn't change the // privilege. Check GetLastError() too. See MSDN document. - if (os::Advapi32Dll::AdjustTokenPrivileges(_hToken, false, &tp, sizeof(tp), NULL, NULL) && + if (AdjustTokenPrivileges(_hToken, false, &tp, sizeof(tp), NULL, NULL) && (GetLastError() == ERROR_SUCCESS)) { return true; } @@ -2944,21 +2861,17 @@ static bool numa_interleaving_init() { size_t min_interleave_granularity = UseLargePages ? _large_page_size : os::vm_allocation_granularity(); NUMAInterleaveGranularity = align_size_up(NUMAInterleaveGranularity, min_interleave_granularity); - if (os::Kernel32Dll::NumaCallsAvailable()) { - if (numa_node_list_holder.build()) { - if (PrintMiscellaneous && Verbose) { - tty->print("NUMA UsedNodeCount=%d, namely ", numa_node_list_holder.get_count()); - for (int i = 0; i < numa_node_list_holder.get_count(); i++) { - tty->print("%d ", numa_node_list_holder.get_node_list_entry(i)); - } - tty->print("\n"); + if (numa_node_list_holder.build()) { + if (PrintMiscellaneous && Verbose) { + tty->print("NUMA UsedNodeCount=%d, namely ", numa_node_list_holder.get_count()); + for (int i = 0; i < numa_node_list_holder.get_count(); i++) { + tty->print("%d ", numa_node_list_holder.get_node_list_entry(i)); } - success = true; - } else { - WARN("Process does not cover multiple NUMA nodes."); + tty->print("\n"); } + success = true; } else { - WARN("NUMA Interleaving is not supported by the operating system."); + WARN("Process does not cover multiple NUMA nodes."); } if (!success) { if (use_numa_interleaving_specified) WARN("...Ignoring UseNUMAInterleaving flag."); @@ -3045,12 +2958,7 @@ static char* allocate_pages_individually(size_t bytes, char* addr, DWORD flags, // get the next node to use from the used_node_list assert(numa_node_list_holder.get_count() > 0, "Multiple NUMA nodes expected"); DWORD node = numa_node_list_holder.get_node_list_entry(count % numa_node_list_holder.get_count()); - p_new = (char *)os::Kernel32Dll::VirtualAllocExNuma(hProc, - next_alloc_addr, - bytes_to_rq, - flags, - prot, - node); + p_new = (char *)VirtualAllocExNuma(hProc, next_alloc_addr, bytes_to_rq, flags, prot, node); } } @@ -3103,32 +3011,28 @@ void os::large_page_init() { bool success = false; #define WARN(msg) if (warn_on_failure) { warning(msg); } - if (resolve_functions_for_large_page_init()) { - if (request_lock_memory_privilege()) { - size_t s = os::Kernel32Dll::GetLargePageMinimum(); - if (s) { + if (request_lock_memory_privilege()) { + size_t s = GetLargePageMinimum(); + if (s) { #if defined(IA32) || defined(AMD64) - if (s > 4*M || LargePageSizeInBytes > 4*M) { - WARN("JVM cannot use large pages bigger than 4mb."); - } else { -#endif - if (LargePageSizeInBytes && LargePageSizeInBytes % s == 0) { - _large_page_size = LargePageSizeInBytes; - } else { - _large_page_size = s; - } - success = true; -#if defined(IA32) || defined(AMD64) - } -#endif + if (s > 4*M || LargePageSizeInBytes > 4*M) { + WARN("JVM cannot use large pages bigger than 4mb."); } else { - WARN("Large page is not supported by the processor."); +#endif + if (LargePageSizeInBytes && LargePageSizeInBytes % s == 0) { + _large_page_size = LargePageSizeInBytes; + } else { + _large_page_size = s; + } + success = true; +#if defined(IA32) || defined(AMD64) } +#endif } else { - WARN("JVM cannot use large page memory because it does not have enough privilege to lock pages in memory."); + WARN("Large page is not supported by the processor."); } } else { - WARN("Large page is not supported by the operating system."); + WARN("JVM cannot use large page memory because it does not have enough privilege to lock pages in memory."); } #undef WARN @@ -3605,13 +3509,8 @@ void os::infinite_sleep() { typedef BOOL (WINAPI * STTSignature)(void); void os::naked_yield() { - // Use either SwitchToThread() or Sleep(0) // Consider passing back the return value from SwitchToThread(). - if (os::Kernel32Dll::SwitchToThreadAvailable()) { - SwitchToThread(); - } else { - Sleep(0); - } + SwitchToThread(); } // Win32 only gives you access to seven real priorities at a time, @@ -3773,15 +3672,12 @@ size_t os::win32::_default_stack_size = 0; intx os::win32::_os_thread_limit = 0; volatile intx os::win32::_os_thread_count = 0; -bool os::win32::_is_nt = false; -bool os::win32::_is_windows_2003 = false; bool os::win32::_is_windows_server = false; // 6573254 // Currently, the bug is observed across all the supported Windows releases, // including the latest one (as of this writing - Windows Server 2012 R2) bool os::win32::_has_exit_bug = true; -bool os::win32::_has_performance_count = 0; void os::win32::initialize_system_info() { SYSTEM_INFO si; @@ -3804,14 +3700,9 @@ void os::win32::initialize_system_info() { oi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); GetVersionEx((OSVERSIONINFO*)&oi); switch (oi.dwPlatformId) { - case VER_PLATFORM_WIN32_WINDOWS: _is_nt = false; break; case VER_PLATFORM_WIN32_NT: - _is_nt = true; { int os_vers = oi.dwMajorVersion * 1000 + oi.dwMinorVersion; - if (os_vers == 5002) { - _is_windows_2003 = true; - } if (oi.wProductType == VER_NT_DOMAIN_CONTROLLER || oi.wProductType == VER_NT_SERVER) { _is_windows_server = true; @@ -4091,8 +3982,7 @@ void os::init(void) { init_page_sizes((size_t) win32::vm_page_size()); // This may be overridden later when argument processing is done. - FLAG_SET_ERGO(bool, UseLargePagesIndividualAllocation, - os::win32::is_windows_2003()); + FLAG_SET_ERGO(bool, UseLargePagesIndividualAllocation, false); // Initialize main_process and main_thread main_process = GetCurrentProcess(); // Remember main_process is a pseudo handle @@ -4341,22 +4231,18 @@ jlong os::current_thread_cpu_time(bool user_sys_cpu_time) { jlong os::thread_cpu_time(Thread* thread, bool user_sys_cpu_time) { // This code is copy from clasic VM -> hpi::sysThreadCPUTime // If this function changes, os::is_thread_cpu_time_supported() should too - if (os::win32::is_nt()) { - FILETIME CreationTime; - FILETIME ExitTime; - FILETIME KernelTime; - FILETIME UserTime; + FILETIME CreationTime; + FILETIME ExitTime; + FILETIME KernelTime; + FILETIME UserTime; - if (GetThreadTimes(thread->osthread()->thread_handle(), &CreationTime, - &ExitTime, &KernelTime, &UserTime) == 0) { - return -1; - } else if (user_sys_cpu_time) { - return (FT2INT64(UserTime) + FT2INT64(KernelTime)) * 100; - } else { - return FT2INT64(UserTime) * 100; - } + if (GetThreadTimes(thread->osthread()->thread_handle(), &CreationTime, + &ExitTime, &KernelTime, &UserTime) == 0) { + return -1; + } else if (user_sys_cpu_time) { + return (FT2INT64(UserTime) + FT2INT64(KernelTime)) * 100; } else { - return (jlong) timeGetTime() * 1000000; + return FT2INT64(UserTime) * 100; } } @@ -4376,20 +4262,16 @@ void os::thread_cpu_time_info(jvmtiTimerInfo *info_ptr) { bool os::is_thread_cpu_time_supported() { // see os::thread_cpu_time - if (os::win32::is_nt()) { - FILETIME CreationTime; - FILETIME ExitTime; - FILETIME KernelTime; - FILETIME UserTime; + FILETIME CreationTime; + FILETIME ExitTime; + FILETIME KernelTime; + FILETIME UserTime; - if (GetThreadTimes(GetCurrentThread(), &CreationTime, &ExitTime, - &KernelTime, &UserTime) == 0) { - return false; - } else { - return true; - } - } else { + if (GetThreadTimes(GetCurrentThread(), &CreationTime, &ExitTime, + &KernelTime, &UserTime) == 0) { return false; + } else { + return true; } } @@ -5341,13 +5223,7 @@ bool os::is_headless_jre() { return false; } static jint initSock() { WSADATA wsadata; - if (!os::WinSock2Dll::WinSock2Available()) { - jio_fprintf(stderr, "Could not load Winsock (error: %d)\n", - ::GetLastError()); - return JNI_ERR; - } - - if (os::WinSock2Dll::WSAStartup(MAKEWORD(2,2), &wsadata) != 0) { + if (WSAStartup(MAKEWORD(2,2), &wsadata) != 0) { jio_fprintf(stderr, "Could not initialize Winsock (error: %d)\n", ::GetLastError()); return JNI_ERR; @@ -5356,7 +5232,7 @@ static jint initSock() { } struct hostent* os::get_host_by_name(char* name) { - return (struct hostent*)os::WinSock2Dll::gethostbyname(name); + return (struct hostent*)gethostbyname(name); } int os::socket_close(int fd) { @@ -5448,95 +5324,6 @@ void os::SuspendedThreadTask::internal_do_task() { CloseHandle(h); } - -// Kernel32 API -typedef SIZE_T (WINAPI* GetLargePageMinimum_Fn)(void); -typedef LPVOID (WINAPI *VirtualAllocExNuma_Fn)(HANDLE, LPVOID, SIZE_T, DWORD, DWORD, DWORD); -typedef BOOL (WINAPI *GetNumaHighestNodeNumber_Fn)(PULONG); -typedef BOOL (WINAPI *GetNumaNodeProcessorMask_Fn)(UCHAR, PULONGLONG); -typedef USHORT (WINAPI* RtlCaptureStackBackTrace_Fn)(ULONG, ULONG, PVOID*, PULONG); - -GetLargePageMinimum_Fn os::Kernel32Dll::_GetLargePageMinimum = NULL; -VirtualAllocExNuma_Fn os::Kernel32Dll::_VirtualAllocExNuma = NULL; -GetNumaHighestNodeNumber_Fn os::Kernel32Dll::_GetNumaHighestNodeNumber = NULL; -GetNumaNodeProcessorMask_Fn os::Kernel32Dll::_GetNumaNodeProcessorMask = NULL; -RtlCaptureStackBackTrace_Fn os::Kernel32Dll::_RtlCaptureStackBackTrace = NULL; - - -BOOL os::Kernel32Dll::initialized = FALSE; -SIZE_T os::Kernel32Dll::GetLargePageMinimum() { - assert(initialized && _GetLargePageMinimum != NULL, - "GetLargePageMinimumAvailable() not yet called"); - return _GetLargePageMinimum(); -} - -BOOL os::Kernel32Dll::GetLargePageMinimumAvailable() { - if (!initialized) { - initialize(); - } - return _GetLargePageMinimum != NULL; -} - -BOOL os::Kernel32Dll::NumaCallsAvailable() { - if (!initialized) { - initialize(); - } - return _VirtualAllocExNuma != NULL; -} - -LPVOID os::Kernel32Dll::VirtualAllocExNuma(HANDLE hProc, LPVOID addr, - SIZE_T bytes, DWORD flags, - DWORD prot, DWORD node) { - assert(initialized && _VirtualAllocExNuma != NULL, - "NUMACallsAvailable() not yet called"); - - return _VirtualAllocExNuma(hProc, addr, bytes, flags, prot, node); -} - -BOOL os::Kernel32Dll::GetNumaHighestNodeNumber(PULONG ptr_highest_node_number) { - assert(initialized && _GetNumaHighestNodeNumber != NULL, - "NUMACallsAvailable() not yet called"); - - return _GetNumaHighestNodeNumber(ptr_highest_node_number); -} - -BOOL os::Kernel32Dll::GetNumaNodeProcessorMask(UCHAR node, - PULONGLONG proc_mask) { - assert(initialized && _GetNumaNodeProcessorMask != NULL, - "NUMACallsAvailable() not yet called"); - - return _GetNumaNodeProcessorMask(node, proc_mask); -} - -USHORT os::Kernel32Dll::RtlCaptureStackBackTrace(ULONG FrameToSkip, - ULONG FrameToCapture, - PVOID* BackTrace, - PULONG BackTraceHash) { - if (!initialized) { - initialize(); - } - - if (_RtlCaptureStackBackTrace != NULL) { - return _RtlCaptureStackBackTrace(FrameToSkip, FrameToCapture, - BackTrace, BackTraceHash); - } else { - return 0; - } -} - -void os::Kernel32Dll::initializeCommon() { - if (!initialized) { - HMODULE handle = ::GetModuleHandle("Kernel32.dll"); - assert(handle != NULL, "Just check"); - _GetLargePageMinimum = (GetLargePageMinimum_Fn)::GetProcAddress(handle, "GetLargePageMinimum"); - _VirtualAllocExNuma = (VirtualAllocExNuma_Fn)::GetProcAddress(handle, "VirtualAllocExNuma"); - _GetNumaHighestNodeNumber = (GetNumaHighestNodeNumber_Fn)::GetProcAddress(handle, "GetNumaHighestNodeNumber"); - _GetNumaNodeProcessorMask = (GetNumaNodeProcessorMask_Fn)::GetProcAddress(handle, "GetNumaNodeProcessorMask"); - _RtlCaptureStackBackTrace = (RtlCaptureStackBackTrace_Fn)::GetProcAddress(handle, "RtlCaptureStackBackTrace"); - initialized = TRUE; - } -} - bool os::start_debugging(char *buf, int buflen) { int len = (int)strlen(buf); char *p = &buf[len]; @@ -5563,111 +5350,6 @@ bool os::start_debugging(char *buf, int buflen) { return yes; } -void os::Kernel32Dll::initialize() { - initializeCommon(); -} - - -// Kernel32 API -inline BOOL os::Kernel32Dll::SwitchToThread() { - return ::SwitchToThread(); -} - -inline BOOL os::Kernel32Dll::SwitchToThreadAvailable() { - return true; -} - -// Help tools -inline BOOL os::Kernel32Dll::HelpToolsAvailable() { - return true; -} - -inline HANDLE os::Kernel32Dll::CreateToolhelp32Snapshot(DWORD dwFlags, - DWORD th32ProcessId) { - return ::CreateToolhelp32Snapshot(dwFlags, th32ProcessId); -} - -inline BOOL os::Kernel32Dll::Module32First(HANDLE hSnapshot, - LPMODULEENTRY32 lpme) { - return ::Module32First(hSnapshot, lpme); -} - -inline BOOL os::Kernel32Dll::Module32Next(HANDLE hSnapshot, - LPMODULEENTRY32 lpme) { - return ::Module32Next(hSnapshot, lpme); -} - -inline void os::Kernel32Dll::GetNativeSystemInfo(LPSYSTEM_INFO lpSystemInfo) { - ::GetNativeSystemInfo(lpSystemInfo); -} - -// PSAPI API -inline BOOL os::PSApiDll::EnumProcessModules(HANDLE hProcess, - HMODULE *lpModule, DWORD cb, - LPDWORD lpcbNeeded) { - return ::EnumProcessModules(hProcess, lpModule, cb, lpcbNeeded); -} - -inline DWORD os::PSApiDll::GetModuleFileNameEx(HANDLE hProcess, - HMODULE hModule, - LPTSTR lpFilename, - DWORD nSize) { - return ::GetModuleFileNameEx(hProcess, hModule, lpFilename, nSize); -} - -inline BOOL os::PSApiDll::GetModuleInformation(HANDLE hProcess, - HMODULE hModule, - LPMODULEINFO lpmodinfo, - DWORD cb) { - return ::GetModuleInformation(hProcess, hModule, lpmodinfo, cb); -} - -inline BOOL os::PSApiDll::PSApiAvailable() { - return true; -} - - -// WinSock2 API -inline BOOL os::WinSock2Dll::WSAStartup(WORD wVersionRequested, - LPWSADATA lpWSAData) { - return ::WSAStartup(wVersionRequested, lpWSAData); -} - -inline struct hostent* os::WinSock2Dll::gethostbyname(const char *name) { - return ::gethostbyname(name); -} - -inline BOOL os::WinSock2Dll::WinSock2Available() { - return true; -} - -// Advapi API -inline BOOL os::Advapi32Dll::AdjustTokenPrivileges(HANDLE TokenHandle, - BOOL DisableAllPrivileges, - PTOKEN_PRIVILEGES NewState, - DWORD BufferLength, - PTOKEN_PRIVILEGES PreviousState, - PDWORD ReturnLength) { - return ::AdjustTokenPrivileges(TokenHandle, DisableAllPrivileges, NewState, - BufferLength, PreviousState, ReturnLength); -} - -inline BOOL os::Advapi32Dll::OpenProcessToken(HANDLE ProcessHandle, - DWORD DesiredAccess, - PHANDLE TokenHandle) { - return ::OpenProcessToken(ProcessHandle, DesiredAccess, TokenHandle); -} - -inline BOOL os::Advapi32Dll::LookupPrivilegeValue(LPCTSTR lpSystemName, - LPCTSTR lpName, - PLUID lpLuid) { - return ::LookupPrivilegeValue(lpSystemName, lpName, lpLuid); -} - -inline BOOL os::Advapi32Dll::AdvapiAvailable() { - return true; -} - void* os::get_default_process_handle() { return (void*)GetModuleHandle(NULL); } diff --git a/hotspot/src/os/windows/vm/os_windows.hpp b/hotspot/src/os/windows/vm/os_windows.hpp index 58abc3510fd..5bef412f904 100644 --- a/hotspot/src/os/windows/vm/os_windows.hpp +++ b/hotspot/src/os/windows/vm/os_windows.hpp @@ -45,11 +45,8 @@ class win32 { static int _processor_level; static julong _physical_memory; static size_t _default_stack_size; - static bool _is_nt; - static bool _is_windows_2003; static bool _is_windows_server; static bool _has_exit_bug; - static bool _has_performance_count; static void print_windows_version(outputStream* st); @@ -60,9 +57,7 @@ class win32 { // Processor info as provided by NT static int processor_type() { return _processor_type; } - // Processor level may not be accurate on non-NT systems static int processor_level() { - assert(is_nt(), "use vm_version instead"); return _processor_level; } static julong available_memory(); @@ -85,15 +80,9 @@ class win32 { static intx _os_thread_limit; static volatile intx _os_thread_count; - // Tells whether the platform is NT or Windown95 - static bool is_nt() { return _is_nt; } - // Tells whether this is a server version of Windows static bool is_windows_server() { return _is_windows_server; } - // Tells whether the platform is Windows 2003 - static bool is_windows_2003() { return _is_windows_2003; } - // Tells whether there can be the race bug during process exit on this platform static bool has_exit_bug() { return _has_exit_bug; } @@ -187,70 +176,4 @@ class PlatformParker : public CHeapObj { } ; -class WinSock2Dll: AllStatic { -public: - static BOOL WSAStartup(WORD, LPWSADATA); - static struct hostent* gethostbyname(const char *name); - static BOOL WinSock2Available(); -}; - -class Kernel32Dll: AllStatic { -public: - static BOOL SwitchToThread(); - static SIZE_T GetLargePageMinimum(); - - static BOOL SwitchToThreadAvailable(); - static BOOL GetLargePageMinimumAvailable(); - - // Help tools - static BOOL HelpToolsAvailable(); - static HANDLE CreateToolhelp32Snapshot(DWORD,DWORD); - static BOOL Module32First(HANDLE,LPMODULEENTRY32); - static BOOL Module32Next(HANDLE,LPMODULEENTRY32); - - static void GetNativeSystemInfo(LPSYSTEM_INFO); - - // NUMA calls - static BOOL NumaCallsAvailable(); - static LPVOID VirtualAllocExNuma(HANDLE, LPVOID, SIZE_T, DWORD, DWORD, DWORD); - static BOOL GetNumaHighestNodeNumber(PULONG); - static BOOL GetNumaNodeProcessorMask(UCHAR, PULONGLONG); - - // Stack walking - static USHORT RtlCaptureStackBackTrace(ULONG, ULONG, PVOID*, PULONG); - -private: - // GetLargePageMinimum available on Windows Vista/Windows Server 2003 - // and later - // NUMA calls available Windows Vista/WS2008 and later - - static SIZE_T (WINAPI *_GetLargePageMinimum)(void); - static LPVOID (WINAPI *_VirtualAllocExNuma) (HANDLE, LPVOID, SIZE_T, DWORD, DWORD, DWORD); - static BOOL (WINAPI *_GetNumaHighestNodeNumber) (PULONG); - static BOOL (WINAPI *_GetNumaNodeProcessorMask) (UCHAR, PULONGLONG); - static USHORT (WINAPI *_RtlCaptureStackBackTrace)(ULONG, ULONG, PVOID*, PULONG); - static BOOL initialized; - - static void initialize(); - static void initializeCommon(); -}; - -class Advapi32Dll: AllStatic { -public: - static BOOL AdjustTokenPrivileges(HANDLE, BOOL, PTOKEN_PRIVILEGES, DWORD, PTOKEN_PRIVILEGES, PDWORD); - static BOOL OpenProcessToken(HANDLE, DWORD, PHANDLE); - static BOOL LookupPrivilegeValue(LPCTSTR, LPCTSTR, PLUID); - - static BOOL AdvapiAvailable(); -}; - -class PSApiDll: AllStatic { -public: - static BOOL EnumProcessModules(HANDLE, HMODULE *, DWORD, LPDWORD); - static DWORD GetModuleFileNameEx(HANDLE, HMODULE, LPTSTR, DWORD); - static BOOL GetModuleInformation(HANDLE, HMODULE, LPMODULEINFO, DWORD); - - static BOOL PSApiAvailable(); -}; - #endif // OS_WINDOWS_VM_OS_WINDOWS_HPP diff --git a/hotspot/src/os/windows/vm/os_windows.inline.hpp b/hotspot/src/os/windows/vm/os_windows.inline.hpp index be0b9e94a9b..09590cf9ca4 100644 --- a/hotspot/src/os/windows/vm/os_windows.inline.hpp +++ b/hotspot/src/os/windows/vm/os_windows.inline.hpp @@ -50,11 +50,10 @@ inline bool os::obsolete_option(const JavaVMOption *option) { } inline bool os::uses_stack_guard_pages() { - return os::win32::is_nt(); + return true; } inline bool os::allocate_stack_guard_pages() { - assert(uses_stack_guard_pages(), "sanity check"); return true; } @@ -98,7 +97,7 @@ inline int os::close(int fd) { } inline bool os::supports_monotonic_clock() { - return win32::_has_performance_count; + return true; } inline void os::exit(int num) { diff --git a/hotspot/src/os/windows/vm/perfMemory_windows.cpp b/hotspot/src/os/windows/vm/perfMemory_windows.cpp index 74ebe7d6f8a..8987ef1fb5b 100644 --- a/hotspot/src/os/windows/vm/perfMemory_windows.cpp +++ b/hotspot/src/os/windows/vm/perfMemory_windows.cpp @@ -1308,25 +1308,21 @@ static HANDLE create_sharedmem_resources(const char* dirname, const char* filena // the file. This is important as the apis do not allow a terminating // JVM being monitored by another process to remove the file name. // - // the FILE_SHARE_DELETE share mode is valid only in winnt - // fh = CreateFile( - filename, /* LPCTSTR file name */ + filename, /* LPCTSTR file name */ - GENERIC_READ|GENERIC_WRITE, /* DWORD desired access */ + GENERIC_READ|GENERIC_WRITE, /* DWORD desired access */ + FILE_SHARE_DELETE|FILE_SHARE_READ, /* DWORD share mode, future READONLY + * open operations allowed + */ + lpFileSA, /* LPSECURITY security attributes */ + CREATE_ALWAYS, /* DWORD creation disposition + * create file, if it already + * exists, overwrite it. + */ + FILE_FLAG_DELETE_ON_CLOSE, /* DWORD flags and attributes */ - (os::win32::is_nt() ? FILE_SHARE_DELETE : 0)| - FILE_SHARE_READ, /* DWORD share mode, future READONLY - * open operations allowed - */ - lpFileSA, /* LPSECURITY security attributes */ - CREATE_ALWAYS, /* DWORD creation disposition - * create file, if it already - * exists, overwrite it. - */ - FILE_FLAG_DELETE_ON_CLOSE, /* DWORD flags and attributes */ - - NULL); /* HANDLE template file access */ + NULL); /* HANDLE template file access */ free_security_attr(lpFileSA); @@ -1734,7 +1730,7 @@ void delete_shared_memory(char* addr, size_t size) { // void PerfMemory::create_memory_region(size_t size) { - if (PerfDisableSharedMem || !os::win32::is_nt()) { + if (PerfDisableSharedMem) { // do not share the memory for the performance data. PerfDisableSharedMem = true; _start = create_standard_memory(size); From ac0d55c188f314d1ccedefe1324c595ce17d103e Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Tue, 22 Dec 2015 11:11:29 -0500 Subject: [PATCH 127/146] 8074457: Remove the non-Zero CPP Interpreter Remove cppInterpreter assembly files and reorganize InterpreterGenerator includes Reviewed-by: goetz, bdelsart --- .../vm/bytecodeInterpreter_aarch64.cpp | 48 - .../vm/bytecodeInterpreter_aarch64.hpp | 116 - .../vm/bytecodeInterpreter_aarch64.inline.hpp | 286 -- .../src/cpu/aarch64/vm/c2_globals_aarch64.hpp | 6 +- .../vm/cppInterpreterGenerator_aarch64.hpp | 35 - hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp | 36 - hotspot/src/cpu/aarch64/vm/frame_aarch64.hpp | 48 - .../cpu/aarch64/vm/frame_aarch64.inline.hpp | 55 - .../cpu/aarch64/vm/interp_masm_aarch64.cpp | 18 +- .../cpu/aarch64/vm/interp_masm_aarch64.hpp | 18 +- .../vm/interpreterGenerator_aarch64.hpp | 56 - .../cpu/aarch64/vm/interpreter_aarch64.cpp | 8 +- .../cpu/aarch64/vm/interpreter_aarch64.hpp | 43 - .../cpu/aarch64/vm/macroAssembler_aarch64.hpp | 17 +- .../templateInterpreterGenerator_aarch64.cpp | 45 +- .../templateInterpreterGenerator_aarch64.hpp | 35 - .../vm/templateInterpreter_aarch64.cpp | 8 +- .../vm/templateInterpreter_aarch64.hpp | 39 - .../cpu/aarch64/vm/templateTable_aarch64.cpp | 3 - .../src/cpu/ppc/vm/globalDefinitions_ppc.hpp | 2 +- .../cpu/ppc/vm/interpreterGenerator_ppc.hpp | 42 - hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp | 6 +- hotspot/src/cpu/ppc/vm/interpreter_ppc.hpp | 48 - .../vm/templateInterpreterGenerator_ppc.cpp | 21 +- .../vm/templateInterpreterGenerator_ppc.hpp | 43 - .../cpu/ppc/vm/templateInterpreter_ppc.cpp | 8 +- .../cpu/ppc/vm/templateInterpreter_ppc.hpp | 44 - .../sparc/vm/bytecodeInterpreter_sparc.cpp | 45 - .../sparc/vm/bytecodeInterpreter_sparc.hpp | 104 - .../vm/bytecodeInterpreter_sparc.inline.hpp | 338 --- hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp | 4 - .../vm/cppInterpreterGenerator_sparc.hpp | 40 - .../src/cpu/sparc/vm/cppInterpreter_sparc.cpp | 2201 ---------------- .../src/cpu/sparc/vm/cppInterpreter_sparc.hpp | 44 - hotspot/src/cpu/sparc/vm/frame_sparc.cpp | 18 - hotspot/src/cpu/sparc/vm/frame_sparc.hpp | 30 +- .../src/cpu/sparc/vm/frame_sparc.inline.hpp | 70 - .../src/cpu/sparc/vm/interp_masm_sparc.cpp | 44 - .../src/cpu/sparc/vm/interp_masm_sparc.hpp | 13 - .../sparc/vm/interpreterGenerator_sparc.hpp | 51 - .../src/cpu/sparc/vm/interpreter_sparc.cpp | 8 +- .../src/cpu/sparc/vm/interpreter_sparc.hpp | 41 - .../src/cpu/sparc/vm/macroAssembler_sparc.cpp | 12 - .../src/cpu/sparc/vm/macroAssembler_sparc.hpp | 43 +- .../sparc/vm/register_definitions_sparc.cpp | 15 +- .../vm/templateInterpreterGenerator_sparc.cpp | 39 +- .../vm/templateInterpreterGenerator_sparc.hpp | 34 - .../sparc/vm/templateInterpreter_sparc.cpp | 15 +- .../sparc/vm/templateInterpreter_sparc.hpp | 45 - .../src/cpu/sparc/vm/templateTable_sparc.cpp | 2 - .../cpu/x86/vm/bytecodeInterpreter_x86.cpp | 49 - .../cpu/x86/vm/bytecodeInterpreter_x86.hpp | 115 - .../x86/vm/bytecodeInterpreter_x86.inline.hpp | 285 -- hotspot/src/cpu/x86/vm/c2_globals_x86.hpp | 4 - .../x86/vm/cppInterpreterGenerator_x86.hpp | 39 - hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp | 2314 ----------------- hotspot/src/cpu/x86/vm/cppInterpreter_x86.hpp | 38 - hotspot/src/cpu/x86/vm/frame_x86.cpp | 38 - hotspot/src/cpu/x86/vm/frame_x86.hpp | 10 - hotspot/src/cpu/x86/vm/frame_x86.inline.hpp | 55 - hotspot/src/cpu/x86/vm/interp_masm_x86.cpp | 25 +- hotspot/src/cpu/x86/vm/interp_masm_x86.hpp | 18 - .../cpu/x86/vm/interpreterGenerator_x86.cpp | 8 +- .../cpu/x86/vm/interpreterGenerator_x86.hpp | 56 - hotspot/src/cpu/x86/vm/interpreter_x86.hpp | 45 - hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp | 4 +- hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp | 4 +- hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp | 2 - hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp | 15 +- .../src/cpu/x86/vm/sharedRuntime_x86_32.cpp | 32 - .../src/cpu/x86/vm/sharedRuntime_x86_64.cpp | 22 - .../vm/templateInterpreterGenerator_x86.cpp | 39 +- .../vm/templateInterpreterGenerator_x86.hpp | 34 - .../templateInterpreterGenerator_x86_32.cpp | 20 +- .../templateInterpreterGenerator_x86_64.cpp | 12 +- .../cpu/x86/vm/templateInterpreter_x86.cpp | 15 +- .../cpu/x86/vm/templateInterpreter_x86.hpp | 42 - hotspot/src/cpu/x86/vm/templateTable_x86.cpp | 4 - .../zero/vm/cppInterpreterGenerator_zero.hpp | 47 - .../src/cpu/zero/vm/cppInterpreter_zero.cpp | 44 +- hotspot/src/cpu/zero/vm/frame_zero.inline.hpp | 7 +- .../cpu/zero/vm/interpreterGenerator_zero.hpp | 46 - hotspot/src/cpu/zero/vm/interpreter_zero.cpp | 6 +- hotspot/src/cpu/zero/vm/interpreter_zero.hpp | 54 - .../src/cpu/zero/vm/methodHandles_zero.cpp | 12 +- .../vm/templateInterpreterGenerator_zero.hpp | 31 - .../cpu/zero/vm/templateInterpreter_zero.cpp | 49 - .../cpu/zero/vm/templateInterpreter_zero.hpp | 31 - .../src/cpu/zero/vm/templateTable_zero.cpp | 39 - .../src/cpu/zero/vm/templateTable_zero.hpp | 31 - .../vm/interpreter/abstractInterpreter.hpp | 35 +- .../vm/interpreter/bytecodeHistogram.hpp | 4 +- .../vm/interpreter/bytecodeInterpreter.hpp | 21 +- .../bytecodeInterpreter.inline.hpp | 20 +- .../share/vm/interpreter/cppInterpreter.cpp | 116 +- .../share/vm/interpreter/cppInterpreter.hpp | 57 +- .../interpreter/cppInterpreterGenerator.hpp | 58 +- .../src/share/vm/interpreter/interpreter.cpp | 87 +- .../src/share/vm/interpreter/interpreter.hpp | 32 +- .../vm/interpreter/interpreterGenerator.hpp | 69 - .../vm/interpreter/interpreterRuntime.hpp | 2 +- .../vm/interpreter/templateInterpreter.cpp | 92 +- .../vm/interpreter/templateInterpreter.hpp | 32 +- .../templateInterpreterGenerator.hpp | 66 +- .../share/vm/interpreter/templateTable.hpp | 2 - hotspot/src/share/vm/prims/methodHandles.hpp | 6 + hotspot/src/share/vm/runtime/arguments.cpp | 2 +- hotspot/src/share/vm/runtime/frame.inline.hpp | 9 +- .../src/share/vm/runtime/javaFrameAnchor.hpp | 3 +- 109 files changed, 480 insertions(+), 8364 deletions(-) delete mode 100644 hotspot/src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.cpp delete mode 100644 hotspot/src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.hpp delete mode 100644 hotspot/src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.inline.hpp delete mode 100644 hotspot/src/cpu/aarch64/vm/cppInterpreterGenerator_aarch64.hpp delete mode 100644 hotspot/src/cpu/aarch64/vm/interpreterGenerator_aarch64.hpp delete mode 100644 hotspot/src/cpu/aarch64/vm/interpreter_aarch64.hpp delete mode 100644 hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.hpp delete mode 100644 hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.hpp delete mode 100644 hotspot/src/cpu/ppc/vm/interpreterGenerator_ppc.hpp delete mode 100644 hotspot/src/cpu/ppc/vm/interpreter_ppc.hpp delete mode 100644 hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.hpp delete mode 100644 hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp delete mode 100644 hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.cpp delete mode 100644 hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp delete mode 100644 hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.inline.hpp delete mode 100644 hotspot/src/cpu/sparc/vm/cppInterpreterGenerator_sparc.hpp delete mode 100644 hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp delete mode 100644 hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.hpp delete mode 100644 hotspot/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp delete mode 100644 hotspot/src/cpu/sparc/vm/interpreter_sparc.hpp delete mode 100644 hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.hpp delete mode 100644 hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.hpp delete mode 100644 hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp delete mode 100644 hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.hpp delete mode 100644 hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp delete mode 100644 hotspot/src/cpu/x86/vm/cppInterpreterGenerator_x86.hpp delete mode 100644 hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp delete mode 100644 hotspot/src/cpu/x86/vm/cppInterpreter_x86.hpp delete mode 100644 hotspot/src/cpu/x86/vm/interpreterGenerator_x86.hpp delete mode 100644 hotspot/src/cpu/x86/vm/interpreter_x86.hpp delete mode 100644 hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.hpp delete mode 100644 hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp delete mode 100644 hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp delete mode 100644 hotspot/src/cpu/zero/vm/interpreterGenerator_zero.hpp delete mode 100644 hotspot/src/cpu/zero/vm/interpreter_zero.hpp delete mode 100644 hotspot/src/cpu/zero/vm/templateInterpreterGenerator_zero.hpp delete mode 100644 hotspot/src/cpu/zero/vm/templateInterpreter_zero.cpp delete mode 100644 hotspot/src/cpu/zero/vm/templateInterpreter_zero.hpp delete mode 100644 hotspot/src/cpu/zero/vm/templateTable_zero.cpp delete mode 100644 hotspot/src/cpu/zero/vm/templateTable_zero.hpp delete mode 100644 hotspot/src/share/vm/interpreter/interpreterGenerator.hpp diff --git a/hotspot/src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.cpp deleted file mode 100644 index fd74244b0ba..00000000000 --- a/hotspot/src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "asm/assembler.hpp" -#include "interpreter/bytecodeInterpreter.hpp" -#include "interpreter/bytecodeInterpreter.inline.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "oops/methodData.hpp" -#include "oops/method.hpp" -#include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiThreadState.hpp" -#include "runtime/deoptimization.hpp" -#include "runtime/frame.inline.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/stubRoutines.hpp" -#include "runtime/synchronizer.hpp" -#include "runtime/vframeArray.hpp" -#include "utilities/debug.hpp" -#include "interp_masm_aarch64.hpp" - -#ifdef CC_INTERP - -#endif // CC_INTERP (all) diff --git a/hotspot/src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.hpp deleted file mode 100644 index 5b4405b7ecd..00000000000 --- a/hotspot/src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.hpp +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_AARCH64_VM_BYTECODEINTERPRETER_AARCH64_HPP -#define CPU_AARCH64_VM_BYTECODEINTERPRETER_AARCH64_HPP - -// Platform specific for C++ based Interpreter - -private: - - interpreterState _self_link; /* Previous interpreter state */ /* sometimes points to self??? */ - address _result_handler; /* temp for saving native result handler */ - intptr_t* _sender_sp; /* sender's sp before stack (locals) extension */ - - address _extra_junk1; /* temp to save on recompiles */ - address _extra_junk2; /* temp to save on recompiles */ - address _extra_junk3; /* temp to save on recompiles */ - // address dummy_for_native2; /* a native frame result handler would be here... */ - // address dummy_for_native1; /* native result type stored here in a interpreter native frame */ - address _extra_junk4; /* temp to save on recompiles */ - address _extra_junk5; /* temp to save on recompiles */ - address _extra_junk6; /* temp to save on recompiles */ -public: - // we have an interpreter frame... -inline intptr_t* sender_sp() { - return _sender_sp; -} - -// The interpreter always has the frame anchor fully setup so we don't -// have to do anything going to vm from the interpreter. On return -// we do have to clear the flags in case they we're modified to -// maintain the stack walking invariants. -// -#define SET_LAST_JAVA_FRAME() - -#define RESET_LAST_JAVA_FRAME() - -/* - * Macros for accessing the stack. - */ -#undef STACK_INT -#undef STACK_FLOAT -#undef STACK_ADDR -#undef STACK_OBJECT -#undef STACK_DOUBLE -#undef STACK_LONG - -// JavaStack Implementation - -#define GET_STACK_SLOT(offset) (*((intptr_t*) &topOfStack[-(offset)])) -#define STACK_SLOT(offset) ((address) &topOfStack[-(offset)]) -#define STACK_ADDR(offset) (*((address *) &topOfStack[-(offset)])) -#define STACK_INT(offset) (*((jint*) &topOfStack[-(offset)])) -#define STACK_FLOAT(offset) (*((jfloat *) &topOfStack[-(offset)])) -#define STACK_OBJECT(offset) (*((oop *) &topOfStack [-(offset)])) -#define STACK_DOUBLE(offset) (((VMJavaVal64*) &topOfStack[-(offset)])->d) -#define STACK_LONG(offset) (((VMJavaVal64 *) &topOfStack[-(offset)])->l) - -#define SET_STACK_SLOT(value, offset) (*(intptr_t*)&topOfStack[-(offset)] = *(intptr_t*)(value)) -#define SET_STACK_ADDR(value, offset) (*((address *)&topOfStack[-(offset)]) = (value)) -#define SET_STACK_INT(value, offset) (*((jint *)&topOfStack[-(offset)]) = (value)) -#define SET_STACK_FLOAT(value, offset) (*((jfloat *)&topOfStack[-(offset)]) = (value)) -#define SET_STACK_OBJECT(value, offset) (*((oop *)&topOfStack[-(offset)]) = (value)) -#define SET_STACK_DOUBLE(value, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->d = (value)) -#define SET_STACK_DOUBLE_FROM_ADDR(addr, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->d = \ - ((VMJavaVal64*)(addr))->d) -#define SET_STACK_LONG(value, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->l = (value)) -#define SET_STACK_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->l = \ - ((VMJavaVal64*)(addr))->l) -// JavaLocals implementation - -#define LOCALS_SLOT(offset) ((intptr_t*)&locals[-(offset)]) -#define LOCALS_ADDR(offset) ((address)locals[-(offset)]) -#define LOCALS_INT(offset) ((jint)(locals[-(offset)])) -#define LOCALS_FLOAT(offset) (*((jfloat*)&locals[-(offset)])) -#define LOCALS_OBJECT(offset) ((oop)locals[-(offset)]) -#define LOCALS_DOUBLE(offset) (((VMJavaVal64*)&locals[-((offset) + 1)])->d) -#define LOCALS_LONG(offset) (((VMJavaVal64*)&locals[-((offset) + 1)])->l) -#define LOCALS_LONG_AT(offset) (((address)&locals[-((offset) + 1)])) -#define LOCALS_DOUBLE_AT(offset) (((address)&locals[-((offset) + 1)])) - -#define SET_LOCALS_SLOT(value, offset) (*(intptr_t*)&locals[-(offset)] = *(intptr_t *)(value)) -#define SET_LOCALS_ADDR(value, offset) (*((address *)&locals[-(offset)]) = (value)) -#define SET_LOCALS_INT(value, offset) (*((jint *)&locals[-(offset)]) = (value)) -#define SET_LOCALS_FLOAT(value, offset) (*((jfloat *)&locals[-(offset)]) = (value)) -#define SET_LOCALS_OBJECT(value, offset) (*((oop *)&locals[-(offset)]) = (value)) -#define SET_LOCALS_DOUBLE(value, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->d = (value)) -#define SET_LOCALS_LONG(value, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = (value)) -#define SET_LOCALS_DOUBLE_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->d = \ - ((VMJavaVal64*)(addr))->d) -#define SET_LOCALS_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = \ - ((VMJavaVal64*)(addr))->l) - -#endif // CPU_AARCH64_VM_BYTECODEINTERPRETER_AARCH64_HPP diff --git a/hotspot/src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.inline.hpp b/hotspot/src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.inline.hpp deleted file mode 100644 index 7ffed4b95a5..00000000000 --- a/hotspot/src/cpu/aarch64/vm/bytecodeInterpreter_aarch64.inline.hpp +++ /dev/null @@ -1,286 +0,0 @@ -/* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_AARCH64_VM_BYTECODEINTERPRETER_AARCH64_INLINE_HPP -#define CPU_AARCH64_VM_BYTECODEINTERPRETER_AARCH64_INLINE_HPP - -// Inline interpreter functions for IA32 - -inline jfloat BytecodeInterpreter::VMfloatAdd(jfloat op1, jfloat op2) { return op1 + op2; } -inline jfloat BytecodeInterpreter::VMfloatSub(jfloat op1, jfloat op2) { return op1 - op2; } -inline jfloat BytecodeInterpreter::VMfloatMul(jfloat op1, jfloat op2) { return op1 * op2; } -inline jfloat BytecodeInterpreter::VMfloatDiv(jfloat op1, jfloat op2) { return op1 / op2; } -inline jfloat BytecodeInterpreter::VMfloatRem(jfloat op1, jfloat op2) { return fmod(op1, op2); } - -inline jfloat BytecodeInterpreter::VMfloatNeg(jfloat op) { return -op; } - -inline int32_t BytecodeInterpreter::VMfloatCompare(jfloat op1, jfloat op2, int32_t direction) { - return ( op1 < op2 ? -1 : - op1 > op2 ? 1 : - op1 == op2 ? 0 : - (direction == -1 || direction == 1) ? direction : 0); - -} - -inline void BytecodeInterpreter::VMmemCopy64(uint32_t to[2], const uint32_t from[2]) { - // x86 can do unaligned copies but not 64bits at a time - to[0] = from[0]; to[1] = from[1]; -} - -// The long operations depend on compiler support for "long long" on x86 - -inline jlong BytecodeInterpreter::VMlongAdd(jlong op1, jlong op2) { - return op1 + op2; -} - -inline jlong BytecodeInterpreter::VMlongAnd(jlong op1, jlong op2) { - return op1 & op2; -} - -inline jlong BytecodeInterpreter::VMlongDiv(jlong op1, jlong op2) { - // QQQ what about check and throw... - return op1 / op2; -} - -inline jlong BytecodeInterpreter::VMlongMul(jlong op1, jlong op2) { - return op1 * op2; -} - -inline jlong BytecodeInterpreter::VMlongOr(jlong op1, jlong op2) { - return op1 | op2; -} - -inline jlong BytecodeInterpreter::VMlongSub(jlong op1, jlong op2) { - return op1 - op2; -} - -inline jlong BytecodeInterpreter::VMlongXor(jlong op1, jlong op2) { - return op1 ^ op2; -} - -inline jlong BytecodeInterpreter::VMlongRem(jlong op1, jlong op2) { - return op1 % op2; -} - -inline jlong BytecodeInterpreter::VMlongUshr(jlong op1, jint op2) { - // CVM did this 0x3f mask, is the really needed??? QQQ - return ((unsigned long long) op1) >> (op2 & 0x3F); -} - -inline jlong BytecodeInterpreter::VMlongShr(jlong op1, jint op2) { - return op1 >> (op2 & 0x3F); -} - -inline jlong BytecodeInterpreter::VMlongShl(jlong op1, jint op2) { - return op1 << (op2 & 0x3F); -} - -inline jlong BytecodeInterpreter::VMlongNeg(jlong op) { - return -op; -} - -inline jlong BytecodeInterpreter::VMlongNot(jlong op) { - return ~op; -} - -inline int32_t BytecodeInterpreter::VMlongLtz(jlong op) { - return (op <= 0); -} - -inline int32_t BytecodeInterpreter::VMlongGez(jlong op) { - return (op >= 0); -} - -inline int32_t BytecodeInterpreter::VMlongEqz(jlong op) { - return (op == 0); -} - -inline int32_t BytecodeInterpreter::VMlongEq(jlong op1, jlong op2) { - return (op1 == op2); -} - -inline int32_t BytecodeInterpreter::VMlongNe(jlong op1, jlong op2) { - return (op1 != op2); -} - -inline int32_t BytecodeInterpreter::VMlongGe(jlong op1, jlong op2) { - return (op1 >= op2); -} - -inline int32_t BytecodeInterpreter::VMlongLe(jlong op1, jlong op2) { - return (op1 <= op2); -} - -inline int32_t BytecodeInterpreter::VMlongLt(jlong op1, jlong op2) { - return (op1 < op2); -} - -inline int32_t BytecodeInterpreter::VMlongGt(jlong op1, jlong op2) { - return (op1 > op2); -} - -inline int32_t BytecodeInterpreter::VMlongCompare(jlong op1, jlong op2) { - return (VMlongLt(op1, op2) ? -1 : VMlongGt(op1, op2) ? 1 : 0); -} - -// Long conversions - -inline jdouble BytecodeInterpreter::VMlong2Double(jlong val) { - return (jdouble) val; -} - -inline jfloat BytecodeInterpreter::VMlong2Float(jlong val) { - return (jfloat) val; -} - -inline jint BytecodeInterpreter::VMlong2Int(jlong val) { - return (jint) val; -} - -// Double Arithmetic - -inline jdouble BytecodeInterpreter::VMdoubleAdd(jdouble op1, jdouble op2) { - return op1 + op2; -} - -inline jdouble BytecodeInterpreter::VMdoubleDiv(jdouble op1, jdouble op2) { - // Divide by zero... QQQ - return op1 / op2; -} - -inline jdouble BytecodeInterpreter::VMdoubleMul(jdouble op1, jdouble op2) { - return op1 * op2; -} - -inline jdouble BytecodeInterpreter::VMdoubleNeg(jdouble op) { - return -op; -} - -inline jdouble BytecodeInterpreter::VMdoubleRem(jdouble op1, jdouble op2) { - return fmod(op1, op2); -} - -inline jdouble BytecodeInterpreter::VMdoubleSub(jdouble op1, jdouble op2) { - return op1 - op2; -} - -inline int32_t BytecodeInterpreter::VMdoubleCompare(jdouble op1, jdouble op2, int32_t direction) { - return ( op1 < op2 ? -1 : - op1 > op2 ? 1 : - op1 == op2 ? 0 : - (direction == -1 || direction == 1) ? direction : 0); -} - -// Double Conversions - -inline jfloat BytecodeInterpreter::VMdouble2Float(jdouble val) { - return (jfloat) val; -} - -// Float Conversions - -inline jdouble BytecodeInterpreter::VMfloat2Double(jfloat op) { - return (jdouble) op; -} - -// Integer Arithmetic - -inline jint BytecodeInterpreter::VMintAdd(jint op1, jint op2) { - return op1 + op2; -} - -inline jint BytecodeInterpreter::VMintAnd(jint op1, jint op2) { - return op1 & op2; -} - -inline jint BytecodeInterpreter::VMintDiv(jint op1, jint op2) { - /* it's possible we could catch this special case implicitly */ - if ((juint)op1 == 0x80000000 && op2 == -1) return op1; - else return op1 / op2; -} - -inline jint BytecodeInterpreter::VMintMul(jint op1, jint op2) { - return op1 * op2; -} - -inline jint BytecodeInterpreter::VMintNeg(jint op) { - return -op; -} - -inline jint BytecodeInterpreter::VMintOr(jint op1, jint op2) { - return op1 | op2; -} - -inline jint BytecodeInterpreter::VMintRem(jint op1, jint op2) { - /* it's possible we could catch this special case implicitly */ - if ((juint)op1 == 0x80000000 && op2 == -1) return 0; - else return op1 % op2; -} - -inline jint BytecodeInterpreter::VMintShl(jint op1, jint op2) { - return op1 << op2; -} - -inline jint BytecodeInterpreter::VMintShr(jint op1, jint op2) { - return op1 >> (op2 & 0x1f); -} - -inline jint BytecodeInterpreter::VMintSub(jint op1, jint op2) { - return op1 - op2; -} - -inline jint BytecodeInterpreter::VMintUshr(jint op1, jint op2) { - return ((juint) op1) >> (op2 & 0x1f); -} - -inline jint BytecodeInterpreter::VMintXor(jint op1, jint op2) { - return op1 ^ op2; -} - -inline jdouble BytecodeInterpreter::VMint2Double(jint val) { - return (jdouble) val; -} - -inline jfloat BytecodeInterpreter::VMint2Float(jint val) { - return (jfloat) val; -} - -inline jlong BytecodeInterpreter::VMint2Long(jint val) { - return (jlong) val; -} - -inline jchar BytecodeInterpreter::VMint2Char(jint val) { - return (jchar) val; -} - -inline jshort BytecodeInterpreter::VMint2Short(jint val) { - return (jshort) val; -} - -inline jbyte BytecodeInterpreter::VMint2Byte(jint val) { - return (jbyte) val; -} - -#endif // CPU_AARCH64_VM_BYTECODEINTERPRETER_AARCH64_INLINE_HPP diff --git a/hotspot/src/cpu/aarch64/vm/c2_globals_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/c2_globals_aarch64.hpp index 342f07bdb04..28d198225b4 100644 --- a/hotspot/src/cpu/aarch64/vm/c2_globals_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/c2_globals_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -40,11 +40,7 @@ define_pd_global(bool, InlineIntrinsics, true); define_pd_global(bool, PreferInterpreterNativeStubs, false); define_pd_global(bool, ProfileTraps, true); define_pd_global(bool, UseOnStackReplacement, true); -#ifdef CC_INTERP -define_pd_global(bool, ProfileInterpreter, false); -#else define_pd_global(bool, ProfileInterpreter, true); -#endif // CC_INTERP define_pd_global(bool, TieredCompilation, trueInTiered); define_pd_global(intx, CompileThreshold, 10000); define_pd_global(intx, BackEdgeThreshold, 100000); diff --git a/hotspot/src/cpu/aarch64/vm/cppInterpreterGenerator_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/cppInterpreterGenerator_aarch64.hpp deleted file mode 100644 index 662d2849efc..00000000000 --- a/hotspot/src/cpu/aarch64/vm/cppInterpreterGenerator_aarch64.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_AARCH64_VM_CPPINTERPRETERGENERATOR_AARCH64_HPP -#define CPU_AARCH64_VM_CPPINTERPRETERGENERATOR_AARCH64_HPP - - protected: - - void generate_more_monitors(); - void generate_deopt_handling(); - void lock_method(void); - -#endif // CPU_AARCH64_VM_CPPINTERPRETERGENERATOR_AARCH64_HPP diff --git a/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp index 141d9a8fa93..77664cba6b2 100644 --- a/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/frame_aarch64.cpp @@ -314,27 +314,6 @@ intptr_t* frame::entry_frame_argument_at(int offset) const { } // sender_sp -#ifdef CC_INTERP -intptr_t* frame::interpreter_frame_sender_sp() const { - assert(is_interpreted_frame(), "interpreted frame expected"); - // QQQ why does this specialize method exist if frame::sender_sp() does same thing? - // seems odd and if we always know interpreted vs. non then sender_sp() is really - // doing too much work. - return get_interpreterState()->sender_sp(); -} - -// monitor elements - -BasicObjectLock* frame::interpreter_frame_monitor_begin() const { - return get_interpreterState()->monitor_base(); -} - -BasicObjectLock* frame::interpreter_frame_monitor_end() const { - return (BasicObjectLock*) get_interpreterState()->stack_base(); -} - -#else // CC_INTERP - intptr_t* frame::interpreter_frame_sender_sp() const { assert(is_interpreted_frame(), "interpreted frame expected"); return (intptr_t*) at(interpreter_frame_sender_sp_offset); @@ -368,7 +347,6 @@ void frame::interpreter_frame_set_monitor_end(BasicObjectLock* value) { void frame::interpreter_frame_set_last_sp(intptr_t* sp) { *((intptr_t**)addr_at(interpreter_frame_last_sp_offset)) = sp; } -#endif // CC_INTERP frame frame::sender_for_entry_frame(RegisterMap* map) const { assert(map != NULL, "map must be set"); @@ -528,9 +506,6 @@ frame frame::sender(RegisterMap* map) const { } bool frame::is_interpreted_frame_valid(JavaThread* thread) const { -// QQQ -#ifdef CC_INTERP -#else assert(is_interpreted_frame(), "Not an interpreted frame"); // These are reasonable sanity checks if (fp() == 0 || (intptr_t(fp()) & (wordSize-1)) != 0) { @@ -584,17 +559,10 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const { if (locals > thread->stack_base() || locals < (address) fp()) return false; // We'd have to be pretty unlucky to be mislead at this point - -#endif // CC_INTERP return true; } BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result) { -#ifdef CC_INTERP - // Needed for JVMTI. The result should always be in the - // interpreterState object - interpreterState istate = get_interpreterState(); -#endif // CC_INTERP assert(is_interpreted_frame(), "interpreted frame expected"); Method* method = interpreter_frame_method(); BasicType type = method->result_type(); @@ -620,11 +588,7 @@ BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result) case T_ARRAY : { oop obj; if (method->is_native()) { -#ifdef CC_INTERP - obj = istate->_oop_temp; -#else obj = cast_to_oop(at(interpreter_frame_oop_temp_offset)); -#endif // CC_INTERP } else { oop* obj_p = (oop*)tos_addr; obj = (obj_p == NULL) ? (oop)NULL : *obj_p; diff --git a/hotspot/src/cpu/aarch64/vm/frame_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/frame_aarch64.hpp index 496bb0ed7af..d267036974e 100644 --- a/hotspot/src/cpu/aarch64/vm/frame_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/frame_aarch64.hpp @@ -63,44 +63,6 @@ // <- sender sp // ------------------------------ Asm interpreter ---------------------------------------- -// ------------------------------ C++ interpreter ---------------------------------------- -// -// Layout of C++ interpreter frame: (While executing in BytecodeInterpreter::run) -// -// <- SP (current esp/rsp) -// [local variables ] BytecodeInterpreter::run local variables -// ... BytecodeInterpreter::run local variables -// [local variables ] BytecodeInterpreter::run local variables -// [old frame pointer ] fp [ BytecodeInterpreter::run's ebp/rbp ] -// [return pc ] (return to frame manager) -// [interpreter_state* ] (arg to BytecodeInterpreter::run) -------------- -// [expression stack ] <- last_Java_sp | -// [... ] * <- interpreter_state.stack | -// [expression stack ] * <- interpreter_state.stack_base | -// [monitors ] \ | -// ... | monitor block size | -// [monitors ] / <- interpreter_state.monitor_base | -// [struct interpretState ] <-----------------------------------------| -// [return pc ] (return to callee of frame manager [1] -// [locals and parameters ] -// <- sender sp - -// [1] When the c++ interpreter calls a new method it returns to the frame -// manager which allocates a new frame on the stack. In that case there -// is no real callee of this newly allocated frame. The frame manager is -// aware of the additional frame(s) and will pop them as nested calls -// complete. Howevers tTo make it look good in the debugger the frame -// manager actually installs a dummy pc pointing to RecursiveInterpreterActivation -// with a fake interpreter_state* parameter to make it easy to debug -// nested calls. - -// Note that contrary to the layout for the assembly interpreter the -// expression stack allocated for the C++ interpreter is full sized. -// However this is not as bad as it seems as the interpreter frame_manager -// will truncate the unused space on succesive method calls. -// -// ------------------------------ C++ interpreter ---------------------------------------- - public: enum { pc_return_offset = 0, @@ -109,8 +71,6 @@ return_addr_offset = 1, sender_sp_offset = 2, -#ifndef CC_INTERP - // Interpreter frames interpreter_frame_oop_temp_offset = 3, // for native calls only @@ -127,8 +87,6 @@ interpreter_frame_monitor_block_top_offset = interpreter_frame_initial_sp_offset, interpreter_frame_monitor_block_bottom_offset = interpreter_frame_initial_sp_offset, -#endif // CC_INTERP - // Entry frames // n.b. these values are determined by the layout defined in // stubGenerator for the Java call stub @@ -193,13 +151,7 @@ // helper to update a map with callee-saved RBP static void update_map_with_saved_link(RegisterMap* map, intptr_t** link_addr); -#ifndef CC_INTERP // deoptimization support void interpreter_frame_set_last_sp(intptr_t* sp); -#endif // CC_INTERP - -#ifdef CC_INTERP - inline interpreterState get_interpreterState() const; -#endif // CC_INTERP #endif // CPU_AARCH64_VM_FRAME_AARCH64_HPP diff --git a/hotspot/src/cpu/aarch64/vm/frame_aarch64.inline.hpp b/hotspot/src/cpu/aarch64/vm/frame_aarch64.inline.hpp index 3288eef3dac..7fce68be5b9 100644 --- a/hotspot/src/cpu/aarch64/vm/frame_aarch64.inline.hpp +++ b/hotspot/src/cpu/aarch64/vm/frame_aarch64.inline.hpp @@ -157,59 +157,6 @@ inline intptr_t* frame::unextended_sp() const { return _unextended_sp; } inline address* frame::sender_pc_addr() const { return (address*) addr_at( return_addr_offset); } inline address frame::sender_pc() const { return *sender_pc_addr(); } -#ifdef CC_INTERP - -inline interpreterState frame::get_interpreterState() const { - return ((interpreterState)addr_at( -((int)sizeof(BytecodeInterpreter))/wordSize )); -} - -inline intptr_t* frame::sender_sp() const { - // Hmm this seems awfully expensive QQQ, is this really called with interpreted frames? - if (is_interpreted_frame()) { - assert(false, "should never happen"); - return get_interpreterState()->sender_sp(); - } else { - return addr_at(sender_sp_offset); - } -} - -inline intptr_t** frame::interpreter_frame_locals_addr() const { - assert(is_interpreted_frame(), "must be interpreted"); - return &(get_interpreterState()->_locals); -} - -inline intptr_t* frame::interpreter_frame_bcx_addr() const { - assert(is_interpreted_frame(), "must be interpreted"); - return (intptr_t*) &(get_interpreterState()->_bcp); -} - - -// Constant pool cache - -inline constantPoolCacheOop* frame::interpreter_frame_cache_addr() const { - assert(is_interpreted_frame(), "must be interpreted"); - return &(get_interpreterState()->_constants); -} - -// Method - -inline methodOop* frame::interpreter_frame_method_addr() const { - assert(is_interpreted_frame(), "must be interpreted"); - return &(get_interpreterState()->_method); -} - -inline intptr_t* frame::interpreter_frame_mdx_addr() const { - assert(is_interpreted_frame(), "must be interpreted"); - return (intptr_t*) &(get_interpreterState()->_mdx); -} - -// top of expression stack -inline intptr_t* frame::interpreter_frame_tos_address() const { - assert(is_interpreted_frame(), "wrong frame type"); - return get_interpreterState()->_stack + 1; -} - -#else /* asm interpreter */ inline intptr_t* frame::sender_sp() const { return addr_at( sender_sp_offset); } inline intptr_t** frame::interpreter_frame_locals_addr() const { @@ -259,8 +206,6 @@ inline oop* frame::interpreter_frame_temp_oop_addr() const { return (oop *)(fp() + interpreter_frame_oop_temp_offset); } -#endif /* CC_INTERP */ - inline int frame::pd_oop_map_offset_adjustment() const { return 0; } diff --git a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp index d463f059978..e70b4cce54a 100644 --- a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.cpp @@ -47,8 +47,6 @@ void InterpreterMacroAssembler::jump_to_entry(address entry) { b(entry); } -#ifndef CC_INTERP - void InterpreterMacroAssembler::check_and_handle_popframe(Register java_thread) { if (JvmtiExport::can_pop_frame()) { Label L; @@ -595,8 +593,6 @@ void InterpreterMacroAssembler::remove_activation( andr(sp, esp, -16); } -#endif // C_INTERP - // Lock object // // Args: @@ -758,8 +754,6 @@ void InterpreterMacroAssembler::unlock_object(Register lock_reg) } } -#ifndef CC_INTERP - void InterpreterMacroAssembler::test_method_data_pointer(Register mdp, Label& zero_continue) { assert(ProfileInterpreter, "must be profiling interpreter"); @@ -1345,7 +1339,6 @@ void InterpreterMacroAssembler::verify_oop(Register reg, TosState state) { } void InterpreterMacroAssembler::verify_FPU(int stack_depth, TosState state) { ; } -#endif // !CC_INTERP void InterpreterMacroAssembler::notify_method_entry() { @@ -1392,24 +1385,23 @@ void InterpreterMacroAssembler::notify_method_exit( // is changed then the interpreter_frame_result implementation will // need to be updated too. - // For c++ interpreter the result is always stored at a known location in the frame - // template interpreter will leave it on the top of the stack. - NOT_CC_INTERP(push(state);) + // template interpreter will leave the result on the top of the stack. + push(state); ldrw(r3, Address(rthread, JavaThread::interp_only_mode_offset())); cbz(r3, L); call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_method_exit)); bind(L); - NOT_CC_INTERP(pop(state)); + pop(state); } { SkipIfEqual skip(this, &DTraceMethodProbes, false); - NOT_CC_INTERP(push(state)); + push(state); get_method(c_rarg1); call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), rthread, c_rarg1); - NOT_CC_INTERP(pop(state)); + pop(state); } } diff --git a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp index 5cdfdecf2d3..81bf0f7bd09 100644 --- a/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/interp_masm_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -35,7 +35,6 @@ class InterpreterMacroAssembler: public MacroAssembler { -#ifndef CC_INTERP protected: protected: @@ -59,7 +58,6 @@ class InterpreterMacroAssembler: public MacroAssembler { // base routine for all dispatches void dispatch_base(TosState state, address* table, bool verifyoop = true); -#endif // CC_INTERP public: InterpreterMacroAssembler(CodeBuffer* code) : MacroAssembler(code) {} @@ -68,15 +66,6 @@ class InterpreterMacroAssembler: public MacroAssembler { void jump_to_entry(address entry); -#ifdef CC_INTERP - void save_bcp() { /* not needed in c++ interpreter and harmless */ } - void restore_bcp() { /* not needed in c++ interpreter and harmless */ } - - // Helpers for runtime call arguments/results - void get_method(Register reg); - -#else - // Interpreter-specific registers void save_bcp() { str(rbcp, Address(rfp, frame::interpreter_frame_bcp_offset * wordSize)); @@ -202,7 +191,6 @@ class InterpreterMacroAssembler: public MacroAssembler { bool throw_monitor_exception = true, bool install_monitor_exception = true, bool notify_jvmdi = true); -#endif // CC_INTERP // FIXME: Give us a valid frame at a null check. virtual void null_check(Register reg, int offset = -1) { @@ -220,8 +208,6 @@ class InterpreterMacroAssembler: public MacroAssembler { void lock_object (Register lock_reg); void unlock_object(Register lock_reg); -#ifndef CC_INTERP - // Interpreter profiling operations void set_method_data_pointer_for_bcp(); void test_method_data_pointer(Register mdp, Label& zero_continue); @@ -280,8 +266,6 @@ class InterpreterMacroAssembler: public MacroAssembler { // only if +VerifyFPU && (state == ftos || state == dtos) void verify_FPU(int stack_depth, TosState state = ftos); -#endif // !CC_INTERP - typedef enum { NotifyJVMTI, SkipNotifyJVMTI } NotifyMethodExitMode; // support for jvmti/dtrace diff --git a/hotspot/src/cpu/aarch64/vm/interpreterGenerator_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/interpreterGenerator_aarch64.hpp deleted file mode 100644 index 3d886570a5a..00000000000 --- a/hotspot/src/cpu/aarch64/vm/interpreterGenerator_aarch64.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_AARCH64_VM_INTERPRETERGENERATOR_AARCH64_HPP -#define CPU_AARCH64_VM_INTERPRETERGENERATOR_AARCH64_HPP - - -// Generation of Interpreter -// - friend class AbstractInterpreterGenerator; - -protected: - - void bang_stack_shadow_pages(bool native_call); - -private: - - address generate_normal_entry(bool synchronized); - address generate_native_entry(bool synchronized); - address generate_abstract_entry(void); - address generate_math_entry(AbstractInterpreter::MethodKind kind); - address generate_accessor_entry(void) { return NULL; } - address generate_empty_entry(void) { return NULL; } - void generate_transcendental_entry(AbstractInterpreter::MethodKind kind, int fpargs); - address generate_Reference_get_entry(); - address generate_CRC32_update_entry(); - address generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind); - address generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) { return NULL; } - void generate_stack_overflow_check(void); - - void generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue); - void generate_counter_overflow(Label* do_continue); - -#endif // CPU_AARCH64_VM_INTERPRETERGENERATOR_AARCH64_HPP diff --git a/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.cpp index a9cd044a1d8..cdb6d5eecc4 100644 --- a/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.cpp @@ -27,9 +27,9 @@ #include "asm/macroAssembler.hpp" #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/interp_masm.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" @@ -123,7 +123,7 @@ address AbstractInterpreterGenerator::generate_slow_signature_handler() { // Various method entries // -address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { +address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { // rmethod: Method* // r13: sender sp // esp: args @@ -202,7 +202,7 @@ address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKin // static jdouble dexp(jdouble x); // static jdouble dpow(jdouble x, jdouble y); -void InterpreterGenerator::generate_transcendental_entry(AbstractInterpreter::MethodKind kind, int fpargs) { +void TemplateInterpreterGenerator::generate_transcendental_entry(AbstractInterpreter::MethodKind kind, int fpargs) { address fn; switch (kind) { case Interpreter::java_lang_math_sin : @@ -237,7 +237,7 @@ void InterpreterGenerator::generate_transcendental_entry(AbstractInterpreter::Me // Abstract method entry // Attempt to execute abstract method. Throw exception -address InterpreterGenerator::generate_abstract_entry(void) { +address TemplateInterpreterGenerator::generate_abstract_entry(void) { // rmethod: Method* // r13: sender SP diff --git a/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.hpp deleted file mode 100644 index 7300a002e27..00000000000 --- a/hotspot/src/cpu/aarch64/vm/interpreter_aarch64.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_AARCH64_VM_INTERPRETER_AARCH64_HPP -#define CPU_AARCH64_VM_INTERPRETER_AARCH64_HPP - - public: - - // Offset from rsp (which points to the last stack element) - static int expr_offset_in_bytes(int i) { return stackElementSize * i; } - - // Stack index relative to tos (which points at value) - static int expr_index_at(int i) { return stackElementWords * i; } - - // Already negated by c++ interpreter - static int local_index_at(int i) { - assert(i <= 0, "local direction already negated"); - return stackElementWords * i; - } - -#endif // CPU_AARCH64_VM_INTERPRETER_AARCH64_HPP diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp index 4c4e79b8629..de6365c681b 100644 --- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -47,20 +47,13 @@ class MacroAssembler: public Assembler { // This is the base routine called by the different versions of call_VM_leaf. The interpreter // may customize this version by overriding it for its purposes (e.g., to save/restore // additional registers when doing a VM call). -#ifdef CC_INTERP - // c++ interpreter never wants to use interp_masm version of call_VM - #define VIRTUAL -#else - #define VIRTUAL virtual -#endif - - VIRTUAL void call_VM_leaf_base( + virtual void call_VM_leaf_base( address entry_point, // the entry point int number_of_arguments, // the number of arguments to pop after the call Label *retaddr = NULL ); - VIRTUAL void call_VM_leaf_base( + virtual void call_VM_leaf_base( address entry_point, // the entry point int number_of_arguments, // the number of arguments to pop after the call Label &retaddr) { @@ -75,7 +68,7 @@ class MacroAssembler: public Assembler { // returns the register which contains the thread upon return. If a thread register has been // specified, the return value will correspond to that register. If no last_java_sp is specified // (noreg) than rsp will be used instead. - VIRTUAL void call_VM_base( // returns the register containing the thread upon return + virtual void call_VM_base( // returns the register containing the thread upon return Register oop_result, // where an oop-result ends up if any; use noreg otherwise Register java_thread, // the thread if computed before ; use noreg otherwise Register last_java_sp, // to set up last_Java_frame in stubs; use noreg otherwise @@ -1004,8 +997,6 @@ public: Register table0, Register table1, Register table2, Register table3, Register tmp, Register tmp2, Register tmp3); -#undef VIRTUAL - // Stack push and pop individual 64 bit registers void push(Register src); void pop(Register dst); diff --git a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp index 1ae3d7f77ae..1edb46adf16 100644 --- a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp @@ -27,9 +27,9 @@ #include "asm/macroAssembler.hpp" #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/interp_masm.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" #include "interpreter/templateTable.hpp" #include "interpreter/bytecodeTracer.hpp" #include "oops/arrayOop.hpp" @@ -59,8 +59,6 @@ #define __ _masm-> -#ifndef CC_INTERP - //----------------------------------------------------------------------------- extern "C" void entry(CodeBuffer*); @@ -304,7 +302,7 @@ address TemplateInterpreterGenerator::generate_safept_entry_for( // // rmethod: method // -void InterpreterGenerator::generate_counter_incr( +void TemplateInterpreterGenerator::generate_counter_incr( Label* overflow, Label* profile_method, Label* profile_method_continue) { @@ -382,7 +380,7 @@ void InterpreterGenerator::generate_counter_incr( } } -void InterpreterGenerator::generate_counter_overflow(Label* do_continue) { +void TemplateInterpreterGenerator::generate_counter_overflow(Label& do_continue) { // Asm interpreter on entry // On return (i.e. jump to entry_point) [ back to invocation of interpreter ] @@ -401,7 +399,7 @@ void InterpreterGenerator::generate_counter_overflow(Label* do_continue) { InterpreterRuntime::frequency_counter_overflow), c_rarg1); - __ b(*do_continue); + __ b(do_continue); } // See if we've got enough room on the stack for locals plus overhead. @@ -418,7 +416,7 @@ void InterpreterGenerator::generate_counter_overflow(Label* do_continue) { // // Kills: // r0 -void InterpreterGenerator::generate_stack_overflow_check(void) { +void TemplateInterpreterGenerator::generate_stack_overflow_check(void) { // monitor entry size: see picture of stack set // (generate_method_entry) and frame_amd64.hpp @@ -634,7 +632,7 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call) { // // Method entry for java.lang.ref.Reference.get. -address InterpreterGenerator::generate_Reference_get_entry(void) { +address TemplateInterpreterGenerator::generate_Reference_get_entry(void) { #if INCLUDE_ALL_GCS // Code: _aload_0, _getfield, _areturn // parameter size = 1 @@ -712,7 +710,7 @@ address InterpreterGenerator::generate_Reference_get_entry(void) { * Method entry for static native methods: * int java.util.zip.CRC32.update(int crc, int b) */ -address InterpreterGenerator::generate_CRC32_update_entry() { +address TemplateInterpreterGenerator::generate_CRC32_update_entry() { if (UseCRC32Intrinsics) { address entry = __ pc(); @@ -766,7 +764,7 @@ address InterpreterGenerator::generate_CRC32_update_entry() { * int java.util.zip.CRC32.updateBytes(int crc, byte[] b, int off, int len) * int java.util.zip.CRC32.updateByteBuffer(int crc, long buf, int off, int len) */ -address InterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) { +address TemplateInterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) { if (UseCRC32Intrinsics) { address entry = __ pc(); @@ -821,7 +819,12 @@ address InterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpret return NULL; } -void InterpreterGenerator::bang_stack_shadow_pages(bool native_call) { +// Not supported +address TemplateInterpreterGenerator::generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) { + return NULL; +} + +void TemplateInterpreterGenerator::bang_stack_shadow_pages(bool native_call) { // Bang each page in the shadow zone. We can't assume it's been done for // an interpreter frame with greater than a page of locals, so each page // needs to be checked. Only true for non-native. @@ -840,7 +843,7 @@ void InterpreterGenerator::bang_stack_shadow_pages(bool native_call) { // Interpreter stub for calling a native method. (asm interpreter) // This sets up a somewhat different looking stack for calling the // native method than the typical interpreter frame setup. -address InterpreterGenerator::generate_native_entry(bool synchronized) { +address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { // determine code generation flags bool inc_counter = UseCompiler || CountCompiledCalls || LogTouchedMethods; @@ -1269,7 +1272,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) { if (inc_counter) { // Handle overflow of counter and compile method __ bind(invocation_counter_overflow); - generate_counter_overflow(&continue_after_compile); + generate_counter_overflow(continue_after_compile); } return entry_point; @@ -1278,7 +1281,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) { // // Generic interpreted method entry to (asm) interpreter // -address InterpreterGenerator::generate_normal_entry(bool synchronized) { +address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) { // determine code generation flags bool inc_counter = UseCompiler || CountCompiledCalls || LogTouchedMethods; @@ -1440,7 +1443,7 @@ address InterpreterGenerator::generate_normal_entry(bool synchronized) { } // Handle overflow of counter and compile method __ bind(invocation_counter_overflow); - generate_counter_overflow(&continue_after_compile); + generate_counter_overflow(continue_after_compile); } return entry_point; @@ -1725,17 +1728,6 @@ void TemplateInterpreterGenerator::set_vtos_entry_points(Template* t, generate_and_dispatch(t); } -//----------------------------------------------------------------------------- -// Generation of individual instructions - -// helpers for generate_and_dispatch - - -InterpreterGenerator::InterpreterGenerator(StubQueue* code) - : TemplateInterpreterGenerator(code) { - generate_all(); // down here so it can be "virtual" -} - //----------------------------------------------------------------------------- // Non-product code @@ -1923,4 +1915,3 @@ extern "C" { #endif // BUILTIN_SIM #endif // !PRODUCT -#endif // ! CC_INTERP diff --git a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.hpp deleted file mode 100644 index 25da0ee30e6..00000000000 --- a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_AARCH64_VM_TEMPLATEINTERPRETERGENERATOR_AARCH64_HPP -#define CPU_AARCH64_VM_TEMPLATEINTERPRETERGENERATOR_AARCH64_HPP - - protected: - -void generate_fixed_frame(bool native_call); - - // address generate_asm_interpreter_entry(bool synchronized); - -#endif // CPU_AARCH64_VM_TEMPLATEINTERPRETERGENERATOR_AARCH64_HPP diff --git a/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp index 314af0b87ab..b067af82d44 100644 --- a/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp @@ -31,6 +31,12 @@ #include "utilities/debug.hpp" #include "utilities/macros.hpp" +// Size of interpreter code. Increase if too small. Interpreter will +// fail with a guarantee ("not enough space for interpreter generation"); +// if too small. +// Run with +PrintInterpreter to get the VM to print out the size. +// Max size with JVMTI +int TemplateInterpreter::InterpreterCodeSize = 200 * 1024; int AbstractInterpreter::BasicType_as_index(BasicType type) { int i = 0; @@ -97,7 +103,7 @@ int AbstractInterpreter::size_activation(int max_stack, int callee_locals, bool is_top_frame) { // Note: This calculation must exactly parallel the frame setup - // in InterpreterGenerator::generate_method_entry. + // in TemplateInterpreterGenerator::generate_method_entry. // fixed size of an interpreter frame: int overhead = frame::sender_sp_offset - diff --git a/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.hpp deleted file mode 100644 index b77a5e9fcd0..00000000000 --- a/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, Red Hat Inc. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_AARCH64_VM_TEMPLATEINTERPRETER_AARCH64_HPP -#define CPU_AARCH64_VM_TEMPLATEINTERPRETER_AARCH64_HPP - - - protected: - - // Size of interpreter code. Increase if too small. Interpreter will - // fail with a guarantee ("not enough space for interpreter generation"); - // if too small. - // Run with +PrintInterpreter to get the VM to print out the size. - // Max size with JVMTI - const static int InterpreterCodeSize = 200 * 1024; - -#endif // CPU_AARCH64_VM_TEMPLATEINTERPRETER_AARCH64_HPP diff --git a/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp index 1ee5823f7f6..6c8c5ac8bac 100644 --- a/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/templateTable_aarch64.cpp @@ -39,8 +39,6 @@ #include "runtime/stubRoutines.hpp" #include "runtime/synchronizer.hpp" -#ifndef CC_INTERP - #define __ _masm-> // Platform-dependent initialization @@ -3795,4 +3793,3 @@ void TemplateTable::multianewarray() { __ load_unsigned_byte(r1, at_bcp(3)); __ lea(esp, Address(esp, r1, Address::uxtw(3))); } -#endif // !CC_INTERP diff --git a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp index c7d33304bd1..fabffc8c3cf 100644 --- a/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/globalDefinitions_ppc.hpp @@ -27,7 +27,7 @@ #define CPU_PPC_VM_GLOBALDEFINITIONS_PPC_HPP #ifdef CC_INTERP -#error "CC_INTERP no more supported. Removed in change 8145117." +#error "CC_INTERP is no longer supported. Removed in change 8145117." #endif // Size of PPC Instructions diff --git a/hotspot/src/cpu/ppc/vm/interpreterGenerator_ppc.hpp b/hotspot/src/cpu/ppc/vm/interpreterGenerator_ppc.hpp deleted file mode 100644 index 02a6931b662..00000000000 --- a/hotspot/src/cpu/ppc/vm/interpreterGenerator_ppc.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_PPC_VM_INTERPRETERGENERATOR_PPC_HPP -#define CPU_PPC_VM_INTERPRETERGENERATOR_PPC_HPP - - friend class AbstractInterpreterGenerator; - - private: - - address generate_abstract_entry(void); - address generate_accessor_entry(void) { return NULL; } - address generate_empty_entry(void) { return NULL; } - address generate_Reference_get_entry(void); - - address generate_CRC32_update_entry(); - address generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind); - address generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) { return NULL; } - -#endif // CPU_PPC_VM_INTERPRETERGENERATOR_PPC_HPP diff --git a/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp index b887d17828d..bd3488f9873 100644 --- a/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/interpreter_ppc.cpp @@ -27,9 +27,9 @@ #include "asm/macroAssembler.inline.hpp" #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/interp_masm.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" @@ -416,7 +416,7 @@ address AbstractInterpreterGenerator::generate_result_handler_for(BasicType type // Abstract method entry. // -address InterpreterGenerator::generate_abstract_entry(void) { +address TemplateInterpreterGenerator::generate_abstract_entry(void) { address entry = __ pc(); // @@ -474,7 +474,7 @@ address InterpreterGenerator::generate_abstract_entry(void) { // It contains a GC barrier which puts the reference into the satb buffer // to indicate that someone holds a strong reference to the object the // weak ref points to! -address InterpreterGenerator::generate_Reference_get_entry(void) { +address TemplateInterpreterGenerator::generate_Reference_get_entry(void) { // Code: _aload_0, _getfield, _areturn // parameter size = 1 // diff --git a/hotspot/src/cpu/ppc/vm/interpreter_ppc.hpp b/hotspot/src/cpu/ppc/vm/interpreter_ppc.hpp deleted file mode 100644 index 50dc2a2c567..00000000000 --- a/hotspot/src/cpu/ppc/vm/interpreter_ppc.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012, 2015 SAP AG. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_PPC_VM_INTERPRETER_PPC_HPP -#define CPU_PPC_VM_INTERPRETER_PPC_HPP - - public: - - // Stack index relative to tos (which points at value). - static int expr_index_at(int i) { - return stackElementWords * i; - } - - // Already negated by c++ interpreter. - static int local_index_at(int i) { - assert(i <= 0, "local direction already negated"); - return stackElementWords * i; - } - - // The offset in bytes to access a expression stack slot - // relative to the esp pointer. - static int expr_offset_in_bytes(int slot) { - return stackElementSize * slot + wordSize; - } - -#endif // CPU_PPC_VM_INTERPRETER_PPC_HPP diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp index 321a9c0e86d..1972e21f743 100644 --- a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp @@ -27,9 +27,9 @@ #include "asm/macroAssembler.inline.hpp" #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/interp_masm.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" @@ -1245,7 +1245,7 @@ address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) { * Method entry for static native methods: * int java.util.zip.CRC32.update(int crc, int b) */ -address InterpreterGenerator::generate_CRC32_update_entry() { +address TemplateInterpreterGenerator::generate_CRC32_update_entry() { if (UseCRC32Intrinsics) { address start = __ pc(); // Remember stub start address (is rtn value). Label slow_path; @@ -1305,7 +1305,7 @@ address InterpreterGenerator::generate_CRC32_update_entry() { * int java.util.zip.CRC32.updateBytes( int crc, byte[] b, int off, int len) * int java.util.zip.CRC32.updateByteBuffer(int crc, long* buf, int off, int len) */ -address InterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) { +address TemplateInterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) { if (UseCRC32Intrinsics) { address start = __ pc(); // Remember stub start address (is rtn value). Label slow_path; @@ -1391,6 +1391,11 @@ address InterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpret return NULL; } +// Not supported +address TemplateInterpreterGenerator::generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) { + return NULL; +} + // ============================================================================= // Exceptions @@ -1642,16 +1647,6 @@ void TemplateInterpreterGenerator::set_vtos_entry_points(Template* t, generate_and_dispatch(t); } -//----------------------------------------------------------------------------- -// Generation of individual instructions - -// helpers for generate_and_dispatch - -InterpreterGenerator::InterpreterGenerator(StubQueue* code) - : TemplateInterpreterGenerator(code) { - generate_all(); // Down here so it can be "virtual". -} - //----------------------------------------------------------------------------- // Non-product code diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.hpp b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.hpp deleted file mode 100644 index ea12f04124c..00000000000 --- a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2013, 2014 SAP AG. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_PPC_VM_TEMPLATEINTERPRETERGENERATOR_PPC_HPP -#define CPU_PPC_VM_TEMPLATEINTERPRETERGENERATOR_PPC_HPP - - protected: - address generate_normal_entry(bool synchronized); - address generate_native_entry(bool synchronized); - address generate_math_entry(AbstractInterpreter::MethodKind kind); - - void lock_method(Register Rflags, Register Rscratch1, Register Rscratch2, bool flags_preloaded=false); - void unlock_method(bool check_exceptions = true); - - void generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue); - void generate_counter_overflow(Label& continue_entry); - - void generate_fixed_frame(bool native_call, Register Rsize_of_parameters, Register Rsize_of_locals); - void generate_stack_overflow_check(Register Rframe_size, Register Rscratch1); - -#endif // CPU_PPC_VM_TEMPLATEINTERPRETERGENERATOR_PPC_HPP diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp index 5179d817853..8cd02dca4b3 100644 --- a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.cpp @@ -31,6 +31,12 @@ #include "utilities/debug.hpp" #include "utilities/macros.hpp" +// Size of interpreter code. Increase if too small. Interpreter will +// fail with a guarantee ("not enough space for interpreter generation"); +// if too small. +// Run with +PrintInterpreter to get the VM to print out the size. +// Max size with JVMTI +int TemplateInterpreter::InterpreterCodeSize = 230*K; int AbstractInterpreter::BasicType_as_index(BasicType type) { int i = 0; @@ -79,7 +85,7 @@ int AbstractInterpreter::size_activation(int max_stack, int callee_locals, bool is_top_frame) { // Note: This calculation must exactly parallel the frame setup - // in InterpreterGenerator::generate_fixed_frame. + // in TemplateInterpreterGenerator::generate_fixed_frame. assert(Interpreter::stackElementWords == 1, "sanity"); const int max_alignment_space = StackAlignmentInBytes / Interpreter::stackElementSize; const int abi_scratch = is_top_frame ? (frame::abi_reg_args_size / Interpreter::stackElementSize) : diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp b/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp deleted file mode 100644 index b9003dd3c4b..00000000000 --- a/hotspot/src/cpu/ppc/vm/templateInterpreter_ppc.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013, 2015 SAP AG. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_PPC_VM_TEMPLATEINTERPRETER_PPC_HPP -#define CPU_PPC_VM_TEMPLATEINTERPRETER_PPC_HPP - - protected: - - // Size of interpreter code. Increase if too small. Interpreter will - // fail with a guarantee ("not enough space for interpreter generation"); - // if too small. - // Run with +PrintInterpreter to get the VM to print out the size. - // Max size with JVMTI - const static int InterpreterCodeSize = 230*K; - - public: - // Support abs and sqrt like in compiler. - // For others we can use a normal (native) entry. - static bool math_entry_available(AbstractInterpreter::MethodKind kind); -#endif // CPU_PPC_VM_TEMPLATEINTERPRETER_PPC_HPP - - diff --git a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.cpp deleted file mode 100644 index 3d2087659d6..00000000000 --- a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "asm/assembler.hpp" -#include "interp_masm_sparc.hpp" -#include "interpreter/bytecodeInterpreter.hpp" -#include "interpreter/bytecodeInterpreter.inline.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "oops/methodData.hpp" -#include "oops/method.hpp" -#include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiThreadState.hpp" -#include "runtime/deoptimization.hpp" -#include "runtime/frame.inline.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/stubRoutines.hpp" -#include "runtime/synchronizer.hpp" -#include "runtime/vframeArray.hpp" -#include "utilities/debug.hpp" - -// KILL THIS FILE diff --git a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp b/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp deleted file mode 100644 index dd417a30eb5..00000000000 --- a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.hpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_HPP -#define CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_HPP - -// Platform specific for C++ based Interpreter -#define LOTS_OF_REGS /* Lets interpreter use plenty of registers */ - -private: - - // save the bottom of the stack after frame manager setup. For ease of restoration after return - // from recursive interpreter call - intptr_t* _frame_bottom; /* saved bottom of frame manager frame */ - intptr_t* _last_Java_pc; /* pc to return to in frame manager */ - interpreterState _self_link; /* Previous interpreter state */ /* sometimes points to self??? */ - double _native_fresult; /* save result of native calls that might return floats */ - intptr_t _native_lresult; /* save result of native calls that might return handle/longs */ -public: - - static void pd_layout_interpreterState(interpreterState istate, address last_Java_pc, intptr_t* last_Java_fp); - - -#define SET_LAST_JAVA_FRAME() - -#define RESET_LAST_JAVA_FRAME() THREAD->frame_anchor()->set_flags(0); - -/* - * Macros for accessing the stack. - */ -#undef STACK_INT -#undef STACK_FLOAT -#undef STACK_ADDR -#undef STACK_OBJECT -#undef STACK_DOUBLE -#undef STACK_LONG -// JavaStack Implementation - - -#define GET_STACK_SLOT(offset) (*((intptr_t*) &topOfStack[-(offset)])) -#define STACK_SLOT(offset) ((address) &topOfStack[-(offset)]) -#define STACK_ADDR(offset) (*((address *) &topOfStack[-(offset)])) -#define STACK_INT(offset) (*((jint*) &topOfStack[-(offset)])) -#define STACK_FLOAT(offset) (*((jfloat *) &topOfStack[-(offset)])) -#define STACK_OBJECT(offset) (*((oop *) &topOfStack [-(offset)])) -#define STACK_DOUBLE(offset) (((VMJavaVal64*) &topOfStack[-(offset)])->d) -#define STACK_LONG(offset) (((VMJavaVal64 *) &topOfStack[-(offset)])->l) - -#define SET_STACK_SLOT(value, offset) (*(intptr_t*)&topOfStack[-(offset)] = *(intptr_t*)(value)) -#define SET_STACK_ADDR(value, offset) (*((address *)&topOfStack[-(offset)]) = (value)) -#define SET_STACK_INT(value, offset) (*((jint *)&topOfStack[-(offset)]) = (value)) -#define SET_STACK_FLOAT(value, offset) (*((jfloat *)&topOfStack[-(offset)]) = (value)) -#define SET_STACK_OBJECT(value, offset) (*((oop *)&topOfStack[-(offset)]) = (value)) -#define SET_STACK_DOUBLE(value, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->d = (value)) -#define SET_STACK_DOUBLE_FROM_ADDR(addr, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->d = \ - ((VMJavaVal64*)(addr))->d) -#define SET_STACK_LONG(value, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->l = (value)) -#define SET_STACK_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->l = \ - ((VMJavaVal64*)(addr))->l) - -#define LOCALS_SLOT(offset) ((intptr_t*)&locals[-(offset)]) -#define LOCALS_ADDR(offset) ((address)locals[-(offset)]) -#define LOCALS_INT(offset) (*((jint*)&locals[-(offset)])) -#define LOCALS_FLOAT(offset) (*((jfloat*)&locals[-(offset)])) -#define LOCALS_OBJECT(offset) (cast_to_oop(locals[-(offset)])) -#define LOCALS_DOUBLE(offset) (((VMJavaVal64*)&locals[-((offset) + 1)])->d) -#define LOCALS_LONG(offset) (((VMJavaVal64*)&locals[-((offset) + 1)])->l) -#define LOCALS_LONG_AT(offset) (((address)&locals[-((offset) + 1)])) -#define LOCALS_DOUBLE_AT(offset) (((address)&locals[-((offset) + 1)])) - -#define SET_LOCALS_SLOT(value, offset) (*(intptr_t*)&locals[-(offset)] = *(intptr_t *)(value)) -#define SET_LOCALS_ADDR(value, offset) (*((address *)&locals[-(offset)]) = (value)) -#define SET_LOCALS_INT(value, offset) (*((jint *)&locals[-(offset)]) = (value)) -#define SET_LOCALS_FLOAT(value, offset) (*((jfloat *)&locals[-(offset)]) = (value)) -#define SET_LOCALS_OBJECT(value, offset) (*((oop *)&locals[-(offset)]) = (value)) -#define SET_LOCALS_DOUBLE(value, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->d = (value)) -#define SET_LOCALS_LONG(value, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = (value)) -#define SET_LOCALS_DOUBLE_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->d = \ - ((VMJavaVal64*)(addr))->d) -#define SET_LOCALS_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = \ - ((VMJavaVal64*)(addr))->l) - -#endif // CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.inline.hpp deleted file mode 100644 index d9c8e66de6a..00000000000 --- a/hotspot/src/cpu/sparc/vm/bytecodeInterpreter_sparc.inline.hpp +++ /dev/null @@ -1,338 +0,0 @@ -/* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_INLINE_HPP -#define CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_INLINE_HPP - -// Inline interpreter functions for sparc - -inline jfloat BytecodeInterpreter::VMfloatAdd(jfloat op1, jfloat op2) { return op1 + op2; } -inline jfloat BytecodeInterpreter::VMfloatSub(jfloat op1, jfloat op2) { return op1 - op2; } -inline jfloat BytecodeInterpreter::VMfloatMul(jfloat op1, jfloat op2) { return op1 * op2; } -inline jfloat BytecodeInterpreter::VMfloatDiv(jfloat op1, jfloat op2) { return op1 / op2; } -inline jfloat BytecodeInterpreter::VMfloatRem(jfloat op1, jfloat op2) { return fmod(op1, op2); } - -inline jfloat BytecodeInterpreter::VMfloatNeg(jfloat op) { return -op; } - -inline int32_t BytecodeInterpreter::VMfloatCompare(jfloat op1, jfloat op2, int32_t direction) { - return ( op1 < op2 ? -1 : - op1 > op2 ? 1 : - op1 == op2 ? 0 : - (direction == -1 || direction == 1) ? direction : 0); - -} - -inline void BytecodeInterpreter::VMmemCopy64(uint32_t to[2], const uint32_t from[2]) { - // x86 can do unaligned copies but not 64bits at a time - to[0] = from[0]; to[1] = from[1]; -} - -// The long operations depend on compiler support for "long long" on x86 - -inline jlong BytecodeInterpreter::VMlongAdd(jlong op1, jlong op2) { - return op1 + op2; -} - -inline jlong BytecodeInterpreter::VMlongAnd(jlong op1, jlong op2) { - return op1 & op2; -} - -inline jlong BytecodeInterpreter::VMlongDiv(jlong op1, jlong op2) { - // QQQ what about check and throw... - return op1 / op2; -} - -inline jlong BytecodeInterpreter::VMlongMul(jlong op1, jlong op2) { - return op1 * op2; -} - -inline jlong BytecodeInterpreter::VMlongOr(jlong op1, jlong op2) { - return op1 | op2; -} - -inline jlong BytecodeInterpreter::VMlongSub(jlong op1, jlong op2) { - return op1 - op2; -} - -inline jlong BytecodeInterpreter::VMlongXor(jlong op1, jlong op2) { - return op1 ^ op2; -} - -inline jlong BytecodeInterpreter::VMlongRem(jlong op1, jlong op2) { - return op1 % op2; -} - -inline jlong BytecodeInterpreter::VMlongUshr(jlong op1, jint op2) { - // CVM did this 0x3f mask, is the really needed??? QQQ - return ((unsigned long long) op1) >> (op2 & 0x3F); -} - -inline jlong BytecodeInterpreter::VMlongShr(jlong op1, jint op2) { - return op1 >> (op2 & 0x3F); -} - -inline jlong BytecodeInterpreter::VMlongShl(jlong op1, jint op2) { - return op1 << (op2 & 0x3F); -} - -inline jlong BytecodeInterpreter::VMlongNeg(jlong op) { - return -op; -} - -inline jlong BytecodeInterpreter::VMlongNot(jlong op) { - return ~op; -} - -inline int32_t BytecodeInterpreter::VMlongLtz(jlong op) { - return (op <= 0); -} - -inline int32_t BytecodeInterpreter::VMlongGez(jlong op) { - return (op >= 0); -} - -inline int32_t BytecodeInterpreter::VMlongEqz(jlong op) { - return (op == 0); -} - -inline int32_t BytecodeInterpreter::VMlongEq(jlong op1, jlong op2) { - return (op1 == op2); -} - -inline int32_t BytecodeInterpreter::VMlongNe(jlong op1, jlong op2) { - return (op1 != op2); -} - -inline int32_t BytecodeInterpreter::VMlongGe(jlong op1, jlong op2) { - return (op1 >= op2); -} - -inline int32_t BytecodeInterpreter::VMlongLe(jlong op1, jlong op2) { - return (op1 <= op2); -} - -inline int32_t BytecodeInterpreter::VMlongLt(jlong op1, jlong op2) { - return (op1 < op2); -} - -inline int32_t BytecodeInterpreter::VMlongGt(jlong op1, jlong op2) { - return (op1 > op2); -} - -inline int32_t BytecodeInterpreter::VMlongCompare(jlong op1, jlong op2) { - return (VMlongLt(op1, op2) ? -1 : VMlongGt(op1, op2) ? 1 : 0); -} - -// Long conversions - -inline jdouble BytecodeInterpreter::VMlong2Double(jlong val) { - return (jdouble) val; -} - -inline jfloat BytecodeInterpreter::VMlong2Float(jlong val) { - return (jfloat) val; -} - -inline jint BytecodeInterpreter::VMlong2Int(jlong val) { - return (jint) val; -} - -// Double Arithmetic - -inline jdouble BytecodeInterpreter::VMdoubleAdd(jdouble op1, jdouble op2) { - return op1 + op2; -} - -inline jdouble BytecodeInterpreter::VMdoubleDiv(jdouble op1, jdouble op2) { - // Divide by zero... QQQ - return op1 / op2; -} - -inline jdouble BytecodeInterpreter::VMdoubleMul(jdouble op1, jdouble op2) { - return op1 * op2; -} - -inline jdouble BytecodeInterpreter::VMdoubleNeg(jdouble op) { - return -op; -} - -inline jdouble BytecodeInterpreter::VMdoubleRem(jdouble op1, jdouble op2) { - return fmod(op1, op2); -} - -inline jdouble BytecodeInterpreter::VMdoubleSub(jdouble op1, jdouble op2) { - return op1 - op2; -} - -inline int32_t BytecodeInterpreter::VMdoubleCompare(jdouble op1, jdouble op2, int32_t direction) { - return ( op1 < op2 ? -1 : - op1 > op2 ? 1 : - op1 == op2 ? 0 : - (direction == -1 || direction == 1) ? direction : 0); -} - -// Double Conversions - -inline jfloat BytecodeInterpreter::VMdouble2Float(jdouble val) { - return (jfloat) val; -} - -// Float Conversions - -inline jdouble BytecodeInterpreter::VMfloat2Double(jfloat op) { - return (jdouble) op; -} - -// Integer Arithmetic - -inline jint BytecodeInterpreter::VMintAdd(jint op1, jint op2) { - return op1 + op2; -} - -inline jint BytecodeInterpreter::VMintAnd(jint op1, jint op2) { - return op1 & op2; -} - -inline jint BytecodeInterpreter::VMintDiv(jint op1, jint op2) { - /* it's possible we could catch this special case implicitly */ - if (op1 == 0x80000000 && op2 == -1) return op1; - else return op1 / op2; -} - -inline jint BytecodeInterpreter::VMintMul(jint op1, jint op2) { - return op1 * op2; -} - -inline jint BytecodeInterpreter::VMintNeg(jint op) { - return -op; -} - -inline jint BytecodeInterpreter::VMintOr(jint op1, jint op2) { - return op1 | op2; -} - -inline jint BytecodeInterpreter::VMintRem(jint op1, jint op2) { - /* it's possible we could catch this special case implicitly */ - if (op1 == 0x80000000 && op2 == -1) return 0; - else return op1 % op2; -} - -inline jint BytecodeInterpreter::VMintShl(jint op1, jint op2) { - return op1 << (op2 & 0x1f); -} - -inline jint BytecodeInterpreter::VMintShr(jint op1, jint op2) { - return op1 >> (op2 & 0x1f); -} - -inline jint BytecodeInterpreter::VMintSub(jint op1, jint op2) { - return op1 - op2; -} - -inline juint BytecodeInterpreter::VMintUshr(jint op1, jint op2) { - return ((juint) op1) >> (op2 & 0x1f); -} - -inline jint BytecodeInterpreter::VMintXor(jint op1, jint op2) { - return op1 ^ op2; -} - -inline jdouble BytecodeInterpreter::VMint2Double(jint val) { - return (jdouble) val; -} - -inline jfloat BytecodeInterpreter::VMint2Float(jint val) { - return (jfloat) val; -} - -inline jlong BytecodeInterpreter::VMint2Long(jint val) { - return (jlong) val; -} - -inline jchar BytecodeInterpreter::VMint2Char(jint val) { - return (jchar) val; -} - -inline jshort BytecodeInterpreter::VMint2Short(jint val) { - return (jshort) val; -} - -inline jbyte BytecodeInterpreter::VMint2Byte(jint val) { - return (jbyte) val; -} - -// The implementations are platform dependent. We have to worry about alignment -// issues on some machines which can change on the same platform depending on -// whether it is an LP64 machine also. - -// We know that on LP32 mode that longs/doubles are the only thing that gives -// us alignment headaches. We also know that the worst we have is 32bit alignment -// so thing are not really too bad. -// (Also sparcworks compiler does the right thing for free if we don't use -arch.. -// switches. Only gcc gives us a hard time. In LP64 mode I think we have no issue -// with alignment. - -#ifdef _GNU_SOURCE - #define ALIGN_CONVERTER /* Needs alignment converter */ -#else - #undef ALIGN_CONVERTER /* No alignment converter */ -#endif /* _GNU_SOURCE */ - -#ifdef ALIGN_CONVERTER -class u8_converter { - - private: - - public: - static jdouble get_jdouble(address p) { - VMJavaVal64 tmp; - tmp.v[0] = ((uint32_t*)p)[0]; - tmp.v[1] = ((uint32_t*)p)[1]; - return tmp.d; - } - - static void put_jdouble(address p, jdouble d) { - VMJavaVal64 tmp; - tmp.d = d; - ((uint32_t*)p)[0] = tmp.v[0]; - ((uint32_t*)p)[1] = tmp.v[1]; - } - - static jlong get_jlong(address p) { - VMJavaVal64 tmp; - tmp.v[0] = ((uint32_t*)p)[0]; - tmp.v[1] = ((uint32_t*)p)[1]; - return tmp.l; - } - - static void put_jlong(address p, jlong l) { - VMJavaVal64 tmp; - tmp.l = l; - ((uint32_t*)p)[0] = tmp.v[0]; - ((uint32_t*)p)[1] = tmp.v[1]; - } -}; -#endif /* ALIGN_CONVERTER */ - -#endif // CPU_SPARC_VM_BYTECODEINTERPRETER_SPARC_INLINE_HPP diff --git a/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp b/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp index 152529b9beb..4787b4fa835 100644 --- a/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/c2_globals_sparc.hpp @@ -37,11 +37,7 @@ define_pd_global(bool, InlineIntrinsics, false); define_pd_global(bool, PreferInterpreterNativeStubs, false); define_pd_global(bool, ProfileTraps, true); define_pd_global(bool, UseOnStackReplacement, true); -#ifdef CC_INTERP -define_pd_global(bool, ProfileInterpreter, false); -#else define_pd_global(bool, ProfileInterpreter, true); -#endif // CC_INTERP define_pd_global(bool, TieredCompilation, trueInTiered); define_pd_global(intx, CompileThreshold, 10000); diff --git a/hotspot/src/cpu/sparc/vm/cppInterpreterGenerator_sparc.hpp b/hotspot/src/cpu/sparc/vm/cppInterpreterGenerator_sparc.hpp deleted file mode 100644 index 70d7000b3c8..00000000000 --- a/hotspot/src/cpu/sparc/vm/cppInterpreterGenerator_sparc.hpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_SPARC_VM_CPPINTERPRETERGENERATOR_SPARC_HPP -#define CPU_SPARC_VM_CPPINTERPRETERGENERATOR_SPARC_HPP - - static address frame_manager_return; - static address frame_manager_sync_return; - - - void generate_more_monitors(); - void generate_deopt_handling(); - void lock_method(void); - void adjust_callers_stack(Register args); - void generate_compute_interpreter_state(const Register state, - const Register prev_state, - bool native); - -#endif // CPU_SPARC_VM_CPPINTERPRETERGENERATOR_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp deleted file mode 100644 index 8fd601277c7..00000000000 --- a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.cpp +++ /dev/null @@ -1,2201 +0,0 @@ -/* - * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "asm/assembler.hpp" -#include "interpreter/bytecodeHistogram.hpp" -#include "interpreter/cppInterpreter.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "interpreter/interp_masm.hpp" -#include "oops/arrayOop.hpp" -#include "oops/methodData.hpp" -#include "oops/method.hpp" -#include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiThreadState.hpp" -#include "runtime/arguments.hpp" -#include "runtime/deoptimization.hpp" -#include "runtime/frame.inline.hpp" -#include "runtime/interfaceSupport.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/stubRoutines.hpp" -#include "runtime/synchronizer.hpp" -#include "runtime/timer.hpp" -#include "runtime/vframeArray.hpp" -#include "utilities/debug.hpp" -#include "utilities/macros.hpp" -#ifdef SHARK -#include "shark/shark_globals.hpp" -#endif - -#ifdef CC_INTERP - -// Routine exists to make tracebacks look decent in debugger -// while "shadow" interpreter frames are on stack. It is also -// used to distinguish interpreter frames. - -extern "C" void RecursiveInterpreterActivation(interpreterState istate) { - ShouldNotReachHere(); -} - -bool CppInterpreter::contains(address pc) { - return ( _code->contains(pc) || - ( pc == (CAST_FROM_FN_PTR(address, RecursiveInterpreterActivation) + frame::pc_return_offset))); -} - -#define STATE(field_name) Lstate, in_bytes(byte_offset_of(BytecodeInterpreter, field_name)) -#define __ _masm-> - -Label frame_manager_entry; // c++ interpreter entry point this holds that entry point label. - -static address unctrap_frame_manager_entry = NULL; - -static address interpreter_return_address = NULL; -static address deopt_frame_manager_return_atos = NULL; -static address deopt_frame_manager_return_btos = NULL; -static address deopt_frame_manager_return_itos = NULL; -static address deopt_frame_manager_return_ltos = NULL; -static address deopt_frame_manager_return_ftos = NULL; -static address deopt_frame_manager_return_dtos = NULL; -static address deopt_frame_manager_return_vtos = NULL; - -const Register prevState = G1_scratch; - -void InterpreterGenerator::save_native_result(void) { - // result potentially in O0/O1: save it across calls - __ stf(FloatRegisterImpl::D, F0, STATE(_native_fresult)); -#ifdef _LP64 - __ stx(O0, STATE(_native_lresult)); -#else - __ std(O0, STATE(_native_lresult)); -#endif -} - -void InterpreterGenerator::restore_native_result(void) { - - // Restore any method result value - __ ldf(FloatRegisterImpl::D, STATE(_native_fresult), F0); -#ifdef _LP64 - __ ldx(STATE(_native_lresult), O0); -#else - __ ldd(STATE(_native_lresult), O0); -#endif -} - -// A result handler converts/unboxes a native call result into -// a java interpreter/compiler result. The current frame is an -// interpreter frame. The activation frame unwind code must be -// consistent with that of TemplateTable::_return(...). In the -// case of native methods, the caller's SP was not modified. -address CppInterpreterGenerator::generate_result_handler_for(BasicType type) { - address entry = __ pc(); - Register Itos_i = Otos_i ->after_save(); - Register Itos_l = Otos_l ->after_save(); - Register Itos_l1 = Otos_l1->after_save(); - Register Itos_l2 = Otos_l2->after_save(); - switch (type) { - case T_BOOLEAN: __ subcc(G0, O0, G0); __ addc(G0, 0, Itos_i); break; // !0 => true; 0 => false - case T_CHAR : __ sll(O0, 16, O0); __ srl(O0, 16, Itos_i); break; // cannot use and3, 0xFFFF too big as immediate value! - case T_BYTE : __ sll(O0, 24, O0); __ sra(O0, 24, Itos_i); break; - case T_SHORT : __ sll(O0, 16, O0); __ sra(O0, 16, Itos_i); break; - case T_LONG : -#ifndef _LP64 - __ mov(O1, Itos_l2); // move other half of long -#endif // ifdef or no ifdef, fall through to the T_INT case - case T_INT : __ mov(O0, Itos_i); break; - case T_VOID : /* nothing to do */ break; - case T_FLOAT : assert(F0 == Ftos_f, "fix this code" ); break; - case T_DOUBLE : assert(F0 == Ftos_d, "fix this code" ); break; - case T_OBJECT : - __ ld_ptr(STATE(_oop_temp), Itos_i); - __ verify_oop(Itos_i); - break; - default : ShouldNotReachHere(); - } - __ ret(); // return from interpreter activation - __ delayed()->restore(I5_savedSP, G0, SP); // remove interpreter frame - NOT_PRODUCT(__ emit_int32(0);) // marker for disassembly - return entry; -} - -// tosca based result to c++ interpreter stack based result. -// Result goes to address in L1_scratch - -address CppInterpreterGenerator::generate_tosca_to_stack_converter(BasicType type) { - // A result is in the native abi result register from a native method call. - // We need to return this result to the interpreter by pushing the result on the interpreter's - // stack. This is relatively simple the destination is in L1_scratch - // i.e. L1_scratch is the first free element on the stack. If we "push" a return value we must - // adjust L1_scratch - address entry = __ pc(); - switch (type) { - case T_BOOLEAN: - // !0 => true; 0 => false - __ subcc(G0, O0, G0); - __ addc(G0, 0, O0); - __ st(O0, L1_scratch, 0); - __ sub(L1_scratch, wordSize, L1_scratch); - break; - - // cannot use and3, 0xFFFF too big as immediate value! - case T_CHAR : - __ sll(O0, 16, O0); - __ srl(O0, 16, O0); - __ st(O0, L1_scratch, 0); - __ sub(L1_scratch, wordSize, L1_scratch); - break; - - case T_BYTE : - __ sll(O0, 24, O0); - __ sra(O0, 24, O0); - __ st(O0, L1_scratch, 0); - __ sub(L1_scratch, wordSize, L1_scratch); - break; - - case T_SHORT : - __ sll(O0, 16, O0); - __ sra(O0, 16, O0); - __ st(O0, L1_scratch, 0); - __ sub(L1_scratch, wordSize, L1_scratch); - break; - case T_LONG : -#ifndef _LP64 -#if defined(COMPILER2) - // All return values are where we want them, except for Longs. C2 returns - // longs in G1 in the 32-bit build whereas the interpreter wants them in O0/O1. - // Since the interpreter will return longs in G1 and O0/O1 in the 32bit - // build even if we are returning from interpreted we just do a little - // stupid shuffing. - // Note: I tried to make c2 return longs in O0/O1 and G1 so we wouldn't have to - // do this here. Unfortunately if we did a rethrow we'd see an machepilog node - // first which would move g1 -> O0/O1 and destroy the exception we were throwing. - __ stx(G1, L1_scratch, -wordSize); -#else - // native result is in O0, O1 - __ st(O1, L1_scratch, 0); // Low order - __ st(O0, L1_scratch, -wordSize); // High order -#endif /* COMPILER2 */ -#else - __ stx(O0, L1_scratch, -wordSize); -#endif - __ sub(L1_scratch, 2*wordSize, L1_scratch); - break; - - case T_INT : - __ st(O0, L1_scratch, 0); - __ sub(L1_scratch, wordSize, L1_scratch); - break; - - case T_VOID : /* nothing to do */ - break; - - case T_FLOAT : - __ stf(FloatRegisterImpl::S, F0, L1_scratch, 0); - __ sub(L1_scratch, wordSize, L1_scratch); - break; - - case T_DOUBLE : - // Every stack slot is aligned on 64 bit, However is this - // the correct stack slot on 64bit?? QQQ - __ stf(FloatRegisterImpl::D, F0, L1_scratch, -wordSize); - __ sub(L1_scratch, 2*wordSize, L1_scratch); - break; - case T_OBJECT : - __ verify_oop(O0); - __ st_ptr(O0, L1_scratch, 0); - __ sub(L1_scratch, wordSize, L1_scratch); - break; - default : ShouldNotReachHere(); - } - __ retl(); // return from interpreter activation - __ delayed()->nop(); // schedule this better - NOT_PRODUCT(__ emit_int32(0);) // marker for disassembly - return entry; -} - -address CppInterpreterGenerator::generate_stack_to_stack_converter(BasicType type) { - // A result is in the java expression stack of the interpreted method that has just - // returned. Place this result on the java expression stack of the caller. - // - // The current interpreter activation in Lstate is for the method just returning its - // result. So we know that the result of this method is on the top of the current - // execution stack (which is pre-pushed) and will be return to the top of the caller - // stack. The top of the callers stack is the bottom of the locals of the current - // activation. - // Because of the way activation are managed by the frame manager the value of esp is - // below both the stack top of the current activation and naturally the stack top - // of the calling activation. This enable this routine to leave the return address - // to the frame manager on the stack and do a vanilla return. - // - // On entry: O0 - points to source (callee stack top) - // O1 - points to destination (caller stack top [i.e. free location]) - // destroys O2, O3 - // - - address entry = __ pc(); - switch (type) { - case T_VOID: break; - break; - case T_FLOAT : - case T_BOOLEAN: - case T_CHAR : - case T_BYTE : - case T_SHORT : - case T_INT : - // 1 word result - __ ld(O0, 0, O2); - __ st(O2, O1, 0); - __ sub(O1, wordSize, O1); - break; - case T_DOUBLE : - case T_LONG : - // return top two words on current expression stack to caller's expression stack - // The caller's expression stack is adjacent to the current frame manager's intepretState - // except we allocated one extra word for this intepretState so we won't overwrite it - // when we return a two word result. -#ifdef _LP64 - __ ld_ptr(O0, 0, O2); - __ st_ptr(O2, O1, -wordSize); -#else - __ ld(O0, 0, O2); - __ ld(O0, wordSize, O3); - __ st(O3, O1, 0); - __ st(O2, O1, -wordSize); -#endif - __ sub(O1, 2*wordSize, O1); - break; - case T_OBJECT : - __ ld_ptr(O0, 0, O2); - __ verify_oop(O2); // verify it - __ st_ptr(O2, O1, 0); - __ sub(O1, wordSize, O1); - break; - default : ShouldNotReachHere(); - } - __ retl(); - __ delayed()->nop(); // QQ schedule this better - return entry; -} - -address CppInterpreterGenerator::generate_stack_to_native_abi_converter(BasicType type) { - // A result is in the java expression stack of the interpreted method that has just - // returned. Place this result in the native abi that the caller expects. - // We are in a new frame registers we set must be in caller (i.e. callstub) frame. - // - // Similar to generate_stack_to_stack_converter above. Called at a similar time from the - // frame manager execept in this situation the caller is native code (c1/c2/call_stub) - // and so rather than return result onto caller's java expression stack we return the - // result in the expected location based on the native abi. - // On entry: O0 - source (stack top) - // On exit result in expected output register - // QQQ schedule this better - - address entry = __ pc(); - switch (type) { - case T_VOID: break; - break; - case T_FLOAT : - __ ldf(FloatRegisterImpl::S, O0, 0, F0); - break; - case T_BOOLEAN: - case T_CHAR : - case T_BYTE : - case T_SHORT : - case T_INT : - // 1 word result - __ ld(O0, 0, O0->after_save()); - break; - case T_DOUBLE : - __ ldf(FloatRegisterImpl::D, O0, 0, F0); - break; - case T_LONG : - // return top two words on current expression stack to caller's expression stack - // The caller's expression stack is adjacent to the current frame manager's interpretState - // except we allocated one extra word for this intepretState so we won't overwrite it - // when we return a two word result. -#ifdef _LP64 - __ ld_ptr(O0, 0, O0->after_save()); -#else - __ ld(O0, wordSize, O1->after_save()); - __ ld(O0, 0, O0->after_save()); -#endif -#if defined(COMPILER2) && !defined(_LP64) - // C2 expects long results in G1 we can't tell if we're returning to interpreted - // or compiled so just be safe use G1 and O0/O1 - - // Shift bits into high (msb) of G1 - __ sllx(Otos_l1->after_save(), 32, G1); - // Zero extend low bits - __ srl (Otos_l2->after_save(), 0, Otos_l2->after_save()); - __ or3 (Otos_l2->after_save(), G1, G1); -#endif /* COMPILER2 */ - break; - case T_OBJECT : - __ ld_ptr(O0, 0, O0->after_save()); - __ verify_oop(O0->after_save()); // verify it - break; - default : ShouldNotReachHere(); - } - __ retl(); - __ delayed()->nop(); - return entry; -} - -address CppInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { - // make it look good in the debugger - return CAST_FROM_FN_PTR(address, RecursiveInterpreterActivation) + frame::pc_return_offset; -} - -address CppInterpreter::deopt_entry(TosState state, int length) { - address ret = NULL; - if (length != 0) { - switch (state) { - case atos: ret = deopt_frame_manager_return_atos; break; - case btos: ret = deopt_frame_manager_return_btos; break; - case ctos: - case stos: - case itos: ret = deopt_frame_manager_return_itos; break; - case ltos: ret = deopt_frame_manager_return_ltos; break; - case ftos: ret = deopt_frame_manager_return_ftos; break; - case dtos: ret = deopt_frame_manager_return_dtos; break; - case vtos: ret = deopt_frame_manager_return_vtos; break; - } - } else { - ret = unctrap_frame_manager_entry; // re-execute the bytecode ( e.g. uncommon trap) - } - assert(ret != NULL, "Not initialized"); - return ret; -} - -// -// Helpers for commoning out cases in the various type of method entries. -// - -// increment invocation count & check for overflow -// -// Note: checking for negative value instead of overflow -// so we have a 'sticky' overflow test -// -// Lmethod: method -// ??: invocation counter -// -void InterpreterGenerator::generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue) { - Label done; - const Register Rcounters = G3_scratch; - - __ ld_ptr(STATE(_method), G5_method); - __ get_method_counters(G5_method, Rcounters, done); - - // Update standard invocation counters - __ increment_invocation_counter(Rcounters, O0, G4_scratch); - if (ProfileInterpreter) { - Address interpreter_invocation_counter(Rcounters, - in_bytes(MethodCounters::interpreter_invocation_counter_offset())); - __ ld(interpreter_invocation_counter, G4_scratch); - __ inc(G4_scratch); - __ st(G4_scratch, interpreter_invocation_counter); - } - - AddressLiteral invocation_limit((address)&InvocationCounter::InterpreterInvocationLimit); - __ load_contents(invocation_limit, G3_scratch); - __ cmp(O0, G3_scratch); - __ br(Assembler::greaterEqualUnsigned, false, Assembler::pn, *overflow); - __ delayed()->nop(); - __ bind(done); -} - -address InterpreterGenerator::generate_empty_entry(void) { - - // A method that does nothing but return... - - address entry = __ pc(); - Label slow_path; - - // do nothing for empty methods (do not even increment invocation counter) - if ( UseFastEmptyMethods) { - // If we need a safepoint check, generate full interpreter entry. - AddressLiteral sync_state(SafepointSynchronize::address_of_state()); - __ load_contents(sync_state, G3_scratch); - __ cmp(G3_scratch, SafepointSynchronize::_not_synchronized); - __ br(Assembler::notEqual, false, Assembler::pn, frame_manager_entry); - __ delayed()->nop(); - - // Code: _return - __ retl(); - __ delayed()->mov(O5_savedSP, SP); - return entry; - } - return NULL; -} - -address InterpreterGenerator::generate_Reference_get_entry(void) { -#if INCLUDE_ALL_GCS - if (UseG1GC) { - // We need to generate have a routine that generates code to: - // * load the value in the referent field - // * passes that value to the pre-barrier. - // - // In the case of G1 this will record the value of the - // referent in an SATB buffer if marking is active. - // This will cause concurrent marking to mark the referent - // field as live. - Unimplemented(); - } -#endif // INCLUDE_ALL_GCS - - // If G1 is not enabled then attempt to go through the accessor entry point - // Reference.get is an accessor - return NULL; -} - -// -// Interpreter stub for calling a native method. (C++ interpreter) -// This sets up a somewhat different looking stack for calling the native method -// than the typical interpreter frame setup. -// - -address InterpreterGenerator::generate_native_entry(bool synchronized) { - address entry = __ pc(); - - // the following temporary registers are used during frame creation - const Register Gtmp1 = G3_scratch ; - const Register Gtmp2 = G1_scratch; - const Register RconstMethod = Gtmp1; - const Address constMethod(G5_method, in_bytes(Method::const_offset())); - const Address size_of_parameters(RconstMethod, in_bytes(ConstMethod::size_of_parameters_offset())); - - bool inc_counter = UseCompiler || CountCompiledCalls; - - // make sure registers are different! - assert_different_registers(G2_thread, G5_method, Gargs, Gtmp1, Gtmp2); - - const Address access_flags (G5_method, in_bytes(Method::access_flags_offset())); - - Label Lentry; - __ bind(Lentry); - - const Register Glocals_size = G3; - assert_different_registers(Glocals_size, G4_scratch, Gframe_size); - - // make sure method is native & not abstract - // rethink these assertions - they can be simplified and shared (gri 2/25/2000) -#ifdef ASSERT - __ ld(access_flags, Gtmp1); - { - Label L; - __ btst(JVM_ACC_NATIVE, Gtmp1); - __ br(Assembler::notZero, false, Assembler::pt, L); - __ delayed()->nop(); - __ stop("tried to execute non-native method as native"); - __ bind(L); - } - { Label L; - __ btst(JVM_ACC_ABSTRACT, Gtmp1); - __ br(Assembler::zero, false, Assembler::pt, L); - __ delayed()->nop(); - __ stop("tried to execute abstract method as non-abstract"); - __ bind(L); - } -#endif // ASSERT - - __ ld_ptr(constMethod, RconstMethod); - __ lduh(size_of_parameters, Gtmp1); - __ sll(Gtmp1, LogBytesPerWord, Gtmp2); // parameter size in bytes - __ add(Gargs, Gtmp2, Gargs); // points to first local + BytesPerWord - // NEW - __ add(Gargs, -wordSize, Gargs); // points to first local[0] - // generate the code to allocate the interpreter stack frame - // NEW FRAME ALLOCATED HERE - // save callers original sp - // __ mov(SP, I5_savedSP->after_restore()); - - generate_compute_interpreter_state(Lstate, G0, true); - - // At this point Lstate points to new interpreter state - // - - const Address do_not_unlock_if_synchronized(G2_thread, - in_bytes(JavaThread::do_not_unlock_if_synchronized_offset())); - // Since at this point in the method invocation the exception handler - // would try to exit the monitor of synchronized methods which hasn't - // been entered yet, we set the thread local variable - // _do_not_unlock_if_synchronized to true. If any exception was thrown by - // runtime, exception handling i.e. unlock_if_synchronized_method will - // check this thread local flag. - // This flag has two effects, one is to force an unwind in the topmost - // interpreter frame and not perform an unlock while doing so. - - __ movbool(true, G3_scratch); - __ stbool(G3_scratch, do_not_unlock_if_synchronized); - - - // increment invocation counter and check for overflow - // - // Note: checking for negative value instead of overflow - // so we have a 'sticky' overflow test (may be of - // importance as soon as we have true MT/MP) - Label invocation_counter_overflow; - if (inc_counter) { - generate_counter_incr(&invocation_counter_overflow, NULL, NULL); - } - Label Lcontinue; - __ bind(Lcontinue); - - bang_stack_shadow_pages(true); - // reset the _do_not_unlock_if_synchronized flag - __ stbool(G0, do_not_unlock_if_synchronized); - - // check for synchronized methods - // Must happen AFTER invocation_counter check, so method is not locked - // if counter overflows. - - if (synchronized) { - lock_method(); - // Don't see how G2_thread is preserved here... - // __ verify_thread(); QQQ destroys L0,L1 can't use - } else { -#ifdef ASSERT - { Label ok; - __ ld_ptr(STATE(_method), G5_method); - __ ld(access_flags, O0); - __ btst(JVM_ACC_SYNCHRONIZED, O0); - __ br( Assembler::zero, false, Assembler::pt, ok); - __ delayed()->nop(); - __ stop("method needs synchronization"); - __ bind(ok); - } -#endif // ASSERT - } - - // start execution - -// __ verify_thread(); kills L1,L2 can't use at the moment - - // jvmti/jvmpi support - __ notify_method_entry(); - - // native call - - // (note that O0 is never an oop--at most it is a handle) - // It is important not to smash any handles created by this call, - // until any oop handle in O0 is dereferenced. - - // (note that the space for outgoing params is preallocated) - - // get signature handler - - Label pending_exception_present; - - { Label L; - __ ld_ptr(STATE(_method), G5_method); - __ ld_ptr(Address(G5_method, in_bytes(Method::signature_handler_offset())), G3_scratch); - __ tst(G3_scratch); - __ brx(Assembler::notZero, false, Assembler::pt, L); - __ delayed()->nop(); - __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::prepare_native_call), G5_method, false); - __ ld_ptr(STATE(_method), G5_method); - - Address exception_addr(G2_thread, in_bytes(Thread::pending_exception_offset())); - __ ld_ptr(exception_addr, G3_scratch); - __ br_notnull_short(G3_scratch, Assembler::pn, pending_exception_present); - __ ld_ptr(Address(G5_method, in_bytes(Method::signature_handler_offset())), G3_scratch); - __ bind(L); - } - - // Push a new frame so that the args will really be stored in - // Copy a few locals across so the new frame has the variables - // we need but these values will be dead at the jni call and - // therefore not gc volatile like the values in the current - // frame (Lstate in particular) - - // Flush the state pointer to the register save area - // Which is the only register we need for a stack walk. - __ st_ptr(Lstate, SP, (Lstate->sp_offset_in_saved_window() * wordSize) + STACK_BIAS); - - __ mov(Lstate, O1); // Need to pass the state pointer across the frame - - // Calculate current frame size - __ sub(SP, FP, O3); // Calculate negative of current frame size - __ save(SP, O3, SP); // Allocate an identical sized frame - - __ mov(I1, Lstate); // In the "natural" register. - - // Note I7 has leftover trash. Slow signature handler will fill it in - // should we get there. Normal jni call will set reasonable last_Java_pc - // below (and fix I7 so the stack trace doesn't have a meaningless frame - // in it). - - - // call signature handler - __ ld_ptr(STATE(_method), Lmethod); - __ ld_ptr(STATE(_locals), Llocals); - - __ callr(G3_scratch, 0); - __ delayed()->nop(); - __ ld_ptr(STATE(_thread), G2_thread); // restore thread (shouldn't be needed) - - { Label not_static; - - __ ld_ptr(STATE(_method), G5_method); - __ ld(access_flags, O0); - __ btst(JVM_ACC_STATIC, O0); - __ br( Assembler::zero, false, Assembler::pt, not_static); - __ delayed()-> - // get native function entry point(O0 is a good temp until the very end) - ld_ptr(Address(G5_method, in_bytes(Method::native_function_offset())), O0); - // for static methods insert the mirror argument - const int mirror_offset = in_bytes(Klass::java_mirror_offset()); - - __ ld_ptr(Address(G5_method, in_bytes(Method:: const_offset())), O1); - __ ld_ptr(Address(O1, in_bytes(ConstMethod::constants_offset())), O1); - __ ld_ptr(Address(O1, ConstantPool::pool_holder_offset_in_bytes()), O1); - __ ld_ptr(O1, mirror_offset, O1); - // where the mirror handle body is allocated: -#ifdef ASSERT - if (!PrintSignatureHandlers) // do not dirty the output with this - { Label L; - __ tst(O1); - __ brx(Assembler::notZero, false, Assembler::pt, L); - __ delayed()->nop(); - __ stop("mirror is missing"); - __ bind(L); - } -#endif // ASSERT - __ st_ptr(O1, STATE(_oop_temp)); - __ add(STATE(_oop_temp), O1); // this is really an LEA not an add - __ bind(not_static); - } - - // At this point, arguments have been copied off of stack into - // their JNI positions, which are O1..O5 and SP[68..]. - // Oops are boxed in-place on the stack, with handles copied to arguments. - // The result handler is in Lscratch. O0 will shortly hold the JNIEnv*. - -#ifdef ASSERT - { Label L; - __ tst(O0); - __ brx(Assembler::notZero, false, Assembler::pt, L); - __ delayed()->nop(); - __ stop("native entry point is missing"); - __ bind(L); - } -#endif // ASSERT - - // - // setup the java frame anchor - // - // The scavenge function only needs to know that the PC of this frame is - // in the interpreter method entry code, it doesn't need to know the exact - // PC and hence we can use O7 which points to the return address from the - // previous call in the code stream (signature handler function) - // - // The other trick is we set last_Java_sp to FP instead of the usual SP because - // we have pushed the extra frame in order to protect the volatile register(s) - // in that frame when we return from the jni call - // - - - __ set_last_Java_frame(FP, O7); - __ mov(O7, I7); // make dummy interpreter frame look like one above, - // not meaningless information that'll confuse me. - - // flush the windows now. We don't care about the current (protection) frame - // only the outer frames - - __ flushw(); - - // mark windows as flushed - Address flags(G2_thread, - in_bytes(JavaThread::frame_anchor_offset()) + in_bytes(JavaFrameAnchor::flags_offset())); - __ set(JavaFrameAnchor::flushed, G3_scratch); - __ st(G3_scratch, flags); - - // Transition from _thread_in_Java to _thread_in_native. We are already safepoint ready. - - Address thread_state(G2_thread, in_bytes(JavaThread::thread_state_offset())); -#ifdef ASSERT - { Label L; - __ ld(thread_state, G3_scratch); - __ cmp(G3_scratch, _thread_in_Java); - __ br(Assembler::equal, false, Assembler::pt, L); - __ delayed()->nop(); - __ stop("Wrong thread state in native stub"); - __ bind(L); - } -#endif // ASSERT - __ set(_thread_in_native, G3_scratch); - __ st(G3_scratch, thread_state); - - // Call the jni method, using the delay slot to set the JNIEnv* argument. - __ callr(O0, 0); - __ delayed()-> - add(G2_thread, in_bytes(JavaThread::jni_environment_offset()), O0); - __ ld_ptr(STATE(_thread), G2_thread); // restore thread - - // must we block? - - // Block, if necessary, before resuming in _thread_in_Java state. - // In order for GC to work, don't clear the last_Java_sp until after blocking. - { Label no_block; - AddressLiteral sync_state(SafepointSynchronize::address_of_state()); - - // Switch thread to "native transition" state before reading the synchronization state. - // This additional state is necessary because reading and testing the synchronization - // state is not atomic w.r.t. GC, as this scenario demonstrates: - // Java thread A, in _thread_in_native state, loads _not_synchronized and is preempted. - // VM thread changes sync state to synchronizing and suspends threads for GC. - // Thread A is resumed to finish this native method, but doesn't block here since it - // didn't see any synchronization is progress, and escapes. - __ set(_thread_in_native_trans, G3_scratch); - __ st(G3_scratch, thread_state); - if(os::is_MP()) { - // Write serialization page so VM thread can do a pseudo remote membar. - // We use the current thread pointer to calculate a thread specific - // offset to write to within the page. This minimizes bus traffic - // due to cache line collision. - __ serialize_memory(G2_thread, G1_scratch, G3_scratch); - } - __ load_contents(sync_state, G3_scratch); - __ cmp(G3_scratch, SafepointSynchronize::_not_synchronized); - - - Label L; - Address suspend_state(G2_thread, in_bytes(JavaThread::suspend_flags_offset())); - __ br(Assembler::notEqual, false, Assembler::pn, L); - __ delayed()-> - ld(suspend_state, G3_scratch); - __ cmp(G3_scratch, 0); - __ br(Assembler::equal, false, Assembler::pt, no_block); - __ delayed()->nop(); - __ bind(L); - - // Block. Save any potential method result value before the operation and - // use a leaf call to leave the last_Java_frame setup undisturbed. - save_native_result(); - __ call_VM_leaf(noreg, - CAST_FROM_FN_PTR(address, JavaThread::check_safepoint_and_suspend_for_native_trans), - G2_thread); - __ ld_ptr(STATE(_thread), G2_thread); // restore thread - // Restore any method result value - restore_native_result(); - __ bind(no_block); - } - - // Clear the frame anchor now - - __ reset_last_Java_frame(); - - // Move the result handler address - __ mov(Lscratch, G3_scratch); - // return possible result to the outer frame -#ifndef __LP64 - __ mov(O0, I0); - __ restore(O1, G0, O1); -#else - __ restore(O0, G0, O0); -#endif /* __LP64 */ - - // Move result handler to expected register - __ mov(G3_scratch, Lscratch); - - - // thread state is thread_in_native_trans. Any safepoint blocking has - // happened in the trampoline we are ready to switch to thread_in_Java. - - __ set(_thread_in_Java, G3_scratch); - __ st(G3_scratch, thread_state); - - // If we have an oop result store it where it will be safe for any further gc - // until we return now that we've released the handle it might be protected by - - { - Label no_oop, store_result; - - __ set((intptr_t)AbstractInterpreter::result_handler(T_OBJECT), G3_scratch); - __ cmp(G3_scratch, Lscratch); - __ brx(Assembler::notEqual, false, Assembler::pt, no_oop); - __ delayed()->nop(); - __ addcc(G0, O0, O0); - __ brx(Assembler::notZero, true, Assembler::pt, store_result); // if result is not NULL: - __ delayed()->ld_ptr(O0, 0, O0); // unbox it - __ mov(G0, O0); - - __ bind(store_result); - // Store it where gc will look for it and result handler expects it. - __ st_ptr(O0, STATE(_oop_temp)); - - __ bind(no_oop); - - } - - // reset handle block - __ ld_ptr(G2_thread, in_bytes(JavaThread::active_handles_offset()), G3_scratch); - __ st(G0, G3_scratch, JNIHandleBlock::top_offset_in_bytes()); - - - // handle exceptions (exception handling will handle unlocking!) - { Label L; - Address exception_addr (G2_thread, in_bytes(Thread::pending_exception_offset())); - - __ ld_ptr(exception_addr, Gtemp); - __ tst(Gtemp); - __ brx(Assembler::equal, false, Assembler::pt, L); - __ delayed()->nop(); - __ bind(pending_exception_present); - // With c++ interpreter we just leave it pending caller will do the correct thing. However... - // Like x86 we ignore the result of the native call and leave the method locked. This - // seems wrong to leave things locked. - - __ br(Assembler::always, false, Assembler::pt, StubRoutines::forward_exception_entry(), relocInfo::runtime_call_type); - __ delayed()->restore(I5_savedSP, G0, SP); // remove interpreter frame - - __ bind(L); - } - - // jvmdi/jvmpi support (preserves thread register) - __ notify_method_exit(true, ilgl, InterpreterMacroAssembler::NotifyJVMTI); - - if (synchronized) { - // save and restore any potential method result value around the unlocking operation - save_native_result(); - - const int entry_size = frame::interpreter_frame_monitor_size() * wordSize; - // Get the initial monitor we allocated - __ sub(Lstate, entry_size, O1); // initial monitor - __ unlock_object(O1); - restore_native_result(); - } - -#if defined(COMPILER2) && !defined(_LP64) - - // C2 expects long results in G1 we can't tell if we're returning to interpreted - // or compiled so just be safe. - - __ sllx(O0, 32, G1); // Shift bits into high G1 - __ srl (O1, 0, O1); // Zero extend O1 - __ or3 (O1, G1, G1); // OR 64 bits into G1 - -#endif /* COMPILER2 && !_LP64 */ - -#ifdef ASSERT - { - Label ok; - __ cmp(I5_savedSP, FP); - __ brx(Assembler::greaterEqualUnsigned, false, Assembler::pt, ok); - __ delayed()->nop(); - __ stop("bad I5_savedSP value"); - __ should_not_reach_here(); - __ bind(ok); - } -#endif - // Calls result handler which POPS FRAME - if (TraceJumps) { - // Move target to register that is recordable - __ mov(Lscratch, G3_scratch); - __ JMP(G3_scratch, 0); - } else { - __ jmp(Lscratch, 0); - } - __ delayed()->nop(); - - if (inc_counter) { - // handle invocation counter overflow - __ bind(invocation_counter_overflow); - generate_counter_overflow(Lcontinue); - } - - - return entry; -} - -void CppInterpreterGenerator::generate_compute_interpreter_state(const Register state, - const Register prev_state, - bool native) { - - // On entry - // G5_method - caller's method - // Gargs - points to initial parameters (i.e. locals[0]) - // G2_thread - valid? (C1 only??) - // "prev_state" - contains any previous frame manager state which we must save a link - // - // On return - // "state" is a pointer to the newly allocated state object. We must allocate and initialize - // a new interpretState object and the method expression stack. - - assert_different_registers(state, prev_state); - assert_different_registers(prev_state, G3_scratch); - const Register Gtmp = G3_scratch; - const Address constMethod (G5_method, in_bytes(Method::const_offset())); - const Address access_flags (G5_method, in_bytes(Method::access_flags_offset())); - - // slop factor is two extra slots on the expression stack so that - // we always have room to store a result when returning from a call without parameters - // that returns a result. - - const int slop_factor = 2*wordSize; - - const int fixed_size = ((sizeof(BytecodeInterpreter) + slop_factor) >> LogBytesPerWord) + // what is the slop factor? - Method::extra_stack_entries() + // extra stack for jsr 292 - frame::memory_parameter_word_sp_offset + // register save area + param window - (native ? frame::interpreter_frame_extra_outgoing_argument_words : 0); // JNI, class - - // XXX G5_method valid - - // Now compute new frame size - - if (native) { - const Register RconstMethod = Gtmp; - const Address size_of_parameters(RconstMethod, in_bytes(ConstMethod::size_of_parameters_offset())); - __ ld_ptr(constMethod, RconstMethod); - __ lduh( size_of_parameters, Gtmp ); - __ calc_mem_param_words(Gtmp, Gtmp); // space for native call parameters passed on the stack in words - } else { - // Full size expression stack - __ ld_ptr(constMethod, Gtmp); - __ lduh(Gtmp, in_bytes(ConstMethod::max_stack_offset()), Gtmp); - } - __ add(Gtmp, fixed_size, Gtmp); // plus the fixed portion - - __ neg(Gtmp); // negative space for stack/parameters in words - __ and3(Gtmp, -WordsPerLong, Gtmp); // make multiple of 2 (SP must be 2-word aligned) - __ sll(Gtmp, LogBytesPerWord, Gtmp); // negative space for frame in bytes - - // Need to do stack size check here before we fault on large frames - - Label stack_ok; - - const int max_pages = StackShadowPages > (StackRedPages+StackYellowPages) ? StackShadowPages : - (StackRedPages+StackYellowPages); - - - __ ld_ptr(G2_thread, in_bytes(Thread::stack_base_offset()), O0); - __ ld_ptr(G2_thread, in_bytes(Thread::stack_size_offset()), O1); - // compute stack bottom - __ sub(O0, O1, O0); - - // Avoid touching the guard pages - // Also a fudge for frame size of BytecodeInterpreter::run - // It varies from 1k->4k depending on build type - const int fudge = 6 * K; - - __ set(fudge + (max_pages * os::vm_page_size()), O1); - - __ add(O0, O1, O0); - __ sub(O0, Gtmp, O0); - __ cmp(SP, O0); - __ brx(Assembler::greaterUnsigned, false, Assembler::pt, stack_ok); - __ delayed()->nop(); - - // throw exception return address becomes throwing pc - - __ call_VM(Oexception, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_StackOverflowError)); - __ stop("never reached"); - - __ bind(stack_ok); - - __ save(SP, Gtmp, SP); // setup new frame and register window - - // New window I7 call_stub or previous activation - // O6 - register save area, BytecodeInterpreter just below it, args/locals just above that - // - __ sub(FP, sizeof(BytecodeInterpreter), state); // Point to new Interpreter state - __ add(state, STACK_BIAS, state ); // Account for 64bit bias - -#define XXX_STATE(field_name) state, in_bytes(byte_offset_of(BytecodeInterpreter, field_name)) - - // Initialize a new Interpreter state - // orig_sp - caller's original sp - // G2_thread - thread - // Gargs - &locals[0] (unbiased?) - // G5_method - method - // SP (biased) - accounts for full size java stack, BytecodeInterpreter object, register save area, and register parameter save window - - - __ set(0xdead0004, O1); - - - __ st_ptr(Gargs, XXX_STATE(_locals)); - __ st_ptr(G0, XXX_STATE(_oop_temp)); - - __ st_ptr(state, XXX_STATE(_self_link)); // point to self - __ st_ptr(prev_state->after_save(), XXX_STATE(_prev_link)); // Chain interpreter states - __ st_ptr(G2_thread, XXX_STATE(_thread)); // Store javathread - - if (native) { - __ st_ptr(G0, XXX_STATE(_bcp)); - } else { - __ ld_ptr(G5_method, in_bytes(Method::const_offset()), O2); // get ConstMethod* - __ add(O2, in_bytes(ConstMethod::codes_offset()), O2); // get bcp - __ st_ptr(O2, XXX_STATE(_bcp)); - } - - __ st_ptr(G0, XXX_STATE(_mdx)); - __ st_ptr(G5_method, XXX_STATE(_method)); - - __ set((int) BytecodeInterpreter::method_entry, O1); - __ st(O1, XXX_STATE(_msg)); - - __ ld_ptr(constMethod, O3); - __ ld_ptr(O3, in_bytes(ConstMethod::constants_offset()), O3); - __ ld_ptr(O3, ConstantPool::cache_offset_in_bytes(), O2); - __ st_ptr(O2, XXX_STATE(_constants)); - - __ st_ptr(G0, XXX_STATE(_result._to_call._callee)); - - // Monitor base is just start of BytecodeInterpreter object; - __ mov(state, O2); - __ st_ptr(O2, XXX_STATE(_monitor_base)); - - // Do we need a monitor for synchonized method? - { - __ ld(access_flags, O1); - Label done; - Label got_obj; - __ btst(JVM_ACC_SYNCHRONIZED, O1); - __ br( Assembler::zero, false, Assembler::pt, done); - - const int mirror_offset = in_bytes(Klass::java_mirror_offset()); - __ delayed()->btst(JVM_ACC_STATIC, O1); - __ ld_ptr(XXX_STATE(_locals), O1); - __ br( Assembler::zero, true, Assembler::pt, got_obj); - __ delayed()->ld_ptr(O1, 0, O1); // get receiver for not-static case - __ ld_ptr(constMethod, O1); - __ ld_ptr( O1, in_bytes(ConstMethod::constants_offset()), O1); - __ ld_ptr( O1, ConstantPool::pool_holder_offset_in_bytes(), O1); - // lock the mirror, not the Klass* - __ ld_ptr( O1, mirror_offset, O1); - - __ bind(got_obj); - - #ifdef ASSERT - __ tst(O1); - __ breakpoint_trap(Assembler::zero, Assembler::ptr_cc); - #endif // ASSERT - - const int entry_size = frame::interpreter_frame_monitor_size() * wordSize; - __ sub(SP, entry_size, SP); // account for initial monitor - __ sub(O2, entry_size, O2); // initial monitor - __ st_ptr(O1, O2, BasicObjectLock::obj_offset_in_bytes()); // and allocate it for interpreter use - __ bind(done); - } - - // Remember initial frame bottom - - __ st_ptr(SP, XXX_STATE(_frame_bottom)); - - __ st_ptr(O2, XXX_STATE(_stack_base)); - - __ sub(O2, wordSize, O2); // prepush - __ st_ptr(O2, XXX_STATE(_stack)); // PREPUSH - - // Full size expression stack - __ ld_ptr(constMethod, O3); - __ lduh(O3, in_bytes(ConstMethod::max_stack_offset()), O3); - __ inc(O3, Method::extra_stack_entries()); - __ sll(O3, LogBytesPerWord, O3); - __ sub(O2, O3, O3); -// __ sub(O3, wordSize, O3); // so prepush doesn't look out of bounds - __ st_ptr(O3, XXX_STATE(_stack_limit)); - - if (!native) { - // - // Code to initialize locals - // - Register init_value = noreg; // will be G0 if we must clear locals - // Now zero locals - if (true /* zerolocals */ || ClearInterpreterLocals) { - // explicitly initialize locals - init_value = G0; - } else { - #ifdef ASSERT - // initialize locals to a garbage pattern for better debugging - init_value = O3; - __ set( 0x0F0F0F0F, init_value ); - #endif // ASSERT - } - if (init_value != noreg) { - Label clear_loop; - const Register RconstMethod = O1; - const Address size_of_parameters(RconstMethod, in_bytes(ConstMethod::size_of_parameters_offset())); - const Address size_of_locals (RconstMethod, in_bytes(ConstMethod::size_of_locals_offset())); - - // NOTE: If you change the frame layout, this code will need to - // be updated! - __ ld_ptr( constMethod, RconstMethod ); - __ lduh( size_of_locals, O2 ); - __ lduh( size_of_parameters, O1 ); - __ sll( O2, LogBytesPerWord, O2); - __ sll( O1, LogBytesPerWord, O1 ); - __ ld_ptr(XXX_STATE(_locals), L2_scratch); - __ sub( L2_scratch, O2, O2 ); - __ sub( L2_scratch, O1, O1 ); - - __ bind( clear_loop ); - __ inc( O2, wordSize ); - - __ cmp( O2, O1 ); - __ br( Assembler::lessEqualUnsigned, true, Assembler::pt, clear_loop ); - __ delayed()->st_ptr( init_value, O2, 0 ); - } - } -} -// Find preallocated monitor and lock method (C++ interpreter) -// -void CppInterpreterGenerator::lock_method() { -// Lock the current method. -// Destroys registers L2_scratch, L3_scratch, O0 -// -// Find everything relative to Lstate - -#ifdef ASSERT - __ ld_ptr(STATE(_method), L2_scratch); - __ ld(L2_scratch, in_bytes(Method::access_flags_offset()), O0); - - { Label ok; - __ btst(JVM_ACC_SYNCHRONIZED, O0); - __ br( Assembler::notZero, false, Assembler::pt, ok); - __ delayed()->nop(); - __ stop("method doesn't need synchronization"); - __ bind(ok); - } -#endif // ASSERT - - // monitor is already allocated at stack base - // and the lockee is already present - __ ld_ptr(STATE(_stack_base), L2_scratch); - __ ld_ptr(L2_scratch, BasicObjectLock::obj_offset_in_bytes(), O0); // get object - __ lock_object(L2_scratch, O0); - -} - -// Generate code for handling resuming a deopted method -void CppInterpreterGenerator::generate_deopt_handling() { - - Label return_from_deopt_common; - - // deopt needs to jump to here to enter the interpreter (return a result) - deopt_frame_manager_return_atos = __ pc(); - - // O0/O1 live - __ ba(return_from_deopt_common); - __ delayed()->set(AbstractInterpreter::BasicType_as_index(T_OBJECT), L3_scratch); // Result stub address array index - - - // deopt needs to jump to here to enter the interpreter (return a result) - deopt_frame_manager_return_btos = __ pc(); - - // O0/O1 live - __ ba(return_from_deopt_common); - __ delayed()->set(AbstractInterpreter::BasicType_as_index(T_BOOLEAN), L3_scratch); // Result stub address array index - - // deopt needs to jump to here to enter the interpreter (return a result) - deopt_frame_manager_return_itos = __ pc(); - - // O0/O1 live - __ ba(return_from_deopt_common); - __ delayed()->set(AbstractInterpreter::BasicType_as_index(T_INT), L3_scratch); // Result stub address array index - - // deopt needs to jump to here to enter the interpreter (return a result) - - deopt_frame_manager_return_ltos = __ pc(); -#if !defined(_LP64) && defined(COMPILER2) - // All return values are where we want them, except for Longs. C2 returns - // longs in G1 in the 32-bit build whereas the interpreter wants them in O0/O1. - // Since the interpreter will return longs in G1 and O0/O1 in the 32bit - // build even if we are returning from interpreted we just do a little - // stupid shuffing. - // Note: I tried to make c2 return longs in O0/O1 and G1 so we wouldn't have to - // do this here. Unfortunately if we did a rethrow we'd see an machepilog node - // first which would move g1 -> O0/O1 and destroy the exception we were throwing. - - __ srl (G1, 0,O1); - __ srlx(G1,32,O0); -#endif /* !_LP64 && COMPILER2 */ - // O0/O1 live - __ ba(return_from_deopt_common); - __ delayed()->set(AbstractInterpreter::BasicType_as_index(T_LONG), L3_scratch); // Result stub address array index - - // deopt needs to jump to here to enter the interpreter (return a result) - - deopt_frame_manager_return_ftos = __ pc(); - // O0/O1 live - __ ba(return_from_deopt_common); - __ delayed()->set(AbstractInterpreter::BasicType_as_index(T_FLOAT), L3_scratch); // Result stub address array index - - // deopt needs to jump to here to enter the interpreter (return a result) - deopt_frame_manager_return_dtos = __ pc(); - - // O0/O1 live - __ ba(return_from_deopt_common); - __ delayed()->set(AbstractInterpreter::BasicType_as_index(T_DOUBLE), L3_scratch); // Result stub address array index - - // deopt needs to jump to here to enter the interpreter (return a result) - deopt_frame_manager_return_vtos = __ pc(); - - // O0/O1 live - __ set(AbstractInterpreter::BasicType_as_index(T_VOID), L3_scratch); - - // Deopt return common - // an index is present that lets us move any possible result being - // return to the interpreter's stack - // - __ bind(return_from_deopt_common); - - // Result if any is in native abi result (O0..O1/F0..F1). The java expression - // stack is in the state that the calling convention left it. - // Copy the result from native abi result and place it on java expression stack. - - // Current interpreter state is present in Lstate - - // Get current pre-pushed top of interpreter stack - // Any result (if any) is in native abi - // result type index is in L3_scratch - - __ ld_ptr(STATE(_stack), L1_scratch); // get top of java expr stack - - __ set((intptr_t)CppInterpreter::_tosca_to_stack, L4_scratch); - __ sll(L3_scratch, LogBytesPerWord, L3_scratch); - __ ld_ptr(L4_scratch, L3_scratch, Lscratch); // get typed result converter address - __ jmpl(Lscratch, G0, O7); // and convert it - __ delayed()->nop(); - - // L1_scratch points to top of stack (prepushed) - __ st_ptr(L1_scratch, STATE(_stack)); -} - -// Generate the code to handle a more_monitors message from the c++ interpreter -void CppInterpreterGenerator::generate_more_monitors() { - - Label entry, loop; - const int entry_size = frame::interpreter_frame_monitor_size() * wordSize; - // 1. compute new pointers // esp: old expression stack top - __ delayed()->ld_ptr(STATE(_stack_base), L4_scratch); // current expression stack bottom - __ sub(L4_scratch, entry_size, L4_scratch); - __ st_ptr(L4_scratch, STATE(_stack_base)); - - __ sub(SP, entry_size, SP); // Grow stack - __ st_ptr(SP, STATE(_frame_bottom)); - - __ ld_ptr(STATE(_stack_limit), L2_scratch); - __ sub(L2_scratch, entry_size, L2_scratch); - __ st_ptr(L2_scratch, STATE(_stack_limit)); - - __ ld_ptr(STATE(_stack), L1_scratch); // Get current stack top - __ sub(L1_scratch, entry_size, L1_scratch); - __ st_ptr(L1_scratch, STATE(_stack)); - __ ba(entry); - __ delayed()->add(L1_scratch, wordSize, L1_scratch); // first real entry (undo prepush) - - // 2. move expression stack - - __ bind(loop); - __ st_ptr(L3_scratch, Address(L1_scratch, 0)); - __ add(L1_scratch, wordSize, L1_scratch); - __ bind(entry); - __ cmp(L1_scratch, L4_scratch); - __ br(Assembler::notEqual, false, Assembler::pt, loop); - __ delayed()->ld_ptr(L1_scratch, entry_size, L3_scratch); - - // now zero the slot so we can find it. - __ st_ptr(G0, L4_scratch, BasicObjectLock::obj_offset_in_bytes()); - -} - -// Initial entry to C++ interpreter from the call_stub. -// This entry point is called the frame manager since it handles the generation -// of interpreter activation frames via requests directly from the vm (via call_stub) -// and via requests from the interpreter. The requests from the call_stub happen -// directly thru the entry point. Requests from the interpreter happen via returning -// from the interpreter and examining the message the interpreter has returned to -// the frame manager. The frame manager can take the following requests: - -// NO_REQUEST - error, should never happen. -// MORE_MONITORS - need a new monitor. Shuffle the expression stack on down and -// allocate a new monitor. -// CALL_METHOD - setup a new activation to call a new method. Very similar to what -// happens during entry during the entry via the call stub. -// RETURN_FROM_METHOD - remove an activation. Return to interpreter or call stub. -// -// Arguments: -// -// ebx: Method* -// ecx: receiver - unused (retrieved from stack as needed) -// esi: previous frame manager state (NULL from the call_stub/c1/c2) -// -// -// Stack layout at entry -// -// [ return address ] <--- esp -// [ parameter n ] -// ... -// [ parameter 1 ] -// [ expression stack ] -// -// -// We are free to blow any registers we like because the call_stub which brought us here -// initially has preserved the callee save registers already. -// -// - -static address interpreter_frame_manager = NULL; - -#ifdef ASSERT - #define VALIDATE_STATE(scratch, marker) \ - { \ - Label skip; \ - __ ld_ptr(STATE(_self_link), scratch); \ - __ cmp(Lstate, scratch); \ - __ brx(Assembler::equal, false, Assembler::pt, skip); \ - __ delayed()->nop(); \ - __ breakpoint_trap(); \ - __ emit_int32(marker); \ - __ bind(skip); \ - } -#else - #define VALIDATE_STATE(scratch, marker) -#endif /* ASSERT */ - -void CppInterpreterGenerator::adjust_callers_stack(Register args) { -// -// Adjust caller's stack so that all the locals can be contiguous with -// the parameters. -// Worries about stack overflow make this a pain. -// -// Destroys args, G3_scratch, G3_scratch -// In/Out O5_savedSP (sender's original SP) -// -// assert_different_registers(state, prev_state); - const Register Gtmp = G3_scratch; - const Register RconstMethod = G3_scratch; - const Register tmp = O2; - const Address constMethod(G5_method, in_bytes(Method::const_offset())); - const Address size_of_parameters(RconstMethod, in_bytes(ConstMethod::size_of_parameters_offset())); - const Address size_of_locals (RconstMethod, in_bytes(ConstMethod::size_of_locals_offset())); - - __ ld_ptr(constMethod, RconstMethod); - __ lduh(size_of_parameters, tmp); - __ sll(tmp, LogBytesPerWord, Gargs); // parameter size in bytes - __ add(args, Gargs, Gargs); // points to first local + BytesPerWord - // NEW - __ add(Gargs, -wordSize, Gargs); // points to first local[0] - // determine extra space for non-argument locals & adjust caller's SP - // Gtmp1: parameter size in words - __ lduh(size_of_locals, Gtmp); - __ compute_extra_locals_size_in_bytes(tmp, Gtmp, Gtmp); - -#if 1 - // c2i adapters place the final interpreter argument in the register save area for O0/I0 - // the call_stub will place the final interpreter argument at - // frame::memory_parameter_word_sp_offset. This is mostly not noticable for either asm - // or c++ interpreter. However with the c++ interpreter when we do a recursive call - // and try to make it look good in the debugger we will store the argument to - // RecursiveInterpreterActivation in the register argument save area. Without allocating - // extra space for the compiler this will overwrite locals in the local array of the - // interpreter. - // QQQ still needed with frameless adapters??? - - const int c2i_adjust_words = frame::memory_parameter_word_sp_offset - frame::callee_register_argument_save_area_sp_offset; - - __ add(Gtmp, c2i_adjust_words*wordSize, Gtmp); -#endif // 1 - - - __ sub(SP, Gtmp, SP); // just caller's frame for the additional space we need. -} - -address InterpreterGenerator::generate_normal_entry(bool synchronized) { - - // G5_method: Method* - // G2_thread: thread (unused) - // Gargs: bottom of args (sender_sp) - // O5: sender's sp - - // A single frame manager is plenty as we don't specialize for synchronized. We could and - // the code is pretty much ready. Would need to change the test below and for good measure - // modify generate_interpreter_state to only do the (pre) sync stuff stuff for synchronized - // routines. Not clear this is worth it yet. - - if (interpreter_frame_manager) { - return interpreter_frame_manager; - } - - __ bind(frame_manager_entry); - - // the following temporary registers are used during frame creation - const Register Gtmp1 = G3_scratch; - // const Register Lmirror = L1; // native mirror (native calls only) - - const Address constMethod (G5_method, in_bytes(Method::const_offset())); - const Address access_flags (G5_method, in_bytes(Method::access_flags_offset())); - - address entry_point = __ pc(); - __ mov(G0, prevState); // no current activation - - - Label re_dispatch; - - __ bind(re_dispatch); - - // Interpreter needs to have locals completely contiguous. In order to do that - // We must adjust the caller's stack pointer for any locals beyond just the - // parameters - adjust_callers_stack(Gargs); - - // O5_savedSP still contains sender's sp - - // NEW FRAME - - generate_compute_interpreter_state(Lstate, prevState, false); - - // At this point a new interpreter frame and state object are created and initialized - // Lstate has the pointer to the new activation - // Any stack banging or limit check should already be done. - - Label call_interpreter; - - __ bind(call_interpreter); - - -#if 1 - __ set(0xdead002, Lmirror); - __ set(0xdead002, L2_scratch); - __ set(0xdead003, L3_scratch); - __ set(0xdead004, L4_scratch); - __ set(0xdead005, Lscratch); - __ set(0xdead006, Lscratch2); - __ set(0xdead007, L7_scratch); - - __ set(0xdeaf002, O2); - __ set(0xdeaf003, O3); - __ set(0xdeaf004, O4); - __ set(0xdeaf005, O5); -#endif - - // Call interpreter (stack bang complete) enter here if message is - // set and we know stack size is valid - - Label call_interpreter_2; - - __ bind(call_interpreter_2); - -#ifdef ASSERT - { - Label skip; - __ ld_ptr(STATE(_frame_bottom), G3_scratch); - __ cmp(G3_scratch, SP); - __ brx(Assembler::equal, false, Assembler::pt, skip); - __ delayed()->nop(); - __ stop("SP not restored to frame bottom"); - __ bind(skip); - } -#endif - - VALIDATE_STATE(G3_scratch, 4); - __ set_last_Java_frame(SP, noreg); - __ mov(Lstate, O0); // (arg) pointer to current state - - __ call(CAST_FROM_FN_PTR(address, - JvmtiExport::can_post_interpreter_events() ? - BytecodeInterpreter::runWithChecks - : BytecodeInterpreter::run), - relocInfo::runtime_call_type); - - __ delayed()->nop(); - - __ ld_ptr(STATE(_thread), G2_thread); - __ reset_last_Java_frame(); - - // examine msg from interpreter to determine next action - __ ld_ptr(STATE(_thread), G2_thread); // restore G2_thread - - __ ld(STATE(_msg), L1_scratch); // Get new message - - Label call_method; - Label return_from_interpreted_method; - Label throw_exception; - Label do_OSR; - Label bad_msg; - Label resume_interpreter; - - __ cmp(L1_scratch, (int)BytecodeInterpreter::call_method); - __ br(Assembler::equal, false, Assembler::pt, call_method); - __ delayed()->cmp(L1_scratch, (int)BytecodeInterpreter::return_from_method); - __ br(Assembler::equal, false, Assembler::pt, return_from_interpreted_method); - __ delayed()->cmp(L1_scratch, (int)BytecodeInterpreter::throwing_exception); - __ br(Assembler::equal, false, Assembler::pt, throw_exception); - __ delayed()->cmp(L1_scratch, (int)BytecodeInterpreter::do_osr); - __ br(Assembler::equal, false, Assembler::pt, do_OSR); - __ delayed()->cmp(L1_scratch, (int)BytecodeInterpreter::more_monitors); - __ br(Assembler::notEqual, false, Assembler::pt, bad_msg); - - // Allocate more monitor space, shuffle expression stack.... - - generate_more_monitors(); - - // new monitor slot allocated, resume the interpreter. - - __ set((int)BytecodeInterpreter::got_monitors, L1_scratch); - VALIDATE_STATE(G3_scratch, 5); - __ ba(call_interpreter); - __ delayed()->st(L1_scratch, STATE(_msg)); - - // uncommon trap needs to jump to here to enter the interpreter (re-execute current bytecode) - unctrap_frame_manager_entry = __ pc(); - - // QQQ what message do we send - - __ ba(call_interpreter); - __ delayed()->ld_ptr(STATE(_frame_bottom), SP); // restore to full stack frame - - //============================================================================= - // Returning from a compiled method into a deopted method. The bytecode at the - // bcp has completed. The result of the bytecode is in the native abi (the tosca - // for the template based interpreter). Any stack space that was used by the - // bytecode that has completed has been removed (e.g. parameters for an invoke) - // so all that we have to do is place any pending result on the expression stack - // and resume execution on the next bytecode. - - generate_deopt_handling(); - - // ready to resume the interpreter - - __ set((int)BytecodeInterpreter::deopt_resume, L1_scratch); - __ ba(call_interpreter); - __ delayed()->st(L1_scratch, STATE(_msg)); - - // Current frame has caught an exception we need to dispatch to the - // handler. We can get here because a native interpreter frame caught - // an exception in which case there is no handler and we must rethrow - // If it is a vanilla interpreted frame the we simply drop into the - // interpreter and let it do the lookup. - - Interpreter::_rethrow_exception_entry = __ pc(); - - Label return_with_exception; - Label unwind_and_forward; - - // O0: exception - // O7: throwing pc - - // We want exception in the thread no matter what we ultimately decide about frame type. - - Address exception_addr (G2_thread, in_bytes(Thread::pending_exception_offset())); - __ verify_thread(); - __ st_ptr(O0, exception_addr); - - // get the Method* - __ ld_ptr(STATE(_method), G5_method); - - // if this current frame vanilla or native? - - __ ld(access_flags, Gtmp1); - __ btst(JVM_ACC_NATIVE, Gtmp1); - __ br(Assembler::zero, false, Assembler::pt, return_with_exception); // vanilla interpreted frame handle directly - __ delayed()->nop(); - - // We drop thru to unwind a native interpreted frame with a pending exception - // We jump here for the initial interpreter frame with exception pending - // We unwind the current acivation and forward it to our caller. - - __ bind(unwind_and_forward); - - // Unwind frame and jump to forward exception. unwinding will place throwing pc in O7 - // as expected by forward_exception. - - __ restore(FP, G0, SP); // unwind interpreter state frame - __ br(Assembler::always, false, Assembler::pt, StubRoutines::forward_exception_entry(), relocInfo::runtime_call_type); - __ delayed()->mov(I5_savedSP->after_restore(), SP); - - // Return point from a call which returns a result in the native abi - // (c1/c2/jni-native). This result must be processed onto the java - // expression stack. - // - // A pending exception may be present in which case there is no result present - - address return_from_native_method = __ pc(); - - VALIDATE_STATE(G3_scratch, 6); - - // Result if any is in native abi result (O0..O1/F0..F1). The java expression - // stack is in the state that the calling convention left it. - // Copy the result from native abi result and place it on java expression stack. - - // Current interpreter state is present in Lstate - - // Exception pending? - - __ ld_ptr(STATE(_frame_bottom), SP); // restore to full stack frame - __ ld_ptr(exception_addr, Lscratch); // get any pending exception - __ tst(Lscratch); // exception pending? - __ brx(Assembler::notZero, false, Assembler::pt, return_with_exception); - __ delayed()->nop(); - - // Process the native abi result to java expression stack - - __ ld_ptr(STATE(_result._to_call._callee), L4_scratch); // called method - __ ld_ptr(STATE(_stack), L1_scratch); // get top of java expr stack - // get parameter size - __ ld_ptr(L4_scratch, in_bytes(Method::const_offset()), L2_scratch); - __ lduh(L2_scratch, in_bytes(ConstMethod::size_of_parameters_offset()), L2_scratch); - __ sll(L2_scratch, LogBytesPerWord, L2_scratch ); // parameter size in bytes - __ add(L1_scratch, L2_scratch, L1_scratch); // stack destination for result - __ ld(L4_scratch, in_bytes(Method::result_index_offset()), L3_scratch); // called method result type index - - // tosca is really just native abi - __ set((intptr_t)CppInterpreter::_tosca_to_stack, L4_scratch); - __ sll(L3_scratch, LogBytesPerWord, L3_scratch); - __ ld_ptr(L4_scratch, L3_scratch, Lscratch); // get typed result converter address - __ jmpl(Lscratch, G0, O7); // and convert it - __ delayed()->nop(); - - // L1_scratch points to top of stack (prepushed) - - __ ba(resume_interpreter); - __ delayed()->mov(L1_scratch, O1); - - // An exception is being caught on return to a vanilla interpreter frame. - // Empty the stack and resume interpreter - - __ bind(return_with_exception); - - __ ld_ptr(STATE(_frame_bottom), SP); // restore to full stack frame - __ ld_ptr(STATE(_stack_base), O1); // empty java expression stack - __ ba(resume_interpreter); - __ delayed()->sub(O1, wordSize, O1); // account for prepush - - // Return from interpreted method we return result appropriate to the caller (i.e. "recursive" - // interpreter call, or native) and unwind this interpreter activation. - // All monitors should be unlocked. - - __ bind(return_from_interpreted_method); - - VALIDATE_STATE(G3_scratch, 7); - - Label return_to_initial_caller; - - // Interpreted result is on the top of the completed activation expression stack. - // We must return it to the top of the callers stack if caller was interpreted - // otherwise we convert to native abi result and return to call_stub/c1/c2 - // The caller's expression stack was truncated by the call however the current activation - // has enough stuff on the stack that we have usable space there no matter what. The - // other thing that makes it easy is that the top of the caller's stack is stored in STATE(_locals) - // for the current activation - - __ ld_ptr(STATE(_prev_link), L1_scratch); - __ ld_ptr(STATE(_method), L2_scratch); // get method just executed - __ ld(L2_scratch, in_bytes(Method::result_index_offset()), L2_scratch); - __ tst(L1_scratch); - __ brx(Assembler::zero, false, Assembler::pt, return_to_initial_caller); - __ delayed()->sll(L2_scratch, LogBytesPerWord, L2_scratch); - - // Copy result to callers java stack - - __ set((intptr_t)CppInterpreter::_stack_to_stack, L4_scratch); - __ ld_ptr(L4_scratch, L2_scratch, Lscratch); // get typed result converter address - __ ld_ptr(STATE(_stack), O0); // current top (prepushed) - __ ld_ptr(STATE(_locals), O1); // stack destination - - // O0 - will be source, O1 - will be destination (preserved) - __ jmpl(Lscratch, G0, O7); // and convert it - __ delayed()->add(O0, wordSize, O0); // get source (top of current expr stack) - - // O1 == &locals[0] - - // Result is now on caller's stack. Just unwind current activation and resume - - Label unwind_recursive_activation; - - - __ bind(unwind_recursive_activation); - - // O1 == &locals[0] (really callers stacktop) for activation now returning - // returning to interpreter method from "recursive" interpreter call - // result converter left O1 pointing to top of the( prepushed) java stack for method we are returning - // to. Now all we must do is unwind the state from the completed call - - // Must restore stack - VALIDATE_STATE(G3_scratch, 8); - - // Return to interpreter method after a method call (interpreted/native/c1/c2) has completed. - // Result if any is already on the caller's stack. All we must do now is remove the now dead - // frame and tell interpreter to resume. - - - __ mov(O1, I1); // pass back new stack top across activation - // POP FRAME HERE ================================== - __ restore(FP, G0, SP); // unwind interpreter state frame - __ ld_ptr(STATE(_frame_bottom), SP); // restore to full stack frame - - - // Resume the interpreter. The current frame contains the current interpreter - // state object. - // - // O1 == new java stack pointer - - __ bind(resume_interpreter); - VALIDATE_STATE(G3_scratch, 10); - - // A frame we have already used before so no need to bang stack so use call_interpreter_2 entry - - __ set((int)BytecodeInterpreter::method_resume, L1_scratch); - __ st(L1_scratch, STATE(_msg)); - __ ba(call_interpreter_2); - __ delayed()->st_ptr(O1, STATE(_stack)); - - // interpreter returning to native code (call_stub/c1/c2) - // convert result and unwind initial activation - // L2_scratch - scaled result type index - - __ bind(return_to_initial_caller); - - __ set((intptr_t)CppInterpreter::_stack_to_native_abi, L4_scratch); - __ ld_ptr(L4_scratch, L2_scratch, Lscratch); // get typed result converter address - __ ld_ptr(STATE(_stack), O0); // current top (prepushed) - __ jmpl(Lscratch, G0, O7); // and convert it - __ delayed()->add(O0, wordSize, O0); // get source (top of current expr stack) - - Label unwind_initial_activation; - __ bind(unwind_initial_activation); - - // RETURN TO CALL_STUB/C1/C2 code (result if any in I0..I1/(F0/..F1) - // we can return here with an exception that wasn't handled by interpreted code - // how does c1/c2 see it on return? - - // compute resulting sp before/after args popped depending upon calling convention - // __ ld_ptr(STATE(_saved_sp), Gtmp1); - // - // POP FRAME HERE ================================== - __ restore(FP, G0, SP); - __ retl(); - __ delayed()->mov(I5_savedSP->after_restore(), SP); - - // OSR request, unwind the current frame and transfer to the OSR entry - // and enter OSR nmethod - - __ bind(do_OSR); - Label remove_initial_frame; - __ ld_ptr(STATE(_prev_link), L1_scratch); - __ ld_ptr(STATE(_result._osr._osr_buf), G1_scratch); - - // We are going to pop this frame. Is there another interpreter frame underneath - // it or is it callstub/compiled? - - __ tst(L1_scratch); - __ brx(Assembler::zero, false, Assembler::pt, remove_initial_frame); - __ delayed()->ld_ptr(STATE(_result._osr._osr_entry), G3_scratch); - - // Frame underneath is an interpreter frame simply unwind - // POP FRAME HERE ================================== - __ restore(FP, G0, SP); // unwind interpreter state frame - __ mov(I5_savedSP->after_restore(), SP); - - // Since we are now calling native need to change our "return address" from the - // dummy RecursiveInterpreterActivation to a return from native - - __ set((intptr_t)return_from_native_method - 8, O7); - - __ jmpl(G3_scratch, G0, G0); - __ delayed()->mov(G1_scratch, O0); - - __ bind(remove_initial_frame); - - // POP FRAME HERE ================================== - __ restore(FP, G0, SP); - __ mov(I5_savedSP->after_restore(), SP); - __ jmpl(G3_scratch, G0, G0); - __ delayed()->mov(G1_scratch, O0); - - // Call a new method. All we do is (temporarily) trim the expression stack - // push a return address to bring us back to here and leap to the new entry. - // At this point we have a topmost frame that was allocated by the frame manager - // which contains the current method interpreted state. We trim this frame - // of excess java expression stack entries and then recurse. - - __ bind(call_method); - - // stack points to next free location and not top element on expression stack - // method expects sp to be pointing to topmost element - - __ ld_ptr(STATE(_thread), G2_thread); - __ ld_ptr(STATE(_result._to_call._callee), G5_method); - - - // SP already takes in to account the 2 extra words we use for slop - // when we call a "static long no_params()" method. So if - // we trim back sp by the amount of unused java expression stack - // there will be automagically the 2 extra words we need. - // We also have to worry about keeping SP aligned. - - __ ld_ptr(STATE(_stack), Gargs); - __ ld_ptr(STATE(_stack_limit), L1_scratch); - - // compute the unused java stack size - __ sub(Gargs, L1_scratch, L2_scratch); // compute unused space - - // Round down the unused space to that stack is always 16-byte aligned - // by making the unused space a multiple of the size of two longs. - - __ and3(L2_scratch, -2*BytesPerLong, L2_scratch); - - // Now trim the stack - __ add(SP, L2_scratch, SP); - - - // Now point to the final argument (account for prepush) - __ add(Gargs, wordSize, Gargs); -#ifdef ASSERT - // Make sure we have space for the window - __ sub(Gargs, SP, L1_scratch); - __ cmp(L1_scratch, 16*wordSize); - { - Label skip; - __ brx(Assembler::greaterEqual, false, Assembler::pt, skip); - __ delayed()->nop(); - __ stop("killed stack"); - __ bind(skip); - } -#endif // ASSERT - - // Create a new frame where we can store values that make it look like the interpreter - // really recursed. - - // prepare to recurse or call specialized entry - - // First link the registers we need - - // make the pc look good in debugger - __ set(CAST_FROM_FN_PTR(intptr_t, RecursiveInterpreterActivation), O7); - // argument too - __ mov(Lstate, I0); - - // Record our sending SP - __ mov(SP, O5_savedSP); - - __ ld_ptr(STATE(_result._to_call._callee_entry_point), L2_scratch); - __ set((intptr_t) entry_point, L1_scratch); - __ cmp(L1_scratch, L2_scratch); - __ brx(Assembler::equal, false, Assembler::pt, re_dispatch); - __ delayed()->mov(Lstate, prevState); // link activations - - // method uses specialized entry, push a return so we look like call stub setup - // this path will handle fact that result is returned in registers and not - // on the java stack. - - __ set((intptr_t)return_from_native_method - 8, O7); - __ jmpl(L2_scratch, G0, G0); // Do specialized entry - __ delayed()->nop(); - - // - // Bad Message from interpreter - // - __ bind(bad_msg); - __ stop("Bad message from interpreter"); - - // Interpreted method "returned" with an exception pass it on... - // Pass result, unwind activation and continue/return to interpreter/call_stub - // We handle result (if any) differently based on return to interpreter or call_stub - - __ bind(throw_exception); - __ ld_ptr(STATE(_prev_link), L1_scratch); - __ tst(L1_scratch); - __ brx(Assembler::zero, false, Assembler::pt, unwind_and_forward); - __ delayed()->nop(); - - __ ld_ptr(STATE(_locals), O1); // get result of popping callee's args - __ ba(unwind_recursive_activation); - __ delayed()->nop(); - - interpreter_frame_manager = entry_point; - return entry_point; -} - -InterpreterGenerator::InterpreterGenerator(StubQueue* code) - : CppInterpreterGenerator(code) { - generate_all(); // down here so it can be "virtual" -} - - -static int size_activation_helper(int callee_extra_locals, int max_stack, int monitor_size) { - - // Figure out the size of an interpreter frame (in words) given that we have a fully allocated - // expression stack, the callee will have callee_extra_locals (so we can account for - // frame extension) and monitor_size for monitors. Basically we need to calculate - // this exactly like generate_fixed_frame/generate_compute_interpreter_state. - // - // - // The big complicating thing here is that we must ensure that the stack stays properly - // aligned. This would be even uglier if monitor size wasn't modulo what the stack - // needs to be aligned for). We are given that the sp (fp) is already aligned by - // the caller so we must ensure that it is properly aligned for our callee. - // - // Ths c++ interpreter always makes sure that we have a enough extra space on the - // stack at all times to deal with the "stack long no_params()" method issue. This - // is "slop_factor" here. - const int slop_factor = 2; - - const int fixed_size = sizeof(BytecodeInterpreter)/wordSize + // interpreter state object - frame::memory_parameter_word_sp_offset; // register save area + param window - return (round_to(max_stack + - slop_factor + - fixed_size + - monitor_size + - (callee_extra_locals * Interpreter::stackElementWords), WordsPerLong)); - -} - -int AbstractInterpreter::size_top_interpreter_activation(Method* method) { - - // See call_stub code - int call_stub_size = round_to(7 + frame::memory_parameter_word_sp_offset, - WordsPerLong); // 7 + register save area - - // Save space for one monitor to get into the interpreted method in case - // the method is synchronized - int monitor_size = method->is_synchronized() ? - 1*frame::interpreter_frame_monitor_size() : 0; - return size_activation_helper(method->max_locals(), method->max_stack(), - monitor_size) + call_stub_size; -} - -void BytecodeInterpreter::layout_interpreterState(interpreterState to_fill, - frame* caller, - frame* current, - Method* method, - intptr_t* locals, - intptr_t* stack, - intptr_t* stack_base, - intptr_t* monitor_base, - intptr_t* frame_bottom, - bool is_top_frame - ) -{ - // What about any vtable? - // - to_fill->_thread = JavaThread::current(); - // This gets filled in later but make it something recognizable for now - to_fill->_bcp = method->code_base(); - to_fill->_locals = locals; - to_fill->_constants = method->constants()->cache(); - to_fill->_method = method; - to_fill->_mdx = NULL; - to_fill->_stack = stack; - if (is_top_frame && JavaThread::current()->popframe_forcing_deopt_reexecution() ) { - to_fill->_msg = deopt_resume2; - } else { - to_fill->_msg = method_resume; - } - to_fill->_result._to_call._bcp_advance = 0; - to_fill->_result._to_call._callee_entry_point = NULL; // doesn't matter to anyone - to_fill->_result._to_call._callee = NULL; // doesn't matter to anyone - to_fill->_prev_link = NULL; - - // Fill in the registers for the frame - - // Need to install _sender_sp. Actually not too hard in C++! - // When the skeletal frames are layed out we fill in a value - // for _sender_sp. That value is only correct for the oldest - // skeletal frame constructed (because there is only a single - // entry for "caller_adjustment". While the skeletal frames - // exist that is good enough. We correct that calculation - // here and get all the frames correct. - - // to_fill->_sender_sp = locals - (method->size_of_parameters() - 1); - - *current->register_addr(Lstate) = (intptr_t) to_fill; - // skeletal already places a useful value here and this doesn't account - // for alignment so don't bother. - // *current->register_addr(I5_savedSP) = (intptr_t) locals - (method->size_of_parameters() - 1); - - if (caller->is_interpreted_frame()) { - interpreterState prev = caller->get_interpreterState(); - to_fill->_prev_link = prev; - // Make the prev callee look proper - prev->_result._to_call._callee = method; - if (*prev->_bcp == Bytecodes::_invokeinterface) { - prev->_result._to_call._bcp_advance = 5; - } else { - prev->_result._to_call._bcp_advance = 3; - } - } - to_fill->_oop_temp = NULL; - to_fill->_stack_base = stack_base; - // Need +1 here because stack_base points to the word just above the first expr stack entry - // and stack_limit is supposed to point to the word just below the last expr stack entry. - // See generate_compute_interpreter_state. - to_fill->_stack_limit = stack_base - (method->max_stack() + 1); - to_fill->_monitor_base = (BasicObjectLock*) monitor_base; - - // sparc specific - to_fill->_frame_bottom = frame_bottom; - to_fill->_self_link = to_fill; -#ifdef ASSERT - to_fill->_native_fresult = 123456.789; - to_fill->_native_lresult = CONST64(0xdeadcafedeafcafe); -#endif -} - -void BytecodeInterpreter::pd_layout_interpreterState(interpreterState istate, address last_Java_pc, intptr_t* last_Java_fp) { - istate->_last_Java_pc = (intptr_t*) last_Java_pc; -} - -static int frame_size_helper(int max_stack, - int moncount, - int callee_param_size, - int callee_locals_size, - bool is_top_frame, - int& monitor_size, - int& full_frame_words) { - int extra_locals_size = callee_locals_size - callee_param_size; - monitor_size = (sizeof(BasicObjectLock) * moncount) / wordSize; - full_frame_words = size_activation_helper(extra_locals_size, max_stack, monitor_size); - int short_frame_words = size_activation_helper(extra_locals_size, max_stack, monitor_size); - int frame_words = is_top_frame ? full_frame_words : short_frame_words; - - return frame_words; -} - -int AbstractInterpreter::size_activation(int max_stack, - int tempcount, - int extra_args, - int moncount, - int callee_param_size, - int callee_locals_size, - bool is_top_frame) { - assert(extra_args == 0, "NEED TO FIX"); - // NOTE: return size is in words not bytes - // Calculate the amount our frame will be adjust by the callee. For top frame - // this is zero. - - // NOTE: ia64 seems to do this wrong (or at least backwards) in that it - // calculates the extra locals based on itself. Not what the callee does - // to it. So it ignores last_frame_adjust value. Seems suspicious as far - // as getting sender_sp correct. - - int unused_monitor_size = 0; - int unused_full_frame_words = 0; - return frame_size_helper(max_stack, moncount, callee_param_size, callee_locals_size, is_top_frame, - unused_monitor_size, unused_full_frame_words); -} -void AbstractInterpreter::layout_activation(Method* method, - int tempcount, // Number of slots on java expression stack in use - int popframe_extra_args, - int moncount, // Number of active monitors - int caller_actual_parameters, - int callee_param_size, - int callee_locals_size, - frame* caller, - frame* interpreter_frame, - bool is_top_frame, - bool is_bottom_frame) { - assert(popframe_extra_args == 0, "NEED TO FIX"); - // NOTE this code must exactly mimic what InterpreterGenerator::generate_compute_interpreter_state() - // does as far as allocating an interpreter frame. - // Set up the method, locals, and monitors. - // The frame interpreter_frame is guaranteed to be the right size, - // as determined by a previous call to the size_activation() method. - // It is also guaranteed to be walkable even though it is in a skeletal state - // NOTE: tempcount is the current size of the java expression stack. For top most - // frames we will allocate a full sized expression stack and not the curback - // version that non-top frames have. - - int monitor_size = 0; - int full_frame_words = 0; - int frame_words = frame_size_helper(method->max_stack(), moncount, callee_param_size, callee_locals_size, - is_top_frame, monitor_size, full_frame_words); - - /* - We must now fill in all the pieces of the frame. This means both - the interpreterState and the registers. - */ - - // MUCHO HACK - - intptr_t* frame_bottom = interpreter_frame->sp() - (full_frame_words - frame_words); - // 'interpreter_frame->sp()' is unbiased while 'frame_bottom' must be a biased value in 64bit mode. - assert(((intptr_t)frame_bottom & 0xf) == 0, "SP biased in layout_activation"); - frame_bottom = (intptr_t*)((intptr_t)frame_bottom - STACK_BIAS); - - /* Now fillin the interpreterState object */ - - interpreterState cur_state = (interpreterState) ((intptr_t)interpreter_frame->fp() - sizeof(BytecodeInterpreter)); - - - intptr_t* locals; - - // Calculate the postion of locals[0]. This is painful because of - // stack alignment (same as ia64). The problem is that we can - // not compute the location of locals from fp(). fp() will account - // for the extra locals but it also accounts for aligning the stack - // and we can't determine if the locals[0] was misaligned but max_locals - // was enough to have the - // calculate postion of locals. fp already accounts for extra locals. - // +2 for the static long no_params() issue. - - if (caller->is_interpreted_frame()) { - // locals must agree with the caller because it will be used to set the - // caller's tos when we return. - interpreterState prev = caller->get_interpreterState(); - // stack() is prepushed. - locals = prev->stack() + method->size_of_parameters(); - } else { - // Lay out locals block in the caller adjacent to the register window save area. - // - // Compiled frames do not allocate a varargs area which is why this if - // statement is needed. - // - intptr_t* fp = interpreter_frame->fp(); - int local_words = method->max_locals() * Interpreter::stackElementWords; - - if (caller->is_compiled_frame()) { - locals = fp + frame::register_save_words + local_words - 1; - } else { - locals = fp + frame::memory_parameter_word_sp_offset + local_words - 1; - } - - } - // END MUCHO HACK - - intptr_t* monitor_base = (intptr_t*) cur_state; - intptr_t* stack_base = monitor_base - monitor_size; - /* +1 because stack is always prepushed */ - intptr_t* stack = stack_base - (tempcount + 1); - - - BytecodeInterpreter::layout_interpreterState(cur_state, - caller, - interpreter_frame, - method, - locals, - stack, - stack_base, - monitor_base, - frame_bottom, - is_top_frame); - - BytecodeInterpreter::pd_layout_interpreterState(cur_state, interpreter_return_address, interpreter_frame->fp()); -} - -#endif // CC_INTERP diff --git a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.hpp b/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.hpp deleted file mode 100644 index 3d613f36a02..00000000000 --- a/hotspot/src/cpu/sparc/vm/cppInterpreter_sparc.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_SPARC_VM_CPPINTERPRETER_SPARC_HPP -#define CPU_SPARC_VM_CPPINTERPRETER_SPARC_HPP - - // Size of interpreter code. Increase if too small. Interpreter will - // fail with a guarantee ("not enough space for interpreter generation"); - // if too small. - // Run with +PrintInterpreter to get the VM to print out the size. - // Max size with JVMTI - - // QQQ this is proably way too large for c++ interpreter - -#ifdef _LP64 - // The sethi() instruction generates lots more instructions when shell - // stack limit is unlimited, so that's why this is much bigger. - const static int InterpreterCodeSize = 210 * K; -#else - const static int InterpreterCodeSize = 180 * K; -#endif - -#endif // CPU_SPARC_VM_CPPINTERPRETER_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp index 6ee253c4d0b..a9ac2a97a76 100644 --- a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp @@ -441,12 +441,10 @@ intptr_t* frame::interpreter_frame_sender_sp() const { return fp(); } -#ifndef CC_INTERP void frame::set_interpreter_frame_sender_sp(intptr_t* sender_sp) { assert(is_interpreted_frame(), "interpreted frame expected"); Unimplemented(); } -#endif // CC_INTERP frame frame::sender_for_entry_frame(RegisterMap *map) const { assert(map != NULL, "map must be set"); @@ -600,9 +598,6 @@ bool frame::is_valid_stack_pointer(intptr_t* valid_sp, intptr_t* sp) { } bool frame::is_interpreted_frame_valid(JavaThread* thread) const { -#ifdef CC_INTERP - // Is there anything to do? -#else assert(is_interpreted_frame(), "Not an interpreted frame"); // These are reasonable sanity checks if (fp() == 0 || (intptr_t(fp()) & (2*wordSize-1)) != 0) { @@ -654,7 +649,6 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const { if (locals > thread->stack_base() || locals < (address) fp()) return false; // We'd have to be pretty unlucky to be mislead at this point -#endif /* CC_INTERP */ return true; } @@ -712,14 +706,8 @@ BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result) // Prior to notifying the runtime of the method_exit the possible result // value is saved to l_scratch and d_scratch. -#ifdef CC_INTERP - interpreterState istate = get_interpreterState(); - intptr_t* l_scratch = (intptr_t*) &istate->_native_lresult; - intptr_t* d_scratch = (intptr_t*) &istate->_native_fresult; -#else /* CC_INTERP */ intptr_t* l_scratch = fp() + interpreter_frame_l_scratch_fp_offset; intptr_t* d_scratch = fp() + interpreter_frame_d_scratch_fp_offset; -#endif /* CC_INTERP */ address l_addr = (address)l_scratch; #ifdef _LP64 @@ -731,13 +719,9 @@ BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result) switch (type) { case T_OBJECT: case T_ARRAY: { -#ifdef CC_INTERP - *oop_result = istate->_oop_temp; -#else oop obj = cast_to_oop(at(interpreter_frame_oop_temp_offset)); assert(obj == NULL || Universe::heap()->is_in(obj), "sanity check"); *oop_result = obj; -#endif // CC_INTERP break; } @@ -797,7 +781,6 @@ void frame::describe_pd(FrameValues& values, int frame_no) { } if (is_interpreted_frame()) { -#ifndef CC_INTERP DESCRIBE_FP_OFFSET(interpreter_frame_d_scratch_fp); DESCRIBE_FP_OFFSET(interpreter_frame_l_scratch_fp); DESCRIBE_FP_OFFSET(interpreter_frame_padding); @@ -808,7 +791,6 @@ void frame::describe_pd(FrameValues& values, int frame_no) { if ((esp >= sp()) && (esp < fp())) { values.describe(-1, esp, "*Lesp"); } -#endif } if (!is_compiled_frame()) { diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.hpp b/hotspot/src/cpu/sparc/vm/frame_sparc.hpp index 4cc5c429fa0..5de8ad4bf1d 100644 --- a/hotspot/src/cpu/sparc/vm/frame_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/frame_sparc.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -90,11 +90,6 @@ // G5_method is set to method to call, G5_inline_cache_klass may be set, // parameters are put in O registers, and also extra parameters // must be cleverly copied from the top of stack to the outgoing param area in the frame, -// ------------------------------ C++ interpreter ---------------------------------------- -// Layout of C++ interpreter frame: -// - - // All frames: @@ -211,7 +206,6 @@ public: // Asm interpreter -#ifndef CC_INTERP enum interpreter_frame_vm_locals { // 2 words, also used to save float regs across calls to C interpreter_frame_d_scratch_fp_offset = -2, @@ -228,18 +222,6 @@ interpreter_frame_extra_outgoing_argument_words = 2 }; -#else - enum interpreter_frame_vm_locals { - // 2 words, also used to save float regs across calls to C - interpreter_state_ptr_offset = 0, // Is in L0 (Lstate) in save area - interpreter_frame_mirror_offset = 1, // Is in L1 (Lmirror) in save area (for native calls only) - - // interpreter frame set-up needs to save 2 extra words in outgoing param area - // for class and jnienv arguments for native stubs (see nativeStubGen_sparc.cpp_ - - interpreter_frame_extra_outgoing_argument_words = 2 - }; -#endif /* CC_INTERP */ enum compiler_frame_fixed_locals { compiler_frame_vm_locals_fp_offset = -2 @@ -248,8 +230,6 @@ private: ConstantPoolCache** interpreter_frame_cpoolcache_addr() const; -#ifndef CC_INTERP - // where Lmonitors is saved: inline BasicObjectLock** interpreter_frame_monitors_addr() const; inline intptr_t** interpreter_frame_esp_addr() const; @@ -262,14 +242,6 @@ private: BasicObjectLock* interpreter_frame_monitors() const; void interpreter_frame_set_monitors(BasicObjectLock* monitors); -#else - public: - inline interpreterState get_interpreterState() const { - return ((interpreterState)sp_at(interpreter_state_ptr_offset)); - } - -#endif /* CC_INTERP */ - public: #endif // CPU_SPARC_VM_FRAME_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp index 2649b6da872..01e24727863 100644 --- a/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp +++ b/hotspot/src/cpu/sparc/vm/frame_sparc.inline.hpp @@ -91,75 +91,6 @@ inline int frame::pd_oop_map_offset_adjustment() const { return _sp_adjustment_by_callee * VMRegImpl::slots_per_word; } -#ifdef CC_INTERP -inline intptr_t** frame::interpreter_frame_locals_addr() const { - interpreterState istate = get_interpreterState(); - return (intptr_t**) &istate->_locals; -} - -inline intptr_t* frame::interpreter_frame_bcp_addr() const { - interpreterState istate = get_interpreterState(); - return (intptr_t*) &istate->_bcp; -} - -inline intptr_t* frame::interpreter_frame_mdp_addr() const { - interpreterState istate = get_interpreterState(); - return (intptr_t*) &istate->_mdx; -} - -inline jint frame::interpreter_frame_expression_stack_direction() { return -1; } - -// bottom(base) of the expression stack (highest address) -inline intptr_t* frame::interpreter_frame_expression_stack() const { - return (intptr_t*)interpreter_frame_monitor_end() - 1; -} - -// top of expression stack (lowest address) -inline intptr_t* frame::interpreter_frame_tos_address() const { - interpreterState istate = get_interpreterState(); - return istate->_stack + 1; // Is this off by one? QQQ -} - -// monitor elements - -// in keeping with Intel side: end is lower in memory than begin; -// and beginning element is oldest element -// Also begin is one past last monitor. - -inline BasicObjectLock* frame::interpreter_frame_monitor_begin() const { - return get_interpreterState()->monitor_base(); -} - -inline BasicObjectLock* frame::interpreter_frame_monitor_end() const { - return (BasicObjectLock*) get_interpreterState()->stack_base(); -} - - -inline int frame::interpreter_frame_monitor_size() { - return round_to(BasicObjectLock::size(), WordsPerLong); -} - -inline Method** frame::interpreter_frame_method_addr() const { - interpreterState istate = get_interpreterState(); - return &istate->_method; -} - - -// Constant pool cache - -// where LcpoolCache is saved: -inline ConstantPoolCache** frame::interpreter_frame_cpoolcache_addr() const { - interpreterState istate = get_interpreterState(); - return &istate->_constants; // should really use accessor - } - -inline ConstantPoolCache** frame::interpreter_frame_cache_addr() const { - interpreterState istate = get_interpreterState(); - return &istate->_constants; -} - -#else // !CC_INTERP - inline intptr_t** frame::interpreter_frame_locals_addr() const { return (intptr_t**) sp_addr_at( Llocals->sp_offset_in_saved_window()); } @@ -246,7 +177,6 @@ inline ConstantPoolCache** frame::interpreter_frame_cache_addr() const { inline oop* frame::interpreter_frame_temp_oop_addr() const { return (oop *)(fp() + interpreter_frame_oop_temp_offset); } -#endif // CC_INTERP inline JavaCallWrapper** frame::entry_frame_call_wrapper_addr() const { diff --git a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp index 1e8d36fbb88..4e0b6d504f6 100644 --- a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp @@ -39,7 +39,6 @@ #include "runtime/sharedRuntime.hpp" #include "runtime/thread.inline.hpp" -#ifndef CC_INTERP #ifndef FAST_DISPATCH #define FAST_DISPATCH 1 #endif @@ -52,13 +51,6 @@ const Address InterpreterMacroAssembler::l_tmp(FP, (frame::interpreter_frame_l_scratch_fp_offset * wordSize) + STACK_BIAS); const Address InterpreterMacroAssembler::d_tmp(FP, (frame::interpreter_frame_d_scratch_fp_offset * wordSize) + STACK_BIAS); -#else // CC_INTERP -#ifndef STATE -#define STATE(field_name) Lstate, in_bytes(byte_offset_of(BytecodeInterpreter, field_name)) -#endif // STATE - -#endif // CC_INTERP - void InterpreterMacroAssembler::jump_to_entry(address entry) { assert(entry, "Entry must have been generated by now"); AddressLiteral al(entry); @@ -82,8 +74,6 @@ void InterpreterMacroAssembler::compute_extra_locals_size_in_bytes(Register args sll(delta, LogBytesPerWord, delta); // extra space for locals in bytes } -#ifndef CC_INTERP - // Dispatch code executed in the prolog of a bytecode which does not do it's // own dispatch. The dispatch address is computed and placed in IdispatchAddress void InterpreterMacroAssembler::dispatch_prolog(TosState state, int bcp_incr) { @@ -265,10 +255,6 @@ void InterpreterMacroAssembler::super_call_VM_leaf(Register thread_cache, addres mov(arg_2, O1); MacroAssembler::call_VM_leaf_base(thread_cache, entry_point, 2); } -#endif /* CC_INTERP */ - - -#ifndef CC_INTERP void InterpreterMacroAssembler::dispatch_base(TosState state, address* table) { assert_not_delayed(); @@ -1189,8 +1175,6 @@ void InterpreterMacroAssembler::remove_activation(TosState state, #endif /* COMPILER2 */ } -#endif /* CC_INTERP */ - // Lock object // @@ -1323,8 +1307,6 @@ void InterpreterMacroAssembler::unlock_object(Register lock_reg) { } } -#ifndef CC_INTERP - // Get the method data pointer from the Method* and set the // specified register to its value. @@ -2366,8 +2348,6 @@ void InterpreterMacroAssembler::compute_stack_base( Register Rdest ) { add( Lesp, wordSize, Rdest ); } -#endif /* CC_INTERP */ - void InterpreterMacroAssembler::get_method_counters(Register method, Register Rcounters, Label& skip) { @@ -2443,7 +2423,6 @@ void InterpreterMacroAssembler::increment_backedge_counter( Register Rcounters, // Note that this macro must leave backedge_count + invocation_count in Rtmp! } -#ifndef CC_INTERP void InterpreterMacroAssembler::test_backedge_count_for_osr( Register backedge_count, Register method_counters, Register branch_bcp, @@ -2581,7 +2560,6 @@ void InterpreterMacroAssembler::increment_mask_and_jump(Address counter_addr, br(cond, false, Assembler::pn, *where); delayed()->st(scratch1, counter_addr); } -#endif /* CC_INTERP */ // Inline assembly for: // @@ -2597,8 +2575,6 @@ void InterpreterMacroAssembler::increment_mask_and_jump(Address counter_addr, void InterpreterMacroAssembler::notify_method_entry() { - // C++ interpreter only uses this for native methods. - // Whenever JVMTI puts a thread in interp_only_mode, method // entry/exit events are sent for that thread to track stack // depth. If it is possible to enter interp_only_mode we add @@ -2647,7 +2623,6 @@ void InterpreterMacroAssembler::notify_method_entry() { void InterpreterMacroAssembler::notify_method_exit(bool is_native_method, TosState state, NotifyMethodExitMode mode) { - // C++ interpreter only uses this for native methods. // Whenever JVMTI puts a thread in interp_only_mode, method // entry/exit events are sent for that thread to track stack @@ -2687,15 +2662,6 @@ void InterpreterMacroAssembler::notify_method_exit(bool is_native_method, } void InterpreterMacroAssembler::save_return_value(TosState state, bool is_native_call) { -#ifdef CC_INTERP - // result potentially in O0/O1: save it across calls - stf(FloatRegisterImpl::D, F0, STATE(_native_fresult)); -#ifdef _LP64 - stx(O0, STATE(_native_lresult)); -#else - std(O0, STATE(_native_lresult)); -#endif -#else // CC_INTERP if (is_native_call) { stf(FloatRegisterImpl::D, F0, d_tmp); #ifdef _LP64 @@ -2706,18 +2672,9 @@ void InterpreterMacroAssembler::save_return_value(TosState state, bool is_native } else { push(state); } -#endif // CC_INTERP } void InterpreterMacroAssembler::restore_return_value( TosState state, bool is_native_call) { -#ifdef CC_INTERP - ldf(FloatRegisterImpl::D, STATE(_native_fresult), F0); -#ifdef _LP64 - ldx(STATE(_native_lresult), O0); -#else - ldd(STATE(_native_lresult), O0); -#endif -#else // CC_INTERP if (is_native_call) { ldf(FloatRegisterImpl::D, d_tmp, F0); #ifdef _LP64 @@ -2728,5 +2685,4 @@ void InterpreterMacroAssembler::restore_return_value( TosState state, bool is_na } else { pop(state); } -#endif // CC_INTERP } diff --git a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp index b944bf089c3..4fa3b09b3a9 100644 --- a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.hpp @@ -54,7 +54,6 @@ REGISTER_DECLARATION(FloatRegister, Ftos_d2, F1); // for 2nd part of double class InterpreterMacroAssembler: public MacroAssembler { protected: -#ifndef CC_INTERP // Interpreter specific version of call_VM_base virtual void call_VM_leaf_base( Register java_thread, @@ -76,7 +75,6 @@ class InterpreterMacroAssembler: public MacroAssembler { // base routine for all dispatches void dispatch_base(TosState state, address* table); -#endif /* CC_INTERP */ public: InterpreterMacroAssembler(CodeBuffer* c) @@ -84,12 +82,10 @@ class InterpreterMacroAssembler: public MacroAssembler { void jump_to_entry(address entry); -#ifndef CC_INTERP virtual void load_earlyret_value(TosState state); static const Address l_tmp ; static const Address d_tmp ; -#endif /* CC_INTERP */ // helper routine for frame allocation/deallocation // compute the delta by which the caller's SP has to @@ -97,8 +93,6 @@ class InterpreterMacroAssembler: public MacroAssembler { // locals void compute_extra_locals_size_in_bytes(Register args_size, Register locals_size, Register delta); -#ifndef CC_INTERP - // dispatch routines void dispatch_prolog(TosState state, int step = 0); void dispatch_epilog(TosState state, int step = 0); @@ -118,7 +112,6 @@ class InterpreterMacroAssembler: public MacroAssembler { protected: void dispatch_Lbyte_code(TosState state, address* table, int bcp_incr = 0, bool verify = true); -#endif /* CC_INTERP */ public: // Super call_VM calls - correspond to MacroAssembler::call_VM(_leaf) calls @@ -130,7 +123,6 @@ class InterpreterMacroAssembler: public MacroAssembler { Register arg_2, bool check_exception = true); -#ifndef CC_INTERP void super_call_VM_leaf(Register thread_cache, address entry_point, Register arg_1, Register arg_2); // Generate a subtype check: branch to ok_is_subtype if sub_klass is @@ -265,19 +257,15 @@ class InterpreterMacroAssembler: public MacroAssembler { Address top_most_monitor(); void compute_stack_base( Register Rdest ); -#endif /* CC_INTERP */ void get_method_counters(Register method, Register Rcounters, Label& skip); void increment_invocation_counter( Register Rcounters, Register Rtmp, Register Rtmp2 ); void increment_backedge_counter( Register Rcounters, Register Rtmp, Register Rtmp2 ); -#ifndef CC_INTERP void test_backedge_count_for_osr(Register backedge_count, Register method_counters, Register branch_bcp, Register Rtmp ); -#endif /* CC_INTERP */ // Object locking void lock_object (Register lock_reg, Register obj_reg); void unlock_object(Register lock_reg); -#ifndef CC_INTERP // Interpreter profiling operations void set_method_data_pointer(); void set_method_data_pointer_for_bcp(); @@ -341,7 +329,6 @@ class InterpreterMacroAssembler: public MacroAssembler { void verify_oop_or_return_address(Register reg, Register rtmp); // for astore void verify_FPU(int stack_depth, TosState state = ftos); // only if +VerifyFPU && (state == ftos || state == dtos) -#endif /* CC_INTERP */ // support for JVMTI/Dtrace typedef enum { NotifyJVMTI, SkipNotifyJVMTI } NotifyMethodExitMode; void notify_method_entry(); diff --git a/hotspot/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp b/hotspot/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp deleted file mode 100644 index f0513d4035b..00000000000 --- a/hotspot/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_SPARC_VM_INTERPRETERGENERATOR_SPARC_HPP -#define CPU_SPARC_VM_INTERPRETERGENERATOR_SPARC_HPP - - friend class AbstractInterpreterGenerator; - - private: - - address generate_normal_entry(bool synchronized); - address generate_native_entry(bool synchronized); - address generate_abstract_entry(void); - // there are no math intrinsics on sparc - address generate_math_entry(AbstractInterpreter::MethodKind kind) { return NULL; } - address generate_accessor_entry(void) { return NULL; } - address generate_empty_entry(void) { return NULL; } - address generate_Reference_get_entry(void); - void save_native_result(void); - void restore_native_result(void); - - void generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue); - void generate_counter_overflow(Label& Lcontinue); - - address generate_CRC32_update_entry(); - address generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind); - - // Not supported - address generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) { return NULL; } -#endif // CPU_SPARC_VM_INTERPRETERGENERATOR_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp index 4e9199fa9d8..cf22a6c6f2e 100644 --- a/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/interpreter_sparc.cpp @@ -26,9 +26,9 @@ #include "asm/macroAssembler.hpp" #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/interp_masm.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" @@ -53,7 +53,7 @@ // Generation of Interpreter // -// The InterpreterGenerator generates the interpreter into Interpreter::_code. +// The TemplateInterpreterGenerator generates the interpreter into Interpreter::_code. #define __ _masm-> @@ -194,7 +194,7 @@ address AbstractInterpreterGenerator::generate_slow_signature_handler() { } #endif -void InterpreterGenerator::generate_counter_overflow(Label& Lcontinue) { +void TemplateInterpreterGenerator::generate_counter_overflow(Label& Lcontinue) { // Generate code to initiate compilation on the counter overflow. @@ -219,7 +219,7 @@ void InterpreterGenerator::generate_counter_overflow(Label& Lcontinue) { // Abstract method entry // Attempt to execute abstract method. Throw exception // -address InterpreterGenerator::generate_abstract_entry(void) { +address TemplateInterpreterGenerator::generate_abstract_entry(void) { address entry = __ pc(); // abstract method entry // throw exception diff --git a/hotspot/src/cpu/sparc/vm/interpreter_sparc.hpp b/hotspot/src/cpu/sparc/vm/interpreter_sparc.hpp deleted file mode 100644 index bc38d6e882f..00000000000 --- a/hotspot/src/cpu/sparc/vm/interpreter_sparc.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_SPARC_VM_INTERPRETER_SPARC_HPP -#define CPU_SPARC_VM_INTERPRETER_SPARC_HPP - - public: - - static int expr_offset_in_bytes(int i) { return stackElementSize * i + wordSize; } - - // Stack index relative to tos (which points at value) - static int expr_index_at(int i) { return stackElementWords * i; } - - // Already negated by c++ interpreter - static int local_index_at(int i) { - assert(i <= 0, "local direction already negated"); - return stackElementWords * i; - } - -#endif // CPU_SPARC_VM_INTERPRETER_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp index 15e2e791114..0920bc90e08 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp @@ -401,9 +401,6 @@ static Thread* verify_thread_subroutine(Thread* gthread_value) { void MacroAssembler::verify_thread() { if (VerifyThread) { // NOTE: this chops off the heads of the 64-bit O registers. -#ifdef CC_INTERP - save_frame(0); -#else // make sure G2_thread contains the right value save_frame_and_mov(0, Lmethod, Lmethod); // to avoid clobbering O0 (and propagate Lmethod for -Xprof) mov(G1, L1); // avoid clobbering G1 @@ -411,7 +408,6 @@ void MacroAssembler::verify_thread() { mov(G3, L3); // avoid clobbering G3 mov(G4, L4); // avoid clobbering G4 mov(G5_method, L5); // avoid clobbering G5_method -#endif /* CC_INTERP */ #if defined(COMPILER2) && !defined(_LP64) // Save & restore possible 64-bit Long arguments in G-regs srlx(G1,32,L0); @@ -530,11 +526,7 @@ void MacroAssembler::reset_last_Java_frame(void) { #ifdef ASSERT // check that it WAS previously set -#ifdef CC_INTERP - save_frame(0); -#else save_frame_and_mov(0, Lmethod, Lmethod); // Propagate Lmethod to helper frame for -Xprof -#endif /* CC_INTERP */ ld_ptr(sp_addr, L0); tst(L0); breakpoint_trap(Assembler::zero, Assembler::ptr_cc); @@ -754,11 +746,7 @@ void MacroAssembler::set_vm_result(Register oop_result) { # ifdef ASSERT // Check that we are not overwriting any other oop. -#ifdef CC_INTERP - save_frame(0); -#else save_frame_and_mov(0, Lmethod, Lmethod); // Propagate Lmethod for -Xprof -#endif /* CC_INTERP */ ld_ptr(vm_result_addr, L0); tst(L0); restore(); diff --git a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp index a7703fa0262..f2757fbe4f5 100644 --- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp +++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.hpp @@ -136,25 +136,6 @@ REGISTER_DECLARATION(Register, Lentry_args , L0); // pointer to args passed // Interpreter frames -#ifdef CC_INTERP -REGISTER_DECLARATION(Register, Lstate , L0); // interpreter state object pointer -REGISTER_DECLARATION(Register, L1_scratch , L1); // scratch -REGISTER_DECLARATION(Register, Lmirror , L1); // mirror (for native methods only) -REGISTER_DECLARATION(Register, L2_scratch , L2); -REGISTER_DECLARATION(Register, L3_scratch , L3); -REGISTER_DECLARATION(Register, L4_scratch , L4); -REGISTER_DECLARATION(Register, Lscratch , L5); // C1 uses -REGISTER_DECLARATION(Register, Lscratch2 , L6); // C1 uses -REGISTER_DECLARATION(Register, L7_scratch , L7); // constant pool cache -REGISTER_DECLARATION(Register, O5_savedSP , O5); -REGISTER_DECLARATION(Register, I5_savedSP , I5); // Saved SP before bumping for locals. This is simply - // a copy SP, so in 64-bit it's a biased value. The bias - // is added and removed as needed in the frame code. -// Interface to signature handler -REGISTER_DECLARATION(Register, Llocals , L7); // pointer to locals for signature handler -REGISTER_DECLARATION(Register, Lmethod , L6); // Method* when calling signature handler - -#else REGISTER_DECLARATION(Register, Lesp , L0); // expression stack pointer REGISTER_DECLARATION(Register, Lbcp , L1); // pointer to next bytecode REGISTER_DECLARATION(Register, Lmethod , L2); @@ -178,7 +159,6 @@ REGISTER_DECLARATION(Register, I5_savedSP , I5); // Saved SP before bumpin REGISTER_DECLARATION(Register, IdispatchTables , I4); // Base address of the bytecode dispatch tables REGISTER_DECLARATION(Register, IdispatchAddress , I3); // Register which saves the dispatch address for each bytecode REGISTER_DECLARATION(Register, ImethodDataPtr , I2); // Pointer to the current method data -#endif /* CC_INTERP */ // NOTE: Lscratch2 and LcpoolCache point to the same registers in // the interpreter code. If Lscratch2 needs to be used for some @@ -233,19 +213,6 @@ REGISTER_DECLARATION(Register, Oissuing_pc , O1); // where the exception is comi #define Gframe_size AS_REGISTER(Register, Gframe_size) #define Gtemp AS_REGISTER(Register, Gtemp) -#ifdef CC_INTERP -#define Lstate AS_REGISTER(Register, Lstate) -#define Lesp AS_REGISTER(Register, Lesp) -#define L1_scratch AS_REGISTER(Register, L1_scratch) -#define Lmirror AS_REGISTER(Register, Lmirror) -#define L2_scratch AS_REGISTER(Register, L2_scratch) -#define L3_scratch AS_REGISTER(Register, L3_scratch) -#define L4_scratch AS_REGISTER(Register, L4_scratch) -#define Lscratch AS_REGISTER(Register, Lscratch) -#define Lscratch2 AS_REGISTER(Register, Lscratch2) -#define L7_scratch AS_REGISTER(Register, L7_scratch) -#define Ostate AS_REGISTER(Register, Ostate) -#else #define Lesp AS_REGISTER(Register, Lesp) #define Lbcp AS_REGISTER(Register, Lbcp) #define Lmethod AS_REGISTER(Register, Lmethod) @@ -255,7 +222,6 @@ REGISTER_DECLARATION(Register, Oissuing_pc , O1); // where the exception is comi #define Lscratch AS_REGISTER(Register, Lscratch) #define Lscratch2 AS_REGISTER(Register, Lscratch2) #define LcpoolCache AS_REGISTER(Register, LcpoolCache) -#endif /* ! CC_INTERP */ #define Lentry_args AS_REGISTER(Register, Lentry_args) #define I5_savedSP AS_REGISTER(Register, I5_savedSP) @@ -610,13 +576,7 @@ class MacroAssembler : public Assembler { // This is the base routine called by the different versions of call_VM_leaf. The interpreter // may customize this version by overriding it for its purposes (e.g., to save/restore // additional registers when doing a VM call). -#ifdef CC_INTERP - #define VIRTUAL -#else - #define VIRTUAL virtual -#endif - - VIRTUAL void call_VM_leaf_base(Register thread_cache, address entry_point, int number_of_arguments); + virtual void call_VM_leaf_base(Register thread_cache, address entry_point, int number_of_arguments); // // It is imperative that all calls into the VM are handled via the call_VM macros. @@ -1483,7 +1443,6 @@ public: void fold_8bit_crc32(Register xcrc, Register table, Register xtmp, Register tmp); void fold_8bit_crc32(Register crc, Register table, Register tmp); -#undef VIRTUAL }; /** diff --git a/hotspot/src/cpu/sparc/vm/register_definitions_sparc.cpp b/hotspot/src/cpu/sparc/vm/register_definitions_sparc.cpp index 03d08ddfa35..a27dc432aed 100644 --- a/hotspot/src/cpu/sparc/vm/register_definitions_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/register_definitions_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -152,18 +152,6 @@ REGISTER_DEFINITION(Register, G5_method_type); REGISTER_DEFINITION(Register, G3_method_handle); REGISTER_DEFINITION(Register, L7_mh_SP_save); -#ifdef CC_INTERP -REGISTER_DEFINITION(Register, Lstate); -REGISTER_DEFINITION(Register, L1_scratch); -REGISTER_DEFINITION(Register, Lmirror); -REGISTER_DEFINITION(Register, L2_scratch); -REGISTER_DEFINITION(Register, L3_scratch); -REGISTER_DEFINITION(Register, L4_scratch); -REGISTER_DEFINITION(Register, Lscratch); -REGISTER_DEFINITION(Register, Lscratch2); -REGISTER_DEFINITION(Register, L7_scratch); -REGISTER_DEFINITION(Register, I5_savedSP); -#else // CC_INTERP REGISTER_DEFINITION(Register, Lesp); REGISTER_DEFINITION(Register, Lbcp); REGISTER_DEFINITION(Register, Lmonitors); @@ -177,7 +165,6 @@ REGISTER_DEFINITION(Register, O5_savedSP); REGISTER_DEFINITION(Register, IdispatchAddress); REGISTER_DEFINITION(Register, ImethodDataPtr); REGISTER_DEFINITION(Register, IdispatchTables); -#endif // CC_INTERP REGISTER_DEFINITION(Register, Lmethod); REGISTER_DEFINITION(Register, Llocals); REGISTER_DEFINITION(Register, Oexception); diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp index fc1a8f3124c..b8ac98b61cf 100644 --- a/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp @@ -26,9 +26,9 @@ #include "asm/macroAssembler.hpp" #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/interp_masm.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" @@ -47,7 +47,6 @@ #include "utilities/debug.hpp" #include "utilities/macros.hpp" -#ifndef CC_INTERP #ifndef FAST_DISPATCH #define FAST_DISPATCH 1 #endif @@ -56,7 +55,7 @@ // Generation of Interpreter // -// The InterpreterGenerator generates the interpreter into Interpreter::_code. +// The TemplateInterpreterGenerator generates the interpreter into Interpreter::_code. #define __ _masm-> @@ -65,7 +64,7 @@ //---------------------------------------------------------------------------------------------------- -void InterpreterGenerator::save_native_result(void) { +void TemplateInterpreterGenerator::save_native_result(void) { // result potentially in O0/O1: save it across calls const Address& l_tmp = InterpreterMacroAssembler::l_tmp; @@ -81,7 +80,7 @@ void InterpreterGenerator::save_native_result(void) { #endif } -void InterpreterGenerator::restore_native_result(void) { +void TemplateInterpreterGenerator::restore_native_result(void) { const Address& l_tmp = InterpreterMacroAssembler::l_tmp; const Address& d_tmp = InterpreterMacroAssembler::d_tmp; @@ -293,7 +292,7 @@ address TemplateInterpreterGenerator::generate_continuation_for(TosState state) // Lmethod: method // ??: invocation counter // -void InterpreterGenerator::generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue) { +void TemplateInterpreterGenerator::generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue) { // Note: In tiered we increment either counters in MethodCounters* or in // MDO depending if we're profiling or not. const Register G3_method_counters = G3_scratch; @@ -724,7 +723,7 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call) { } // Method entry for java.lang.ref.Reference.get. -address InterpreterGenerator::generate_Reference_get_entry(void) { +address TemplateInterpreterGenerator::generate_Reference_get_entry(void) { #if INCLUDE_ALL_GCS // Code: _aload_0, _getfield, _areturn // parameter size = 1 @@ -807,7 +806,7 @@ address InterpreterGenerator::generate_Reference_get_entry(void) { * Method entry for static native methods: * int java.util.zip.CRC32.update(int crc, int b) */ -address InterpreterGenerator::generate_CRC32_update_entry() { +address TemplateInterpreterGenerator::generate_CRC32_update_entry() { if (UseCRC32Intrinsics) { address entry = __ pc(); @@ -851,7 +850,7 @@ address InterpreterGenerator::generate_CRC32_update_entry() { * int java.util.zip.CRC32.updateBytes(int crc, byte[] b, int off, int len) * int java.util.zip.CRC32.updateByteBuffer(int crc, long buf, int off, int len) */ -address InterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) { +address TemplateInterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) { if (UseCRC32Intrinsics) { address entry = __ pc(); @@ -903,13 +902,22 @@ address InterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpret return NULL; } +// Not supported +address TemplateInterpreterGenerator::generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) { + return NULL; +} + +// Not supported +address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { + return NULL; +} // // Interpreter stub for calling a native method. (asm interpreter) // This sets up a somewhat different looking stack for calling the native method // than the typical interpreter frame setup. // -address InterpreterGenerator::generate_native_entry(bool synchronized) { +address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { address entry = __ pc(); // the following temporary registers are used during frame creation @@ -1336,7 +1344,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) { // Generic method entry to (asm) interpreter -address InterpreterGenerator::generate_normal_entry(bool synchronized) { +address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) { address entry = __ pc(); bool inc_counter = UseCompiler || CountCompiledCalls || LogTouchedMethods; @@ -1743,14 +1751,6 @@ void TemplateInterpreterGenerator::set_vtos_entry_points(Template* t, address& b // -------------------------------------------------------------------------------- - -InterpreterGenerator::InterpreterGenerator(StubQueue* code) - : TemplateInterpreterGenerator(code) { - generate_all(); // down here so it can be "virtual" -} - -// -------------------------------------------------------------------------------- - // Non-product code #ifndef PRODUCT address TemplateInterpreterGenerator::generate_trace_code(TosState state) { @@ -1829,4 +1829,3 @@ void TemplateInterpreterGenerator::stop_interpreter_at() { __ breakpoint_trap(Assembler::equal, Assembler::icc); } #endif // not PRODUCT -#endif // !CC_INTERP diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.hpp b/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.hpp deleted file mode 100644 index 73b0f1478b5..00000000000 --- a/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_SPARC_VM_TEMPLATEINTERPRETERGENERATOR_SPARC_HPP -#define CPU_SPARC_VM_TEMPLATEINTERPRETERGENERATOR_SPARC_HPP - - protected: - - void generate_fixed_frame(bool native_call); // template interpreter only - void generate_stack_overflow_check(Register Rframe_size, Register Rscratch, - Register Rscratch2); - -#endif // CPU_SPARC_VM_TEMPLATEINTERPRETERGENERATOR_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp index 04d15c42693..b1bc7fc6136 100644 --- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp @@ -24,7 +24,6 @@ #include "precompiled.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "oops/constMethod.hpp" #include "oops/method.hpp" #include "runtime/arguments.hpp" @@ -32,6 +31,18 @@ #include "runtime/synchronizer.hpp" #include "utilities/macros.hpp" +// Size of interpreter code. Increase if too small. Interpreter will +// fail with a guarantee ("not enough space for interpreter generation"); +// if too small. +// Run with +PrintInterpreter to get the VM to print out the size. +// Max size with JVMTI +#ifdef _LP64 + // The sethi() instruction generates lots more instructions when shell + // stack limit is unlimited, so that's why this is much bigger. +int TemplateInterpreter::InterpreterCodeSize = 260 * K; +#else +int TemplateInterpreter::InterpreterCodeSize = 230 * K; +#endif int AbstractInterpreter::BasicType_as_index(BasicType type) { int i = 0; @@ -107,7 +118,7 @@ int AbstractInterpreter::size_activation(int max_stack, int callee_locals, bool is_top_frame) { // Note: This calculation must exactly parallel the frame setup - // in InterpreterGenerator::generate_fixed_frame. + // in TemplateInterpreterGenerator::generate_fixed_frame. int monitor_size = monitors * frame::interpreter_frame_monitor_size(); diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.hpp b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.hpp deleted file mode 100644 index 43d7cef64f4..00000000000 --- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_SPARC_VM_TEMPLATEINTERPRETER_SPARC_HPP -#define CPU_SPARC_VM_TEMPLATEINTERPRETER_SPARC_HPP - - - protected: - - // Size of interpreter code. Increase if too small. Interpreter will - // fail with a guarantee ("not enough space for interpreter generation"); - // if too small. - // Run with +PrintInterpreter to get the VM to print out the size. - // Max size with JVMTI - -#ifdef _LP64 - // The sethi() instruction generates lots more instructions when shell - // stack limit is unlimited, so that's why this is much bigger. - const static int InterpreterCodeSize = 260 * K; -#else - const static int InterpreterCodeSize = 230 * K; -#endif - -#endif // CPU_SPARC_VM_TEMPLATEINTERPRETER_SPARC_HPP diff --git a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp index 48da68c0cba..158bb544d9e 100644 --- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp @@ -37,7 +37,6 @@ #include "runtime/synchronizer.hpp" #include "utilities/macros.hpp" -#ifndef CC_INTERP #define __ _masm-> // Misc helpers @@ -3777,4 +3776,3 @@ void TemplateTable::multianewarray() { call_VM(Otos_i, CAST_FROM_FN_PTR(address, InterpreterRuntime::multianewarray), O1); __ add( Lesp, Lscratch, Lesp); // pop all dimensions off the stack } -#endif /* !CC_INTERP */ diff --git a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp b/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp deleted file mode 100644 index 3088400c801..00000000000 --- a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "asm/assembler.hpp" -#include "interpreter/bytecodeInterpreter.hpp" -#include "interpreter/bytecodeInterpreter.inline.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "oops/methodData.hpp" -#include "oops/method.hpp" -#include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiThreadState.hpp" -#include "runtime/deoptimization.hpp" -#include "runtime/frame.inline.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/stubRoutines.hpp" -#include "runtime/synchronizer.hpp" -#include "runtime/vframeArray.hpp" -#include "utilities/debug.hpp" -#ifdef TARGET_ARCH_x86 -# include "interp_masm_x86.hpp" -#endif - -#ifdef CC_INTERP - -#endif // CC_INTERP (all) diff --git a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.hpp b/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.hpp deleted file mode 100644 index 2538b4ef451..00000000000 --- a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.hpp +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_X86_VM_BYTECODEINTERPRETER_X86_HPP -#define CPU_X86_VM_BYTECODEINTERPRETER_X86_HPP - -// Platform specific for C++ based Interpreter - -private: - - interpreterState _self_link; /* Previous interpreter state */ /* sometimes points to self??? */ - address _result_handler; /* temp for saving native result handler */ - intptr_t* _sender_sp; /* sender's sp before stack (locals) extension */ - - address _extra_junk1; /* temp to save on recompiles */ - address _extra_junk2; /* temp to save on recompiles */ - address _extra_junk3; /* temp to save on recompiles */ - // address dummy_for_native2; /* a native frame result handler would be here... */ - // address dummy_for_native1; /* native result type stored here in a interpreter native frame */ - address _extra_junk4; /* temp to save on recompiles */ - address _extra_junk5; /* temp to save on recompiles */ - address _extra_junk6; /* temp to save on recompiles */ -public: - // we have an interpreter frame... -inline intptr_t* sender_sp() { - return _sender_sp; -} - -// The interpreter always has the frame anchor fully setup so we don't -// have to do anything going to vm from the interpreter. On return -// we do have to clear the flags in case they we're modified to -// maintain the stack walking invariants. -// -#define SET_LAST_JAVA_FRAME() - -#define RESET_LAST_JAVA_FRAME() - -/* - * Macros for accessing the stack. - */ -#undef STACK_INT -#undef STACK_FLOAT -#undef STACK_ADDR -#undef STACK_OBJECT -#undef STACK_DOUBLE -#undef STACK_LONG - -// JavaStack Implementation - -#define GET_STACK_SLOT(offset) (*((intptr_t*) &topOfStack[-(offset)])) -#define STACK_SLOT(offset) ((address) &topOfStack[-(offset)]) -#define STACK_ADDR(offset) (*((address *) &topOfStack[-(offset)])) -#define STACK_INT(offset) (*((jint*) &topOfStack[-(offset)])) -#define STACK_FLOAT(offset) (*((jfloat *) &topOfStack[-(offset)])) -#define STACK_OBJECT(offset) (*((oop *) &topOfStack [-(offset)])) -#define STACK_DOUBLE(offset) (((VMJavaVal64*) &topOfStack[-(offset)])->d) -#define STACK_LONG(offset) (((VMJavaVal64 *) &topOfStack[-(offset)])->l) - -#define SET_STACK_SLOT(value, offset) (*(intptr_t*)&topOfStack[-(offset)] = *(intptr_t*)(value)) -#define SET_STACK_ADDR(value, offset) (*((address *)&topOfStack[-(offset)]) = (value)) -#define SET_STACK_INT(value, offset) (*((jint *)&topOfStack[-(offset)]) = (value)) -#define SET_STACK_FLOAT(value, offset) (*((jfloat *)&topOfStack[-(offset)]) = (value)) -#define SET_STACK_OBJECT(value, offset) (*((oop *)&topOfStack[-(offset)]) = (value)) -#define SET_STACK_DOUBLE(value, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->d = (value)) -#define SET_STACK_DOUBLE_FROM_ADDR(addr, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->d = \ - ((VMJavaVal64*)(addr))->d) -#define SET_STACK_LONG(value, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->l = (value)) -#define SET_STACK_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&topOfStack[-(offset)])->l = \ - ((VMJavaVal64*)(addr))->l) -// JavaLocals implementation - -#define LOCALS_SLOT(offset) ((intptr_t*)&locals[-(offset)]) -#define LOCALS_ADDR(offset) ((address)locals[-(offset)]) -#define LOCALS_INT(offset) ((jint)(locals[-(offset)])) -#define LOCALS_FLOAT(offset) (*((jfloat*)&locals[-(offset)])) -#define LOCALS_OBJECT(offset) (cast_to_oop(locals[-(offset)])) -#define LOCALS_DOUBLE(offset) (((VMJavaVal64*)&locals[-((offset) + 1)])->d) -#define LOCALS_LONG(offset) (((VMJavaVal64*)&locals[-((offset) + 1)])->l) -#define LOCALS_LONG_AT(offset) (((address)&locals[-((offset) + 1)])) -#define LOCALS_DOUBLE_AT(offset) (((address)&locals[-((offset) + 1)])) - -#define SET_LOCALS_SLOT(value, offset) (*(intptr_t*)&locals[-(offset)] = *(intptr_t *)(value)) -#define SET_LOCALS_ADDR(value, offset) (*((address *)&locals[-(offset)]) = (value)) -#define SET_LOCALS_INT(value, offset) (*((jint *)&locals[-(offset)]) = (value)) -#define SET_LOCALS_FLOAT(value, offset) (*((jfloat *)&locals[-(offset)]) = (value)) -#define SET_LOCALS_OBJECT(value, offset) (*((oop *)&locals[-(offset)]) = (value)) -#define SET_LOCALS_DOUBLE(value, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->d = (value)) -#define SET_LOCALS_LONG(value, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = (value)) -#define SET_LOCALS_DOUBLE_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->d = \ - ((VMJavaVal64*)(addr))->d) -#define SET_LOCALS_LONG_FROM_ADDR(addr, offset) (((VMJavaVal64*)&locals[-((offset)+1)])->l = \ - ((VMJavaVal64*)(addr))->l) - -#endif // CPU_X86_VM_BYTECODEINTERPRETER_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp b/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp deleted file mode 100644 index d205f1db79a..00000000000 --- a/hotspot/src/cpu/x86/vm/bytecodeInterpreter_x86.inline.hpp +++ /dev/null @@ -1,285 +0,0 @@ -/* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_X86_VM_BYTECODEINTERPRETER_X86_INLINE_HPP -#define CPU_X86_VM_BYTECODEINTERPRETER_X86_INLINE_HPP - -// Inline interpreter functions for IA32 - -inline jfloat BytecodeInterpreter::VMfloatAdd(jfloat op1, jfloat op2) { return op1 + op2; } -inline jfloat BytecodeInterpreter::VMfloatSub(jfloat op1, jfloat op2) { return op1 - op2; } -inline jfloat BytecodeInterpreter::VMfloatMul(jfloat op1, jfloat op2) { return op1 * op2; } -inline jfloat BytecodeInterpreter::VMfloatDiv(jfloat op1, jfloat op2) { return op1 / op2; } -inline jfloat BytecodeInterpreter::VMfloatRem(jfloat op1, jfloat op2) { return fmod(op1, op2); } - -inline jfloat BytecodeInterpreter::VMfloatNeg(jfloat op) { return -op; } - -inline int32_t BytecodeInterpreter::VMfloatCompare(jfloat op1, jfloat op2, int32_t direction) { - return ( op1 < op2 ? -1 : - op1 > op2 ? 1 : - op1 == op2 ? 0 : - (direction == -1 || direction == 1) ? direction : 0); - -} - -inline void BytecodeInterpreter::VMmemCopy64(uint32_t to[2], const uint32_t from[2]) { - // x86 can do unaligned copies but not 64bits at a time - to[0] = from[0]; to[1] = from[1]; -} - -// The long operations depend on compiler support for "long long" on x86 - -inline jlong BytecodeInterpreter::VMlongAdd(jlong op1, jlong op2) { - return op1 + op2; -} - -inline jlong BytecodeInterpreter::VMlongAnd(jlong op1, jlong op2) { - return op1 & op2; -} - -inline jlong BytecodeInterpreter::VMlongDiv(jlong op1, jlong op2) { - // QQQ what about check and throw... - return op1 / op2; -} - -inline jlong BytecodeInterpreter::VMlongMul(jlong op1, jlong op2) { - return op1 * op2; -} - -inline jlong BytecodeInterpreter::VMlongOr(jlong op1, jlong op2) { - return op1 | op2; -} - -inline jlong BytecodeInterpreter::VMlongSub(jlong op1, jlong op2) { - return op1 - op2; -} - -inline jlong BytecodeInterpreter::VMlongXor(jlong op1, jlong op2) { - return op1 ^ op2; -} - -inline jlong BytecodeInterpreter::VMlongRem(jlong op1, jlong op2) { - return op1 % op2; -} - -inline jlong BytecodeInterpreter::VMlongUshr(jlong op1, jint op2) { - // CVM did this 0x3f mask, is the really needed??? QQQ - return ((unsigned long long) op1) >> (op2 & 0x3F); -} - -inline jlong BytecodeInterpreter::VMlongShr(jlong op1, jint op2) { - return op1 >> (op2 & 0x3F); -} - -inline jlong BytecodeInterpreter::VMlongShl(jlong op1, jint op2) { - return op1 << (op2 & 0x3F); -} - -inline jlong BytecodeInterpreter::VMlongNeg(jlong op) { - return -op; -} - -inline jlong BytecodeInterpreter::VMlongNot(jlong op) { - return ~op; -} - -inline int32_t BytecodeInterpreter::VMlongLtz(jlong op) { - return (op <= 0); -} - -inline int32_t BytecodeInterpreter::VMlongGez(jlong op) { - return (op >= 0); -} - -inline int32_t BytecodeInterpreter::VMlongEqz(jlong op) { - return (op == 0); -} - -inline int32_t BytecodeInterpreter::VMlongEq(jlong op1, jlong op2) { - return (op1 == op2); -} - -inline int32_t BytecodeInterpreter::VMlongNe(jlong op1, jlong op2) { - return (op1 != op2); -} - -inline int32_t BytecodeInterpreter::VMlongGe(jlong op1, jlong op2) { - return (op1 >= op2); -} - -inline int32_t BytecodeInterpreter::VMlongLe(jlong op1, jlong op2) { - return (op1 <= op2); -} - -inline int32_t BytecodeInterpreter::VMlongLt(jlong op1, jlong op2) { - return (op1 < op2); -} - -inline int32_t BytecodeInterpreter::VMlongGt(jlong op1, jlong op2) { - return (op1 > op2); -} - -inline int32_t BytecodeInterpreter::VMlongCompare(jlong op1, jlong op2) { - return (VMlongLt(op1, op2) ? -1 : VMlongGt(op1, op2) ? 1 : 0); -} - -// Long conversions - -inline jdouble BytecodeInterpreter::VMlong2Double(jlong val) { - return (jdouble) val; -} - -inline jfloat BytecodeInterpreter::VMlong2Float(jlong val) { - return (jfloat) val; -} - -inline jint BytecodeInterpreter::VMlong2Int(jlong val) { - return (jint) val; -} - -// Double Arithmetic - -inline jdouble BytecodeInterpreter::VMdoubleAdd(jdouble op1, jdouble op2) { - return op1 + op2; -} - -inline jdouble BytecodeInterpreter::VMdoubleDiv(jdouble op1, jdouble op2) { - // Divide by zero... QQQ - return op1 / op2; -} - -inline jdouble BytecodeInterpreter::VMdoubleMul(jdouble op1, jdouble op2) { - return op1 * op2; -} - -inline jdouble BytecodeInterpreter::VMdoubleNeg(jdouble op) { - return -op; -} - -inline jdouble BytecodeInterpreter::VMdoubleRem(jdouble op1, jdouble op2) { - return fmod(op1, op2); -} - -inline jdouble BytecodeInterpreter::VMdoubleSub(jdouble op1, jdouble op2) { - return op1 - op2; -} - -inline int32_t BytecodeInterpreter::VMdoubleCompare(jdouble op1, jdouble op2, int32_t direction) { - return ( op1 < op2 ? -1 : - op1 > op2 ? 1 : - op1 == op2 ? 0 : - (direction == -1 || direction == 1) ? direction : 0); -} - -// Double Conversions - -inline jfloat BytecodeInterpreter::VMdouble2Float(jdouble val) { - return (jfloat) val; -} - -// Float Conversions - -inline jdouble BytecodeInterpreter::VMfloat2Double(jfloat op) { - return (jdouble) op; -} - -// Integer Arithmetic - -inline jint BytecodeInterpreter::VMintAdd(jint op1, jint op2) { - return op1 + op2; -} - -inline jint BytecodeInterpreter::VMintAnd(jint op1, jint op2) { - return op1 & op2; -} - -inline jint BytecodeInterpreter::VMintDiv(jint op1, jint op2) { - /* it's possible we could catch this special case implicitly */ - if ((juint)op1 == 0x80000000 && op2 == -1) return op1; - else return op1 / op2; -} - -inline jint BytecodeInterpreter::VMintMul(jint op1, jint op2) { - return op1 * op2; -} - -inline jint BytecodeInterpreter::VMintNeg(jint op) { - return -op; -} - -inline jint BytecodeInterpreter::VMintOr(jint op1, jint op2) { - return op1 | op2; -} - -inline jint BytecodeInterpreter::VMintRem(jint op1, jint op2) { - /* it's possible we could catch this special case implicitly */ - if ((juint)op1 == 0x80000000 && op2 == -1) return 0; - else return op1 % op2; -} - -inline jint BytecodeInterpreter::VMintShl(jint op1, jint op2) { - return op1 << op2; -} - -inline jint BytecodeInterpreter::VMintShr(jint op1, jint op2) { - return op1 >> (op2 & 0x1f); -} - -inline jint BytecodeInterpreter::VMintSub(jint op1, jint op2) { - return op1 - op2; -} - -inline juint BytecodeInterpreter::VMintUshr(jint op1, jint op2) { - return ((juint) op1) >> (op2 & 0x1f); -} - -inline jint BytecodeInterpreter::VMintXor(jint op1, jint op2) { - return op1 ^ op2; -} - -inline jdouble BytecodeInterpreter::VMint2Double(jint val) { - return (jdouble) val; -} - -inline jfloat BytecodeInterpreter::VMint2Float(jint val) { - return (jfloat) val; -} - -inline jlong BytecodeInterpreter::VMint2Long(jint val) { - return (jlong) val; -} - -inline jchar BytecodeInterpreter::VMint2Char(jint val) { - return (jchar) val; -} - -inline jshort BytecodeInterpreter::VMint2Short(jint val) { - return (jshort) val; -} - -inline jbyte BytecodeInterpreter::VMint2Byte(jint val) { - return (jbyte) val; -} - -#endif // CPU_X86_VM_BYTECODEINTERPRETER_X86_INLINE_HPP diff --git a/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp b/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp index ec0b81cc541..ffd7e277c96 100644 --- a/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp +++ b/hotspot/src/cpu/x86/vm/c2_globals_x86.hpp @@ -38,11 +38,7 @@ define_pd_global(bool, InlineIntrinsics, true); define_pd_global(bool, PreferInterpreterNativeStubs, false); define_pd_global(bool, ProfileTraps, true); define_pd_global(bool, UseOnStackReplacement, true); -#ifdef CC_INTERP -define_pd_global(bool, ProfileInterpreter, false); -#else define_pd_global(bool, ProfileInterpreter, true); -#endif // CC_INTERP define_pd_global(bool, TieredCompilation, trueInTiered); define_pd_global(intx, CompileThreshold, 10000); diff --git a/hotspot/src/cpu/x86/vm/cppInterpreterGenerator_x86.hpp b/hotspot/src/cpu/x86/vm/cppInterpreterGenerator_x86.hpp deleted file mode 100644 index bf47c3430ef..00000000000 --- a/hotspot/src/cpu/x86/vm/cppInterpreterGenerator_x86.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_X86_VM_CPPINTERPRETERGENERATOR_X86_HPP -#define CPU_X86_VM_CPPINTERPRETERGENERATOR_X86_HPP - - protected: - - void generate_more_monitors(); - void generate_deopt_handling(); - void lock_method(void); - address generate_interpreter_frame_manager(bool synchronized); // C++ interpreter only - void generate_compute_interpreter_state(const Register state, - const Register prev_state, - const Register sender_sp, - bool native); // C++ interpreter only - -#endif // CPU_X86_VM_CPPINTERPRETERGENERATOR_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp b/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp deleted file mode 100644 index b3ed77e68c6..00000000000 --- a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.cpp +++ /dev/null @@ -1,2314 +0,0 @@ -/* - * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "asm/macroAssembler.hpp" -#include "interpreter/bytecodeHistogram.hpp" -#include "interpreter/cppInterpreter.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "oops/arrayOop.hpp" -#include "oops/methodData.hpp" -#include "oops/method.hpp" -#include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiThreadState.hpp" -#include "runtime/arguments.hpp" -#include "runtime/deoptimization.hpp" -#include "runtime/frame.inline.hpp" -#include "runtime/interfaceSupport.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/stubRoutines.hpp" -#include "runtime/synchronizer.hpp" -#include "runtime/timer.hpp" -#include "runtime/vframeArray.hpp" -#include "utilities/debug.hpp" -#include "utilities/macros.hpp" -#ifdef SHARK -#include "shark/shark_globals.hpp" -#endif - -#ifdef CC_INTERP - -// Routine exists to make tracebacks look decent in debugger -// while we are recursed in the frame manager/c++ interpreter. -// We could use an address in the frame manager but having -// frames look natural in the debugger is a plus. -extern "C" void RecursiveInterpreterActivation(interpreterState istate ) -{ - // - ShouldNotReachHere(); -} - - -#define __ _masm-> -#define STATE(field_name) (Address(state, byte_offset_of(BytecodeInterpreter, field_name))) - -// default registers for state and sender_sp -// state and sender_sp are the same on 32bit because we have no choice. -// state could be rsi on 64bit but it is an arg reg and not callee save -// so r13 is better choice. - -const Register state = NOT_LP64(rsi) LP64_ONLY(r13); -const Register sender_sp_on_entry = NOT_LP64(rsi) LP64_ONLY(r13); - -// NEEDED for JVMTI? -// address AbstractInterpreter::_remove_activation_preserving_args_entry; - -static address unctrap_frame_manager_entry = NULL; - -static address deopt_frame_manager_return_atos = NULL; -static address deopt_frame_manager_return_btos = NULL; -static address deopt_frame_manager_return_itos = NULL; -static address deopt_frame_manager_return_ltos = NULL; -static address deopt_frame_manager_return_ftos = NULL; -static address deopt_frame_manager_return_dtos = NULL; -static address deopt_frame_manager_return_vtos = NULL; - -int AbstractInterpreter::BasicType_as_index(BasicType type) { - int i = 0; - switch (type) { - case T_BOOLEAN: i = 0; break; - case T_CHAR : i = 1; break; - case T_BYTE : i = 2; break; - case T_SHORT : i = 3; break; - case T_INT : i = 4; break; - case T_VOID : i = 5; break; - case T_FLOAT : i = 8; break; - case T_LONG : i = 9; break; - case T_DOUBLE : i = 6; break; - case T_OBJECT : // fall through - case T_ARRAY : i = 7; break; - default : ShouldNotReachHere(); - } - assert(0 <= i && i < AbstractInterpreter::number_of_result_handlers, "index out of bounds"); - return i; -} - -// Is this pc anywhere within code owned by the interpreter? -// This only works for pc that might possibly be exposed to frame -// walkers. It clearly misses all of the actual c++ interpreter -// implementation -bool CppInterpreter::contains(address pc) { - return (_code->contains(pc) || - pc == CAST_FROM_FN_PTR(address, RecursiveInterpreterActivation)); -} - - -address CppInterpreterGenerator::generate_result_handler_for(BasicType type) { - address entry = __ pc(); - switch (type) { - case T_BOOLEAN: __ c2bool(rax); break; - case T_CHAR : __ andl(rax, 0xFFFF); break; - case T_BYTE : __ sign_extend_byte (rax); break; - case T_SHORT : __ sign_extend_short(rax); break; - case T_VOID : // fall thru - case T_LONG : // fall thru - case T_INT : /* nothing to do */ break; - - case T_DOUBLE : - case T_FLOAT : - { - const Register t = InterpreterRuntime::SignatureHandlerGenerator::temp(); - __ pop(t); // remove return address first - // Must return a result for interpreter or compiler. In SSE - // mode, results are returned in xmm0 and the FPU stack must - // be empty. - if (type == T_FLOAT && UseSSE >= 1) { -#ifndef _LP64 - // Load ST0 - __ fld_d(Address(rsp, 0)); - // Store as float and empty fpu stack - __ fstp_s(Address(rsp, 0)); -#endif // !_LP64 - // and reload - __ movflt(xmm0, Address(rsp, 0)); - } else if (type == T_DOUBLE && UseSSE >= 2 ) { - __ movdbl(xmm0, Address(rsp, 0)); - } else { - // restore ST0 - __ fld_d(Address(rsp, 0)); - } - // and pop the temp - __ addptr(rsp, 2 * wordSize); - __ push(t); // restore return address - } - break; - case T_OBJECT : - // retrieve result from frame - __ movptr(rax, STATE(_oop_temp)); - // and verify it - __ verify_oop(rax); - break; - default : ShouldNotReachHere(); - } - __ ret(0); // return from result handler - return entry; -} - -// tosca based result to c++ interpreter stack based result. -// Result goes to top of native stack. - -#undef EXTEND // SHOULD NOT BE NEEDED -address CppInterpreterGenerator::generate_tosca_to_stack_converter(BasicType type) { - // A result is in the tosca (abi result) from either a native method call or compiled - // code. Place this result on the java expression stack so C++ interpreter can use it. - address entry = __ pc(); - - const Register t = InterpreterRuntime::SignatureHandlerGenerator::temp(); - __ pop(t); // remove return address first - switch (type) { - case T_VOID: - break; - case T_BOOLEAN: -#ifdef EXTEND - __ c2bool(rax); -#endif - __ push(rax); - break; - case T_CHAR : -#ifdef EXTEND - __ andl(rax, 0xFFFF); -#endif - __ push(rax); - break; - case T_BYTE : -#ifdef EXTEND - __ sign_extend_byte (rax); -#endif - __ push(rax); - break; - case T_SHORT : -#ifdef EXTEND - __ sign_extend_short(rax); -#endif - __ push(rax); - break; - case T_LONG : - __ push(rdx); // pushes useless junk on 64bit - __ push(rax); - break; - case T_INT : - __ push(rax); - break; - case T_FLOAT : - // Result is in ST(0)/xmm0 - __ subptr(rsp, wordSize); - if ( UseSSE < 1) { - __ fstp_s(Address(rsp, 0)); - } else { - __ movflt(Address(rsp, 0), xmm0); - } - break; - case T_DOUBLE : - __ subptr(rsp, 2*wordSize); - if ( UseSSE < 2 ) { - __ fstp_d(Address(rsp, 0)); - } else { - __ movdbl(Address(rsp, 0), xmm0); - } - break; - case T_OBJECT : - __ verify_oop(rax); // verify it - __ push(rax); - break; - default : ShouldNotReachHere(); - } - __ jmp(t); // return from result handler - return entry; -} - -address CppInterpreterGenerator::generate_stack_to_stack_converter(BasicType type) { - // A result is in the java expression stack of the interpreted method that has just - // returned. Place this result on the java expression stack of the caller. - // - // The current interpreter activation in rsi/r13 is for the method just returning its - // result. So we know that the result of this method is on the top of the current - // execution stack (which is pre-pushed) and will be return to the top of the caller - // stack. The top of the callers stack is the bottom of the locals of the current - // activation. - // Because of the way activation are managed by the frame manager the value of rsp is - // below both the stack top of the current activation and naturally the stack top - // of the calling activation. This enable this routine to leave the return address - // to the frame manager on the stack and do a vanilla return. - // - // On entry: rsi/r13 - interpreter state of activation returning a (potential) result - // On Return: rsi/r13 - unchanged - // rax - new stack top for caller activation (i.e. activation in _prev_link) - // - // Can destroy rdx, rcx. - // - - address entry = __ pc(); - const Register t = InterpreterRuntime::SignatureHandlerGenerator::temp(); - switch (type) { - case T_VOID: - __ movptr(rax, STATE(_locals)); // pop parameters get new stack value - __ addptr(rax, wordSize); // account for prepush before we return - break; - case T_FLOAT : - case T_BOOLEAN: - case T_CHAR : - case T_BYTE : - case T_SHORT : - case T_INT : - // 1 word result - __ movptr(rdx, STATE(_stack)); - __ movptr(rax, STATE(_locals)); // address for result - __ movl(rdx, Address(rdx, wordSize)); // get result - __ movptr(Address(rax, 0), rdx); // and store it - break; - case T_LONG : - case T_DOUBLE : - // return top two words on current expression stack to caller's expression stack - // The caller's expression stack is adjacent to the current frame manager's intepretState - // except we allocated one extra word for this intepretState so we won't overwrite it - // when we return a two word result. - - __ movptr(rax, STATE(_locals)); // address for result - __ movptr(rcx, STATE(_stack)); - __ subptr(rax, wordSize); // need addition word besides locals[0] - __ movptr(rdx, Address(rcx, 2*wordSize)); // get result word (junk in 64bit) - __ movptr(Address(rax, wordSize), rdx); // and store it - __ movptr(rdx, Address(rcx, wordSize)); // get result word - __ movptr(Address(rax, 0), rdx); // and store it - break; - case T_OBJECT : - __ movptr(rdx, STATE(_stack)); - __ movptr(rax, STATE(_locals)); // address for result - __ movptr(rdx, Address(rdx, wordSize)); // get result - __ verify_oop(rdx); // verify it - __ movptr(Address(rax, 0), rdx); // and store it - break; - default : ShouldNotReachHere(); - } - __ ret(0); - return entry; -} - -address CppInterpreterGenerator::generate_stack_to_native_abi_converter(BasicType type) { - // A result is in the java expression stack of the interpreted method that has just - // returned. Place this result in the native abi that the caller expects. - // - // Similar to generate_stack_to_stack_converter above. Called at a similar time from the - // frame manager execept in this situation the caller is native code (c1/c2/call_stub) - // and so rather than return result onto caller's java expression stack we return the - // result in the expected location based on the native abi. - // On entry: rsi/r13 - interpreter state of activation returning a (potential) result - // On Return: rsi/r13 - unchanged - // Other registers changed [rax/rdx/ST(0) as needed for the result returned] - - address entry = __ pc(); - switch (type) { - case T_VOID: - break; - case T_BOOLEAN: - case T_CHAR : - case T_BYTE : - case T_SHORT : - case T_INT : - __ movptr(rdx, STATE(_stack)); // get top of stack - __ movl(rax, Address(rdx, wordSize)); // get result word 1 - break; - case T_LONG : - __ movptr(rdx, STATE(_stack)); // get top of stack - __ movptr(rax, Address(rdx, wordSize)); // get result low word - NOT_LP64(__ movl(rdx, Address(rdx, 2*wordSize));) // get result high word - break; - case T_FLOAT : - __ movptr(rdx, STATE(_stack)); // get top of stack - if ( UseSSE >= 1) { - __ movflt(xmm0, Address(rdx, wordSize)); - } else { - __ fld_s(Address(rdx, wordSize)); // pushd float result - } - break; - case T_DOUBLE : - __ movptr(rdx, STATE(_stack)); // get top of stack - if ( UseSSE > 1) { - __ movdbl(xmm0, Address(rdx, wordSize)); - } else { - __ fld_d(Address(rdx, wordSize)); // push double result - } - break; - case T_OBJECT : - __ movptr(rdx, STATE(_stack)); // get top of stack - __ movptr(rax, Address(rdx, wordSize)); // get result word 1 - __ verify_oop(rax); // verify it - break; - default : ShouldNotReachHere(); - } - __ ret(0); - return entry; -} - -address CppInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { - // make it look good in the debugger - return CAST_FROM_FN_PTR(address, RecursiveInterpreterActivation); -} - -address CppInterpreter::deopt_entry(TosState state, int length) { - address ret = NULL; - if (length != 0) { - switch (state) { - case atos: ret = deopt_frame_manager_return_atos; break; - case btos: ret = deopt_frame_manager_return_btos; break; - case ctos: - case stos: - case itos: ret = deopt_frame_manager_return_itos; break; - case ltos: ret = deopt_frame_manager_return_ltos; break; - case ftos: ret = deopt_frame_manager_return_ftos; break; - case dtos: ret = deopt_frame_manager_return_dtos; break; - case vtos: ret = deopt_frame_manager_return_vtos; break; - } - } else { - ret = unctrap_frame_manager_entry; // re-execute the bytecode ( e.g. uncommon trap) - } - assert(ret != NULL, "Not initialized"); - return ret; -} - -// C++ Interpreter -void CppInterpreterGenerator::generate_compute_interpreter_state(const Register state, - const Register locals, - const Register sender_sp, - bool native) { - - // On entry the "locals" argument points to locals[0] (or where it would be in case no locals in - // a static method). "state" contains any previous frame manager state which we must save a link - // to in the newly generated state object. On return "state" is a pointer to the newly allocated - // state object. We must allocate and initialize a new interpretState object and the method - // expression stack. Because the returned result (if any) of the method will be placed on the caller's - // expression stack and this will overlap with locals[0] (and locals[1] if double/long) we must - // be sure to leave space on the caller's stack so that this result will not overwrite values when - // locals[0] and locals[1] do not exist (and in fact are return address and saved rbp). So when - // we are non-native we in essence ensure that locals[0-1] exist. We play an extra trick in - // non-product builds and initialize this last local with the previous interpreterState as - // this makes things look real nice in the debugger. - - // State on entry - // Assumes locals == &locals[0] - // Assumes state == any previous frame manager state (assuming call path from c++ interpreter) - // Assumes rax = return address - // rcx == senders_sp - // rbx == method - // Modifies rcx, rdx, rax - // Returns: - // state == address of new interpreterState - // rsp == bottom of method's expression stack. - - const Address const_offset (rbx, Method::const_offset()); - - - // On entry sp is the sender's sp. This includes the space for the arguments - // that the sender pushed. If the sender pushed no args (a static) and the - // caller returns a long then we need two words on the sender's stack which - // are not present (although when we return a restore full size stack the - // space will be present). If we didn't allocate two words here then when - // we "push" the result of the caller's stack we would overwrite the return - // address and the saved rbp. Not good. So simply allocate 2 words now - // just to be safe. This is the "static long no_params() method" issue. - // See Lo.java for a testcase. - // We don't need this for native calls because they return result in - // register and the stack is expanded in the caller before we store - // the results on the stack. - - if (!native) { -#ifdef PRODUCT - __ subptr(rsp, 2*wordSize); -#else /* PRODUCT */ - __ push((int32_t)NULL_WORD); - __ push(state); // make it look like a real argument -#endif /* PRODUCT */ - } - - // Now that we are assure of space for stack result, setup typical linkage - - __ push(rax); - __ enter(); - - __ mov(rax, state); // save current state - - __ lea(rsp, Address(rsp, -(int)sizeof(BytecodeInterpreter))); - __ mov(state, rsp); - - // rsi/r13 == state/locals rax == prevstate - - // initialize the "shadow" frame so that use since C++ interpreter not directly - // recursive. Simpler to recurse but we can't trim expression stack as we call - // new methods. - __ movptr(STATE(_locals), locals); // state->_locals = locals() - __ movptr(STATE(_self_link), state); // point to self - __ movptr(STATE(_prev_link), rax); // state->_link = state on entry (NULL or previous state) - __ movptr(STATE(_sender_sp), sender_sp); // state->_sender_sp = sender_sp -#ifdef _LP64 - __ movptr(STATE(_thread), r15_thread); // state->_bcp = codes() -#else - __ get_thread(rax); // get vm's javathread* - __ movptr(STATE(_thread), rax); // state->_bcp = codes() -#endif // _LP64 - __ movptr(rdx, Address(rbx, Method::const_offset())); // get constantMethodOop - __ lea(rdx, Address(rdx, ConstMethod::codes_offset())); // get code base - if (native) { - __ movptr(STATE(_bcp), (int32_t)NULL_WORD); // state->_bcp = NULL - } else { - __ movptr(STATE(_bcp), rdx); // state->_bcp = codes() - } - __ xorptr(rdx, rdx); - __ movptr(STATE(_oop_temp), rdx); // state->_oop_temp = NULL (only really needed for native) - __ movptr(STATE(_mdx), rdx); // state->_mdx = NULL - __ movptr(rdx, Address(rbx, Method::const_offset())); - __ movptr(rdx, Address(rdx, ConstMethod::constants_offset())); - __ movptr(rdx, Address(rdx, ConstantPool::cache_offset_in_bytes())); - __ movptr(STATE(_constants), rdx); // state->_constants = constants() - - __ movptr(STATE(_method), rbx); // state->_method = method() - __ movl(STATE(_msg), (int32_t) BytecodeInterpreter::method_entry); // state->_msg = initial method entry - __ movptr(STATE(_result._to_call._callee), (int32_t) NULL_WORD); // state->_result._to_call._callee_callee = NULL - - - __ movptr(STATE(_monitor_base), rsp); // set monitor block bottom (grows down) this would point to entry [0] - // entries run from -1..x where &monitor[x] == - - { - // Must not attempt to lock method until we enter interpreter as gc won't be able to find the - // initial frame. However we allocate a free monitor so we don't have to shuffle the expression stack - // immediately. - - // synchronize method - const Address access_flags (rbx, Method::access_flags_offset()); - const int entry_size = frame::interpreter_frame_monitor_size() * wordSize; - Label not_synced; - - __ movl(rax, access_flags); - __ testl(rax, JVM_ACC_SYNCHRONIZED); - __ jcc(Assembler::zero, not_synced); - - // Allocate initial monitor and pre initialize it - // get synchronization object - - Label done; - const int mirror_offset = in_bytes(Klass::java_mirror_offset()); - __ movl(rax, access_flags); - __ testl(rax, JVM_ACC_STATIC); - __ movptr(rax, Address(locals, 0)); // get receiver (assume this is frequent case) - __ jcc(Assembler::zero, done); - __ movptr(rax, Address(rbx, Method::const_offset())); - __ movptr(rax, Address(rax, ConstMethod::constants_offset())); - __ movptr(rax, Address(rax, ConstantPool::pool_holder_offset_in_bytes())); - __ movptr(rax, Address(rax, mirror_offset)); - __ bind(done); - // add space for monitor & lock - __ subptr(rsp, entry_size); // add space for a monitor entry - __ movptr(Address(rsp, BasicObjectLock::obj_offset_in_bytes()), rax); // store object - __ bind(not_synced); - } - - __ movptr(STATE(_stack_base), rsp); // set expression stack base ( == &monitors[-count]) - if (native) { - __ movptr(STATE(_stack), rsp); // set current expression stack tos - __ movptr(STATE(_stack_limit), rsp); - } else { - __ subptr(rsp, wordSize); // pre-push stack - __ movptr(STATE(_stack), rsp); // set current expression stack tos - - // compute full expression stack limit - - __ movptr(rdx, Address(rbx, Method::const_offset())); - __ load_unsigned_short(rdx, Address(rdx, ConstMethod::max_stack_offset())); // get size of expression stack in words - __ negptr(rdx); // so we can subtract in next step - // Allocate expression stack - __ lea(rsp, Address(rsp, rdx, Address::times_ptr, -Method::extra_stack_words())); - __ movptr(STATE(_stack_limit), rsp); - } - -#ifdef _LP64 - // Make sure stack is properly aligned and sized for the abi - __ subptr(rsp, frame::arg_reg_save_area_bytes); // windows - __ andptr(rsp, -16); // must be 16 byte boundary (see amd64 ABI) -#endif // _LP64 - - - -} - -// Helpers for commoning out cases in the various type of method entries. -// - -// increment invocation count & check for overflow -// -// Note: checking for negative value instead of overflow -// so we have a 'sticky' overflow test -// -// rbx,: method -// rcx: invocation counter -// -void InterpreterGenerator::generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue) { - Label done; - const Address invocation_counter(rax, - MethodCounters::invocation_counter_offset() + - InvocationCounter::counter_offset()); - const Address backedge_counter (rax, - MethodCounters::backedge_counter_offset() + - InvocationCounter::counter_offset()); - - __ get_method_counters(rbx, rax, done); - - if (ProfileInterpreter) { - __ incrementl(Address(rax, - MethodCounters::interpreter_invocation_counter_offset())); - } - // Update standard invocation counters - __ movl(rcx, invocation_counter); - __ increment(rcx, InvocationCounter::count_increment); - __ movl(invocation_counter, rcx); // save invocation count - - __ movl(rax, backedge_counter); // load backedge counter - __ andl(rax, InvocationCounter::count_mask_value); // mask out the status bits - - __ addl(rcx, rax); // add both counters - - // profile_method is non-null only for interpreted method so - // profile_method != NULL == !native_call - // BytecodeInterpreter only calls for native so code is elided. - - __ cmp32(rcx, - ExternalAddress((address)&InvocationCounter::InterpreterInvocationLimit)); - __ jcc(Assembler::aboveEqual, *overflow); - __ bind(done); -} - -void InterpreterGenerator::generate_counter_overflow(Label* do_continue) { - - // C++ interpreter on entry - // rsi/r13 - new interpreter state pointer - // rbp - interpreter frame pointer - // rbx - method - - // On return (i.e. jump to entry_point) [ back to invocation of interpreter ] - // rbx, - method - // rcx - rcvr (assuming there is one) - // top of stack return address of interpreter caller - // rsp - sender_sp - - // C++ interpreter only - // rsi/r13 - previous interpreter state pointer - - // InterpreterRuntime::frequency_counter_overflow takes one argument - // indicating if the counter overflow occurs at a backwards branch (non-NULL bcp). - // The call returns the address of the verified entry point for the method or NULL - // if the compilation did not complete (either went background or bailed out). - __ movptr(rax, (int32_t)false); - __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::frequency_counter_overflow), rax); - - // for c++ interpreter can rsi really be munged? - __ lea(state, Address(rbp, -(int)sizeof(BytecodeInterpreter))); // restore state - __ movptr(rbx, Address(state, byte_offset_of(BytecodeInterpreter, _method))); // restore method - __ movptr(rdi, Address(state, byte_offset_of(BytecodeInterpreter, _locals))); // get locals pointer - - __ jmp(*do_continue, relocInfo::none); - -} - -void InterpreterGenerator::generate_stack_overflow_check(void) { - // see if we've got enough room on the stack for locals plus overhead. - // the expression stack grows down incrementally, so the normal guard - // page mechanism will work for that. - // - // Registers live on entry: - // - // Asm interpreter - // rdx: number of additional locals this frame needs (what we must check) - // rbx,: Method* - - // C++ Interpreter - // rsi/r13: previous interpreter frame state object - // rdi: &locals[0] - // rcx: # of locals - // rdx: number of additional locals this frame needs (what we must check) - // rbx: Method* - - // destroyed on exit - // rax, - - // NOTE: since the additional locals are also always pushed (wasn't obvious in - // generate_method_entry) so the guard should work for them too. - // - - const int entry_size = frame::interpreter_frame_monitor_size() * wordSize; - - // total overhead size: entry_size + (saved rbp, thru expr stack bottom). - // be sure to change this if you add/subtract anything to/from the overhead area - const int overhead_size = (int)sizeof(BytecodeInterpreter); - - const int page_size = os::vm_page_size(); - - Label after_frame_check; - - // compute rsp as if this were going to be the last frame on - // the stack before the red zone - - Label after_frame_check_pop; - - // save rsi == caller's bytecode ptr (c++ previous interp. state) - // QQQ problem here?? rsi overload???? - __ push(state); - - const Register thread = LP64_ONLY(r15_thread) NOT_LP64(rsi); - - NOT_LP64(__ get_thread(thread)); - - const Address stack_base(thread, Thread::stack_base_offset()); - const Address stack_size(thread, Thread::stack_size_offset()); - - // locals + overhead, in bytes - // Always give one monitor to allow us to start interp if sync method. - // Any additional monitors need a check when moving the expression stack - const int one_monitor = frame::interpreter_frame_monitor_size() * wordSize; - __ movptr(rax, Address(rbx, Method::const_offset())); - __ load_unsigned_short(rax, Address(rax, ConstMethod::max_stack_offset())); // get size of expression stack in words - __ lea(rax, Address(noreg, rax, Interpreter::stackElementScale(), one_monitor+Method::extra_stack_words())); - __ lea(rax, Address(rax, rdx, Interpreter::stackElementScale(), overhead_size)); - -#ifdef ASSERT - Label stack_base_okay, stack_size_okay; - // verify that thread stack base is non-zero - __ cmpptr(stack_base, (int32_t)0); - __ jcc(Assembler::notEqual, stack_base_okay); - __ stop("stack base is zero"); - __ bind(stack_base_okay); - // verify that thread stack size is non-zero - __ cmpptr(stack_size, (int32_t)0); - __ jcc(Assembler::notEqual, stack_size_okay); - __ stop("stack size is zero"); - __ bind(stack_size_okay); -#endif - - // Add stack base to locals and subtract stack size - __ addptr(rax, stack_base); - __ subptr(rax, stack_size); - - // We should have a magic number here for the size of the c++ interpreter frame. - // We can't actually tell this ahead of time. The debug version size is around 3k - // product is 1k and fastdebug is 4k - const int slop = 6 * K; - - // Use the maximum number of pages we might bang. - const int max_pages = StackShadowPages > (StackRedPages+StackYellowPages) ? StackShadowPages : - (StackRedPages+StackYellowPages); - // Only need this if we are stack banging which is temporary while - // we're debugging. - __ addptr(rax, slop + 2*max_pages * page_size); - - // check against the current stack bottom - __ cmpptr(rsp, rax); - __ jcc(Assembler::above, after_frame_check_pop); - - __ pop(state); // get c++ prev state. - - // throw exception return address becomes throwing pc - __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_StackOverflowError)); - - // all done with frame size check - __ bind(after_frame_check_pop); - __ pop(state); - - __ bind(after_frame_check); -} - -// Find preallocated monitor and lock method (C++ interpreter) -// rbx - Method* -// -void CppInterpreterGenerator::lock_method() { - // assumes state == rsi/r13 == pointer to current interpreterState - // minimally destroys rax, rdx|c_rarg1, rdi - // - // synchronize method - const int entry_size = frame::interpreter_frame_monitor_size() * wordSize; - const Address access_flags (rbx, Method::access_flags_offset()); - - const Register monitor = NOT_LP64(rdx) LP64_ONLY(c_rarg1); - - // find initial monitor i.e. monitors[-1] - __ movptr(monitor, STATE(_monitor_base)); // get monitor bottom limit - __ subptr(monitor, entry_size); // point to initial monitor - -#ifdef ASSERT - { Label L; - __ movl(rax, access_flags); - __ testl(rax, JVM_ACC_SYNCHRONIZED); - __ jcc(Assembler::notZero, L); - __ stop("method doesn't need synchronization"); - __ bind(L); - } -#endif // ASSERT - // get synchronization object - { Label done; - const int mirror_offset = in_bytes(Klass::java_mirror_offset()); - __ movl(rax, access_flags); - __ movptr(rdi, STATE(_locals)); // prepare to get receiver (assume common case) - __ testl(rax, JVM_ACC_STATIC); - __ movptr(rax, Address(rdi, 0)); // get receiver (assume this is frequent case) - __ jcc(Assembler::zero, done); - __ movptr(rax, Address(rbx, Method::const_offset())); - __ movptr(rax, Address(rax, ConstMethod::constants_offset())); - __ movptr(rax, Address(rax, ConstantPool::pool_holder_offset_in_bytes())); - __ movptr(rax, Address(rax, mirror_offset)); - __ bind(done); - } -#ifdef ASSERT - { Label L; - __ cmpptr(rax, Address(monitor, BasicObjectLock::obj_offset_in_bytes())); // correct object? - __ jcc(Assembler::equal, L); - __ stop("wrong synchronization lobject"); - __ bind(L); - } -#endif // ASSERT - // can destroy rax, rdx|c_rarg1, rcx, and (via call_VM) rdi! - __ lock_object(monitor); -} - -address InterpreterGenerator::generate_Reference_get_entry(void) { -#if INCLUDE_ALL_GCS - if (UseG1GC) { - // We need to generate have a routine that generates code to: - // * load the value in the referent field - // * passes that value to the pre-barrier. - // - // In the case of G1 this will record the value of the - // referent in an SATB buffer if marking is active. - // This will cause concurrent marking to mark the referent - // field as live. - Unimplemented(); - } -#endif // INCLUDE_ALL_GCS - - // If G1 is not enabled then attempt to go through the accessor entry point - // Reference.get is an accessor - return NULL; -} - -// -// C++ Interpreter stub for calling a native method. -// This sets up a somewhat different looking stack for calling the native method -// than the typical interpreter frame setup but still has the pointer to -// an interpreter state. -// - -address InterpreterGenerator::generate_native_entry(bool synchronized) { - // determine code generation flags - bool inc_counter = UseCompiler || CountCompiledCalls; - - // rbx: Method* - // rcx: receiver (unused) - // rsi/r13: previous interpreter state (if called from C++ interpreter) must preserve - // in any case. If called via c1/c2/call_stub rsi/r13 is junk (to use) but harmless - // to save/restore. - address entry_point = __ pc(); - - const Address access_flags (rbx, Method::access_flags_offset()); - - // rsi/r13 == state/locals rdi == prevstate - const Register locals = rdi; - - // get parameter size (always needed) - { - const Address constMethod (rbx, Method::const_offset()); - const Address size_of_parameters(rcx, ConstMethod::size_of_parameters_offset()); - __ movptr(rcx, constMethod); - __ load_unsigned_short(rcx, size_of_parameters); - } - - // rbx: Method* - // rcx: size of parameters - __ pop(rax); // get return address - // for natives the size of locals is zero - - // compute beginning of parameters /locals - - __ lea(locals, Address(rsp, rcx, Address::times_ptr, -wordSize)); - - // initialize fixed part of activation frame - - // Assumes rax = return address - - // allocate and initialize new interpreterState and method expression stack - // IN(locals) -> locals - // IN(state) -> previous frame manager state (NULL from stub/c1/c2) - // destroys rax, rcx, rdx - // OUT (state) -> new interpreterState - // OUT(rsp) -> bottom of methods expression stack - - // save sender_sp - __ mov(rcx, sender_sp_on_entry); - // start with NULL previous state - __ movptr(state, (int32_t)NULL_WORD); - generate_compute_interpreter_state(state, locals, rcx, true); - -#ifdef ASSERT - { Label L; - __ movptr(rax, STATE(_stack_base)); -#ifdef _LP64 - // duplicate the alignment rsp got after setting stack_base - __ subptr(rax, frame::arg_reg_save_area_bytes); // windows - __ andptr(rax, -16); // must be 16 byte boundary (see amd64 ABI) -#endif // _LP64 - __ cmpptr(rax, rsp); - __ jcc(Assembler::equal, L); - __ stop("broken stack frame setup in interpreter"); - __ bind(L); - } -#endif - - const Register unlock_thread = LP64_ONLY(r15_thread) NOT_LP64(rax); - NOT_LP64(__ movptr(unlock_thread, STATE(_thread));) // get thread - // Since at this point in the method invocation the exception handler - // would try to exit the monitor of synchronized methods which hasn't - // been entered yet, we set the thread local variable - // _do_not_unlock_if_synchronized to true. The remove_activation will - // check this flag. - - const Address do_not_unlock_if_synchronized(unlock_thread, - in_bytes(JavaThread::do_not_unlock_if_synchronized_offset())); - __ movbool(do_not_unlock_if_synchronized, true); - - // make sure method is native & not abstract -#ifdef ASSERT - __ movl(rax, access_flags); - { - Label L; - __ testl(rax, JVM_ACC_NATIVE); - __ jcc(Assembler::notZero, L); - __ stop("tried to execute non-native method as native"); - __ bind(L); - } - { Label L; - __ testl(rax, JVM_ACC_ABSTRACT); - __ jcc(Assembler::zero, L); - __ stop("tried to execute abstract method in interpreter"); - __ bind(L); - } -#endif - - - // increment invocation count & check for overflow - Label invocation_counter_overflow; - if (inc_counter) { - generate_counter_incr(&invocation_counter_overflow, NULL, NULL); - } - - Label continue_after_compile; - - __ bind(continue_after_compile); - - bang_stack_shadow_pages(true); - - // reset the _do_not_unlock_if_synchronized flag - NOT_LP64(__ movl(rax, STATE(_thread));) // get thread - __ movbool(do_not_unlock_if_synchronized, false); - - - // check for synchronized native methods - // - // Note: This must happen *after* invocation counter check, since - // when overflow happens, the method should not be locked. - if (synchronized) { - // potentially kills rax, rcx, rdx, rdi - lock_method(); - } else { - // no synchronization necessary -#ifdef ASSERT - { Label L; - __ movl(rax, access_flags); - __ testl(rax, JVM_ACC_SYNCHRONIZED); - __ jcc(Assembler::zero, L); - __ stop("method needs synchronization"); - __ bind(L); - } -#endif - } - - // start execution - - // jvmti support - __ notify_method_entry(); - - // work registers - const Register method = rbx; - const Register thread = LP64_ONLY(r15_thread) NOT_LP64(rdi); - const Register t = InterpreterRuntime::SignatureHandlerGenerator::temp(); // rcx|rscratch1 - - // allocate space for parameters - __ movptr(method, STATE(_method)); - __ verify_method_ptr(method); - { - const Address constMethod (method, Method::const_offset()); - const Address size_of_parameters(t, ConstMethod::size_of_parameters_offset()); - __ movptr(t, constMethod); - __ load_unsigned_short(t, size_of_parameters); - } - __ shll(t, 2); -#ifdef _LP64 - __ subptr(rsp, t); - __ subptr(rsp, frame::arg_reg_save_area_bytes); // windows - __ andptr(rsp, -16); // must be 16 byte boundary (see amd64 ABI) -#else - __ addptr(t, 2*wordSize); // allocate two more slots for JNIEnv and possible mirror - __ subptr(rsp, t); - __ andptr(rsp, -(StackAlignmentInBytes)); // gcc needs 16 byte aligned stacks to do XMM intrinsics -#endif // _LP64 - - // get signature handler - Label pending_exception_present; - - { Label L; - __ movptr(t, Address(method, Method::signature_handler_offset())); - __ testptr(t, t); - __ jcc(Assembler::notZero, L); - __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::prepare_native_call), method, false); - __ movptr(method, STATE(_method)); - __ cmpptr(Address(thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD); - __ jcc(Assembler::notEqual, pending_exception_present); - __ verify_method_ptr(method); - __ movptr(t, Address(method, Method::signature_handler_offset())); - __ bind(L); - } -#ifdef ASSERT - { - Label L; - __ push(t); - __ get_thread(t); // get vm's javathread* - __ cmpptr(t, STATE(_thread)); - __ jcc(Assembler::equal, L); - __ int3(); - __ bind(L); - __ pop(t); - } -#endif // - - const Register from_ptr = InterpreterRuntime::SignatureHandlerGenerator::from(); - // call signature handler - assert(InterpreterRuntime::SignatureHandlerGenerator::to () == rsp, "adjust this code"); - - // The generated handlers do not touch RBX (the method oop). - // However, large signatures cannot be cached and are generated - // each time here. The slow-path generator will blow RBX - // sometime, so we must reload it after the call. - __ movptr(from_ptr, STATE(_locals)); // get the from pointer - __ call(t); - __ movptr(method, STATE(_method)); - __ verify_method_ptr(method); - - // result handler is in rax - // set result handler - __ movptr(STATE(_result_handler), rax); - - - // get native function entry point - { Label L; - __ movptr(rax, Address(method, Method::native_function_offset())); - __ testptr(rax, rax); - __ jcc(Assembler::notZero, L); - __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::prepare_native_call), method); - __ movptr(method, STATE(_method)); - __ verify_method_ptr(method); - __ movptr(rax, Address(method, Method::native_function_offset())); - __ bind(L); - } - - // pass mirror handle if static call - { Label L; - const int mirror_offset = in_bytes(Klass::java_mirror_offset()); - __ movl(t, Address(method, Method::access_flags_offset())); - __ testl(t, JVM_ACC_STATIC); - __ jcc(Assembler::zero, L); - // get mirror - __ movptr(t, Address(method, Method:: const_offset())); - __ movptr(t, Address(t, ConstMethod::constants_offset())); - __ movptr(t, Address(t, ConstantPool::pool_holder_offset_in_bytes())); - __ movptr(t, Address(t, mirror_offset)); - // copy mirror into activation object - __ movptr(STATE(_oop_temp), t); - // pass handle to mirror -#ifdef _LP64 - __ lea(c_rarg1, STATE(_oop_temp)); -#else - __ lea(t, STATE(_oop_temp)); - __ movptr(Address(rsp, wordSize), t); -#endif // _LP64 - __ bind(L); - } -#ifdef ASSERT - { - Label L; - __ push(t); - __ get_thread(t); // get vm's javathread* - __ cmpptr(t, STATE(_thread)); - __ jcc(Assembler::equal, L); - __ int3(); - __ bind(L); - __ pop(t); - } -#endif // - - // pass JNIEnv -#ifdef _LP64 - __ lea(c_rarg0, Address(thread, JavaThread::jni_environment_offset())); -#else - __ movptr(thread, STATE(_thread)); // get thread - __ lea(t, Address(thread, JavaThread::jni_environment_offset())); - - __ movptr(Address(rsp, 0), t); -#endif // _LP64 - -#ifdef ASSERT - { - Label L; - __ push(t); - __ get_thread(t); // get vm's javathread* - __ cmpptr(t, STATE(_thread)); - __ jcc(Assembler::equal, L); - __ int3(); - __ bind(L); - __ pop(t); - } -#endif // - -#ifdef ASSERT - { Label L; - __ movl(t, Address(thread, JavaThread::thread_state_offset())); - __ cmpl(t, _thread_in_Java); - __ jcc(Assembler::equal, L); - __ stop("Wrong thread state in native stub"); - __ bind(L); - } -#endif - - // Change state to native (we save the return address in the thread, since it might not - // be pushed on the stack when we do a a stack traversal). It is enough that the pc() - // points into the right code segment. It does not have to be the correct return pc. - - __ set_last_Java_frame(thread, noreg, rbp, __ pc()); - - __ movl(Address(thread, JavaThread::thread_state_offset()), _thread_in_native); - - __ call(rax); - - // result potentially in rdx:rax or ST0 - __ movptr(method, STATE(_method)); - NOT_LP64(__ movptr(thread, STATE(_thread));) // get thread - - // The potential result is in ST(0) & rdx:rax - // With C++ interpreter we leave any possible result in ST(0) until we are in result handler and then - // we do the appropriate stuff for returning the result. rdx:rax must always be saved because just about - // anything we do here will destroy it, st(0) is only saved if we re-enter the vm where it would - // be destroyed. - // It is safe to do these pushes because state is _thread_in_native and return address will be found - // via _last_native_pc and not via _last_jave_sp - - // Must save the value of ST(0)/xmm0 since it could be destroyed before we get to result handler - { Label Lpush, Lskip; - ExternalAddress float_handler(AbstractInterpreter::result_handler(T_FLOAT)); - ExternalAddress double_handler(AbstractInterpreter::result_handler(T_DOUBLE)); - __ cmpptr(STATE(_result_handler), float_handler.addr()); - __ jcc(Assembler::equal, Lpush); - __ cmpptr(STATE(_result_handler), double_handler.addr()); - __ jcc(Assembler::notEqual, Lskip); - __ bind(Lpush); - __ subptr(rsp, 2*wordSize); - if ( UseSSE < 2 ) { - __ fstp_d(Address(rsp, 0)); - } else { - __ movdbl(Address(rsp, 0), xmm0); - } - __ bind(Lskip); - } - - // save rax:rdx for potential use by result handler. - __ push(rax); -#ifndef _LP64 - __ push(rdx); -#endif // _LP64 - - // Verify or restore cpu control state after JNI call - __ restore_cpu_control_state_after_jni(); - - // change thread state - __ movl(Address(thread, JavaThread::thread_state_offset()), _thread_in_native_trans); - if(os::is_MP()) { - // Write serialization page so VM thread can do a pseudo remote membar. - // We use the current thread pointer to calculate a thread specific - // offset to write to within the page. This minimizes bus traffic - // due to cache line collision. - __ serialize_memory(thread, rcx); - } - - // check for safepoint operation in progress and/or pending suspend requests - { Label Continue; - - __ cmp32(ExternalAddress(SafepointSynchronize::address_of_state()), - SafepointSynchronize::_not_synchronized); - - // threads running native code and they are expected to self-suspend - // when leaving the _thread_in_native state. We need to check for - // pending suspend requests here. - Label L; - __ jcc(Assembler::notEqual, L); - __ cmpl(Address(thread, JavaThread::suspend_flags_offset()), 0); - __ jcc(Assembler::equal, Continue); - __ bind(L); - - // Don't use call_VM as it will see a possible pending exception and forward it - // and never return here preventing us from clearing _last_native_pc down below. - // Also can't use call_VM_leaf either as it will check to see if rsi & rdi are - // preserved and correspond to the bcp/locals pointers. - // - - ((MacroAssembler*)_masm)->call_VM_leaf(CAST_FROM_FN_PTR(address, JavaThread::check_special_condition_for_native_trans), - thread); - __ increment(rsp, wordSize); - - __ movptr(method, STATE(_method)); - __ verify_method_ptr(method); - __ movptr(thread, STATE(_thread)); // get thread - - __ bind(Continue); - } - - // change thread state - __ movl(Address(thread, JavaThread::thread_state_offset()), _thread_in_Java); - - __ reset_last_Java_frame(thread, true, true); - - // reset handle block - __ movptr(t, Address(thread, JavaThread::active_handles_offset())); - __ movl(Address(t, JNIHandleBlock::top_offset_in_bytes()), (int32_t)NULL_WORD); - - // If result was an oop then unbox and save it in the frame - { Label L; - Label no_oop, store_result; - ExternalAddress oop_handler(AbstractInterpreter::result_handler(T_OBJECT)); - __ cmpptr(STATE(_result_handler), oop_handler.addr()); - __ jcc(Assembler::notEqual, no_oop); -#ifndef _LP64 - __ pop(rdx); -#endif // _LP64 - __ pop(rax); - __ testptr(rax, rax); - __ jcc(Assembler::zero, store_result); - // unbox - __ movptr(rax, Address(rax, 0)); - __ bind(store_result); - __ movptr(STATE(_oop_temp), rax); - // keep stack depth as expected by pushing oop which will eventually be discarded - __ push(rax); -#ifndef _LP64 - __ push(rdx); -#endif // _LP64 - __ bind(no_oop); - } - - { - Label no_reguard; - __ cmpl(Address(thread, JavaThread::stack_guard_state_offset()), JavaThread::stack_guard_yellow_disabled); - __ jcc(Assembler::notEqual, no_reguard); - - __ pusha(); - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::reguard_yellow_pages))); - __ popa(); - - __ bind(no_reguard); - } - - - // QQQ Seems like for native methods we simply return and the caller will see the pending - // exception and do the right thing. Certainly the interpreter will, don't know about - // compiled methods. - // Seems that the answer to above is no this is wrong. The old code would see the exception - // and forward it before doing the unlocking and notifying jvmdi that method has exited. - // This seems wrong need to investigate the spec. - - // handle exceptions (exception handling will handle unlocking!) - { Label L; - __ cmpptr(Address(thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD); - __ jcc(Assembler::zero, L); - __ bind(pending_exception_present); - - // There are potential results on the stack (rax/rdx, ST(0)) we ignore these and simply - // return and let caller deal with exception. This skips the unlocking here which - // seems wrong but seems to be what asm interpreter did. Can't find this in the spec. - // Note: must preverve method in rbx - // - - // remove activation - - __ movptr(t, STATE(_sender_sp)); - __ leave(); // remove frame anchor - __ pop(rdi); // get return address - __ movptr(state, STATE(_prev_link)); // get previous state for return - __ mov(rsp, t); // set sp to sender sp - __ push(rdi); // push throwing pc - // The skips unlocking!! This seems to be what asm interpreter does but seems - // very wrong. Not clear if this violates the spec. - __ jump(RuntimeAddress(StubRoutines::forward_exception_entry())); - __ bind(L); - } - - // do unlocking if necessary - { Label L; - __ movl(t, Address(method, Method::access_flags_offset())); - __ testl(t, JVM_ACC_SYNCHRONIZED); - __ jcc(Assembler::zero, L); - // the code below should be shared with interpreter macro assembler implementation - { Label unlock; - const Register monitor = NOT_LP64(rdx) LP64_ONLY(c_rarg1); - // BasicObjectLock will be first in list, since this is a synchronized method. However, need - // to check that the object has not been unlocked by an explicit monitorexit bytecode. - __ movptr(monitor, STATE(_monitor_base)); - __ subptr(monitor, frame::interpreter_frame_monitor_size() * wordSize); // address of initial monitor - - __ movptr(t, Address(monitor, BasicObjectLock::obj_offset_in_bytes())); - __ testptr(t, t); - __ jcc(Assembler::notZero, unlock); - - // Entry already unlocked, need to throw exception - __ MacroAssembler::call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_illegal_monitor_state_exception)); - __ should_not_reach_here(); - - __ bind(unlock); - __ unlock_object(monitor); - // unlock can blow rbx so restore it for path that needs it below - __ movptr(method, STATE(_method)); - } - __ bind(L); - } - - // jvmti support - // Note: This must happen _after_ handling/throwing any exceptions since - // the exception handler code notifies the runtime of method exits - // too. If this happens before, method entry/exit notifications are - // not properly paired (was bug - gri 11/22/99). - __ notify_method_exit(vtos, InterpreterMacroAssembler::NotifyJVMTI); - - // restore potential result in rdx:rax, call result handler to restore potential result in ST0 & handle result -#ifndef _LP64 - __ pop(rdx); -#endif // _LP64 - __ pop(rax); - __ movptr(t, STATE(_result_handler)); // get result handler - __ call(t); // call result handler to convert to tosca form - - // remove activation - - __ movptr(t, STATE(_sender_sp)); - - __ leave(); // remove frame anchor - __ pop(rdi); // get return address - __ movptr(state, STATE(_prev_link)); // get previous state for return (if c++ interpreter was caller) - __ mov(rsp, t); // set sp to sender sp - __ jmp(rdi); - - // invocation counter overflow - if (inc_counter) { - // Handle overflow of counter and compile method - __ bind(invocation_counter_overflow); - generate_counter_overflow(&continue_after_compile); - } - - return entry_point; -} - -// Generate entries that will put a result type index into rcx -void CppInterpreterGenerator::generate_deopt_handling() { - - Label return_from_deopt_common; - - // Generate entries that will put a result type index into rcx - // deopt needs to jump to here to enter the interpreter (return a result) - deopt_frame_manager_return_atos = __ pc(); - - // rax is live here - __ movl(rcx, AbstractInterpreter::BasicType_as_index(T_OBJECT)); // Result stub address array index - __ jmp(return_from_deopt_common); - - - // deopt needs to jump to here to enter the interpreter (return a result) - deopt_frame_manager_return_btos = __ pc(); - - // rax is live here - __ movl(rcx, AbstractInterpreter::BasicType_as_index(T_BOOLEAN)); // Result stub address array index - __ jmp(return_from_deopt_common); - - // deopt needs to jump to here to enter the interpreter (return a result) - deopt_frame_manager_return_itos = __ pc(); - - // rax is live here - __ movl(rcx, AbstractInterpreter::BasicType_as_index(T_INT)); // Result stub address array index - __ jmp(return_from_deopt_common); - - // deopt needs to jump to here to enter the interpreter (return a result) - - deopt_frame_manager_return_ltos = __ pc(); - // rax,rdx are live here - __ movl(rcx, AbstractInterpreter::BasicType_as_index(T_LONG)); // Result stub address array index - __ jmp(return_from_deopt_common); - - // deopt needs to jump to here to enter the interpreter (return a result) - - deopt_frame_manager_return_ftos = __ pc(); - // st(0) is live here - __ movl(rcx, AbstractInterpreter::BasicType_as_index(T_FLOAT)); // Result stub address array index - __ jmp(return_from_deopt_common); - - // deopt needs to jump to here to enter the interpreter (return a result) - deopt_frame_manager_return_dtos = __ pc(); - - // st(0) is live here - __ movl(rcx, AbstractInterpreter::BasicType_as_index(T_DOUBLE)); // Result stub address array index - __ jmp(return_from_deopt_common); - - // deopt needs to jump to here to enter the interpreter (return a result) - deopt_frame_manager_return_vtos = __ pc(); - - __ movl(rcx, AbstractInterpreter::BasicType_as_index(T_VOID)); - - // Deopt return common - // an index is present in rcx that lets us move any possible result being - // return to the interpreter's stack - // - // Because we have a full sized interpreter frame on the youngest - // activation the stack is pushed too deep to share the tosca to - // stack converters directly. We shrink the stack to the desired - // amount and then push result and then re-extend the stack. - // We could have the code in size_activation layout a short - // frame for the top activation but that would look different - // than say sparc (which needs a full size activation because - // the windows are in the way. Really it could be short? QQQ - // - __ bind(return_from_deopt_common); - - __ lea(state, Address(rbp, -(int)sizeof(BytecodeInterpreter))); - - // setup rsp so we can push the "result" as needed. - __ movptr(rsp, STATE(_stack)); // trim stack (is prepushed) - __ addptr(rsp, wordSize); // undo prepush - - ExternalAddress tosca_to_stack((address)CppInterpreter::_tosca_to_stack); - // Address index(noreg, rcx, Address::times_ptr); - __ movptr(rcx, ArrayAddress(tosca_to_stack, Address(noreg, rcx, Address::times_ptr))); - // __ movl(rcx, Address(noreg, rcx, Address::times_ptr, int(AbstractInterpreter::_tosca_to_stack))); - __ call(rcx); // call result converter - - __ movl(STATE(_msg), (int)BytecodeInterpreter::deopt_resume); - __ lea(rsp, Address(rsp, -wordSize)); // prepush stack (result if any already present) - __ movptr(STATE(_stack), rsp); // inform interpreter of new stack depth (parameters removed, - // result if any on stack already ) - __ movptr(rsp, STATE(_stack_limit)); // restore expression stack to full depth -} - -// Generate the code to handle a more_monitors message from the c++ interpreter -void CppInterpreterGenerator::generate_more_monitors() { - - - Label entry, loop; - const int entry_size = frame::interpreter_frame_monitor_size() * wordSize; - // 1. compute new pointers // rsp: old expression stack top - __ movptr(rdx, STATE(_stack_base)); // rdx: old expression stack bottom - __ subptr(rsp, entry_size); // move expression stack top limit - __ subptr(STATE(_stack), entry_size); // update interpreter stack top - __ subptr(STATE(_stack_limit), entry_size); // inform interpreter - __ subptr(rdx, entry_size); // move expression stack bottom - __ movptr(STATE(_stack_base), rdx); // inform interpreter - __ movptr(rcx, STATE(_stack)); // set start value for copy loop - __ jmp(entry); - // 2. move expression stack contents - __ bind(loop); - __ movptr(rbx, Address(rcx, entry_size)); // load expression stack word from old location - __ movptr(Address(rcx, 0), rbx); // and store it at new location - __ addptr(rcx, wordSize); // advance to next word - __ bind(entry); - __ cmpptr(rcx, rdx); // check if bottom reached - __ jcc(Assembler::notEqual, loop); // if not at bottom then copy next word - // now zero the slot so we can find it. - __ movptr(Address(rdx, BasicObjectLock::obj_offset_in_bytes()), (int32_t) NULL_WORD); - __ movl(STATE(_msg), (int)BytecodeInterpreter::got_monitors); -} - - -// Initial entry to C++ interpreter from the call_stub. -// This entry point is called the frame manager since it handles the generation -// of interpreter activation frames via requests directly from the vm (via call_stub) -// and via requests from the interpreter. The requests from the call_stub happen -// directly thru the entry point. Requests from the interpreter happen via returning -// from the interpreter and examining the message the interpreter has returned to -// the frame manager. The frame manager can take the following requests: - -// NO_REQUEST - error, should never happen. -// MORE_MONITORS - need a new monitor. Shuffle the expression stack on down and -// allocate a new monitor. -// CALL_METHOD - setup a new activation to call a new method. Very similar to what -// happens during entry during the entry via the call stub. -// RETURN_FROM_METHOD - remove an activation. Return to interpreter or call stub. -// -// Arguments: -// -// rbx: Method* -// rcx: receiver - unused (retrieved from stack as needed) -// rsi/r13: previous frame manager state (NULL from the call_stub/c1/c2) -// -// -// Stack layout at entry -// -// [ return address ] <--- rsp -// [ parameter n ] -// ... -// [ parameter 1 ] -// [ expression stack ] -// -// -// We are free to blow any registers we like because the call_stub which brought us here -// initially has preserved the callee save registers already. -// -// - -static address interpreter_frame_manager = NULL; - -address InterpreterGenerator::generate_normal_entry(bool synchronized) { - - // rbx: Method* - // rsi/r13: sender sp - - // Because we redispatch "recursive" interpreter entries thru this same entry point - // the "input" register usage is a little strange and not what you expect coming - // from the call_stub. From the call stub rsi/rdi (current/previous) interpreter - // state are NULL but on "recursive" dispatches they are what you'd expect. - // rsi: current interpreter state (C++ interpreter) must preserve (null from call_stub/c1/c2) - - - // A single frame manager is plenty as we don't specialize for synchronized. We could and - // the code is pretty much ready. Would need to change the test below and for good measure - // modify generate_interpreter_state to only do the (pre) sync stuff stuff for synchronized - // routines. Not clear this is worth it yet. - - if (interpreter_frame_manager) return interpreter_frame_manager; - - address entry_point = __ pc(); - - Label dispatch_entry_2; - __ movptr(rcx, sender_sp_on_entry); - __ movptr(state, (int32_t)NULL_WORD); // no current activation - - __ jmp(dispatch_entry_2); - - const Register locals = rdi; - - Label re_dispatch; - - __ bind(re_dispatch); - - // save sender sp (doesn't include return address - __ lea(rcx, Address(rsp, wordSize)); - - __ bind(dispatch_entry_2); - - // save sender sp - __ push(rcx); - - const Address constMethod (rbx, Method::const_offset()); - const Address access_flags (rbx, Method::access_flags_offset()); - const Address size_of_parameters(rdx, ConstMethod::size_of_parameters_offset()); - const Address size_of_locals (rdx, ConstMethod::size_of_locals_offset()); - - // const Address monitor_block_top (rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize); - // const Address monitor_block_bot (rbp, frame::interpreter_frame_initial_sp_offset * wordSize); - // const Address monitor(rbp, frame::interpreter_frame_initial_sp_offset * wordSize - (int)sizeof(BasicObjectLock)); - - // get parameter size (always needed) - __ movptr(rdx, constMethod); - __ load_unsigned_short(rcx, size_of_parameters); - - // rbx: Method* - // rcx: size of parameters - __ load_unsigned_short(rdx, size_of_locals); // get size of locals in words - - __ subptr(rdx, rcx); // rdx = no. of additional locals - - // see if we've got enough room on the stack for locals plus overhead. - generate_stack_overflow_check(); // C++ - - // c++ interpreter does not use stack banging or any implicit exceptions - // leave for now to verify that check is proper. - bang_stack_shadow_pages(false); - - - - // compute beginning of parameters (rdi) - __ lea(locals, Address(rsp, rcx, Address::times_ptr, wordSize)); - - // save sender's sp - // __ movl(rcx, rsp); - - // get sender's sp - __ pop(rcx); - - // get return address - __ pop(rax); - - // rdx - # of additional locals - // allocate space for locals - // explicitly initialize locals - { - Label exit, loop; - __ testl(rdx, rdx); // (32bit ok) - __ jcc(Assembler::lessEqual, exit); // do nothing if rdx <= 0 - __ bind(loop); - __ push((int32_t)NULL_WORD); // initialize local variables - __ decrement(rdx); // until everything initialized - __ jcc(Assembler::greater, loop); - __ bind(exit); - } - - - // Assumes rax = return address - - // allocate and initialize new interpreterState and method expression stack - // IN(locals) -> locals - // IN(state) -> any current interpreter activation - // destroys rax, rcx, rdx, rdi - // OUT (state) -> new interpreterState - // OUT(rsp) -> bottom of methods expression stack - - generate_compute_interpreter_state(state, locals, rcx, false); - - // Call interpreter - - Label call_interpreter; - __ bind(call_interpreter); - - // c++ interpreter does not use stack banging or any implicit exceptions - // leave for now to verify that check is proper. - bang_stack_shadow_pages(false); - - - // Call interpreter enter here if message is - // set and we know stack size is valid - - Label call_interpreter_2; - - __ bind(call_interpreter_2); - - { - const Register thread = NOT_LP64(rcx) LP64_ONLY(r15_thread); - -#ifdef _LP64 - __ mov(c_rarg0, state); -#else - __ push(state); // push arg to interpreter - __ movptr(thread, STATE(_thread)); -#endif // _LP64 - - // We can setup the frame anchor with everything we want at this point - // as we are thread_in_Java and no safepoints can occur until we go to - // vm mode. We do have to clear flags on return from vm but that is it - // - __ movptr(Address(thread, JavaThread::last_Java_fp_offset()), rbp); - __ movptr(Address(thread, JavaThread::last_Java_sp_offset()), rsp); - - // Call the interpreter - - RuntimeAddress normal(CAST_FROM_FN_PTR(address, BytecodeInterpreter::run)); - RuntimeAddress checking(CAST_FROM_FN_PTR(address, BytecodeInterpreter::runWithChecks)); - - __ call(JvmtiExport::can_post_interpreter_events() ? checking : normal); - NOT_LP64(__ pop(rax);) // discard parameter to run - // - // state is preserved since it is callee saved - // - - // reset_last_Java_frame - - NOT_LP64(__ movl(thread, STATE(_thread));) - __ reset_last_Java_frame(thread, true, true); - } - - // examine msg from interpreter to determine next action - - __ movl(rdx, STATE(_msg)); // Get new message - - Label call_method; - Label return_from_interpreted_method; - Label throw_exception; - Label bad_msg; - Label do_OSR; - - __ cmpl(rdx, (int32_t)BytecodeInterpreter::call_method); - __ jcc(Assembler::equal, call_method); - __ cmpl(rdx, (int32_t)BytecodeInterpreter::return_from_method); - __ jcc(Assembler::equal, return_from_interpreted_method); - __ cmpl(rdx, (int32_t)BytecodeInterpreter::do_osr); - __ jcc(Assembler::equal, do_OSR); - __ cmpl(rdx, (int32_t)BytecodeInterpreter::throwing_exception); - __ jcc(Assembler::equal, throw_exception); - __ cmpl(rdx, (int32_t)BytecodeInterpreter::more_monitors); - __ jcc(Assembler::notEqual, bad_msg); - - // Allocate more monitor space, shuffle expression stack.... - - generate_more_monitors(); - - __ jmp(call_interpreter); - - // uncommon trap needs to jump to here to enter the interpreter (re-execute current bytecode) - unctrap_frame_manager_entry = __ pc(); - // - // Load the registers we need. - __ lea(state, Address(rbp, -(int)sizeof(BytecodeInterpreter))); - __ movptr(rsp, STATE(_stack_limit)); // restore expression stack to full depth - __ jmp(call_interpreter_2); - - - - //============================================================================= - // Returning from a compiled method into a deopted method. The bytecode at the - // bcp has completed. The result of the bytecode is in the native abi (the tosca - // for the template based interpreter). Any stack space that was used by the - // bytecode that has completed has been removed (e.g. parameters for an invoke) - // so all that we have to do is place any pending result on the expression stack - // and resume execution on the next bytecode. - - - generate_deopt_handling(); - __ jmp(call_interpreter); - - - // Current frame has caught an exception we need to dispatch to the - // handler. We can get here because a native interpreter frame caught - // an exception in which case there is no handler and we must rethrow - // If it is a vanilla interpreted frame the we simply drop into the - // interpreter and let it do the lookup. - - Interpreter::_rethrow_exception_entry = __ pc(); - // rax: exception - // rdx: return address/pc that threw exception - - Label return_with_exception; - Label unwind_and_forward; - - // restore state pointer. - __ lea(state, Address(rbp, -(int)sizeof(BytecodeInterpreter))); - - __ movptr(rbx, STATE(_method)); // get method -#ifdef _LP64 - __ movptr(Address(r15_thread, Thread::pending_exception_offset()), rax); -#else - __ movl(rcx, STATE(_thread)); // get thread - - // Store exception with interpreter will expect it - __ movptr(Address(rcx, Thread::pending_exception_offset()), rax); -#endif // _LP64 - - // is current frame vanilla or native? - - __ movl(rdx, access_flags); - __ testl(rdx, JVM_ACC_NATIVE); - __ jcc(Assembler::zero, return_with_exception); // vanilla interpreted frame, handle directly - - // We drop thru to unwind a native interpreted frame with a pending exception - // We jump here for the initial interpreter frame with exception pending - // We unwind the current acivation and forward it to our caller. - - __ bind(unwind_and_forward); - - // unwind rbp, return stack to unextended value and re-push return address - - __ movptr(rcx, STATE(_sender_sp)); - __ leave(); - __ pop(rdx); - __ mov(rsp, rcx); - __ push(rdx); - __ jump(RuntimeAddress(StubRoutines::forward_exception_entry())); - - // Return point from a call which returns a result in the native abi - // (c1/c2/jni-native). This result must be processed onto the java - // expression stack. - // - // A pending exception may be present in which case there is no result present - - Label resume_interpreter; - Label do_float; - Label do_double; - Label done_conv; - - // The FPU stack is clean if UseSSE >= 2 but must be cleaned in other cases - if (UseSSE < 2) { - __ lea(state, Address(rbp, -(int)sizeof(BytecodeInterpreter))); - __ movptr(rbx, STATE(_result._to_call._callee)); // get method just executed - __ movl(rcx, Address(rbx, Method::result_index_offset())); - __ cmpl(rcx, AbstractInterpreter::BasicType_as_index(T_FLOAT)); // Result stub address array index - __ jcc(Assembler::equal, do_float); - __ cmpl(rcx, AbstractInterpreter::BasicType_as_index(T_DOUBLE)); // Result stub address array index - __ jcc(Assembler::equal, do_double); -#if !defined(_LP64) || defined(COMPILER1) || !defined(COMPILER2) - __ empty_FPU_stack(); -#endif // COMPILER2 - __ jmp(done_conv); - - __ bind(do_float); -#ifdef COMPILER2 - for (int i = 1; i < 8; i++) { - __ ffree(i); - } -#endif // COMPILER2 - __ jmp(done_conv); - __ bind(do_double); -#ifdef COMPILER2 - for (int i = 1; i < 8; i++) { - __ ffree(i); - } -#endif // COMPILER2 - __ jmp(done_conv); - } else { - __ MacroAssembler::verify_FPU(0, "generate_return_entry_for compiled"); - __ jmp(done_conv); - } - - // Return point to interpreter from compiled/native method - InternalAddress return_from_native_method(__ pc()); - - __ bind(done_conv); - - - // Result if any is in tosca. The java expression stack is in the state that the - // calling convention left it (i.e. params may or may not be present) - // Copy the result from tosca and place it on java expression stack. - - // Restore rsi/r13 as compiled code may not preserve it - - __ lea(state, Address(rbp, -(int)sizeof(BytecodeInterpreter))); - - // restore stack to what we had when we left (in case i2c extended it) - - __ movptr(rsp, STATE(_stack)); - __ lea(rsp, Address(rsp, wordSize)); - - // If there is a pending exception then we don't really have a result to process - -#ifdef _LP64 - __ cmpptr(Address(r15_thread, Thread::pending_exception_offset()), (int32_t)NULL_WORD); -#else - __ movptr(rcx, STATE(_thread)); // get thread - __ cmpptr(Address(rcx, Thread::pending_exception_offset()), (int32_t)NULL_WORD); -#endif // _LP64 - __ jcc(Assembler::notZero, return_with_exception); - - // get method just executed - __ movptr(rbx, STATE(_result._to_call._callee)); - - // callee left args on top of expression stack, remove them - __ movptr(rcx, constMethod); - __ load_unsigned_short(rcx, Address(rcx, ConstMethod::size_of_parameters_offset())); - - __ lea(rsp, Address(rsp, rcx, Address::times_ptr)); - - __ movl(rcx, Address(rbx, Method::result_index_offset())); - ExternalAddress tosca_to_stack((address)CppInterpreter::_tosca_to_stack); - // Address index(noreg, rax, Address::times_ptr); - __ movptr(rcx, ArrayAddress(tosca_to_stack, Address(noreg, rcx, Address::times_ptr))); - // __ movl(rcx, Address(noreg, rcx, Address::times_ptr, int(AbstractInterpreter::_tosca_to_stack))); - __ call(rcx); // call result converter - __ jmp(resume_interpreter); - - // An exception is being caught on return to a vanilla interpreter frame. - // Empty the stack and resume interpreter - - __ bind(return_with_exception); - - // Exception present, empty stack - __ movptr(rsp, STATE(_stack_base)); - __ jmp(resume_interpreter); - - // Return from interpreted method we return result appropriate to the caller (i.e. "recursive" - // interpreter call, or native) and unwind this interpreter activation. - // All monitors should be unlocked. - - __ bind(return_from_interpreted_method); - - Label return_to_initial_caller; - - __ movptr(rbx, STATE(_method)); // get method just executed - __ cmpptr(STATE(_prev_link), (int32_t)NULL_WORD); // returning from "recursive" interpreter call? - __ movl(rax, Address(rbx, Method::result_index_offset())); // get result type index - __ jcc(Assembler::equal, return_to_initial_caller); // back to native code (call_stub/c1/c2) - - // Copy result to callers java stack - ExternalAddress stack_to_stack((address)CppInterpreter::_stack_to_stack); - // Address index(noreg, rax, Address::times_ptr); - - __ movptr(rax, ArrayAddress(stack_to_stack, Address(noreg, rax, Address::times_ptr))); - // __ movl(rax, Address(noreg, rax, Address::times_ptr, int(AbstractInterpreter::_stack_to_stack))); - __ call(rax); // call result converter - - Label unwind_recursive_activation; - __ bind(unwind_recursive_activation); - - // returning to interpreter method from "recursive" interpreter call - // result converter left rax pointing to top of the java stack for method we are returning - // to. Now all we must do is unwind the state from the completed call - - __ movptr(state, STATE(_prev_link)); // unwind state - __ leave(); // pop the frame - __ mov(rsp, rax); // unwind stack to remove args - - // Resume the interpreter. The current frame contains the current interpreter - // state object. - // - - __ bind(resume_interpreter); - - // state == interpreterState object for method we are resuming - - __ movl(STATE(_msg), (int)BytecodeInterpreter::method_resume); - __ lea(rsp, Address(rsp, -wordSize)); // prepush stack (result if any already present) - __ movptr(STATE(_stack), rsp); // inform interpreter of new stack depth (parameters removed, - // result if any on stack already ) - __ movptr(rsp, STATE(_stack_limit)); // restore expression stack to full depth - __ jmp(call_interpreter_2); // No need to bang - - // interpreter returning to native code (call_stub/c1/c2) - // convert result and unwind initial activation - // rax - result index - - __ bind(return_to_initial_caller); - ExternalAddress stack_to_native((address)CppInterpreter::_stack_to_native_abi); - // Address index(noreg, rax, Address::times_ptr); - - __ movptr(rax, ArrayAddress(stack_to_native, Address(noreg, rax, Address::times_ptr))); - __ call(rax); // call result converter - - Label unwind_initial_activation; - __ bind(unwind_initial_activation); - - // RETURN TO CALL_STUB/C1/C2 code (result if any in rax/rdx ST(0)) - - /* Current stack picture - - [ incoming parameters ] - [ extra locals ] - [ return address to CALL_STUB/C1/C2] - fp -> [ CALL_STUB/C1/C2 fp ] - BytecodeInterpreter object - expression stack - sp -> - - */ - - // return restoring the stack to the original sender_sp value - - __ movptr(rcx, STATE(_sender_sp)); - __ leave(); - __ pop(rdi); // get return address - // set stack to sender's sp - __ mov(rsp, rcx); - __ jmp(rdi); // return to call_stub - - // OSR request, adjust return address to make current frame into adapter frame - // and enter OSR nmethod - - __ bind(do_OSR); - - Label remove_initial_frame; - - // We are going to pop this frame. Is there another interpreter frame underneath - // it or is it callstub/compiled? - - // Move buffer to the expected parameter location - __ movptr(rcx, STATE(_result._osr._osr_buf)); - - __ movptr(rax, STATE(_result._osr._osr_entry)); - - __ cmpptr(STATE(_prev_link), (int32_t)NULL_WORD); // returning from "recursive" interpreter call? - __ jcc(Assembler::equal, remove_initial_frame); // back to native code (call_stub/c1/c2) - - __ movptr(sender_sp_on_entry, STATE(_sender_sp)); // get sender's sp in expected register - __ leave(); // pop the frame - __ mov(rsp, sender_sp_on_entry); // trim any stack expansion - - - // We know we are calling compiled so push specialized return - // method uses specialized entry, push a return so we look like call stub setup - // this path will handle fact that result is returned in registers and not - // on the java stack. - - __ pushptr(return_from_native_method.addr()); - - __ jmp(rax); - - __ bind(remove_initial_frame); - - __ movptr(rdx, STATE(_sender_sp)); - __ leave(); - // get real return - __ pop(rsi); - // set stack to sender's sp - __ mov(rsp, rdx); - // repush real return - __ push(rsi); - // Enter OSR nmethod - __ jmp(rax); - - - - - // Call a new method. All we do is (temporarily) trim the expression stack - // push a return address to bring us back to here and leap to the new entry. - - __ bind(call_method); - - // stack points to next free location and not top element on expression stack - // method expects sp to be pointing to topmost element - - __ movptr(rsp, STATE(_stack)); // pop args to c++ interpreter, set sp to java stack top - __ lea(rsp, Address(rsp, wordSize)); - - __ movptr(rbx, STATE(_result._to_call._callee)); // get method to execute - - // don't need a return address if reinvoking interpreter - - // Make it look like call_stub calling conventions - - // Get (potential) receiver - // get size of parameters in words - __ movptr(rcx, constMethod); - __ load_unsigned_short(rcx, Address(rcx, ConstMethod::size_of_parameters_offset())); - - ExternalAddress recursive(CAST_FROM_FN_PTR(address, RecursiveInterpreterActivation)); - __ pushptr(recursive.addr()); // make it look good in the debugger - - InternalAddress entry(entry_point); - __ cmpptr(STATE(_result._to_call._callee_entry_point), entry.addr()); // returning to interpreter? - __ jcc(Assembler::equal, re_dispatch); // yes - - __ pop(rax); // pop dummy address - - - // get specialized entry - __ movptr(rax, STATE(_result._to_call._callee_entry_point)); - // set sender SP - __ mov(sender_sp_on_entry, rsp); - - // method uses specialized entry, push a return so we look like call stub setup - // this path will handle fact that result is returned in registers and not - // on the java stack. - - __ pushptr(return_from_native_method.addr()); - - __ jmp(rax); - - __ bind(bad_msg); - __ stop("Bad message from interpreter"); - - // Interpreted method "returned" with an exception pass it on... - // Pass result, unwind activation and continue/return to interpreter/call_stub - // We handle result (if any) differently based on return to interpreter or call_stub - - Label unwind_initial_with_pending_exception; - - __ bind(throw_exception); - __ cmpptr(STATE(_prev_link), (int32_t)NULL_WORD); // returning from recursive interpreter call? - __ jcc(Assembler::equal, unwind_initial_with_pending_exception); // no, back to native code (call_stub/c1/c2) - __ movptr(rax, STATE(_locals)); // pop parameters get new stack value - __ addptr(rax, wordSize); // account for prepush before we return - __ jmp(unwind_recursive_activation); - - __ bind(unwind_initial_with_pending_exception); - - // We will unwind the current (initial) interpreter frame and forward - // the exception to the caller. We must put the exception in the - // expected register and clear pending exception and then forward. - - __ jmp(unwind_and_forward); - - interpreter_frame_manager = entry_point; - return entry_point; -} - - -InterpreterGenerator::InterpreterGenerator(StubQueue* code) - : CppInterpreterGenerator(code) { - generate_all(); // down here so it can be "virtual" -} - -// Deoptimization helpers for C++ interpreter - -// How much stack a method activation needs in words. -int AbstractInterpreter::size_top_interpreter_activation(Method* method) { - - const int stub_code = 4; // see generate_call_stub - // Save space for one monitor to get into the interpreted method in case - // the method is synchronized - int monitor_size = method->is_synchronized() ? - 1*frame::interpreter_frame_monitor_size() : 0; - - // total static overhead size. Account for interpreter state object, return - // address, saved rbp and 2 words for a "static long no_params() method" issue. - - const int overhead_size = sizeof(BytecodeInterpreter)/wordSize + - ( frame::sender_sp_offset - frame::link_offset) + 2; - - const int method_stack = (method->max_locals() + method->max_stack()) * - Interpreter::stackElementWords; - return overhead_size + method_stack + stub_code; -} - -// returns the activation size. -static int size_activation_helper(int extra_locals_size, int monitor_size) { - return (extra_locals_size + // the addition space for locals - 2*BytesPerWord + // return address and saved rbp - 2*BytesPerWord + // "static long no_params() method" issue - sizeof(BytecodeInterpreter) + // interpreterState - monitor_size); // monitors -} - -void BytecodeInterpreter::layout_interpreterState(interpreterState to_fill, - frame* caller, - frame* current, - Method* method, - intptr_t* locals, - intptr_t* stack, - intptr_t* stack_base, - intptr_t* monitor_base, - intptr_t* frame_bottom, - bool is_top_frame - ) -{ - // What about any vtable? - // - to_fill->_thread = JavaThread::current(); - // This gets filled in later but make it something recognizable for now - to_fill->_bcp = method->code_base(); - to_fill->_locals = locals; - to_fill->_constants = method->constants()->cache(); - to_fill->_method = method; - to_fill->_mdx = NULL; - to_fill->_stack = stack; - if (is_top_frame && JavaThread::current()->popframe_forcing_deopt_reexecution() ) { - to_fill->_msg = deopt_resume2; - } else { - to_fill->_msg = method_resume; - } - to_fill->_result._to_call._bcp_advance = 0; - to_fill->_result._to_call._callee_entry_point = NULL; // doesn't matter to anyone - to_fill->_result._to_call._callee = NULL; // doesn't matter to anyone - to_fill->_prev_link = NULL; - - to_fill->_sender_sp = caller->unextended_sp(); - - if (caller->is_interpreted_frame()) { - interpreterState prev = caller->get_interpreterState(); - to_fill->_prev_link = prev; - // *current->register_addr(GR_Iprev_state) = (intptr_t) prev; - // Make the prev callee look proper - prev->_result._to_call._callee = method; - if (*prev->_bcp == Bytecodes::_invokeinterface) { - prev->_result._to_call._bcp_advance = 5; - } else { - prev->_result._to_call._bcp_advance = 3; - } - } - to_fill->_oop_temp = NULL; - to_fill->_stack_base = stack_base; - // Need +1 here because stack_base points to the word just above the first expr stack entry - // and stack_limit is supposed to point to the word just below the last expr stack entry. - // See generate_compute_interpreter_state. - to_fill->_stack_limit = stack_base - (method->max_stack() + 1); - to_fill->_monitor_base = (BasicObjectLock*) monitor_base; - - to_fill->_self_link = to_fill; - assert(stack >= to_fill->_stack_limit && stack < to_fill->_stack_base, - "Stack top out of range"); -} - - -static int frame_size_helper(int max_stack, - int tempcount, - int moncount, - int callee_param_count, - int callee_locals, - bool is_top_frame, - int& monitor_size, - int& full_frame_size) { - int extra_locals_size = (callee_locals - callee_param_count) * BytesPerWord; - monitor_size = sizeof(BasicObjectLock) * moncount; - - // First calculate the frame size without any java expression stack - int short_frame_size = size_activation_helper(extra_locals_size, - monitor_size); - - // Now with full size expression stack - full_frame_size = short_frame_size + max_stack * BytesPerWord; - - // and now with only live portion of the expression stack - short_frame_size = short_frame_size + tempcount * BytesPerWord; - - // the size the activation is right now. Only top frame is full size - int frame_size = (is_top_frame ? full_frame_size : short_frame_size); - return frame_size; -} - -int AbstractInterpreter::size_activation(int max_stack, - int tempcount, - int extra_args, - int moncount, - int callee_param_count, - int callee_locals, - bool is_top_frame) { - assert(extra_args == 0, "FIX ME"); - // NOTE: return size is in words not bytes - - // Calculate the amount our frame will be adjust by the callee. For top frame - // this is zero. - - // NOTE: ia64 seems to do this wrong (or at least backwards) in that it - // calculates the extra locals based on itself. Not what the callee does - // to it. So it ignores last_frame_adjust value. Seems suspicious as far - // as getting sender_sp correct. - - int unused_monitor_size = 0; - int unused_full_frame_size = 0; - return frame_size_helper(max_stack, tempcount, moncount, callee_param_count, callee_locals, - is_top_frame, unused_monitor_size, unused_full_frame_size)/BytesPerWord; -} - -void AbstractInterpreter::layout_activation(Method* method, - int tempcount, // - int popframe_extra_args, - int moncount, - int caller_actual_parameters, - int callee_param_count, - int callee_locals, - frame* caller, - frame* interpreter_frame, - bool is_top_frame, - bool is_bottom_frame) { - - assert(popframe_extra_args == 0, "FIX ME"); - // NOTE this code must exactly mimic what InterpreterGenerator::generate_compute_interpreter_state() - // does as far as allocating an interpreter frame. - // Set up the method, locals, and monitors. - // The frame interpreter_frame is guaranteed to be the right size, - // as determined by a previous call to the size_activation() method. - // It is also guaranteed to be walkable even though it is in a skeletal state - // NOTE: tempcount is the current size of the java expression stack. For top most - // frames we will allocate a full sized expression stack and not the curback - // version that non-top frames have. - - int monitor_size = 0; - int full_frame_size = 0; - int frame_size = frame_size_helper(method->max_stack(), tempcount, moncount, callee_param_count, callee_locals, - is_top_frame, monitor_size, full_frame_size); - -#ifdef ASSERT - assert(caller->unextended_sp() == interpreter_frame->interpreter_frame_sender_sp(), "Frame not properly walkable"); -#endif - - // MUCHO HACK - - intptr_t* frame_bottom = (intptr_t*) ((intptr_t)interpreter_frame->sp() - (full_frame_size - frame_size)); - - /* Now fillin the interpreterState object */ - - // The state object is the first thing on the frame and easily located - - interpreterState cur_state = (interpreterState) ((intptr_t)interpreter_frame->fp() - sizeof(BytecodeInterpreter)); - - - // Find the locals pointer. This is rather simple on x86 because there is no - // confusing rounding at the callee to account for. We can trivially locate - // our locals based on the current fp(). - // Note: the + 2 is for handling the "static long no_params() method" issue. - // (too bad I don't really remember that issue well...) - - intptr_t* locals; - // If the caller is interpreted we need to make sure that locals points to the first - // argument that the caller passed and not in an area where the stack might have been extended. - // because the stack to stack to converter needs a proper locals value in order to remove the - // arguments from the caller and place the result in the proper location. Hmm maybe it'd be - // simpler if we simply stored the result in the BytecodeInterpreter object and let the c++ code - // adjust the stack?? HMMM QQQ - // - if (caller->is_interpreted_frame()) { - // locals must agree with the caller because it will be used to set the - // caller's tos when we return. - interpreterState prev = caller->get_interpreterState(); - // stack() is prepushed. - locals = prev->stack() + method->size_of_parameters(); - // locals = caller->unextended_sp() + (method->size_of_parameters() - 1); - if (locals != interpreter_frame->fp() + frame::sender_sp_offset + (method->max_locals() - 1) + 2) { - // os::breakpoint(); - } - } else { - // this is where a c2i would have placed locals (except for the +2) - locals = interpreter_frame->fp() + frame::sender_sp_offset + (method->max_locals() - 1) + 2; - } - - intptr_t* monitor_base = (intptr_t*) cur_state; - intptr_t* stack_base = (intptr_t*) ((intptr_t) monitor_base - monitor_size); - /* +1 because stack is always prepushed */ - intptr_t* stack = (intptr_t*) ((intptr_t) stack_base - (tempcount + 1) * BytesPerWord); - - - BytecodeInterpreter::layout_interpreterState(cur_state, - caller, - interpreter_frame, - method, - locals, - stack, - stack_base, - monitor_base, - frame_bottom, - is_top_frame); - - // BytecodeInterpreter::pd_layout_interpreterState(cur_state, interpreter_return_address, interpreter_frame->fp()); -} - -bool AbstractInterpreter::can_be_compiled(methodHandle m) { - switch (method_kind(m)) { - case Interpreter::java_lang_math_sin : // fall thru - case Interpreter::java_lang_math_cos : // fall thru - case Interpreter::java_lang_math_tan : // fall thru - case Interpreter::java_lang_math_abs : // fall thru - case Interpreter::java_lang_math_log : // fall thru - case Interpreter::java_lang_math_log10 : // fall thru - case Interpreter::java_lang_math_sqrt : // fall thru - case Interpreter::java_lang_math_pow : // fall thru - case Interpreter::java_lang_math_exp : - return false; - default: - return true; - } -} - - -#endif // CC_INTERP (all) diff --git a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.hpp b/hotspot/src/cpu/x86/vm/cppInterpreter_x86.hpp deleted file mode 100644 index 797fcebe385..00000000000 --- a/hotspot/src/cpu/x86/vm/cppInterpreter_x86.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_X86_VM_CPPINTERPRETER_X86_HPP -#define CPU_X86_VM_CPPINTERPRETER_X86_HPP - - - protected: - - // Size of interpreter code. Increase if too small. Interpreter will - // fail with a guarantee ("not enough space for interpreter generation"); - // if too small. - // Run with +PrintInterpreter to get the VM to print out the size. - // Max size with JVMTI - const static int InterpreterCodeSize = 168 * 1024; - -#endif // CPU_X86_VM_CPPINTERPRETER_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/frame_x86.cpp b/hotspot/src/cpu/x86/vm/frame_x86.cpp index 9d77b092d4b..d61ae16729c 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.cpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp @@ -314,26 +314,6 @@ intptr_t* frame::entry_frame_argument_at(int offset) const { } // sender_sp -#ifdef CC_INTERP -intptr_t* frame::interpreter_frame_sender_sp() const { - assert(is_interpreted_frame(), "interpreted frame expected"); - // QQQ why does this specialize method exist if frame::sender_sp() does same thing? - // seems odd and if we always know interpreted vs. non then sender_sp() is really - // doing too much work. - return get_interpreterState()->sender_sp(); -} - -// monitor elements - -BasicObjectLock* frame::interpreter_frame_monitor_begin() const { - return get_interpreterState()->monitor_base(); -} - -BasicObjectLock* frame::interpreter_frame_monitor_end() const { - return (BasicObjectLock*) get_interpreterState()->stack_base(); -} - -#else // CC_INTERP intptr_t* frame::interpreter_frame_sender_sp() const { assert(is_interpreted_frame(), "interpreted frame expected"); @@ -368,7 +348,6 @@ void frame::interpreter_frame_set_monitor_end(BasicObjectLock* value) { void frame::interpreter_frame_set_last_sp(intptr_t* sp) { *((intptr_t**)addr_at(interpreter_frame_last_sp_offset)) = sp; } -#endif // CC_INTERP frame frame::sender_for_entry_frame(RegisterMap* map) const { assert(map != NULL, "map must be set"); @@ -524,9 +503,6 @@ frame frame::sender(RegisterMap* map) const { } bool frame::is_interpreted_frame_valid(JavaThread* thread) const { -// QQQ -#ifdef CC_INTERP -#else assert(is_interpreted_frame(), "Not an interpreted frame"); // These are reasonable sanity checks if (fp() == 0 || (intptr_t(fp()) & (wordSize-1)) != 0) { @@ -545,7 +521,6 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const { } // do some validation of frame elements - // first the method Method* m = *interpreter_frame_method_addr(); @@ -580,17 +555,10 @@ bool frame::is_interpreted_frame_valid(JavaThread* thread) const { if (locals > thread->stack_base() || locals < (address) fp()) return false; // We'd have to be pretty unlucky to be mislead at this point - -#endif // CC_INTERP return true; } BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result) { -#ifdef CC_INTERP - // Needed for JVMTI. The result should always be in the - // interpreterState object - interpreterState istate = get_interpreterState(); -#endif // CC_INTERP assert(is_interpreted_frame(), "interpreted frame expected"); Method* method = interpreter_frame_method(); BasicType type = method->result_type(); @@ -620,11 +588,7 @@ BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result) case T_ARRAY : { oop obj; if (method->is_native()) { -#ifdef CC_INTERP - obj = istate->_oop_temp; -#else obj = cast_to_oop(at(interpreter_frame_oop_temp_offset)); -#endif // CC_INTERP } else { oop* obj_p = (oop*)tos_addr; obj = (obj_p == NULL) ? (oop)NULL : *obj_p; @@ -673,7 +637,6 @@ intptr_t* frame::interpreter_frame_tos_at(jint offset) const { void frame::describe_pd(FrameValues& values, int frame_no) { if (is_interpreted_frame()) { -#ifndef CC_INTERP DESCRIBE_FP_OFFSET(interpreter_frame_sender_sp); DESCRIBE_FP_OFFSET(interpreter_frame_last_sp); DESCRIBE_FP_OFFSET(interpreter_frame_method); @@ -692,7 +655,6 @@ void frame::describe_pd(FrameValues& values, int frame_no) { } #endif // AMD64 } -#endif } #endif // !PRODUCT diff --git a/hotspot/src/cpu/x86/vm/frame_x86.hpp b/hotspot/src/cpu/x86/vm/frame_x86.hpp index 3d32d2bd2c5..f5df3c9b1e3 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.hpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.hpp @@ -101,8 +101,6 @@ // non-interpreter frames sender_sp_offset = 2, -#ifndef CC_INTERP - // Interpreter frames interpreter_frame_result_handler_offset = 3, // for native calls only interpreter_frame_oop_temp_offset = 2, // for native calls only @@ -120,8 +118,6 @@ interpreter_frame_monitor_block_top_offset = interpreter_frame_initial_sp_offset, interpreter_frame_monitor_block_bottom_offset = interpreter_frame_initial_sp_offset, -#endif // CC_INTERP - // Entry frames #ifdef AMD64 #ifdef _WIN64 @@ -193,13 +189,7 @@ // helper to update a map with callee-saved RBP static void update_map_with_saved_link(RegisterMap* map, intptr_t** link_addr); -#ifndef CC_INTERP // deoptimization support void interpreter_frame_set_last_sp(intptr_t* sp); -#endif // CC_INTERP - -#ifdef CC_INTERP - inline interpreterState get_interpreterState() const; -#endif // CC_INTERP #endif // CPU_X86_VM_FRAME_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp index 3b5cd411ea3..374d83ca5cd 100644 --- a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp +++ b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp @@ -151,59 +151,6 @@ inline intptr_t* frame::unextended_sp() const { return _unextended_sp; } inline address* frame::sender_pc_addr() const { return (address*) addr_at( return_addr_offset); } inline address frame::sender_pc() const { return *sender_pc_addr(); } -#ifdef CC_INTERP - -inline interpreterState frame::get_interpreterState() const { - return ((interpreterState)addr_at( -((int)sizeof(BytecodeInterpreter))/wordSize )); -} - -inline intptr_t* frame::sender_sp() const { - // Hmm this seems awfully expensive QQQ, is this really called with interpreted frames? - if (is_interpreted_frame()) { - assert(false, "should never happen"); - return get_interpreterState()->sender_sp(); - } else { - return addr_at(sender_sp_offset); - } -} - -inline intptr_t** frame::interpreter_frame_locals_addr() const { - assert(is_interpreted_frame(), "must be interpreted"); - return &(get_interpreterState()->_locals); -} - -inline intptr_t* frame::interpreter_frame_bcp_addr() const { - assert(is_interpreted_frame(), "must be interpreted"); - return (intptr_t*) &(get_interpreterState()->_bcp); -} - - -// Constant pool cache - -inline ConstantPoolCache** frame::interpreter_frame_cache_addr() const { - assert(is_interpreted_frame(), "must be interpreted"); - return &(get_interpreterState()->_constants); -} - -// Method - -inline Method** frame::interpreter_frame_method_addr() const { - assert(is_interpreted_frame(), "must be interpreted"); - return &(get_interpreterState()->_method); -} - -inline intptr_t* frame::interpreter_frame_mdp_addr() const { - assert(is_interpreted_frame(), "must be interpreted"); - return (intptr_t*) &(get_interpreterState()->_mdx); -} - -// top of expression stack -inline intptr_t* frame::interpreter_frame_tos_address() const { - assert(is_interpreted_frame(), "wrong frame type"); - return get_interpreterState()->_stack + 1; -} - -#else /* asm interpreter */ inline intptr_t* frame::sender_sp() const { return addr_at( sender_sp_offset); } inline intptr_t** frame::interpreter_frame_locals_addr() const { @@ -255,8 +202,6 @@ inline oop* frame::interpreter_frame_temp_oop_addr() const { return (oop *)(fp() + interpreter_frame_oop_temp_offset); } -#endif /* CC_INTERP */ - inline int frame::pd_oop_map_offset_adjustment() const { return 0; } diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp b/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp index 2ac94e22e17..8cc7b46be13 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86.cpp @@ -45,7 +45,6 @@ void InterpreterMacroAssembler::jump_to_entry(address entry) { jump(RuntimeAddress(entry)); } -#ifndef CC_INTERP void InterpreterMacroAssembler::profile_obj_type(Register obj, const Address& mdo_addr) { Label update, next, none; @@ -246,16 +245,7 @@ void InterpreterMacroAssembler::profile_parameters_type(Register mdp, Register t bind(profile_continue); } } -#endif -#ifdef CC_INTERP -void InterpreterMacroAssembler::get_method(Register reg) { - movptr(reg, Address(rbp, -(sizeof(BytecodeInterpreter) + 2 * wordSize))); - movptr(reg, Address(reg, byte_offset_of(BytecodeInterpreter, _method))); -} -#endif // CC_INTERP - -#ifndef CC_INTERP void InterpreterMacroAssembler::call_VM_leaf_base(address entry_point, int number_of_arguments) { // interpreter specific @@ -1046,7 +1036,6 @@ void InterpreterMacroAssembler::remove_activation( pop(ret_addr); // get return address mov(rsp, rbx); // set sp to sender sp } -#endif // !CC_INTERP void InterpreterMacroAssembler::get_method_counters(Register method, Register mcs, Label& skip) { @@ -1227,7 +1216,7 @@ void InterpreterMacroAssembler::unlock_object(Register lock_reg) { restore_bcp(); } } -#ifndef CC_INTERP + void InterpreterMacroAssembler::test_method_data_pointer(Register mdp, Label& zero_continue) { assert(ProfileInterpreter, "must be profiling interpreter"); @@ -1886,7 +1875,6 @@ void InterpreterMacroAssembler::increment_mask_and_jump(Address counter_addr, andl(scratch, mask); jcc(cond, *where); } -#endif // CC_INTERP void InterpreterMacroAssembler::notify_method_entry() { // Whenever JVMTI is interp_only_mode, method entry/exit events are sent to @@ -1938,9 +1926,8 @@ void InterpreterMacroAssembler::notify_method_exit( // is changed then the interpreter_frame_result implementation will // need to be updated too. - // For c++ interpreter the result is always stored at a known location in the frame - // template interpreter will leave it on the top of the stack. - NOT_CC_INTERP(push(state);) + // template interpreter will leave the result on the top of the stack. + push(state); NOT_LP64(get_thread(rthread);) movl(rdx, Address(rthread, JavaThread::interp_only_mode_offset())); testl(rdx, rdx); @@ -1948,16 +1935,16 @@ void InterpreterMacroAssembler::notify_method_exit( call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::post_method_exit)); bind(L); - NOT_CC_INTERP(pop(state)); + pop(state); } { SkipIfEqual skip(this, &DTraceMethodProbes, false); - NOT_CC_INTERP(push(state)); + push(state); NOT_LP64(get_thread(rthread);) get_method(rarg); call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit), rthread, rarg); - NOT_CC_INTERP(pop(state)); + pop(state); } } diff --git a/hotspot/src/cpu/x86/vm/interp_masm_x86.hpp b/hotspot/src/cpu/x86/vm/interp_masm_x86.hpp index de467071b1b..470ac6e6399 100644 --- a/hotspot/src/cpu/x86/vm/interp_masm_x86.hpp +++ b/hotspot/src/cpu/x86/vm/interp_masm_x86.hpp @@ -36,7 +36,6 @@ typedef ByteSize (*OffsetFunction)(uint); class InterpreterMacroAssembler: public MacroAssembler { -#ifndef CC_INTERP protected: // Interpreter specific version of call_VM_base virtual void call_VM_leaf_base(address entry_point, @@ -54,7 +53,6 @@ class InterpreterMacroAssembler: public MacroAssembler { // base routine for all dispatches void dispatch_base(TosState state, address* table, bool verifyoop = true); -#endif // CC_INTERP public: InterpreterMacroAssembler(CodeBuffer* code) : MacroAssembler(code), @@ -65,15 +63,6 @@ class InterpreterMacroAssembler: public MacroAssembler { void load_earlyret_value(TosState state); -#ifdef CC_INTERP - void save_bcp() { /* not needed in c++ interpreter and harmless */ } - void restore_bcp() { /* not needed in c++ interpreter and harmless */ } - - // Helpers for runtime call arguments/results - void get_method(Register reg); - -#else - // Interpreter-specific registers void save_bcp() { movptr(Address(rbp, frame::interpreter_frame_bcp_offset * wordSize), _bcp_register); @@ -219,15 +208,12 @@ class InterpreterMacroAssembler: public MacroAssembler { bool throw_monitor_exception = true, bool install_monitor_exception = true, bool notify_jvmdi = true); -#endif // CC_INTERP void get_method_counters(Register method, Register mcs, Label& skip); // Object locking void lock_object (Register lock_reg); void unlock_object(Register lock_reg); -#ifndef CC_INTERP - // Interpreter profiling operations void set_method_data_pointer_for_bcp(); void test_method_data_pointer(Register mdp, Label& zero_continue); @@ -285,8 +271,6 @@ class InterpreterMacroAssembler: public MacroAssembler { // only if +VerifyFPU && (state == ftos || state == dtos) void verify_FPU(int stack_depth, TosState state = ftos); -#endif // !CC_INTERP - typedef enum { NotifyJVMTI, SkipNotifyJVMTI } NotifyMethodExitMode; // support for jvmti/dtrace @@ -299,12 +283,10 @@ class InterpreterMacroAssembler: public MacroAssembler { Register _bcp_register; // register that contains the bcp public: -#ifndef CC_INTERP void profile_obj_type(Register obj, const Address& mdo_addr); void profile_arguments_type(Register mdp, Register callee, Register tmp, bool is_virtual); void profile_return_type(Register mdp, Register ret, Register tmp); void profile_parameters_type(Register mdp, Register tmp1, Register tmp2); -#endif /* !CC_INTERP */ }; diff --git a/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.cpp index e22e3d366a0..c91580ae124 100644 --- a/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.cpp +++ b/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,26 +25,24 @@ #include "precompiled.hpp" #include "asm/macroAssembler.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/interp_masm.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" #define __ _masm-> // Abstract method entry // Attempt to execute abstract method. Throw exception -address InterpreterGenerator::generate_abstract_entry(void) { +address TemplateInterpreterGenerator::generate_abstract_entry(void) { address entry_point = __ pc(); // abstract method entry -#ifndef CC_INTERP // pop return address, reset last_sp to NULL __ empty_expression_stack(); __ restore_bcp(); // rsi must be correct for exception handler (was destroyed) __ restore_locals(); // make sure locals pointer is correct as well (was destroyed) -#endif // throw exception __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError)); diff --git a/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.hpp b/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.hpp deleted file mode 100644 index ad9ca0fba3d..00000000000 --- a/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_X86_VM_INTERPRETERGENERATOR_X86_HPP -#define CPU_X86_VM_INTERPRETERGENERATOR_X86_HPP - - -// Generation of Interpreter -// - friend class AbstractInterpreterGenerator; - - private: - - address generate_normal_entry(bool synchronized); - address generate_native_entry(bool synchronized); - address generate_abstract_entry(void); - address generate_math_entry(AbstractInterpreter::MethodKind kind); - address generate_accessor_entry(void) { return NULL; } - address generate_empty_entry(void) { return NULL; } - address generate_Reference_get_entry(); - address generate_CRC32_update_entry(); - address generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind); - address generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind); -#ifndef _LP64 - address generate_Float_intBitsToFloat_entry(); - address generate_Float_floatToRawIntBits_entry(); - address generate_Double_longBitsToDouble_entry(); - address generate_Double_doubleToRawLongBits_entry(); -#endif - void generate_stack_overflow_check(void); - - void generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue); - void generate_counter_overflow(Label* do_continue); - -#endif // CPU_X86_VM_INTERPRETERGENERATOR_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86.hpp b/hotspot/src/cpu/x86/vm/interpreter_x86.hpp deleted file mode 100644 index 8a6169c0ca4..00000000000 --- a/hotspot/src/cpu/x86/vm/interpreter_x86.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_X86_VM_INTERPRETER_X86_HPP -#define CPU_X86_VM_INTERPRETER_X86_HPP - - public: - static Address::ScaleFactor stackElementScale() { - return NOT_LP64(Address::times_4) LP64_ONLY(Address::times_8); - } - - // Offset from rsp (which points to the last stack element) - static int expr_offset_in_bytes(int i) { return stackElementSize * i; } - - // Stack index relative to tos (which points at value) - static int expr_index_at(int i) { return stackElementWords * i; } - - // Already negated by c++ interpreter - static int local_index_at(int i) { - assert(i <= 0, "local direction already negated"); - return stackElementWords * i; - } - -#endif // CPU_X86_VM_INTERPRETER_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp index a0e3f0685b6..efc8525c333 100644 --- a/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/interpreter_x86_32.cpp @@ -26,9 +26,9 @@ #include "asm/macroAssembler.hpp" #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/interp_masm.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" @@ -66,7 +66,7 @@ address AbstractInterpreterGenerator::generate_slow_signature_handler() { } -address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { +address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { // rbx,: Method* // rcx: scratrch diff --git a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp index 42d7fecb8b1..9e597042095 100644 --- a/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/interpreter_x86_64.cpp @@ -26,9 +26,9 @@ #include "asm/macroAssembler.hpp" #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/interp_masm.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" @@ -199,7 +199,7 @@ address AbstractInterpreterGenerator::generate_slow_signature_handler() { // Various method entries // -address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { +address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { // rbx,: Method* // rcx: scratrch diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp index 4cd0855dc3f..0bde2c6a516 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp @@ -2525,11 +2525,9 @@ void MacroAssembler::call_VM_base(Register oop_result, // Only interpreter should have to clear fp reset_last_Java_frame(java_thread, true, false); -#ifndef CC_INTERP // C++ interp handles this in the interpreter check_and_handle_popframe(java_thread); check_and_handle_earlyret(java_thread); -#endif /* CC_INTERP */ if (check_exceptions) { // check for pending exceptions (java_thread is set upon return) diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp index e185330f231..1617abd3171 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -48,16 +48,9 @@ class MacroAssembler: public Assembler { // This is the base routine called by the different versions of call_VM_leaf. The interpreter // may customize this version by overriding it for its purposes (e.g., to save/restore // additional registers when doing a VM call). -#ifdef CC_INTERP - // c++ interpreter never wants to use interp_masm version of call_VM - #define VIRTUAL -#else - #define VIRTUAL virtual -#endif - #define COMMA , - VIRTUAL void call_VM_leaf_base( + virtual void call_VM_leaf_base( address entry_point, // the entry point int number_of_arguments // the number of arguments to pop after the call ); @@ -70,7 +63,7 @@ class MacroAssembler: public Assembler { // returns the register which contains the thread upon return. If a thread register has been // specified, the return value will correspond to that register. If no last_java_sp is specified // (noreg) than rsp will be used instead. - VIRTUAL void call_VM_base( // returns the register containing the thread upon return + virtual void call_VM_base( // returns the register containing the thread upon return Register oop_result, // where an oop-result ends up if any; use noreg otherwise Register java_thread, // the thread if computed before ; use noreg otherwise Register last_java_sp, // to set up last_Java_frame in stubs; use noreg otherwise @@ -1422,8 +1415,6 @@ public: void byte_array_inflate(Register src, Register dst, Register len, XMMRegister tmp1, Register tmp2); -#undef VIRTUAL - }; /** diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp index 6da8628bd49..2125d7aa9fb 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp @@ -2652,30 +2652,14 @@ void SharedRuntime::generate_deopt_blob() { Label loop; __ bind(loop); __ movptr(rbx, Address(rsi, 0)); // Load frame size -#ifdef CC_INTERP - __ subptr(rbx, 4*wordSize); // we'll push pc and ebp by hand and -#ifdef ASSERT - __ push(0xDEADDEAD); // Make a recognizable pattern - __ push(0xDEADDEAD); -#else /* ASSERT */ - __ subptr(rsp, 2*wordSize); // skip the "static long no_param" -#endif /* ASSERT */ -#else /* CC_INTERP */ __ subptr(rbx, 2*wordSize); // we'll push pc and rbp, by hand -#endif /* CC_INTERP */ __ pushptr(Address(rcx, 0)); // save return address __ enter(); // save old & set new rbp, __ subptr(rsp, rbx); // Prolog! __ movptr(rbx, sp_temp); // sender's sp -#ifdef CC_INTERP - __ movptr(Address(rbp, - -(sizeof(BytecodeInterpreter)) + in_bytes(byte_offset_of(BytecodeInterpreter, _sender_sp))), - rbx); // Make it walkable -#else /* CC_INTERP */ // This value is corrected by layout_activation_impl __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), NULL_WORD); __ movptr(Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize), rbx); // Make it walkable -#endif /* CC_INTERP */ __ movptr(sp_temp, rsp); // pass to next frame __ addptr(rsi, wordSize); // Bump array pointer (sizes) __ addptr(rcx, wordSize); // Bump array pointer (pcs) @@ -2894,30 +2878,14 @@ void SharedRuntime::generate_uncommon_trap_blob() { Label loop; __ bind(loop); __ movptr(rbx, Address(rsi, 0)); // Load frame size -#ifdef CC_INTERP - __ subptr(rbx, 4*wordSize); // we'll push pc and ebp by hand and -#ifdef ASSERT - __ push(0xDEADDEAD); // Make a recognizable pattern - __ push(0xDEADDEAD); // (parm to RecursiveInterpreter...) -#else /* ASSERT */ - __ subptr(rsp, 2*wordSize); // skip the "static long no_param" -#endif /* ASSERT */ -#else /* CC_INTERP */ __ subptr(rbx, 2*wordSize); // we'll push pc and rbp, by hand -#endif /* CC_INTERP */ __ pushptr(Address(rcx, 0)); // save return address __ enter(); // save old & set new rbp, __ subptr(rsp, rbx); // Prolog! __ movptr(rbx, sp_temp); // sender's sp -#ifdef CC_INTERP - __ movptr(Address(rbp, - -(sizeof(BytecodeInterpreter)) + in_bytes(byte_offset_of(BytecodeInterpreter, _sender_sp))), - rbx); // Make it walkable -#else /* CC_INTERP */ // This value is corrected by layout_activation_impl __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), NULL_WORD ); __ movptr(Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize), rbx); // Make it walkable -#endif /* CC_INTERP */ __ movptr(sp_temp, rsp); // pass to next frame __ addptr(rsi, wordSize); // Bump array pointer (sizes) __ addptr(rcx, wordSize); // Bump array pointer (pcs) diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp index 2af5ee60a1c..c2892ed2a88 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp @@ -3021,29 +3021,13 @@ void SharedRuntime::generate_deopt_blob() { Label loop; __ bind(loop); __ movptr(rbx, Address(rsi, 0)); // Load frame size -#ifdef CC_INTERP - __ subptr(rbx, 4*wordSize); // we'll push pc and ebp by hand and -#ifdef ASSERT - __ push(0xDEADDEAD); // Make a recognizable pattern - __ push(0xDEADDEAD); -#else /* ASSERT */ - __ subptr(rsp, 2*wordSize); // skip the "static long no_param" -#endif /* ASSERT */ -#else __ subptr(rbx, 2*wordSize); // We'll push pc and ebp by hand -#endif // CC_INTERP __ pushptr(Address(rcx, 0)); // Save return address __ enter(); // Save old & set new ebp __ subptr(rsp, rbx); // Prolog -#ifdef CC_INTERP - __ movptr(Address(rbp, - -(sizeof(BytecodeInterpreter)) + in_bytes(byte_offset_of(BytecodeInterpreter, _sender_sp))), - sender_sp); // Make it walkable -#else /* CC_INTERP */ // This value is corrected by layout_activation_impl __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD ); __ movptr(Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize), sender_sp); // Make it walkable -#endif /* CC_INTERP */ __ mov(sender_sp, rsp); // Pass sender_sp to next frame __ addptr(rsi, wordSize); // Bump array pointer (sizes) __ addptr(rcx, wordSize); // Bump array pointer (pcs) @@ -3242,16 +3226,10 @@ void SharedRuntime::generate_uncommon_trap_blob() { __ pushptr(Address(rcx, 0)); // Save return address __ enter(); // Save old & set new rbp __ subptr(rsp, rbx); // Prolog -#ifdef CC_INTERP - __ movptr(Address(rbp, - -(sizeof(BytecodeInterpreter)) + in_bytes(byte_offset_of(BytecodeInterpreter, _sender_sp))), - sender_sp); // Make it walkable -#else // CC_INTERP __ movptr(Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize), sender_sp); // Make it walkable // This value is corrected by layout_activation_impl __ movptr(Address(rbp, frame::interpreter_frame_last_sp_offset * wordSize), (int32_t)NULL_WORD ); -#endif // CC_INTERP __ mov(sender_sp, rsp); // Pass sender_sp to next frame __ addptr(rsi, wordSize); // Bump array pointer (sizes) __ addptr(rcx, wordSize); // Bump array pointer (pcs) diff --git a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp index fc242b183c4..db047dfd0d4 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp @@ -25,10 +25,10 @@ #include "precompiled.hpp" #include "asm/macroAssembler.hpp" #include "interpreter/bytecodeHistogram.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" -#include "interpreter/interpreterRuntime.hpp" #include "interpreter/interp_masm.hpp" +#include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" @@ -49,8 +49,6 @@ #define __ _masm-> -#ifndef CC_INTERP - // Global Register Names static const Register rbcp = LP64_ONLY(r13) NOT_LP64(rsi); static const Register rlocals = LP64_ONLY(r14) NOT_LP64(rdi); @@ -361,7 +359,7 @@ address TemplateInterpreterGenerator::generate_safept_entry_for( // rbx: method // rcx: invocation counter // -void InterpreterGenerator::generate_counter_incr( +void TemplateInterpreterGenerator::generate_counter_incr( Label* overflow, Label* profile_method, Label* profile_method_continue) { @@ -436,7 +434,7 @@ void InterpreterGenerator::generate_counter_incr( } } -void InterpreterGenerator::generate_counter_overflow(Label* do_continue) { +void TemplateInterpreterGenerator::generate_counter_overflow(Label& do_continue) { // Asm interpreter on entry // r14/rdi - locals @@ -466,7 +464,7 @@ void InterpreterGenerator::generate_counter_overflow(Label* do_continue) { __ movptr(rbx, Address(rbp, method_offset)); // restore Method* // Preserve invariant that r13/r14 contain bcp/locals of sender frame // and jump to the interpreted entry. - __ jmp(*do_continue, relocInfo::none); + __ jmp(do_continue, relocInfo::none); } // See if we've got enough room on the stack for locals plus overhead. @@ -483,7 +481,7 @@ void InterpreterGenerator::generate_counter_overflow(Label* do_continue) { // // Kills: // rax -void InterpreterGenerator::generate_stack_overflow_check(void) { +void TemplateInterpreterGenerator::generate_stack_overflow_check(void) { // monitor entry size: see picture of stack in frame_x86.hpp const int entry_size = frame::interpreter_frame_monitor_size() * wordSize; @@ -687,7 +685,7 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call) { // End of helpers // Method entry for java.lang.ref.Reference.get. -address InterpreterGenerator::generate_Reference_get_entry(void) { +address TemplateInterpreterGenerator::generate_Reference_get_entry(void) { #if INCLUDE_ALL_GCS // Code: _aload_0, _getfield, _areturn // parameter size = 1 @@ -783,7 +781,7 @@ address InterpreterGenerator::generate_Reference_get_entry(void) { // Interpreter stub for calling a native method. (asm interpreter) // This sets up a somewhat different looking stack for calling the // native method than the typical interpreter frame setup. -address InterpreterGenerator::generate_native_entry(bool synchronized) { +address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { // determine code generation flags bool inc_counter = UseCompiler || CountCompiledCalls || LogTouchedMethods; @@ -1300,7 +1298,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) { if (inc_counter) { // Handle overflow of counter and compile method __ bind(invocation_counter_overflow); - generate_counter_overflow(&continue_after_compile); + generate_counter_overflow(continue_after_compile); } return entry_point; @@ -1309,7 +1307,7 @@ address InterpreterGenerator::generate_native_entry(bool synchronized) { // // Generic interpreted method entry to (asm) interpreter // -address InterpreterGenerator::generate_normal_entry(bool synchronized) { +address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) { // determine code generation flags bool inc_counter = UseCompiler || CountCompiledCalls || LogTouchedMethods; @@ -1471,7 +1469,7 @@ address InterpreterGenerator::generate_normal_entry(bool synchronized) { } // Handle overflow of counter and compile method __ bind(invocation_counter_overflow); - generate_counter_overflow(&continue_after_compile); + generate_counter_overflow(continue_after_compile); } return entry_point; @@ -1767,18 +1765,6 @@ void TemplateInterpreterGenerator::set_vtos_entry_points(Template* t, generate_and_dispatch(t); } - -//----------------------------------------------------------------------------- -// Generation of individual instructions - -// helpers for generate_and_dispatch - - -InterpreterGenerator::InterpreterGenerator(StubQueue* code) - : TemplateInterpreterGenerator(code) { - generate_all(); // down here so it can be "virtual" -} - //----------------------------------------------------------------------------- // Non-product code @@ -1871,4 +1857,3 @@ void TemplateInterpreterGenerator::stop_interpreter_at() { __ bind(L); } #endif // !PRODUCT -#endif // ! CC_INTERP diff --git a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.hpp b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.hpp deleted file mode 100644 index 60e95057cef..00000000000 --- a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.hpp +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_X86_VM_TEMPLATEINTERPRETERGENERATOR_X86_HPP -#define CPU_X86_VM_TEMPLATEINTERPRETERGENERATOR_X86_HPP - - protected: - - void generate_fixed_frame(bool native_call); - - // address generate_asm_interpreter_entry(bool synchronized); - -#endif // CPU_X86_VM_TEMPLATEINTERPRETERGENERATOR_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_32.cpp index d43d2606829..c3496b3f4ce 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_32.cpp @@ -24,20 +24,19 @@ #include "precompiled.hpp" #include "asm/macroAssembler.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" #include "runtime/arguments.hpp" #define __ _masm-> -#ifndef CC_INTERP - /** * Method entry for static native methods: * int java.util.zip.CRC32.update(int crc, int b) */ -address InterpreterGenerator::generate_CRC32_update_entry() { +address TemplateInterpreterGenerator::generate_CRC32_update_entry() { if (UseCRC32Intrinsics) { address entry = __ pc(); @@ -89,7 +88,7 @@ address InterpreterGenerator::generate_CRC32_update_entry() { * int java.util.zip.CRC32.updateBytes(int crc, byte[] b, int off, int len) * int java.util.zip.CRC32.updateByteBuffer(int crc, long buf, int off, int len) */ -address InterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) { +address TemplateInterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) { if (UseCRC32Intrinsics) { address entry = __ pc(); @@ -155,7 +154,7 @@ address InterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpret * int java.util.zip.CRC32C.updateBytes(int crc, byte[] b, int off, int end) * int java.util.zip.CRC32C.updateByteBuffer(int crc, long address, int off, int end) */ -address InterpreterGenerator::generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) { +address TemplateInterpreterGenerator::generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) { if (UseCRC32CIntrinsics) { address entry = __ pc(); // Load parameters @@ -201,7 +200,7 @@ address InterpreterGenerator::generate_CRC32C_updateBytes_entry(AbstractInterpre * Method entry for static native method: * java.lang.Float.intBitsToFloat(int bits) */ -address InterpreterGenerator::generate_Float_intBitsToFloat_entry() { +address TemplateInterpreterGenerator::generate_Float_intBitsToFloat_entry() { if (UseSSE >= 1) { address entry = __ pc(); @@ -227,7 +226,7 @@ address InterpreterGenerator::generate_Float_intBitsToFloat_entry() { * Method entry for static native method: * java.lang.Float.floatToRawIntBits(float value) */ -address InterpreterGenerator::generate_Float_floatToRawIntBits_entry() { +address TemplateInterpreterGenerator::generate_Float_floatToRawIntBits_entry() { if (UseSSE >= 1) { address entry = __ pc(); @@ -254,7 +253,7 @@ address InterpreterGenerator::generate_Float_floatToRawIntBits_entry() { * Method entry for static native method: * java.lang.Double.longBitsToDouble(long bits) */ -address InterpreterGenerator::generate_Double_longBitsToDouble_entry() { +address TemplateInterpreterGenerator::generate_Double_longBitsToDouble_entry() { if (UseSSE >= 2) { address entry = __ pc(); @@ -280,7 +279,7 @@ address InterpreterGenerator::generate_Double_longBitsToDouble_entry() { * Method entry for static native method: * java.lang.Double.doubleToRawLongBits(double value) */ -address InterpreterGenerator::generate_Double_doubleToRawLongBits_entry() { +address TemplateInterpreterGenerator::generate_Double_doubleToRawLongBits_entry() { if (UseSSE >= 2) { address entry = __ pc(); @@ -302,4 +301,3 @@ address InterpreterGenerator::generate_Double_doubleToRawLongBits_entry() { return NULL; } -#endif // CC_INTERP diff --git a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_64.cpp index b77270b02ca..e645a9ffe7e 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86_64.cpp @@ -24,19 +24,18 @@ #include "precompiled.hpp" #include "asm/macroAssembler.hpp" +#include "interpreter/interp_masm.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" #include "runtime/arguments.hpp" #define __ _masm-> -#ifndef CC_INTERP - /** * Method entry for static native methods: * int java.util.zip.CRC32.update(int crc, int b) */ -address InterpreterGenerator::generate_CRC32_update_entry() { +address TemplateInterpreterGenerator::generate_CRC32_update_entry() { if (UseCRC32Intrinsics) { address entry = __ pc(); @@ -88,7 +87,7 @@ address InterpreterGenerator::generate_CRC32_update_entry() { * int java.util.zip.CRC32.updateBytes(int crc, byte[] b, int off, int len) * int java.util.zip.CRC32.updateByteBuffer(int crc, long buf, int off, int len) */ -address InterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) { +address TemplateInterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) { if (UseCRC32Intrinsics) { address entry = __ pc(); @@ -149,7 +148,7 @@ address InterpreterGenerator::generate_CRC32_updateBytes_entry(AbstractInterpret * int java.util.zip.CRC32C.updateBytes(int crc, byte[] b, int off, int end) * int java.util.zip.CRC32C.updateByteBuffer(int crc, long address, int off, int end) */ -address InterpreterGenerator::generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) { +address TemplateInterpreterGenerator::generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) { if (UseCRC32CIntrinsics) { address entry = __ pc(); // Load parameters @@ -194,4 +193,3 @@ address InterpreterGenerator::generate_CRC32C_updateBytes_entry(AbstractInterpre return NULL; } -#endif // ! CC_INTERP diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86.cpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86.cpp index 9b84f71bc3c..0e3cd9927c1 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreter_x86.cpp @@ -27,7 +27,16 @@ #include "interpreter/interpreter.hpp" #include "runtime/frame.inline.hpp" -#ifndef CC_INTERP +// Size of interpreter code. Increase if too small. Interpreter will +// fail with a guarantee ("not enough space for interpreter generation"); +// if too small. +// Run with +PrintInterpreter to get the VM to print out the size. +// Max size with JVMTI +#ifdef AMD64 +int TemplateInterpreter::InterpreterCodeSize = 256 * 1024; +#else +int TemplateInterpreter::InterpreterCodeSize = 224 * 1024; +#endif // AMD64 // asm based interpreter deoptimization helpers int AbstractInterpreter::size_activation(int max_stack, @@ -38,7 +47,7 @@ int AbstractInterpreter::size_activation(int max_stack, int callee_locals, bool is_top_frame) { // Note: This calculation must exactly parallel the frame setup - // in InterpreterGenerator::generate_fixed_frame. + // in TemplateInterpreterGenerator::generate_fixed_frame. // fixed size of an interpreter frame: int overhead = frame::sender_sp_offset - @@ -198,5 +207,3 @@ int AbstractInterpreter::size_top_interpreter_activation(Method* method) { Interpreter::stackElementWords; return (overhead_size + method_stack + stub_code); } - -#endif // CC_INTERP diff --git a/hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp b/hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp deleted file mode 100644 index 071defbab0d..00000000000 --- a/hotspot/src/cpu/x86/vm/templateInterpreter_x86.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_X86_VM_TEMPLATEINTERPRETER_X86_HPP -#define CPU_X86_VM_TEMPLATEINTERPRETER_X86_HPP - - - protected: - - // Size of interpreter code. Increase if too small. Interpreter will - // fail with a guarantee ("not enough space for interpreter generation"); - // if too small. - // Run with +PrintInterpreter to get the VM to print out the size. - // Max size with JVMTI -#ifdef AMD64 - const static int InterpreterCodeSize = 256 * 1024; -#else - const static int InterpreterCodeSize = 224 * 1024; -#endif // AMD64 - -#endif // CPU_X86_VM_TEMPLATEINTERPRETER_X86_HPP diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86.cpp index b589e0100ce..42520c7e418 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86.cpp @@ -38,8 +38,6 @@ #include "runtime/synchronizer.hpp" #include "utilities/macros.hpp" -#ifndef CC_INTERP - #define __ _masm-> // Global Register Names @@ -4341,5 +4339,3 @@ void TemplateTable::multianewarray() { __ load_unsigned_byte(rbx, at_bcp(3)); __ lea(rsp, Address(rsp, rbx, Interpreter::stackElementScale())); // get rid of counts } -#endif /* !CC_INTERP */ - diff --git a/hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp b/hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp deleted file mode 100644 index 6b2cacf5ae2..00000000000 --- a/hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2008, 2009 Red Hat, Inc. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_ZERO_VM_CPPINTERPRETERGENERATOR_ZERO_HPP -#define CPU_ZERO_VM_CPPINTERPRETERGENERATOR_ZERO_HPP - - protected: - MacroAssembler* assembler() const { - return _masm; - } - - public: - static address generate_entry_impl(MacroAssembler* masm, address entry_point) { - ZeroEntry *entry = (ZeroEntry *) masm->pc(); - masm->advance(sizeof(ZeroEntry)); - entry->set_entry_point(entry_point); - return (address) entry; - } - - protected: - address generate_entry(address entry_point) { - return generate_entry_impl(assembler(), entry_point); - } - -#endif // CPU_ZERO_VM_CPPINTERPRETERGENERATOR_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp index 02497845c28..1bb7809ea43 100644 --- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp +++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp @@ -27,8 +27,8 @@ #include "asm/assembler.hpp" #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/cppInterpreter.hpp" +#include "interpreter/cppInterpreterGenerator.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "oops/arrayOop.hpp" #include "oops/methodData.hpp" @@ -788,21 +788,21 @@ BasicType CppInterpreter::result_type_of(Method* method) { return t; } -address InterpreterGenerator::generate_empty_entry() { +address CppInterpreterGenerator::generate_empty_entry() { if (!UseFastEmptyMethods) return NULL; return generate_entry((address) CppInterpreter::empty_entry); } -address InterpreterGenerator::generate_accessor_entry() { +address CppInterpreterGenerator::generate_accessor_entry() { if (!UseFastAccessorMethods) return NULL; return generate_entry((address) CppInterpreter::accessor_entry); } -address InterpreterGenerator::generate_Reference_get_entry(void) { +address CppInterpreterGenerator::generate_Reference_get_entry(void) { #if INCLUDE_ALL_GCS if (UseG1GC) { // We need to generate have a routine that generates code to: @@ -822,20 +822,15 @@ address InterpreterGenerator::generate_Reference_get_entry(void) { return NULL; } -address InterpreterGenerator::generate_native_entry(bool synchronized) { +address CppInterpreterGenerator::generate_native_entry(bool synchronized) { return generate_entry((address) CppInterpreter::native_entry); } -address InterpreterGenerator::generate_normal_entry(bool synchronized) { +address CppInterpreterGenerator::generate_normal_entry(bool synchronized) { return generate_entry((address) CppInterpreter::normal_entry); } -InterpreterGenerator::InterpreterGenerator(StubQueue* code) - : CppInterpreterGenerator(code) { - generate_all(); -} - // Deoptimization helpers InterpreterFrame *InterpreterFrame::build(int size, TRAPS) { @@ -980,31 +975,4 @@ int AbstractInterpreter::size_top_interpreter_activation(Method* method) { bool CppInterpreter::contains(address pc) { return false; // make frame::print_value_on work } - -// Result handlers and convertors - -address CppInterpreterGenerator::generate_result_handler_for( - BasicType type) { - assembler()->advance(1); - return ShouldNotCallThisStub(); -} - -address CppInterpreterGenerator::generate_tosca_to_stack_converter( - BasicType type) { - assembler()->advance(1); - return ShouldNotCallThisStub(); -} - -address CppInterpreterGenerator::generate_stack_to_stack_converter( - BasicType type) { - assembler()->advance(1); - return ShouldNotCallThisStub(); -} - -address CppInterpreterGenerator::generate_stack_to_native_abi_converter( - BasicType type) { - assembler()->advance(1); - return ShouldNotCallThisStub(); -} - #endif // CC_INTERP diff --git a/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp b/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp index 0ea5bbc4f77..f8011a25161 100644 --- a/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp +++ b/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -122,6 +122,11 @@ inline intptr_t* frame::interpreter_frame_mdp_addr() const { inline intptr_t* frame::interpreter_frame_tos_address() const { return get_interpreterState()->_stack + 1; } + +inline oop* frame::interpreter_frame_temp_oop_addr() const { + interpreterState istate = get_interpreterState(); + return (oop *)&istate->_oop_temp; +} #endif // CC_INTERP inline int frame::interpreter_frame_monitor_size() { diff --git a/hotspot/src/cpu/zero/vm/interpreterGenerator_zero.hpp b/hotspot/src/cpu/zero/vm/interpreterGenerator_zero.hpp deleted file mode 100644 index 8f54ae265a9..00000000000 --- a/hotspot/src/cpu/zero/vm/interpreterGenerator_zero.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. - * Copyright 2007 Red Hat, Inc. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_ZERO_VM_INTERPRETERGENERATOR_ZERO_HPP -#define CPU_ZERO_VM_INTERPRETERGENERATOR_ZERO_HPP - - // Generation of Interpreter - // - friend class AbstractInterpreterGenerator; - - private: - address generate_normal_entry(bool synchronized); - address generate_native_entry(bool synchronized); - address generate_abstract_entry(); - address generate_math_entry(AbstractInterpreter::MethodKind kind); - address generate_empty_entry(); - address generate_accessor_entry(); - address generate_Reference_get_entry(); - - // Not supported - address generate_CRC32_update_entry() { return NULL; } - address generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind) { return NULL; } - address generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind) { return NULL; } -#endif // CPU_ZERO_VM_INTERPRETERGENERATOR_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/interpreter_zero.cpp b/hotspot/src/cpu/zero/vm/interpreter_zero.cpp index c99e9391b62..4675ecb4db1 100644 --- a/hotspot/src/cpu/zero/vm/interpreter_zero.cpp +++ b/hotspot/src/cpu/zero/vm/interpreter_zero.cpp @@ -26,8 +26,8 @@ #include "precompiled.hpp" #include "asm/assembler.hpp" #include "interpreter/bytecodeHistogram.hpp" +#include "interpreter/cppInterpreterGenerator.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/templateTable.hpp" #include "oops/arrayOop.hpp" @@ -57,7 +57,7 @@ address AbstractInterpreterGenerator::generate_slow_signature_handler() { return (address) InterpreterRuntime::slow_signature_handler; } -address InterpreterGenerator::generate_math_entry( +address CppInterpreterGenerator::generate_math_entry( AbstractInterpreter::MethodKind kind) { if (!InlineIntrinsics) return NULL; @@ -66,7 +66,7 @@ address InterpreterGenerator::generate_math_entry( return NULL; } -address InterpreterGenerator::generate_abstract_entry() { +address CppInterpreterGenerator::generate_abstract_entry() { return generate_entry((address) ShouldNotCallThisEntry()); } diff --git a/hotspot/src/cpu/zero/vm/interpreter_zero.hpp b/hotspot/src/cpu/zero/vm/interpreter_zero.hpp deleted file mode 100644 index 59900fe254f..00000000000 --- a/hotspot/src/cpu/zero/vm/interpreter_zero.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. - * Copyright 2007, 2008 Red Hat, Inc. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_ZERO_VM_INTERPRETER_ZERO_HPP -#define CPU_ZERO_VM_INTERPRETER_ZERO_HPP - - public: - static void invoke_method(Method* method, address entry_point, TRAPS) { - ((ZeroEntry *) entry_point)->invoke(method, THREAD); - } - static void invoke_osr(Method* method, - address entry_point, - address osr_buf, - TRAPS) { - ((ZeroEntry *) entry_point)->invoke_osr(method, osr_buf, THREAD); - } - - public: - static int expr_index_at(int i) { - return stackElementWords * i; - } - - static int expr_offset_in_bytes(int i) { - return stackElementSize * i; - } - - static int local_index_at(int i) { - assert(i <= 0, "local direction already negated"); - return stackElementWords * i; - } - -#endif // CPU_ZERO_VM_INTERPRETER_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/methodHandles_zero.cpp b/hotspot/src/cpu/zero/vm/methodHandles_zero.cpp index a9c651c81f8..0fce3b50b07 100644 --- a/hotspot/src/cpu/zero/vm/methodHandles_zero.cpp +++ b/hotspot/src/cpu/zero/vm/methodHandles_zero.cpp @@ -24,7 +24,7 @@ */ #include "precompiled.hpp" -#include "interpreter/interpreterGenerator.hpp" +#include "interpreter/cppInterpreterGenerator.hpp" #include "interpreter/interpreter.hpp" #include "memory/allocation.inline.hpp" #include "oops/oop.inline.hpp" @@ -167,16 +167,16 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler* // Perhaps surprisingly, the symbolic references visible to Java are not directly used. // They are linked to Java-generated adapters via MethodHandleNatives.linkMethod. // They all allow an appendix argument. - return InterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_invalid); + return CppInterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_invalid); case vmIntrinsics::_invokeBasic: - return InterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_invokeBasic); + return CppInterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_invokeBasic); case vmIntrinsics::_linkToStatic: case vmIntrinsics::_linkToSpecial: - return InterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_linkToStaticOrSpecial); + return CppInterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_linkToStaticOrSpecial); case vmIntrinsics::_linkToInterface: - return InterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_linkToInterface); + return CppInterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_linkToInterface); case vmIntrinsics::_linkToVirtual: - return InterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_linkToVirtual); + return CppInterpreterGenerator::generate_entry_impl(masm, (address) MethodHandles::method_handle_entry_linkToVirtual); default: ShouldNotReachHere(); return NULL; diff --git a/hotspot/src/cpu/zero/vm/templateInterpreterGenerator_zero.hpp b/hotspot/src/cpu/zero/vm/templateInterpreterGenerator_zero.hpp deleted file mode 100644 index 1747bc6ea26..00000000000 --- a/hotspot/src/cpu/zero/vm/templateInterpreterGenerator_zero.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2009 Red Hat, Inc. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_ZERO_VM_TEMPLATEINTERPRETERGENERATOR_ZERO_HPP -#define CPU_ZERO_VM_TEMPLATEINTERPRETERGENERATOR_ZERO_HPP - -// This file is intentionally empty - -#endif // CPU_ZERO_VM_TEMPLATEINTERPRETERGENERATOR_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/templateInterpreter_zero.cpp b/hotspot/src/cpu/zero/vm/templateInterpreter_zero.cpp deleted file mode 100644 index abc58143bdf..00000000000 --- a/hotspot/src/cpu/zero/vm/templateInterpreter_zero.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - * Copyright 2009 Red Hat, Inc. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "asm/assembler.hpp" -#include "interpreter/bytecodeHistogram.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "interpreter/templateTable.hpp" -#include "oops/arrayOop.hpp" -#include "oops/methodData.hpp" -#include "oops/method.hpp" -#include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "prims/jvmtiThreadState.hpp" -#include "runtime/arguments.hpp" -#include "runtime/deoptimization.hpp" -#include "runtime/frame.inline.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/stubRoutines.hpp" -#include "runtime/synchronizer.hpp" -#include "runtime/timer.hpp" -#include "runtime/vframeArray.hpp" -#include "utilities/debug.hpp" - -// This file is intentionally empty diff --git a/hotspot/src/cpu/zero/vm/templateInterpreter_zero.hpp b/hotspot/src/cpu/zero/vm/templateInterpreter_zero.hpp deleted file mode 100644 index fb0e266a3a9..00000000000 --- a/hotspot/src/cpu/zero/vm/templateInterpreter_zero.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2009 Red Hat, Inc. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_ZERO_VM_TEMPLATEINTERPRETER_ZERO_HPP -#define CPU_ZERO_VM_TEMPLATEINTERPRETER_ZERO_HPP - -// This file is intentionally empty - -#endif // CPU_ZERO_VM_TEMPLATEINTERPRETER_ZERO_HPP diff --git a/hotspot/src/cpu/zero/vm/templateTable_zero.cpp b/hotspot/src/cpu/zero/vm/templateTable_zero.cpp deleted file mode 100644 index 13016b2d58f..00000000000 --- a/hotspot/src/cpu/zero/vm/templateTable_zero.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. - * Copyright 2009 Red Hat, Inc. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "interpreter/interpreter.hpp" -#include "interpreter/interpreterRuntime.hpp" -#include "interpreter/templateTable.hpp" -#include "memory/universe.inline.hpp" -#include "oops/methodData.hpp" -#include "oops/objArrayKlass.hpp" -#include "oops/oop.inline.hpp" -#include "prims/methodHandles.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/stubRoutines.hpp" -#include "runtime/synchronizer.hpp" - -// This file is intentionally empty diff --git a/hotspot/src/cpu/zero/vm/templateTable_zero.hpp b/hotspot/src/cpu/zero/vm/templateTable_zero.hpp deleted file mode 100644 index 6fc38560522..00000000000 --- a/hotspot/src/cpu/zero/vm/templateTable_zero.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2009 Red Hat, Inc. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef CPU_ZERO_VM_TEMPLATETABLE_ZERO_HPP -#define CPU_ZERO_VM_TEMPLATETABLE_ZERO_HPP - -// This file is intentionally empty - -#endif // CPU_ZERO_VM_TEMPLATETABLE_ZERO_HPP diff --git a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp index e43d42d2d6d..62d1947e227 100644 --- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp @@ -48,22 +48,13 @@ // Also code for populating interpreter // frames created during deoptimization. // -// For both template and c++ interpreter. There are common files for aspects of the interpreter -// that are generic to both interpreters. This is the layout: -// -// abstractInterpreter.hpp: generic description of the interpreter. -// interpreter*: generic frame creation and handling. -// - -//------------------------------------------------------------------------------------------------------------------------ -// The C++ interface to the bytecode interpreter(s). class InterpreterMacroAssembler; class AbstractInterpreter: AllStatic { friend class VMStructs; - friend class Interpreter; friend class CppInterpreterGenerator; + friend class TemplateInterpreterGenerator; public: enum MethodKind { zerolocals, // method needs locals initialization @@ -128,7 +119,6 @@ class AbstractInterpreter: AllStatic { static address _rethrow_exception_entry; // rethrows an activation in previous frame friend class AbstractInterpreterGenerator; - friend class InterpreterGenerator; friend class InterpreterMacroAssembler; public: @@ -213,6 +203,29 @@ class AbstractInterpreter: AllStatic { const static int stackElementSize = stackElementWords * wordSize; const static int logStackElementSize = LogBytesPerWord; + static int expr_index_at(int i) { + return stackElementWords * i; + } + + static int expr_offset_in_bytes(int i) { +#if !defined(ZERO) && (defined(PPC) || defined(SPARC)) + return stackElementSize * i + wordSize; // both point to one word past TOS +#else + return stackElementSize * i; +#endif + } + + static int local_index_at(int i) { + assert(i <= 0, "local direction already negated"); + return stackElementWords * i; + } + +#if !defined(ZERO) && (defined(IA32) || defined(AMD64)) + static Address::ScaleFactor stackElementScale() { + return NOT_LP64(Address::times_4) LP64_ONLY(Address::times_8); + } +#endif + // Local values relative to locals[n] static int local_offset_in_bytes(int n) { return ((frame::interpreter_frame_expression_stack_direction() * n) * stackElementSize); diff --git a/hotspot/src/share/vm/interpreter/bytecodeHistogram.hpp b/hotspot/src/share/vm/interpreter/bytecodeHistogram.hpp index 51798d1f078..8658f519f21 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeHistogram.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodeHistogram.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -59,7 +59,6 @@ class BytecodeHistogram: AllStatic { NOT_PRODUCT(static int _counters[Bytecodes::number_of_codes];) // a counter for each bytecode friend class TemplateInterpreterGenerator; - friend class InterpreterGenerator; friend class BytecodeInterpreter; public: @@ -87,7 +86,6 @@ class BytecodePairHistogram: AllStatic { NOT_PRODUCT(static int _counters[number_of_pairs];) // a counter for each pair friend class TemplateInterpreterGenerator; - friend class InterpreterGenerator; public: // Initialization diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp index 45e008408de..f7121d0309b 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -79,7 +79,6 @@ class BytecodeInterpreter : StackObj { friend class SharedRuntime; friend class AbstractInterpreterGenerator; friend class CppInterpreterGenerator; -friend class InterpreterGenerator; friend class InterpreterMacroAssembler; friend class frame; friend class VMStructs; @@ -572,24 +571,10 @@ static const char* C_msg(BytecodeInterpreter::messages msg); void print(); #endif // PRODUCT - // Platform fields/methods -#ifdef TARGET_ARCH_x86 -# include "bytecodeInterpreter_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytecodeInterpreter_sparc.hpp" -#endif #ifdef TARGET_ARCH_zero # include "bytecodeInterpreter_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytecodeInterpreter_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytecodeInterpreter_ppc.hpp" -#endif -#ifdef TARGET_ARCH_aarch64 -# include "bytecodeInterpreter_aarch64.hpp" +#else +#error "Only Zero Bytecode Interpreter is supported" #endif diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp index 2f1bf00d9af..fcc8f5e976f 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,24 +42,10 @@ #define VERIFY_OOP(o) #endif -// Platform dependent data manipulation -#ifdef TARGET_ARCH_x86 -# include "bytecodeInterpreter_x86.inline.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "bytecodeInterpreter_sparc.inline.hpp" -#endif #ifdef TARGET_ARCH_zero # include "bytecodeInterpreter_zero.inline.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "bytecodeInterpreter_arm.inline.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "bytecodeInterpreter_ppc.inline.hpp" -#endif -#ifdef TARGET_ARCH_aarch64 -# include "bytecodeInterpreter_aarch64.inline.hpp" +#else +#error "Only Zero Bytecode Interpreter is supported" #endif #endif // CC_INTERP diff --git a/hotspot/src/share/vm/interpreter/cppInterpreter.cpp b/hotspot/src/share/vm/interpreter/cppInterpreter.cpp index c154a746f4d..318dbd9a74a 100644 --- a/hotspot/src/share/vm/interpreter/cppInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/cppInterpreter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,12 +24,17 @@ #include "precompiled.hpp" #include "interpreter/bytecodeInterpreter.hpp" +#include "interpreter/cppInterpreterGenerator.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #ifdef CC_INTERP -# define __ _masm-> + +#ifdef ZERO +# include "entry_zero.hpp" +#else +#error "Only Zero CppInterpreter is supported" +#endif void CppInterpreter::initialize() { if (_code != NULL) return; @@ -42,7 +47,7 @@ void CppInterpreter::initialize() { NOT_PRODUCT(code_size *= 4;) // debug uses extra interpreter code space _code = new StubQueue(new InterpreterCodeletInterface, code_size, NULL, "Interpreter"); - InterpreterGenerator g(_code); + CppInterpreterGenerator g(_code); if (PrintInterpreter) print(); } @@ -56,11 +61,20 @@ void CppInterpreter::initialize() { } -address CppInterpreter::_tosca_to_stack [AbstractInterpreter::number_of_result_handlers]; -address CppInterpreter::_stack_to_stack [AbstractInterpreter::number_of_result_handlers]; -address CppInterpreter::_stack_to_native_abi [AbstractInterpreter::number_of_result_handlers]; +void CppInterpreter::invoke_method(Method* method, address entry_point, TRAPS) { + ((ZeroEntry *) entry_point)->invoke(method, THREAD); +} + +void CppInterpreter::invoke_osr(Method* method, + address entry_point, + address osr_buf, + TRAPS) { + ((ZeroEntry *) entry_point)->invoke_osr(method, osr_buf, THREAD); +} + CppInterpreterGenerator::CppInterpreterGenerator(StubQueue* _code): AbstractInterpreterGenerator(_code) { + generate_all(); } static const BasicType types[Interpreter::number_of_result_handlers] = { @@ -79,36 +93,8 @@ static const BasicType types[Interpreter::number_of_result_handlers] = { void CppInterpreterGenerator::generate_all() { AbstractInterpreterGenerator::generate_all(); - { CodeletMark cm(_masm, "result handlers for native calls"); - // The various result converter stublets. - int is_generated[Interpreter::number_of_result_handlers]; - memset(is_generated, 0, sizeof(is_generated)); - int _tosca_to_stack_is_generated[Interpreter::number_of_result_handlers]; - int _stack_to_stack_is_generated[Interpreter::number_of_result_handlers]; - int _stack_to_native_abi_is_generated[Interpreter::number_of_result_handlers]; - memset(_tosca_to_stack_is_generated, 0, sizeof(_tosca_to_stack_is_generated)); - memset(_stack_to_stack_is_generated, 0, sizeof(_stack_to_stack_is_generated)); - memset(_stack_to_native_abi_is_generated, 0, sizeof(_stack_to_native_abi_is_generated)); - for (int i = 0; i < Interpreter::number_of_result_handlers; i++) { - BasicType type = types[i]; - if (!is_generated[Interpreter::BasicType_as_index(type)]++) { - Interpreter::_native_abi_to_tosca[Interpreter::BasicType_as_index(type)] = generate_result_handler_for(type); - } - if (!_tosca_to_stack_is_generated[Interpreter::BasicType_as_index(type)]++) { - Interpreter::_tosca_to_stack[Interpreter::BasicType_as_index(type)] = generate_tosca_to_stack_converter(type); - } - if (!_stack_to_stack_is_generated[Interpreter::BasicType_as_index(type)]++) { - Interpreter::_stack_to_stack[Interpreter::BasicType_as_index(type)] = generate_stack_to_stack_converter(type); - } - if (!_stack_to_native_abi_is_generated[Interpreter::BasicType_as_index(type)]++) { - Interpreter::_stack_to_native_abi[Interpreter::BasicType_as_index(type)] = generate_stack_to_native_abi_converter(type); - } - } - } - - -#define method_entry(kind) Interpreter::_entry_table[Interpreter::kind] = ((InterpreterGenerator*)this)->generate_method_entry(Interpreter::kind) +#define method_entry(kind) Interpreter::_entry_table[Interpreter::kind] = generate_method_entry(Interpreter::kind) { CodeletMark cm(_masm, "(kind = frame_manager)"); // all non-native method kinds @@ -138,7 +124,63 @@ void CppInterpreterGenerator::generate_all() { #undef method_entry - } +InterpreterCodelet* CppInterpreter::codelet_containing(address pc) { + // FIXME: I'm pretty sure _code is null and this is never called, which is why it's copied. + return (InterpreterCodelet*)_code->stub_containing(pc); +} + +// Generate method entries +address CppInterpreterGenerator::generate_method_entry( + AbstractInterpreter::MethodKind kind) { + // determine code generation flags + bool native = false; + bool synchronized = false; + address entry_point = NULL; + + switch (kind) { + case Interpreter::zerolocals : break; + case Interpreter::zerolocals_synchronized: synchronized = true; break; + case Interpreter::native : native = true; break; + case Interpreter::native_synchronized : native = true; synchronized = true; break; + case Interpreter::empty : entry_point = generate_empty_entry(); break; + case Interpreter::accessor : entry_point = generate_accessor_entry(); break; + case Interpreter::abstract : entry_point = generate_abstract_entry(); break; + + case Interpreter::java_lang_math_sin : // fall thru + case Interpreter::java_lang_math_cos : // fall thru + case Interpreter::java_lang_math_tan : // fall thru + case Interpreter::java_lang_math_abs : // fall thru + case Interpreter::java_lang_math_log : // fall thru + case Interpreter::java_lang_math_log10 : // fall thru + case Interpreter::java_lang_math_sqrt : // fall thru + case Interpreter::java_lang_math_pow : // fall thru + case Interpreter::java_lang_math_exp : entry_point = generate_math_entry(kind); break; + case Interpreter::java_lang_ref_reference_get + : entry_point = generate_Reference_get_entry(); break; + default: + fatal("unexpected method kind: %d", kind); + break; + } + + if (entry_point) { + return entry_point; + } + + // We expect the normal and native entry points to be generated first so we can reuse them. + if (native) { + entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::native_synchronized : Interpreter::native); + if (entry_point == NULL) { + entry_point = generate_native_entry(synchronized); + } + } else { + entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::zerolocals_synchronized : Interpreter::zerolocals); + if (entry_point == NULL) { + entry_point = generate_normal_entry(synchronized); + } + } + + return entry_point; +} #endif // CC_INTERP diff --git a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp index 3a3913348d7..3d90155bd9c 100644 --- a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,40 +26,24 @@ #define SHARE_VM_INTERPRETER_CPPINTERPRETER_HPP #include "interpreter/abstractInterpreter.hpp" - #ifdef CC_INTERP +class InterpreterCodelet; + // This file contains the platform-independent parts // of the c++ interpreter class CppInterpreter: public AbstractInterpreter { friend class VMStructs; - friend class Interpreter; // contains() - friend class InterpreterGenerator; // result handlers - friend class CppInterpreterGenerator; // result handlers - public: - - - protected: - - // tosca result -> stack result - static address _tosca_to_stack[number_of_result_handlers]; // converts tosca to C++ interpreter stack result - // stack result -> stack result - static address _stack_to_stack[number_of_result_handlers]; // pass result between C++ interpreter calls - // stack result -> native abi result - static address _stack_to_native_abi[number_of_result_handlers]; // converts C++ interpreter results to native abi - - // this is to allow frame and only frame to use contains(). - friend class frame; - public: // Initialization/debugging static void initialize(); // this only returns whether a pc is within generated code for the interpreter. - // This is a moderately dubious interface for the c++ interpreter. Only + // These are moderately dubious interfaces for the c++ interpreter. Only // frame code and debug.cpp should be using it. static bool contains(address pc); + static InterpreterCodelet* codelet_containing(address pc); public: @@ -68,38 +52,17 @@ class CppInterpreter: public AbstractInterpreter { static void notice_safepoints() {} static void ignore_safepoints() {} - static address native_result_to_tosca() { return (address)_native_abi_to_tosca; } // aka result handler - static address tosca_result_to_stack() { return (address)_tosca_to_stack; } - static address stack_result_to_stack() { return (address)_stack_to_stack; } - static address stack_result_to_native() { return (address)_stack_to_native_abi; } - - static address native_result_to_tosca(int index) { return _native_abi_to_tosca[index]; } // aka result handler - static address tosca_result_to_stack(int index) { return _tosca_to_stack[index]; } - static address stack_result_to_stack(int index) { return _stack_to_stack[index]; } - static address stack_result_to_native(int index) { return _stack_to_native_abi[index]; } - static address return_entry (TosState state, int length, Bytecodes::Code code); static address deopt_entry (TosState state, int length); -#ifdef TARGET_ARCH_x86 -# include "cppInterpreter_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "cppInterpreter_sparc.hpp" -#endif + static void invoke_method(Method* method, address entry_point, TRAPS); + static void invoke_osr(Method* method, + address entry_point, + address osr_buf, + TRAPS); #ifdef TARGET_ARCH_zero # include "cppInterpreter_zero.hpp" #endif -#ifdef TARGET_ARCH_arm -# include "cppInterpreter_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "cppInterpreter_ppc.hpp" -#endif -#ifdef TARGET_ARCH_aarch64 -# include "cppInterpreter_aarch64.hpp" -#endif - }; diff --git a/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp index 92db9351b0c..69072c7f50c 100644 --- a/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp +++ b/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,46 +29,48 @@ // of the template interpreter generator. #ifdef CC_INTERP -#ifdef TARGET_ARCH_zero +#ifdef ZERO # include "entry_zero.hpp" # include "interpreter/interp_masm.hpp" #endif class CppInterpreterGenerator: public AbstractInterpreterGenerator { - protected: - // shared code sequences - // Converter for native abi result to tosca result - address generate_result_handler_for(BasicType type); - address generate_tosca_to_stack_converter(BasicType type); - address generate_stack_to_stack_converter(BasicType type); - address generate_stack_to_native_abi_converter(BasicType type); + private: void generate_all(); + address generate_method_entry(AbstractInterpreter::MethodKind kind); + address generate_normal_entry(bool synchronized); + address generate_native_entry(bool synchronized); + address generate_abstract_entry(); + address generate_math_entry(AbstractInterpreter::MethodKind kind); + address generate_empty_entry(); + address generate_accessor_entry(); + address generate_Reference_get_entry(); + public: CppInterpreterGenerator(StubQueue* _code); -#ifdef TARGET_ARCH_x86 -# include "cppInterpreterGenerator_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "cppInterpreterGenerator_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "cppInterpreterGenerator_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "cppInterpreterGenerator_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "cppInterpreterGenerator_ppc.hpp" -#endif -#ifdef TARGET_ARCH_aarch64 -# include "cppInterpreterGenerator_aarch64.hpp" -#endif +#ifdef ZERO + protected: + MacroAssembler* assembler() const { + return _masm; + } + public: + static address generate_entry_impl(MacroAssembler* masm, address entry_point) { + ZeroEntry *entry = (ZeroEntry *) masm->pc(); + masm->advance(sizeof(ZeroEntry)); + entry->set_entry_point(entry_point); + return (address) entry; + } + + protected: + address generate_entry(address entry_point) { + return generate_entry_impl(assembler(), entry_point); + } +#endif // ZERO }; #endif // CC_INTERP - #endif // SHARE_VM_INTERPRETER_CPPINTERPRETERGENERATOR_HPP diff --git a/hotspot/src/share/vm/interpreter/interpreter.cpp b/hotspot/src/share/vm/interpreter/interpreter.cpp index a8a71c4c9a5..3101d3628f6 100644 --- a/hotspot/src/share/vm/interpreter/interpreter.cpp +++ b/hotspot/src/share/vm/interpreter/interpreter.cpp @@ -29,7 +29,6 @@ #include "interpreter/bytecodeHistogram.hpp" #include "interpreter/bytecodeInterpreter.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/interp_masm.hpp" #include "interpreter/templateTable.hpp" @@ -282,7 +281,7 @@ AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(methodHandle m) // Special intrinsic method? // Note: This test must come _after_ the test for native methods, // otherwise we will run into problems with JDK 1.2, see also - // InterpreterGenerator::generate_method_entry() for + // TemplateInterpreterGenerator::generate_method_entry() for // for details. switch (m->intrinsic_id()) { case vmIntrinsics::_dsin : return java_lang_math_sin ; @@ -548,87 +547,3 @@ void AbstractInterpreterGenerator::initialize_method_handle_entries() { Interpreter::_entry_table[kind] = Interpreter::_entry_table[Interpreter::abstract]; } } - -// Generate method entries -address InterpreterGenerator::generate_method_entry( - AbstractInterpreter::MethodKind kind) { - // determine code generation flags - bool native = false; - bool synchronized = false; - address entry_point = NULL; - - switch (kind) { - case Interpreter::zerolocals : break; - case Interpreter::zerolocals_synchronized: synchronized = true; break; - case Interpreter::native : native = true; break; - case Interpreter::native_synchronized : native = true; synchronized = true; break; - case Interpreter::empty : entry_point = generate_empty_entry(); break; - case Interpreter::accessor : entry_point = generate_accessor_entry(); break; - case Interpreter::abstract : entry_point = generate_abstract_entry(); break; - - case Interpreter::java_lang_math_sin : // fall thru - case Interpreter::java_lang_math_cos : // fall thru - case Interpreter::java_lang_math_tan : // fall thru - case Interpreter::java_lang_math_abs : // fall thru - case Interpreter::java_lang_math_log : // fall thru - case Interpreter::java_lang_math_log10 : // fall thru - case Interpreter::java_lang_math_sqrt : // fall thru - case Interpreter::java_lang_math_pow : // fall thru - case Interpreter::java_lang_math_exp : entry_point = generate_math_entry(kind); break; - case Interpreter::java_lang_ref_reference_get - : entry_point = generate_Reference_get_entry(); break; -#ifndef CC_INTERP - case Interpreter::java_util_zip_CRC32_update - : native = true; entry_point = generate_CRC32_update_entry(); break; - case Interpreter::java_util_zip_CRC32_updateBytes - : // fall thru - case Interpreter::java_util_zip_CRC32_updateByteBuffer - : native = true; entry_point = generate_CRC32_updateBytes_entry(kind); break; - case Interpreter::java_util_zip_CRC32C_updateBytes - : // fall thru - case Interpreter::java_util_zip_CRC32C_updateDirectByteBuffer - : entry_point = generate_CRC32C_updateBytes_entry(kind); break; -#if defined(TARGET_ARCH_x86) && !defined(_LP64) - // On x86_32 platforms, a special entry is generated for the following four methods. - // On other platforms the normal entry is used to enter these methods. - case Interpreter::java_lang_Float_intBitsToFloat - : native = true; entry_point = generate_Float_intBitsToFloat_entry(); break; - case Interpreter::java_lang_Float_floatToRawIntBits - : native = true; entry_point = generate_Float_floatToRawIntBits_entry(); break; - case Interpreter::java_lang_Double_longBitsToDouble - : native = true; entry_point = generate_Double_longBitsToDouble_entry(); break; - case Interpreter::java_lang_Double_doubleToRawLongBits - : native = true; entry_point = generate_Double_doubleToRawLongBits_entry(); break; -#else - case Interpreter::java_lang_Float_intBitsToFloat: - case Interpreter::java_lang_Float_floatToRawIntBits: - case Interpreter::java_lang_Double_longBitsToDouble: - case Interpreter::java_lang_Double_doubleToRawLongBits: - native = true; - break; -#endif // defined(TARGET_ARCH_x86) && !defined(_LP64) -#endif // CC_INTERP - default: - fatal("unexpected method kind: %d", kind); - break; - } - - if (entry_point) { - return entry_point; - } - - // We expect the normal and native entry points to be generated first so we can reuse them. - if (native) { - entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::native_synchronized : Interpreter::native); - if (entry_point == NULL) { - entry_point = generate_native_entry(synchronized); - } - } else { - entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::zerolocals_synchronized : Interpreter::zerolocals); - if (entry_point == NULL) { - entry_point = generate_normal_entry(synchronized); - } - } - - return entry_point; -} diff --git a/hotspot/src/share/vm/interpreter/interpreter.hpp b/hotspot/src/share/vm/interpreter/interpreter.hpp index c83294a6cdc..d61166b745d 100644 --- a/hotspot/src/share/vm/interpreter/interpreter.hpp +++ b/hotspot/src/share/vm/interpreter/interpreter.hpp @@ -29,9 +29,6 @@ #include "interpreter/cppInterpreter.hpp" #include "interpreter/templateInterpreter.hpp" #include "memory/resourceArea.hpp" -#ifdef TARGET_ARCH_zero -# include "entry_zero.hpp" -#endif // This file contains the platform-independent parts // of the interpreter and the interpreter generator. @@ -116,34 +113,9 @@ class CodeletMark: ResourceMark { ~CodeletMark(); }; -// Wrapper classes to produce Interpreter/InterpreterGenerator from either +// Wrapper typedef to use the name Interpreter to mean either // the c++ interpreter or the template interpreter. -class Interpreter: public CC_INTERP_ONLY(CppInterpreter) NOT_CC_INTERP(TemplateInterpreter) { - - public: - // Debugging/printing - static InterpreterCodelet* codelet_containing(address pc) { return (InterpreterCodelet*)_code->stub_containing(pc); } - -#ifdef TARGET_ARCH_x86 -# include "interpreter_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "interpreter_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "interpreter_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "interpreter_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "interpreter_ppc.hpp" -#endif -#ifdef TARGET_ARCH_aarch64 -# include "interpreter_aarch64.hpp" -#endif - -}; +typedef CC_INTERP_ONLY(CppInterpreter) NOT_CC_INTERP(TemplateInterpreter) Interpreter; #endif // SHARE_VM_INTERPRETER_INTERPRETER_HPP diff --git a/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp deleted file mode 100644 index fab133108bd..00000000000 --- a/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef SHARE_VM_INTERPRETER_INTERPRETERGENERATOR_HPP -#define SHARE_VM_INTERPRETER_INTERPRETERGENERATOR_HPP - -#include "interpreter/cppInterpreter.hpp" -#include "interpreter/cppInterpreterGenerator.hpp" -#include "interpreter/interp_masm.hpp" -#include "interpreter/templateInterpreter.hpp" -#include "interpreter/templateInterpreterGenerator.hpp" - -// This file contains the platform-independent parts -// of the interpreter generator. - - -class InterpreterGenerator: public CC_INTERP_ONLY(CppInterpreterGenerator) - NOT_CC_INTERP(TemplateInterpreterGenerator) { - - public: - - InterpreterGenerator(StubQueue* _code); - // entry point generator - address generate_method_entry(AbstractInterpreter::MethodKind kind); - -#ifdef TARGET_ARCH_x86 -# include "interpreterGenerator_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "interpreterGenerator_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "interpreterGenerator_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "interpreterGenerator_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "interpreterGenerator_ppc.hpp" -#endif -#ifdef TARGET_ARCH_aarch64 -# include "interpreterGenerator_aarch64.hpp" -#endif - - -}; - -#endif // SHARE_VM_INTERPRETER_INTERPRETERGENERATOR_HPP diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp index 8bf2722442a..8212ccc1f59 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp @@ -115,7 +115,7 @@ class InterpreterRuntime: AllStatic { static void note_rangeCheck_trap(JavaThread* thread, Method *method, int trap_bci); static void note_classCheck_trap(JavaThread* thread, Method *method, int trap_bci); static void note_arrayCheck_trap(JavaThread* thread, Method *method, int trap_bci); - // A dummy for makros that shall not profile traps. + // A dummy for macros that shall not profile traps. static void note_no_trap(JavaThread* thread, Method *method, int trap_bci) {} #endif // CC_INTERP diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp index 73beefc6766..96e8faeafa8 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp @@ -25,10 +25,10 @@ #include "precompiled.hpp" #include "code/codeCacheExtensions.hpp" #include "interpreter/interpreter.hpp" -#include "interpreter/interpreterGenerator.hpp" #include "interpreter/interpreterRuntime.hpp" #include "interpreter/interp_masm.hpp" #include "interpreter/templateInterpreter.hpp" +#include "interpreter/templateInterpreterGenerator.hpp" #include "interpreter/templateTable.hpp" #ifndef CC_INTERP @@ -59,7 +59,7 @@ void TemplateInterpreter::initialize() { #endif _code = new StubQueue(new InterpreterCodeletInterface, code_size, NULL, "Interpreter"); - InterpreterGenerator g(_code); + TemplateInterpreterGenerator g(_code); } if (PrintInterpreter) { if (CodeCacheExtensions::saving_generated_interpreter() && @@ -222,6 +222,7 @@ address TemplateInterpreter::_wentry_point[DispatchTable::length]; TemplateInterpreterGenerator::TemplateInterpreterGenerator(StubQueue* _code): AbstractInterpreterGenerator(_code) { _unimplemented_bytecode = NULL; _illegal_bytecode_sequence = NULL; + generate_all(); } static const BasicType types[Interpreter::number_of_result_handlers] = { @@ -392,7 +393,7 @@ void TemplateInterpreterGenerator::generate_all() { #define method_entry(kind) \ { CodeletMark cm(_masm, "method entry point (kind = " #kind ")"); \ - Interpreter::_entry_table[Interpreter::kind] = ((InterpreterGenerator*)this)->generate_method_entry(Interpreter::kind); \ + Interpreter::_entry_table[Interpreter::kind] = generate_method_entry(Interpreter::kind); \ } // all non-native method kinds @@ -719,4 +720,89 @@ bool TemplateInterpreter::bytecode_should_reexecute(Bytecodes::Code code) { } } +InterpreterCodelet* TemplateInterpreter::codelet_containing(address pc) { + return (InterpreterCodelet*)_code->stub_containing(pc); +} + +// Generate method entries +address TemplateInterpreterGenerator::generate_method_entry( + AbstractInterpreter::MethodKind kind) { + // determine code generation flags + bool native = false; + bool synchronized = false; + address entry_point = NULL; + + switch (kind) { + case Interpreter::zerolocals : break; + case Interpreter::zerolocals_synchronized: synchronized = true; break; + case Interpreter::native : native = true; break; + case Interpreter::native_synchronized : native = true; synchronized = true; break; + case Interpreter::empty : break; + case Interpreter::accessor : break; + case Interpreter::abstract : entry_point = generate_abstract_entry(); break; + + case Interpreter::java_lang_math_sin : // fall thru + case Interpreter::java_lang_math_cos : // fall thru + case Interpreter::java_lang_math_tan : // fall thru + case Interpreter::java_lang_math_abs : // fall thru + case Interpreter::java_lang_math_log : // fall thru + case Interpreter::java_lang_math_log10 : // fall thru + case Interpreter::java_lang_math_sqrt : // fall thru + case Interpreter::java_lang_math_pow : // fall thru + case Interpreter::java_lang_math_exp : entry_point = generate_math_entry(kind); break; + case Interpreter::java_lang_ref_reference_get + : entry_point = generate_Reference_get_entry(); break; + case Interpreter::java_util_zip_CRC32_update + : native = true; entry_point = generate_CRC32_update_entry(); break; + case Interpreter::java_util_zip_CRC32_updateBytes + : // fall thru + case Interpreter::java_util_zip_CRC32_updateByteBuffer + : native = true; entry_point = generate_CRC32_updateBytes_entry(kind); break; + case Interpreter::java_util_zip_CRC32C_updateBytes + : // fall thru + case Interpreter::java_util_zip_CRC32C_updateDirectByteBuffer + : entry_point = generate_CRC32C_updateBytes_entry(kind); break; +#ifdef IA32 + // On x86_32 platforms, a special entry is generated for the following four methods. + // On other platforms the normal entry is used to enter these methods. + case Interpreter::java_lang_Float_intBitsToFloat + : native = true; entry_point = generate_Float_intBitsToFloat_entry(); break; + case Interpreter::java_lang_Float_floatToRawIntBits + : native = true; entry_point = generate_Float_floatToRawIntBits_entry(); break; + case Interpreter::java_lang_Double_longBitsToDouble + : native = true; entry_point = generate_Double_longBitsToDouble_entry(); break; + case Interpreter::java_lang_Double_doubleToRawLongBits + : native = true; entry_point = generate_Double_doubleToRawLongBits_entry(); break; +#else + case Interpreter::java_lang_Float_intBitsToFloat: + case Interpreter::java_lang_Float_floatToRawIntBits: + case Interpreter::java_lang_Double_longBitsToDouble: + case Interpreter::java_lang_Double_doubleToRawLongBits: + native = true; + break; +#endif // defined(TARGET_ARCH_x86) && !defined(_LP64) + default: + fatal("unexpected method kind: %d", kind); + break; + } + + if (entry_point) { + return entry_point; + } + + // We expect the normal and native entry points to be generated first so we can reuse them. + if (native) { + entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::native_synchronized : Interpreter::native); + if (entry_point == NULL) { + entry_point = generate_native_entry(synchronized); + } + } else { + entry_point = Interpreter::entry_for_kind(synchronized ? Interpreter::zerolocals_synchronized : Interpreter::zerolocals); + if (entry_point == NULL) { + entry_point = generate_normal_entry(synchronized); + } + } + + return entry_point; +} #endif // !CC_INTERP diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp index 5c9f60d1414..8a5f4910283 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp @@ -34,6 +34,7 @@ #ifndef CC_INTERP class InterpreterMacroAssembler; +class InterpreterCodelet; //------------------------------------------------------------------------------------------------------------------------ // A little wrapper class to group tosca-specific entry points into a unit. @@ -85,7 +86,6 @@ class TemplateInterpreter: public AbstractInterpreter { friend class VMStructs; friend class InterpreterMacroAssembler; friend class TemplateInterpreterGenerator; - friend class InterpreterGenerator; friend class TemplateTable; friend class CodeCacheExtensions; // friend class Interpreter; @@ -137,6 +137,9 @@ class TemplateInterpreter: public AbstractInterpreter { static void initialize(); // this only returns whether a pc is within generated code for the interpreter. static bool contains(address pc) { return _code != NULL && _code->contains(pc); } + // Debugging/printing + static InterpreterCodelet* codelet_containing(address pc); + public: @@ -188,26 +191,15 @@ class TemplateInterpreter: public AbstractInterpreter { // Compute the address for reexecution static address deopt_reexecute_entry(Method* method, address bcp); -#ifdef TARGET_ARCH_x86 -# include "templateInterpreter_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "templateInterpreter_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "templateInterpreter_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "templateInterpreter_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "templateInterpreter_ppc.hpp" -#endif -#ifdef TARGET_ARCH_aarch64 -# include "templateInterpreter_aarch64.hpp" -#endif - + // Size of interpreter code. Max size with JVMTI + static int InterpreterCodeSize; +#ifdef PPC + public: + // PPC-only: Support abs and sqrt like in compiler. + // For others we can use a normal (native) entry. + static bool math_entry_available(AbstractInterpreter::MethodKind kind); +#endif }; #endif // !CC_INTERP diff --git a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp index e229485ce96..e53e6ac0211 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -82,29 +82,51 @@ class TemplateInterpreterGenerator: public AbstractInterpreterGenerator { void generate_all(); + // entry point generator + address generate_method_entry(AbstractInterpreter::MethodKind kind); + + address generate_normal_entry(bool synchronized); + address generate_native_entry(bool synchronized); + address generate_abstract_entry(void); + address generate_math_entry(AbstractInterpreter::MethodKind kind); + address generate_Reference_get_entry(); + address generate_CRC32_update_entry(); + address generate_CRC32_updateBytes_entry(AbstractInterpreter::MethodKind kind); + address generate_CRC32C_updateBytes_entry(AbstractInterpreter::MethodKind kind); +#ifdef IA32 + address generate_Float_intBitsToFloat_entry(); + address generate_Float_floatToRawIntBits_entry(); + address generate_Double_longBitsToDouble_entry(); + address generate_Double_doubleToRawLongBits_entry(); +#endif // IA32 + void generate_stack_overflow_check(void); + + void generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue); + void generate_counter_overflow(Label& continue_entry); + + void generate_fixed_frame(bool native_call); +#ifdef SPARC + void generate_stack_overflow_check(Register Rframe_size, Register Rscratch, + Register Rscratch2); + void save_native_result(void); + void restore_native_result(void); +#endif // SPARC + +#ifdef AARCH64 + void bang_stack_shadow_pages(bool native_call); + void generate_transcendental_entry(AbstractInterpreter::MethodKind kind, int fpargs); +#endif // AARCH64 + +#ifdef PPC + void lock_method(Register Rflags, Register Rscratch1, Register Rscratch2, bool flags_preloaded=false); + void unlock_method(bool check_exceptions = true); + + void generate_fixed_frame(bool native_call, Register Rsize_of_parameters, Register Rsize_of_locals); + void generate_stack_overflow_check(Register Rframe_size, Register Rscratch1); +#endif // PPC + public: TemplateInterpreterGenerator(StubQueue* _code); - -#ifdef TARGET_ARCH_x86 -# include "templateInterpreterGenerator_x86.hpp" -#endif -#ifdef TARGET_ARCH_sparc -# include "templateInterpreterGenerator_sparc.hpp" -#endif -#ifdef TARGET_ARCH_zero -# include "templateInterpreterGenerator_zero.hpp" -#endif -#ifdef TARGET_ARCH_arm -# include "templateInterpreterGenerator_arm.hpp" -#endif -#ifdef TARGET_ARCH_ppc -# include "templateInterpreterGenerator_ppc.hpp" -#endif -#ifdef TARGET_ARCH_aarch64 -# include "templateInterpreterGenerator_aarch64.hpp" -#endif - - }; #endif // !CC_INTERP diff --git a/hotspot/src/share/vm/interpreter/templateTable.hpp b/hotspot/src/share/vm/interpreter/templateTable.hpp index bd4a76493d9..e32b37afe6c 100644 --- a/hotspot/src/share/vm/interpreter/templateTable.hpp +++ b/hotspot/src/share/vm/interpreter/templateTable.hpp @@ -355,8 +355,6 @@ class TemplateTable: AllStatic { # include "templateTable_x86.hpp" #elif defined TARGET_ARCH_MODEL_sparc # include "templateTable_sparc.hpp" -#elif defined TARGET_ARCH_MODEL_zero -# include "templateTable_zero.hpp" #elif defined TARGET_ARCH_MODEL_ppc_64 # include "templateTable_ppc_64.hpp" #elif defined TARGET_ARCH_MODEL_aarch64 diff --git a/hotspot/src/share/vm/prims/methodHandles.hpp b/hotspot/src/share/vm/prims/methodHandles.hpp index ab41c31b4a3..ad3a6aefcc8 100644 --- a/hotspot/src/share/vm/prims/methodHandles.hpp +++ b/hotspot/src/share/vm/prims/methodHandles.hpp @@ -31,6 +31,12 @@ #include "runtime/globals.hpp" #include "runtime/interfaceSupport.hpp" +#ifdef TARGET_ARCH_zero +# include "entry_zero.hpp" +#endif + + + class MacroAssembler; class Label; diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index fe8dbf1b183..915e4c2b6ad 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -4197,7 +4197,7 @@ jint Arguments::apply_ergo() { UseBiasedLocking = false; } -#ifdef ZERO +#ifdef CC_INTERP // Clear flags not supported on zero. FLAG_SET_DEFAULT(ProfileInterpreter, false); FLAG_SET_DEFAULT(UseBiasedLocking, false); diff --git a/hotspot/src/share/vm/runtime/frame.inline.hpp b/hotspot/src/share/vm/runtime/frame.inline.hpp index eee2833341a..79ba0f98850 100644 --- a/hotspot/src/share/vm/runtime/frame.inline.hpp +++ b/hotspot/src/share/vm/runtime/frame.inline.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,13 +50,6 @@ inline bool frame::is_first_frame() const { return is_entry_frame() && entry_frame_is_first(); } -#ifdef CC_INTERP -inline oop* frame::interpreter_frame_temp_oop_addr() const { - interpreterState istate = get_interpreterState(); - return (oop *)&istate->_oop_temp; -} -#endif // CC_INTERP - // here are the platform-dependent bodies: #ifdef TARGET_ARCH_x86 diff --git a/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp b/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp index fa3c279e001..72c1fec5135 100644 --- a/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp +++ b/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,6 @@ friend class Runtime1; friend class StubAssembler; friend class CallRuntimeDirectNode; friend class MacroAssembler; -friend class InterpreterGenerator; friend class LIR_Assembler; friend class GraphKit; friend class StubGenerator; From 7973ef05b350b979a6768324c43e7ebc806a877b Mon Sep 17 00:00:00 2001 From: Rachel Protacio Date: Tue, 22 Dec 2015 16:29:48 -0500 Subject: [PATCH 128/146] 8141211: Convert TraceExceptions to Unified Logging The -XX:+TraceExceptions flag has been updated to the unified logging framework, i.e. -Xlog:exceptions. The old flag, because it is product-level, has been aliased to the UL option. Reviewed-by: dholmes, coleenp, mockner --- hotspot/src/share/vm/c1/c1_Runtime1.cpp | 20 ++-- .../vm/interpreter/bytecodeInterpreter.cpp | 31 +++--- .../vm/interpreter/interpreterRuntime.cpp | 23 +++-- hotspot/src/share/vm/jvmci/jvmciRuntime.cpp | 21 ++-- hotspot/src/share/vm/logging/logTag.hpp | 1 + hotspot/src/share/vm/opto/runtime.cpp | 38 ++++--- hotspot/src/share/vm/runtime/arguments.cpp | 2 + hotspot/src/share/vm/runtime/globals.hpp | 3 - hotspot/src/share/vm/runtime/thread.cpp | 28 +++--- hotspot/src/share/vm/utilities/exceptions.cpp | 14 ++- .../CommandLine/TraceExceptionsTest.java | 2 +- .../test/runtime/logging/ExceptionsTest.java | 98 +++++++++++++++++++ 12 files changed, 195 insertions(+), 86 deletions(-) create mode 100644 hotspot/test/runtime/logging/ExceptionsTest.java diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp index bfd902c9a0b..73cbdc53a50 100644 --- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp +++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp @@ -43,6 +43,7 @@ #include "gc/shared/collectedHeap.hpp" #include "interpreter/bytecode.hpp" #include "interpreter/interpreter.hpp" +#include "logging/log.hpp" #include "memory/allocation.inline.hpp" #include "memory/oopFactory.hpp" #include "memory/resourceArea.hpp" @@ -548,11 +549,14 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t // debugging support // tracing - if (TraceExceptions) { - ttyLocker ttyl; + if (log_is_enabled(Info, exceptions)) { ResourceMark rm; - tty->print_cr("Exception <%s> (" INTPTR_FORMAT ") thrown in compiled method <%s> at PC " INTPTR_FORMAT " for thread " INTPTR_FORMAT "", - exception->print_value_string(), p2i((address)exception()), nm->method()->print_value_string(), p2i(pc), p2i(thread)); + log_info(exceptions)("Exception <%s> (" INTPTR_FORMAT + ") thrown in compiled method <%s> at PC " INTPTR_FORMAT + " for thread " INTPTR_FORMAT, + exception->print_value_string(), + p2i((address)exception()), + nm->method()->print_value_string(), p2i(pc), p2i(thread)); } // for AbortVMOnException flag Exceptions::debug_check_abort(exception); @@ -583,11 +587,11 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t // Set flag if return address is a method handle call site. thread->set_is_method_handle_return(nm->is_method_handle_return(pc)); - if (TraceExceptions) { - ttyLocker ttyl; + if (log_is_enabled(Info, exceptions)) { ResourceMark rm; - tty->print_cr("Thread " PTR_FORMAT " continuing at PC " PTR_FORMAT " for exception thrown at PC " PTR_FORMAT, - p2i(thread), p2i(continuation), p2i(pc)); + log_info(exceptions)("Thread " PTR_FORMAT " continuing at PC " PTR_FORMAT + " for exception thrown at PC " PTR_FORMAT, + p2i(thread), p2i(continuation), p2i(pc)); } return continuation; diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp index 841d3012690..09e3d579ea0 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp @@ -31,6 +31,7 @@ #include "interpreter/bytecodeInterpreterProfiling.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/interpreterRuntime.hpp" +#include "logging/log.hpp" #include "memory/resourceArea.hpp" #include "oops/methodCounters.hpp" #include "oops/objArrayKlass.hpp" @@ -2778,14 +2779,15 @@ run: SET_STACK_OBJECT(except_oop(), 0); MORE_STACK(1); pc = METHOD->code_base() + continuation_bci; - if (TraceExceptions) { - ttyLocker ttyl; + if (log_is_enabled(Info, exceptions)) { ResourceMark rm; - tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")", except_oop->print_value_string(), p2i(except_oop())); - tty->print_cr(" thrown in interpreter method <%s>", METHOD->print_value_string()); - tty->print_cr(" at bci %d, continuing at %d for thread " INTPTR_FORMAT, - (int)(istate->bcp() - METHOD->code_base()), - (int)continuation_bci, p2i(THREAD)); + log_info(exceptions)("Exception <%s> (" INTPTR_FORMAT ")\n" + " thrown in interpreter method <%s>\n" + " at bci %d, continuing at %d for thread " INTPTR_FORMAT, + except_oop->print_value_string(), p2i(except_oop()), + METHOD->print_value_string(), + (int)(istate->bcp() - METHOD->code_base()), + (int)continuation_bci, p2i(THREAD)); } // for AbortVMOnException flag Exceptions::debug_check_abort(except_oop); @@ -2794,14 +2796,15 @@ run: BI_PROFILE_ALIGN_TO_CURRENT_BCI(); goto run; } - if (TraceExceptions) { - ttyLocker ttyl; + if (log_is_enabled(Info, exceptions)) { ResourceMark rm; - tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")", except_oop->print_value_string(), p2i(except_oop())); - tty->print_cr(" thrown in interpreter method <%s>", METHOD->print_value_string()); - tty->print_cr(" at bci %d, unwinding for thread " INTPTR_FORMAT, - (int)(istate->bcp() - METHOD->code_base()), - p2i(THREAD)); + log_info(exceptions)("Exception <%s> (" INTPTR_FORMAT ")\n" + " thrown in interpreter method <%s>\n" + " at bci %d, unwinding for thread " INTPTR_FORMAT, + except_oop->print_value_string(), p2i(except_oop()), + METHOD->print_value_string(), + (int)(istate->bcp() - METHOD->code_base()), + p2i(THREAD)); } // for AbortVMOnException flag Exceptions::debug_check_abort(except_oop); diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp index 077732802f5..d348e8d2cac 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp @@ -35,6 +35,7 @@ #include "interpreter/interpreterRuntime.hpp" #include "interpreter/linkResolver.hpp" #include "interpreter/templateTable.hpp" +#include "logging/log.hpp" #include "memory/oopFactory.hpp" #include "memory/universe.inline.hpp" #include "oops/constantPool.hpp" @@ -456,21 +457,23 @@ IRT_ENTRY(address, InterpreterRuntime::exception_handler_for_exception(JavaThrea #endif // tracing - if (TraceExceptions) { + if (log_is_enabled(Info, exceptions)) { ResourceMark rm(thread); Symbol* message = java_lang_Throwable::detail_message(h_exception()); - ttyLocker ttyl; // Lock after getting the detail message + stringStream tempst; if (message != NULL) { - tty->print_cr("Exception <%s: %s> (" INTPTR_FORMAT ")", - h_exception->print_value_string(), message->as_C_string(), - p2i(h_exception())); + tempst.print("Exception <%s: %s> (" INTPTR_FORMAT ")\n", + h_exception->print_value_string(), message->as_C_string(), + p2i(h_exception())); } else { - tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")", - h_exception->print_value_string(), - p2i(h_exception())); + tempst.print("Exception <%s> (" INTPTR_FORMAT ")\n", + h_exception->print_value_string(), + p2i(h_exception())); } - tty->print_cr(" thrown in interpreter method <%s>", h_method->print_value_string()); - tty->print_cr(" at bci %d for thread " INTPTR_FORMAT, current_bci, p2i(thread)); + tempst.print(" thrown in interpreter method <%s>\n" + " at bci %d for thread " INTPTR_FORMAT, + h_method->print_value_string(), current_bci, p2i(thread)); + LogHandle(exceptions)::info_stream()->print_raw_cr(tempst.as_string()); } // Don't go paging in something which won't be used. // else if (extable->length() == 0) { diff --git a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp index c401c698fde..b9691e4eb66 100644 --- a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp @@ -31,6 +31,7 @@ #include "jvmci/jvmciCompiler.hpp" #include "jvmci/jvmciJavaClasses.hpp" #include "jvmci/jvmciEnv.hpp" +#include "logging/log.hpp" #include "memory/oopFactory.hpp" #include "oops/oop.inline.hpp" #include "oops/objArrayOop.inline.hpp" @@ -294,11 +295,15 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t // debugging support // tracing - if (TraceExceptions) { - ttyLocker ttyl; + if (log_is_enabled(Info, exceptions)) { ResourceMark rm; - tty->print_cr("Exception <%s> (" INTPTR_FORMAT ") thrown in compiled method <%s> at PC " INTPTR_FORMAT " for thread " INTPTR_FORMAT "", - exception->print_value_string(), p2i((address)exception()), nm->method()->print_value_string(), p2i(pc), p2i(thread)); + log_info(exceptions)("Exception <%s> (" INTPTR_FORMAT ") thrown in" + " compiled method <%s> at PC " INTPTR_FORMAT + " for thread " INTPTR_FORMAT, + exception->print_value_string(), + p2i((address)exception()), + nm->method()->print_value_string(), p2i(pc), + p2i(thread)); } // for AbortVMOnException flag NOT_PRODUCT(Exceptions::debug_check_abort(exception)); @@ -323,11 +328,11 @@ JRT_ENTRY_NO_ASYNC(static address, exception_handler_for_pc_helper(JavaThread* t // Set flag if return address is a method handle call site. thread->set_is_method_handle_return(nm->is_method_handle_return(pc)); - if (TraceExceptions) { - ttyLocker ttyl; + if (log_is_enabled(Info, exceptions)) { ResourceMark rm; - tty->print_cr("Thread " PTR_FORMAT " continuing at PC " PTR_FORMAT " for exception thrown at PC " PTR_FORMAT, - p2i(thread), p2i(continuation), p2i(pc)); + log_info(exceptions)("Thread " PTR_FORMAT " continuing at PC " PTR_FORMAT + " for exception thrown at PC " PTR_FORMAT, + p2i(thread), p2i(continuation), p2i(pc)); } return continuation; diff --git a/hotspot/src/share/vm/logging/logTag.hpp b/hotspot/src/share/vm/logging/logTag.hpp index 7927c7f2a6c..02304afe98b 100644 --- a/hotspot/src/share/vm/logging/logTag.hpp +++ b/hotspot/src/share/vm/logging/logTag.hpp @@ -44,6 +44,7 @@ LOG_TAG(cset) \ LOG_TAG(defaultmethods) \ LOG_TAG(ergo) \ + LOG_TAG(exceptions) \ LOG_TAG(exit) \ LOG_TAG(freelist) \ LOG_TAG(gc) \ diff --git a/hotspot/src/share/vm/opto/runtime.cpp b/hotspot/src/share/vm/opto/runtime.cpp index 1ae727c105a..7e249dd5b30 100644 --- a/hotspot/src/share/vm/opto/runtime.cpp +++ b/hotspot/src/share/vm/opto/runtime.cpp @@ -42,6 +42,7 @@ #include "interpreter/bytecode.hpp" #include "interpreter/interpreter.hpp" #include "interpreter/linkResolver.hpp" +#include "logging/log.hpp" #include "memory/oopFactory.hpp" #include "oops/objArrayKlass.hpp" #include "oops/oop.inline.hpp" @@ -1211,7 +1212,7 @@ bool OptoRuntime::is_callee_saved_register(MachRegisterNumbers reg) { // Exceptions // -static void trace_exception(oop exception_oop, address exception_pc, const char* msg) PRODUCT_RETURN; +static void trace_exception(outputStream* st, oop exception_oop, address exception_pc, const char* msg); // The method is an entry that is always called by a C++ method not // directly from compiled code. Compiled code will call the C++ method following. @@ -1234,8 +1235,9 @@ JRT_ENTRY_NO_ASYNC(address, OptoRuntime::handle_exception_C_helper(JavaThread* t // normal bytecode execution. thread->clear_exception_oop_and_pc(); - if (TraceExceptions) { - trace_exception(exception(), pc, ""); + if (log_is_enabled(Info, exceptions)) { + ResourceMark rm; + trace_exception(LogHandle(exceptions)::info_stream(), exception(), pc, ""); } // for AbortVMOnException flag @@ -1600,29 +1602,25 @@ NamedCounter* OptoRuntime::new_named_counter(JVMState* youngest_jvms, NamedCount return c; } -//----------------------------------------------------------------------------- -// Non-product code -#ifndef PRODUCT - int trace_exception_counter = 0; -static void trace_exception(oop exception_oop, address exception_pc, const char* msg) { - ttyLocker ttyl; +static void trace_exception(outputStream* st, oop exception_oop, address exception_pc, const char* msg) { trace_exception_counter++; - tty->print("%d [Exception (%s): ", trace_exception_counter, msg); - exception_oop->print_value(); - tty->print(" in "); + stringStream tempst; + + tempst.print("%d [Exception (%s): ", trace_exception_counter, msg); + exception_oop->print_value_on(&tempst); + tempst.print(" in "); CodeBlob* blob = CodeCache::find_blob(exception_pc); if (blob->is_nmethod()) { nmethod* nm = blob->as_nmethod_or_null(); - nm->method()->print_value(); + nm->method()->print_value_on(&tempst); } else if (blob->is_runtime_stub()) { - tty->print(""); + tempst.print(""); } else { - tty->print(""); + tempst.print(""); } - tty->print(" at " INTPTR_FORMAT, p2i(exception_pc)); - tty->print_cr("]"); + tempst.print(" at " INTPTR_FORMAT, p2i(exception_pc)); + tempst.print("]"); + + st->print_raw_cr(tempst.as_string()); } - -#endif // PRODUCT - diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index 915e4c2b6ad..334f6eadb33 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -400,6 +400,8 @@ static AliasedFlag const aliased_jvm_flags[] = { }; static AliasedFlag const aliased_jvm_logging_flags[] = { + { "-XX:+TraceExceptions", "-Xlog:exceptions=info" }, + { "-XX:-TraceExceptions", "-Xlog:exceptions=off" }, { "-XX:+TraceMonitorInflation", "-Xlog:monitorinflation=debug" }, { "-XX:-TraceMonitorInflation", "-Xlog:monitorinflation=off" }, { NULL, NULL } diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index e35df070d70..25d94b07eb8 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -1448,9 +1448,6 @@ public: develop(bool, TraceBytecodes, false, \ "Trace bytecode execution") \ \ - product(bool, TraceExceptions, false, \ - "Trace exceptions") \ - \ develop(bool, TraceICs, false, \ "Trace inline cache changes") \ \ diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index e750a234ce5..160f61226c1 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -38,6 +38,7 @@ #include "interpreter/linkResolver.hpp" #include "interpreter/oopMapCache.hpp" #include "jvmtifiles/jvmtiEnv.hpp" +#include "logging/log.hpp" #include "logging/logConfiguration.hpp" #include "memory/metaspaceShared.hpp" #include "memory/oopFactory.hpp" @@ -2062,10 +2063,7 @@ void JavaThread::check_and_handle_async_exceptions(bool check_unsafe_error) { frame caller_fr = last_frame().sender(&map); assert(caller_fr.is_compiled_frame(), "what?"); if (caller_fr.is_deoptimized_frame()) { - if (TraceExceptions) { - ResourceMark rm; - tty->print_cr("deferred async exception at compiled safepoint"); - } + log_info(exceptions)("deferred async exception at compiled safepoint"); return; } } @@ -2091,14 +2089,15 @@ void JavaThread::check_and_handle_async_exceptions(bool check_unsafe_error) { // We cannot call Exceptions::_throw(...) here because we cannot block set_pending_exception(_pending_async_exception, __FILE__, __LINE__); - if (TraceExceptions) { + if (log_is_enabled(Info, exceptions)) { ResourceMark rm; - tty->print("Async. exception installed at runtime exit (" INTPTR_FORMAT ")", p2i(this)); - if (has_last_Java_frame()) { - frame f = last_frame(); - tty->print(" (pc: " INTPTR_FORMAT " sp: " INTPTR_FORMAT " )", p2i(f.pc()), p2i(f.sp())); - } - tty->print_cr(" of type: %s", _pending_async_exception->klass()->external_name()); + outputStream* logstream = LogHandle(exceptions)::info_stream(); + logstream->print("Async. exception installed at runtime exit (" INTPTR_FORMAT ")", p2i(this)); + if (has_last_Java_frame()) { + frame f = last_frame(); + logstream->print(" (pc: " INTPTR_FORMAT " sp: " INTPTR_FORMAT " )", p2i(f.pc()), p2i(f.sp())); + } + logstream->print_cr(" of type: %s", _pending_async_exception->klass()->external_name()); } _pending_async_exception = NULL; clear_has_async_exception(); @@ -2214,9 +2213,10 @@ void JavaThread::send_thread_stop(oop java_throwable) { // Set async. pending exception in thread. set_pending_async_exception(java_throwable); - if (TraceExceptions) { - ResourceMark rm; - tty->print_cr("Pending Async. exception installed of type: %s", _pending_async_exception->klass()->external_name()); + if (log_is_enabled(Info, exceptions)) { + ResourceMark rm; + log_info(exceptions)("Pending Async. exception installed of type: %s", + InstanceKlass::cast(_pending_async_exception->klass())->external_name()); } // for AbortVMOnException flag Exceptions::debug_check_abort(_pending_async_exception->klass()->external_name()); diff --git a/hotspot/src/share/vm/utilities/exceptions.cpp b/hotspot/src/share/vm/utilities/exceptions.cpp index ef14a9ff121..d0847c4c021 100644 --- a/hotspot/src/share/vm/utilities/exceptions.cpp +++ b/hotspot/src/share/vm/utilities/exceptions.cpp @@ -26,6 +26,7 @@ #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" #include "compiler/compileBroker.hpp" +#include "logging/log.hpp" #include "oops/oop.inline.hpp" #include "runtime/init.hpp" #include "runtime/java.hpp" @@ -136,14 +137,11 @@ void Exceptions::_throw(Thread* thread, const char* file, int line, Handle h_exc assert(h_exception() != NULL, "exception should not be NULL"); // tracing (do this up front - so it works during boot strapping) - if (TraceExceptions) { - ttyLocker ttyl; - tty->print_cr("Exception <%s%s%s> (" INTPTR_FORMAT ") \n" - "thrown [%s, line %d]\nfor thread " INTPTR_FORMAT, - h_exception->print_value_string(), - message ? ": " : "", message ? message : "", - p2i(h_exception()), file, line, p2i(thread)); - } + log_info(exceptions)("Exception <%s%s%s> (" INTPTR_FORMAT ") \n" + "thrown [%s, line %d]\nfor thread " INTPTR_FORMAT, + h_exception->print_value_string(), + message ? ": " : "", message ? message : "", + p2i(h_exception()), file, line, p2i(thread)); // for AbortVMOnException flag Exceptions::debug_check_abort(h_exception, message); diff --git a/hotspot/test/runtime/CommandLine/TraceExceptionsTest.java b/hotspot/test/runtime/CommandLine/TraceExceptionsTest.java index 220d7df064b..cbfc33f30e3 100644 --- a/hotspot/test/runtime/CommandLine/TraceExceptionsTest.java +++ b/hotspot/test/runtime/CommandLine/TraceExceptionsTest.java @@ -36,7 +36,7 @@ public class TraceExceptionsTest { public static void main(String[] args) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-XX:+TraceExceptions", "NoClassFound"); + "-Xlog:exceptions=info", "NoClassFound"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain(""); output.shouldNotContain(""); diff --git a/hotspot/test/runtime/logging/ExceptionsTest.java b/hotspot/test/runtime/logging/ExceptionsTest.java new file mode 100644 index 00000000000..0fefed85e9d --- /dev/null +++ b/hotspot/test/runtime/logging/ExceptionsTest.java @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8141211 + * @summary exceptions=info output should have an exception message for both interpreter and compiled methods + * @library /testlibrary + * @modules java.base/sun.misc + * java.management + * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools + * @run driver ExceptionsTest + */ + +import jdk.test.lib.OutputAnalyzer; +import jdk.test.lib.ProcessTools; + +public class ExceptionsTest { + static void analyzeOutputOn(ProcessBuilder pb) throws Exception { + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain(""); + output.shouldContain(" thrown in interpreter method "); + output.shouldContain(") thrown in compiled method "); + output.shouldContain("Exception 2 caught."); + output.shouldHaveExitValue(0); + } + + static void analyzeOutputOff(ProcessBuilder pb) throws Exception { + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldNotContain("[exceptions]"); + output.shouldHaveExitValue(0); + } + + public static void main(String[] args) throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + "-Xlog:exceptions=info", "-Xcomp", + "-XX:CompileCommand=compileonly,ExceptionsTest$InternalClass::compileMe", + InternalClass.class.getName()); + analyzeOutputOn(pb); + + pb = ProcessTools.createJavaProcessBuilder( + "-XX:+TraceExceptions", "-Xcomp", + "-XX:CompileCommand=compileonly,ExceptionsTest$InternalClass::compileMe", + InternalClass.class.getName()); + analyzeOutputOn(pb); + + pb = ProcessTools.createJavaProcessBuilder( + "-Xlog:exceptions=off", "-Xcomp", + "-XX:CompileCommand=compileonly,ExceptionsTest$InternalClass::compileMe", + InternalClass.class.getName()); + analyzeOutputOff(pb); + + pb = ProcessTools.createJavaProcessBuilder( + "-XX:-TraceExceptions", "-Xcomp", + "-XX:CompileCommand=compileonly,ExceptionsTest$InternalClass::compileMe", + InternalClass.class.getName()); + analyzeOutputOff(pb); + } + + public static class InternalClass { + public static void compileMe() throws Exception { + try { + throw new RuntimeException("Test exception 2 for logging"); + } catch (Exception e) { + System.out.println("Exception 2 caught."); + } + } + + public static void main(String[] args) throws Exception { + try { + throw new RuntimeException("Test exception 1 for logging"); + } catch (Exception e) { + System.out.println("Exception 1 caught."); + } + compileMe(); + } + } +} From 76d0d92563036def1c1dbf1a978bcfebac89a040 Mon Sep 17 00:00:00 2001 From: Dmitry Samersoff Date: Wed, 23 Dec 2015 13:12:15 +0300 Subject: [PATCH 129/146] 8067194: Restructure hotspot/agent/src to conform the modular source layout Move sources under jdk.hotspot.agent Reviewed-by: ihse, erikj, jbachorik --- hotspot/agent/make/Makefile | 331 ------------------ hotspot/agent/make/README.txt | 5 - hotspot/agent/make/build-filelist | 10 - hotspot/agent/make/build-pkglist | 11 - hotspot/agent/make/build.xml | 126 ------- hotspot/agent/make/clhsdbproc.sh | 30 -- hotspot/agent/make/clhsdbproc64.sh | 30 -- hotspot/agent/make/clhsdbwindbg.bat | 29 -- hotspot/agent/make/clhsdbwindbg64.bat | 29 -- hotspot/agent/make/dumpflagsproc.sh | 28 -- hotspot/agent/make/dumpflagsproc64.sh | 28 -- hotspot/agent/make/dumpflagswindbg.bat | 28 -- hotspot/agent/make/dumpflagswindbg64.bat | 28 -- hotspot/agent/make/dumpsyspropsproc.sh | 29 -- hotspot/agent/make/dumpsyspropsproc64.sh | 28 -- hotspot/agent/make/dumpsyspropswindbg.bat | 28 -- hotspot/agent/make/dumpsyspropswindbg64.bat | 28 -- hotspot/agent/make/finalizerinfoproc.sh | 28 -- hotspot/agent/make/finalizerinfoproc64.sh | 28 -- hotspot/agent/make/finalizerinfowindbg.bat | 28 -- hotspot/agent/make/finalizerinfowindbg64.bat | 28 -- hotspot/agent/make/grantAll.policy | 30 -- hotspot/agent/make/heapdumpproc.sh | 30 -- hotspot/agent/make/heapdumpproc64.sh | 31 -- hotspot/agent/make/heapdumpwindbg.bat | 29 -- hotspot/agent/make/heapdumpwindbg64.bat | 29 -- hotspot/agent/make/heapsumproc.sh | 28 -- hotspot/agent/make/heapsumproc64.sh | 28 -- hotspot/agent/make/heapsumwindbg.bat | 28 -- hotspot/agent/make/heapsumwindbg64.bat | 28 -- hotspot/agent/make/hsdb.bat | 25 -- hotspot/agent/make/hsdb.sh | 32 -- hotspot/agent/make/hsdbproc.sh | 28 -- hotspot/agent/make/hsdbproc64.sh | 28 -- hotspot/agent/make/hsdbwindbg.bat | 28 -- hotspot/agent/make/hsdbwindbg64.bat | 28 -- hotspot/agent/make/index.html | 262 -------------- hotspot/agent/make/jcoreproc.sh | 31 -- hotspot/agent/make/jcoreproc64.sh | 31 -- hotspot/agent/make/jcorewindbg.bat | 33 -- hotspot/agent/make/jcorewindbg64.bat | 33 -- hotspot/agent/make/jdbcore.sh | 45 --- hotspot/agent/make/jdbcore64.sh | 45 --- hotspot/agent/make/jdbproc.sh | 44 --- hotspot/agent/make/jdbproc64.sh | 44 --- hotspot/agent/make/jhistoproc.sh | 28 -- hotspot/agent/make/jhistoproc64.sh | 28 -- hotspot/agent/make/jhistowindbg.bat | 28 -- hotspot/agent/make/jhistowindbg64.bat | 28 -- hotspot/agent/make/jsdbproc.sh | 30 -- hotspot/agent/make/jsdbproc64.sh | 30 -- hotspot/agent/make/jsdbwindbg.bat | 29 -- hotspot/agent/make/jsdbwindbg64.bat | 29 -- hotspot/agent/make/jstackproc.sh | 28 -- hotspot/agent/make/jstackproc64.sh | 28 -- hotspot/agent/make/jstackwindbg.bat | 28 -- hotspot/agent/make/jstackwindbg64.bat | 28 -- hotspot/agent/make/marks_notes.html | 93 ----- hotspot/agent/make/mkinstall | 148 -------- hotspot/agent/make/permstatproc.sh | 28 -- hotspot/agent/make/permstatproc64.sh | 28 -- hotspot/agent/make/permstatwindbg.bat | 28 -- hotspot/agent/make/permstatwindbg64.bat | 28 -- hotspot/agent/make/pmapproc.sh | 28 -- hotspot/agent/make/pmapproc64.sh | 29 -- hotspot/agent/make/pmapwindbg.bat | 28 -- hotspot/agent/make/pmapwindbg64.bat | 28 -- hotspot/agent/make/pstackproc.sh | 34 -- hotspot/agent/make/pstackproc64.sh | 34 -- hotspot/agent/make/pstackwindbg.bat | 28 -- hotspot/agent/make/pstackwindbg64.bat | 28 -- hotspot/agent/make/saenv.bat | 54 --- hotspot/agent/make/saenv.sh | 84 ----- hotspot/agent/make/saenv64.bat | 60 ---- hotspot/agent/make/saenv64.sh | 83 ----- hotspot/agent/make/soqlproc.sh | 28 -- hotspot/agent/make/soqlproc64.sh | 28 -- hotspot/agent/make/soqlwindbg.bat | 28 -- hotspot/agent/make/soqlwindbg64.bat | 28 -- hotspot/agent/make/start-debug-server | 18 - hotspot/agent/make/start-debug-server-proc.sh | 35 -- .../agent/make/start-debug-server-proc64.sh | 34 -- .../agent/make/start-debug-server-windbg.bat | 39 --- .../make/start-debug-server-windbg64.bat | 39 --- hotspot/agent/make/start-rmiregistry.bat | 37 -- hotspot/agent/make/start-rmiregistry.sh | 34 -- hotspot/agent/src/os/bsd/Makefile | 102 ------ hotspot/agent/src/os/linux/Makefile | 90 ----- hotspot/agent/src/os/solaris/Makefile | 30 -- hotspot/agent/src/os/solaris/proc/Makefile | 70 ---- hotspot/agent/src/os/win32/windbg/Makefile | 91 ----- hotspot/make/lib/Lib-jdk.hotspot.agent.gmk | 19 +- .../mapfiles/libsaproc/mapfile-linux} | 0 .../mapfiles/libsaproc/mapfile-macosx} | 0 .../mapfiles/libsaproc/mapfile-solaris} | 0 .../doc/ReadMe-JavaScript.text | 0 .../jdk.hotspot.agent}/doc/cireplay.html | 0 .../jdk.hotspot.agent}/doc/clhsdb.html | 0 .../jdk.hotspot.agent}/doc/hsdb.html | 0 .../jdk.hotspot.agent}/doc/index.html | 0 .../jdk.hotspot.agent}/doc/jsdb.html | 0 .../doc/transported_core.html | 0 .../native/libsaproc}/LinuxDebuggerLocal.c | 0 .../linux/native/libsaproc}/elfmacros.h | 0 .../linux/native/libsaproc}/libproc.h | 0 .../linux/native/libsaproc}/libproc_impl.c | 0 .../linux/native/libsaproc}/libproc_impl.h | 0 .../linux/native/libsaproc}/proc_service.h | 0 .../linux/native/libsaproc}/ps_core.c | 0 .../linux/native/libsaproc}/ps_proc.c | 0 .../linux/native/libsaproc}/salibelf.c | 0 .../linux/native/libsaproc}/salibelf.h | 0 .../linux/native/libsaproc}/symtab.c | 0 .../linux/native/libsaproc}/symtab.h | 0 .../linux/native/libsaproc}/test.c | 0 .../native/libsaproc}/BsdDebuggerLocal.c | 0 .../native/libsaproc}/MacosxDebuggerLocal.m | 0 .../native/libsaproc}/StubDebuggerLocal.c | 0 .../macosx/native/libsaproc}/elfmacros.h | 0 .../macosx/native/libsaproc}/libproc.h | 0 .../macosx/native/libsaproc}/libproc_impl.c | 0 .../macosx/native/libsaproc}/libproc_impl.h | 0 .../macosx/native/libsaproc}/ps_core.c | 0 .../macosx/native/libsaproc}/ps_proc.c | 0 .../macosx/native/libsaproc}/salibelf.c | 0 .../macosx/native/libsaproc}/salibelf.h | 0 .../macosx/native/libsaproc}/symtab.c | 0 .../macosx/native/libsaproc}/symtab.h | 0 .../macosx/native/libsaproc}/test.c | 0 .../jdk.hotspot.agent}/scripts/README | 0 .../scripts/start-debug-server.bat | 0 .../scripts/start-debug-server.sh | 0 .../scripts/start-debug-server64.sh | 0 .../scripts/start-rmiregistry.bat | 0 .../scripts/start-rmiregistry.sh | 0 .../scripts/start-rmiregistry64.sh | 0 .../services/com.sun.jdi.connect.Connector | 0 .../sun/java/swing/action/AboutAction.java | 0 .../sun/java/swing/action/ActionManager.java | 0 .../java/swing/action/ActionUtilities.java | 0 .../java/swing/action/AlignCenterAction.java | 0 .../java/swing/action/AlignLeftAction.java | 0 .../java/swing/action/AlignRightAction.java | 0 .../sun/java/swing/action/ApplyAction.java | 0 .../com/sun/java/swing/action/BackAction.java | 0 .../sun/java/swing/action/CancelAction.java | 0 .../sun/java/swing/action/DelegateAction.java | 0 .../com/sun/java/swing/action/ExitAction.java | 0 .../com/sun/java/swing/action/FileMenu.java | 0 .../sun/java/swing/action/FinishAction.java | 0 .../com/sun/java/swing/action/HelpAction.java | 0 .../com/sun/java/swing/action/HelpMenu.java | 0 .../com/sun/java/swing/action/NewAction.java | 0 .../com/sun/java/swing/action/NextAction.java | 0 .../com/sun/java/swing/action/OkAction.java | 0 .../com/sun/java/swing/action/OpenAction.java | 0 .../com/sun/java/swing/action/SaveAction.java | 0 .../sun/java/swing/action/SaveAsAction.java | 0 .../java/swing/action/StateChangeAction.java | 0 .../com/sun/java/swing/action/ViewMenu.java | 0 .../com/sun/java/swing/ui/CommonMenuBar.java | 0 .../com/sun/java/swing/ui/CommonToolBar.java | 0 .../com/sun/java/swing/ui/CommonUI.java | 0 .../java/swing/ui/OkCancelButtonPanel.java | 0 .../com/sun/java/swing/ui/OkCancelDialog.java | 0 .../com/sun/java/swing/ui/SplashScreen.java | 0 .../com/sun/java/swing/ui/StatusBar.java | 0 .../com/sun/java/swing/ui/TabsDlg.java | 0 .../ToggleActionPropertyChangeListener.java | 0 .../com/sun/java/swing/ui/WizardDlg.java | 0 .../development/Server16.gif | Bin .../development/Server24.gif | Bin .../toolbarButtonGraphics/general/About16.gif | Bin .../toolbarButtonGraphics/general/About24.gif | Bin .../general/Delete16.gif | Bin .../general/Delete24.gif | Bin .../toolbarButtonGraphics/general/Find16.gif | Bin .../toolbarButtonGraphics/general/Help16.gif | Bin .../toolbarButtonGraphics/general/Help24.gif | Bin .../general/History16.gif | Bin .../general/History24.gif | Bin .../general/Information16.gif | Bin .../general/Information24.gif | Bin .../toolbarButtonGraphics/general/New16.gif | Bin .../toolbarButtonGraphics/general/New24.gif | Bin .../toolbarButtonGraphics/general/Open16.gif | Bin .../toolbarButtonGraphics/general/Open24.gif | Bin .../toolbarButtonGraphics/general/Save16.gif | Bin .../toolbarButtonGraphics/general/Save24.gif | Bin .../general/SaveAs16.gif | Bin .../general/SaveAs24.gif | Bin .../toolbarButtonGraphics/general/Zoom16.gif | Bin .../general/ZoomIn16.gif | Bin .../general/ZoomIn24.gif | Bin .../navigation/Down16.gif | Bin .../toolbarButtonGraphics/navigation/Up16.gif | Bin .../text/AlignCenter16.gif | Bin .../text/AlignCenter24.gif | Bin .../text/AlignLeft16.gif | Bin .../text/AlignLeft24.gif | Bin .../text/AlignRight16.gif | Bin .../text/AlignRight24.gif | Bin .../sun/jvm/hotspot/BsdVtblAccess.java | 0 .../share/classes/sun/jvm/hotspot/CLHSDB.java | 0 .../sun/jvm/hotspot/CommandProcessor.java | 0 .../classes/sun/jvm/hotspot/DebugServer.java | 0 .../share/classes/sun/jvm/hotspot/HSDB.java | 0 .../classes/sun/jvm/hotspot/HelloWorld.java | 0 .../classes/sun/jvm/hotspot/HotSpotAgent.java | 0 .../jvm/hotspot/HotSpotSolarisVtblAccess.java | 0 .../sun/jvm/hotspot/HotSpotTypeDataBase.java | 0 .../sun/jvm/hotspot/LinuxVtblAccess.java | 0 .../sun/jvm/hotspot/ObjectHistogram.java | 0 .../classes/sun/jvm/hotspot/RMIHelper.java | 0 .../classes/sun/jvm/hotspot/SAGetopt.java | 0 .../classes/sun/jvm/hotspot/SALauncher.java | 0 .../sun/jvm/hotspot/SALauncherLoader.java | 0 .../classes/sun/jvm/hotspot/StackTrace.java | 0 .../sun/jvm/hotspot/Win32VtblAccess.java | 0 .../sun/jvm/hotspot/asm/Disassembler.java | 0 .../jvm/hotspot/asm/DummySymbolFinder.java | 0 .../jvm/hotspot/asm/ImmediateOrRegister.java | 0 .../jvm/hotspot/asm/InstructionVisitor.java | 0 .../classes/sun/jvm/hotspot/asm/Operand.java | 0 .../classes/sun/jvm/hotspot/asm/Register.java | 0 .../sun/jvm/hotspot/asm/SymbolFinder.java | 0 .../jvm/hotspot/asm/sparc/SPARCArgument.java | 0 .../jvm/hotspot/asm/sparc/SPARCRegister.java | 0 .../hotspot/asm/sparc/SPARCRegisterType.java | 0 .../jvm/hotspot/asm/sparc/SPARCRegisters.java | 0 .../classes/sun/jvm/hotspot/c1/Runtime1.java | 0 .../sun/jvm/hotspot/ci/ciArrayKlass.java | 0 .../sun/jvm/hotspot/ci/ciBaseObject.java | 0 .../sun/jvm/hotspot/ci/ciConstant.java | 0 .../classes/sun/jvm/hotspot/ci/ciEnv.java | 0 .../classes/sun/jvm/hotspot/ci/ciField.java | 0 .../sun/jvm/hotspot/ci/ciInstance.java | 0 .../sun/jvm/hotspot/ci/ciInstanceKlass.java | 0 .../classes/sun/jvm/hotspot/ci/ciKlass.java | 0 .../sun/jvm/hotspot/ci/ciMetadata.java | 0 .../classes/sun/jvm/hotspot/ci/ciMethod.java | 0 .../sun/jvm/hotspot/ci/ciMethodData.java | 0 .../sun/jvm/hotspot/ci/ciObjArrayKlass.java | 0 .../classes/sun/jvm/hotspot/ci/ciObject.java | 0 .../sun/jvm/hotspot/ci/ciObjectFactory.java | 0 .../classes/sun/jvm/hotspot/ci/ciSymbol.java | 0 .../classes/sun/jvm/hotspot/ci/ciType.java | 0 .../sun/jvm/hotspot/ci/ciTypeArrayKlass.java | 0 .../hotspot/classfile/ClassLoaderData.java | 0 .../sun/jvm/hotspot/code/AdapterBlob.java | 0 .../sun/jvm/hotspot/code/BufferBlob.java | 0 .../sun/jvm/hotspot/code/CodeBlob.java | 0 .../sun/jvm/hotspot/code/CodeCache.java | 0 .../jvm/hotspot/code/CodeCacheVisitor.java | 0 .../hotspot/code/CompressedReadStream.java | 0 .../jvm/hotspot/code/CompressedStream.java | 0 .../hotspot/code/CompressedWriteStream.java | 0 .../jvm/hotspot/code/ConstantDoubleValue.java | 0 .../jvm/hotspot/code/ConstantIntValue.java | 0 .../jvm/hotspot/code/ConstantLongValue.java | 0 .../hotspot/code/ConstantOopReadValue.java | 0 .../jvm/hotspot/code/DebugInfoReadStream.java | 0 .../code/DebugInformationRecorder.java | 0 .../jvm/hotspot/code/DeoptimizationBlob.java | 0 .../sun/jvm/hotspot/code/ExceptionBlob.java | 0 .../sun/jvm/hotspot/code/Location.java | 0 .../sun/jvm/hotspot/code/LocationValue.java | 0 .../code/MethodHandlesAdapterBlob.java | 0 .../sun/jvm/hotspot/code/MonitorValue.java | 0 .../classes/sun/jvm/hotspot/code/NMethod.java | 0 .../sun/jvm/hotspot/code/ObjectValue.java | 0 .../classes/sun/jvm/hotspot/code/PCDesc.java | 0 .../sun/jvm/hotspot/code/RuntimeStub.java | 0 .../sun/jvm/hotspot/code/SafepointBlob.java | 0 .../sun/jvm/hotspot/code/ScopeDesc.java | 0 .../sun/jvm/hotspot/code/ScopeValue.java | 0 .../sun/jvm/hotspot/code/SingletonBlob.java | 0 .../classes/sun/jvm/hotspot/code/Stub.java | 0 .../sun/jvm/hotspot/code/StubQueue.java | 0 .../jvm/hotspot/code/UncommonTrapBlob.java | 0 .../sun/jvm/hotspot/code/VMRegImpl.java | 0 .../sun/jvm/hotspot/compiler/CompileTask.java | 0 .../jvm/hotspot/compiler/ImmutableOopMap.java | 0 .../hotspot/compiler/ImmutableOopMapPair.java | 0 .../hotspot/compiler/ImmutableOopMapSet.java | 0 .../jvm/hotspot/compiler/OopMapStream.java | 0 .../sun/jvm/hotspot/compiler/OopMapValue.java | 0 .../jvm/hotspot/compiler/OopMapVisitor.java | 0 .../sun/jvm/hotspot/debugger/Address.java | 0 .../hotspot/debugger/AddressException.java | 0 .../sun/jvm/hotspot/debugger/DataSource.java | 0 .../sun/jvm/hotspot/debugger/Debugger.java | 0 .../jvm/hotspot/debugger/DebuggerBase.java | 0 .../hotspot/debugger/DebuggerException.java | 0 .../hotspot/debugger/DebuggerUtilities.java | 0 .../sun/jvm/hotspot/debugger/InputLexer.java | 0 .../sun/jvm/hotspot/debugger/JVMDebugger.java | 0 .../sun/jvm/hotspot/debugger/LongHashMap.java | 0 .../hotspot/debugger/MachineDescription.java | 0 .../debugger/MachineDescriptionAArch64.java | 0 .../debugger/MachineDescriptionAMD64.java | 0 .../debugger/MachineDescriptionIA64.java | 0 .../debugger/MachineDescriptionIntelX86.java | 0 .../debugger/MachineDescriptionPPC64.java | 0 .../MachineDescriptionSPARC32Bit.java | 0 .../MachineDescriptionSPARC64Bit.java | 0 .../MachineDescriptionTwosComplement.java | 0 .../debugger/MappedByteBufferDataSource.java | 0 .../debugger/NoSuchSymbolException.java | 0 .../hotspot/debugger/NotInHeapException.java | 0 .../sun/jvm/hotspot/debugger/OopHandle.java | 0 .../sun/jvm/hotspot/debugger/Page.java | 0 .../sun/jvm/hotspot/debugger/PageCache.java | 0 .../sun/jvm/hotspot/debugger/PageFetcher.java | 0 .../sun/jvm/hotspot/debugger/ProcessInfo.java | 0 .../debugger/RandomAccessFileDataSource.java | 0 .../sun/jvm/hotspot/debugger/ReadResult.java | 0 .../jvm/hotspot/debugger/SymbolLookup.java | 0 .../jvm/hotspot/debugger/ThreadAccess.java | 0 .../jvm/hotspot/debugger/ThreadContext.java | 0 .../sun/jvm/hotspot/debugger/ThreadProxy.java | 0 .../debugger/UnalignedAddressException.java | 0 .../debugger/UnmappedAddressException.java | 0 .../aarch64/AARCH64ThreadContext.java | 0 .../debugger/amd64/AMD64ThreadContext.java | 0 .../jvm/hotspot/debugger/bsd/BsdAddress.java | 0 .../hotspot/debugger/bsd/BsdCDebugger.java | 0 .../jvm/hotspot/debugger/bsd/BsdDebugger.java | 0 .../debugger/bsd/BsdDebuggerLocal.java | 0 .../hotspot/debugger/bsd/BsdOopHandle.java | 0 .../jvm/hotspot/debugger/bsd/BsdThread.java | 0 .../debugger/bsd/BsdThreadContextFactory.java | 0 .../hotspot/debugger/bsd/SharedObject.java | 0 .../debugger/bsd/amd64/BsdAMD64CFrame.java | 0 .../bsd/amd64/BsdAMD64ThreadContext.java | 0 .../debugger/bsd/x86/BsdX86CFrame.java | 0 .../debugger/bsd/x86/BsdX86ThreadContext.java | 0 .../hotspot/debugger/cdbg/AccessControl.java | 0 .../jvm/hotspot/debugger/cdbg/ArrayType.java | 0 .../jvm/hotspot/debugger/cdbg/BaseClass.java | 0 .../jvm/hotspot/debugger/cdbg/BitType.java | 0 .../jvm/hotspot/debugger/cdbg/BlockSym.java | 0 .../debugger/cdbg/CDebugInfoDataBase.java | 0 .../jvm/hotspot/debugger/cdbg/CDebugger.java | 0 .../sun/jvm/hotspot/debugger/cdbg/CFrame.java | 0 .../hotspot/debugger/cdbg/CVAttributes.java | 0 .../hotspot/debugger/cdbg/ClosestSymbol.java | 0 .../hotspot/debugger/cdbg/CompoundType.java | 0 .../jvm/hotspot/debugger/cdbg/DebugEvent.java | 0 .../debugger/cdbg/DefaultObjectVisitor.java | 0 .../jvm/hotspot/debugger/cdbg/DoubleType.java | 0 .../jvm/hotspot/debugger/cdbg/EnumType.java | 0 .../sun/jvm/hotspot/debugger/cdbg/Field.java | 0 .../debugger/cdbg/FieldIdentifier.java | 0 .../jvm/hotspot/debugger/cdbg/FloatType.java | 0 .../hotspot/debugger/cdbg/FunctionSym.java | 0 .../hotspot/debugger/cdbg/FunctionType.java | 0 .../jvm/hotspot/debugger/cdbg/GlobalSym.java | 0 .../cdbg/IndexableFieldIdentifier.java | 0 .../jvm/hotspot/debugger/cdbg/IntType.java | 0 .../hotspot/debugger/cdbg/LineNumberInfo.java | 0 .../debugger/cdbg/LineNumberVisitor.java | 0 .../jvm/hotspot/debugger/cdbg/LoadObject.java | 0 .../debugger/cdbg/LoadObjectComparator.java | 0 .../jvm/hotspot/debugger/cdbg/LocalSym.java | 0 .../debugger/cdbg/MemberFunctionType.java | 0 .../debugger/cdbg/NamedFieldIdentifier.java | 0 .../hotspot/debugger/cdbg/ObjectVisitor.java | 0 .../hotspot/debugger/cdbg/PointerType.java | 0 .../hotspot/debugger/cdbg/ProcessControl.java | 0 .../jvm/hotspot/debugger/cdbg/RefType.java | 0 .../sun/jvm/hotspot/debugger/cdbg/Sym.java | 0 .../hotspot/debugger/cdbg/TemplateType.java | 0 .../sun/jvm/hotspot/debugger/cdbg/Type.java | 0 .../hotspot/debugger/cdbg/TypeVisitor.java | 0 .../jvm/hotspot/debugger/cdbg/VoidType.java | 0 .../debugger/cdbg/basic/BasicArrayType.java | 0 .../debugger/cdbg/basic/BasicBaseClass.java | 0 .../debugger/cdbg/basic/BasicBitType.java | 0 .../debugger/cdbg/basic/BasicBlockSym.java | 0 .../cdbg/basic/BasicCDebugInfoDataBase.java | 0 .../debugger/cdbg/basic/BasicCFrame.java | 0 .../cdbg/basic/BasicCompoundType.java | 0 .../debugger/cdbg/basic/BasicDebugEvent.java | 0 .../debugger/cdbg/basic/BasicDoubleType.java | 0 .../debugger/cdbg/basic/BasicEnumType.java | 0 .../debugger/cdbg/basic/BasicField.java | 0 .../debugger/cdbg/basic/BasicFloatType.java | 0 .../debugger/cdbg/basic/BasicFunctionSym.java | 0 .../cdbg/basic/BasicFunctionType.java | 0 .../debugger/cdbg/basic/BasicGlobalSym.java | 0 .../basic/BasicIndexableFieldIdentifier.java | 0 .../debugger/cdbg/basic/BasicIntType.java | 0 .../cdbg/basic/BasicLineNumberInfo.java | 0 .../cdbg/basic/BasicLineNumberMapping.java | 0 .../debugger/cdbg/basic/BasicLocalSym.java | 0 .../cdbg/basic/BasicMemberFunctionType.java | 0 .../cdbg/basic/BasicNamedFieldIdentifier.java | 0 .../debugger/cdbg/basic/BasicPointerType.java | 0 .../debugger/cdbg/basic/BasicRefType.java | 0 .../hotspot/debugger/cdbg/basic/BasicSym.java | 0 .../debugger/cdbg/basic/BasicType.java | 0 .../debugger/cdbg/basic/BasicVoidType.java | 0 .../debugger/cdbg/basic/CompoundTypeKind.java | 0 .../debugger/cdbg/basic/LazyBlockSym.java | 0 .../hotspot/debugger/cdbg/basic/LazyType.java | 0 .../debugger/cdbg/basic/ResolveListener.java | 0 .../hotspot/debugger/dummy/DummyAddress.java | 0 .../hotspot/debugger/dummy/DummyDebugger.java | 0 .../debugger/dummy/DummyOopHandle.java | 0 .../debugger/ia64/IA64ThreadContext.java | 0 .../hotspot/debugger/linux/LinuxAddress.java | 0 .../debugger/linux/LinuxCDebugger.java | 0 .../hotspot/debugger/linux/LinuxDebugger.java | 0 .../debugger/linux/LinuxDebuggerLocal.java | 0 .../debugger/linux/LinuxOopHandle.java | 0 .../hotspot/debugger/linux/LinuxThread.java | 0 .../linux/LinuxThreadContextFactory.java | 0 .../hotspot/debugger/linux/SharedObject.java | 0 .../linux/aarch64/LinuxAARCH64CFrame.java | 0 .../aarch64/LinuxAARCH64ThreadContext.java | 0 .../linux/amd64/LinuxAMD64CFrame.java | 0 .../linux/amd64/LinuxAMD64ThreadContext.java | 0 .../linux/ia64/LinuxIA64ThreadContext.java | 0 .../linux/ppc64/LinuxPPC64CFrame.java | 0 .../linux/ppc64/LinuxPPC64ThreadContext.java | 0 .../linux/sparc/LinuxSPARCCFrame.java | 0 .../linux/sparc/LinuxSPARCThreadContext.java | 0 .../debugger/linux/x86/LinuxX86CFrame.java | 0 .../linux/x86/LinuxX86ThreadContext.java | 0 .../debugger/posix/AddressDataSource.java | 0 .../sun/jvm/hotspot/debugger/posix/DSO.java | 0 .../debugger/posix/elf/ELFException.java | 0 .../hotspot/debugger/posix/elf/ELFFile.java | 0 .../debugger/posix/elf/ELFFileParser.java | 0 .../debugger/posix/elf/ELFHashTable.java | 0 .../hotspot/debugger/posix/elf/ELFHeader.java | 0 .../debugger/posix/elf/ELFProgramHeader.java | 0 .../debugger/posix/elf/ELFSectionHeader.java | 0 .../debugger/posix/elf/ELFStringTable.java | 0 .../hotspot/debugger/posix/elf/ELFSymbol.java | 0 .../debugger/ppc64/PPC64ThreadContext.java | 0 .../hotspot/debugger/proc/ProcAddress.java | 0 .../hotspot/debugger/proc/ProcCDebugger.java | 0 .../jvm/hotspot/debugger/proc/ProcCFrame.java | 0 .../hotspot/debugger/proc/ProcDebugger.java | 0 .../debugger/proc/ProcDebuggerLocal.java | 0 .../hotspot/debugger/proc/ProcOopHandle.java | 0 .../debugger/proc/ProcThreadFactory.java | 0 .../hotspot/debugger/proc/SharedObject.java | 0 .../proc/aarch64/ProcAARCH64Thread.java | 0 .../aarch64/ProcAARCH64ThreadContext.java | 0 .../aarch64/ProcAARCH64ThreadFactory.java | 0 .../debugger/proc/amd64/ProcAMD64Thread.java | 0 .../proc/amd64/ProcAMD64ThreadContext.java | 0 .../proc/amd64/ProcAMD64ThreadFactory.java | 0 .../debugger/proc/ppc64/ProcPPC64Thread.java | 0 .../proc/ppc64/ProcPPC64ThreadContext.java | 0 .../proc/ppc64/ProcPPC64ThreadFactory.java | 0 .../debugger/proc/sparc/ProcSPARCThread.java | 0 .../proc/sparc/ProcSPARCThreadContext.java | 0 .../proc/sparc/ProcSPARCThreadFactory.java | 0 .../debugger/proc/x86/ProcX86Thread.java | 0 .../proc/x86/ProcX86ThreadContext.java | 0 .../proc/x86/ProcX86ThreadFactory.java | 0 .../debugger/remote/RemoteAddress.java | 0 .../debugger/remote/RemoteDebugger.java | 0 .../debugger/remote/RemoteDebuggerClient.java | 0 .../debugger/remote/RemoteDebuggerServer.java | 0 .../debugger/remote/RemoteOopHandle.java | 0 .../hotspot/debugger/remote/RemoteThread.java | 0 .../debugger/remote/RemoteThreadFactory.java | 0 .../remote/aarch64/RemoteAARCH64Thread.java | 0 .../aarch64/RemoteAARCH64ThreadContext.java | 0 .../aarch64/RemoteAARCH64ThreadFactory.java | 0 .../remote/amd64/RemoteAMD64Thread.java | 0 .../amd64/RemoteAMD64ThreadContext.java | 0 .../amd64/RemoteAMD64ThreadFactory.java | 0 .../remote/ppc64/RemotePPC64Thread.java | 0 .../ppc64/RemotePPC64ThreadContext.java | 0 .../ppc64/RemotePPC64ThreadFactory.java | 0 .../remote/sparc/RemoteSPARCThread.java | 0 .../sparc/RemoteSPARCThreadContext.java | 0 .../sparc/RemoteSPARCThreadFactory.java | 0 .../debugger/remote/x86/RemoteX86Thread.java | 0 .../remote/x86/RemoteX86ThreadContext.java | 0 .../remote/x86/RemoteX86ThreadFactory.java | 0 .../debugger/sparc/SPARCThreadContext.java | 0 .../debugger/win32/coff/AuxBfEfRecord.java | 0 .../debugger/win32/coff/AuxFileRecord.java | 0 .../coff/AuxFunctionDefinitionRecord.java | 0 .../coff/AuxSectionDefinitionsRecord.java | 0 .../debugger/win32/coff/AuxSymbolRecord.java | 0 .../win32/coff/AuxWeakExternalRecord.java | 0 .../debugger/win32/coff/COFFException.java | 0 .../hotspot/debugger/win32/coff/COFFFile.java | 0 .../debugger/win32/coff/COFFFileParser.java | 0 .../debugger/win32/coff/COFFHeader.java | 0 .../debugger/win32/coff/COFFLineNumber.java | 0 .../debugger/win32/coff/COFFRelocation.java | 0 .../debugger/win32/coff/COFFSymbol.java | 0 .../win32/coff/COFFSymbolConstants.java | 0 .../win32/coff/COMDATSelectionTypes.java | 0 .../debugger/win32/coff/Characteristics.java | 0 .../win32/coff/DLLCharacteristics.java | 0 .../debugger/win32/coff/DataDirectory.java | 0 .../debugger/win32/coff/DebugDirectory.java | 0 .../win32/coff/DebugDirectoryEntry.java | 0 .../debugger/win32/coff/DebugTypes.java | 0 .../debugger/win32/coff/DebugVC50.java | 0 .../win32/coff/DebugVC50MemberAttributes.java | 0 .../win32/coff/DebugVC50ReservedTypes.java | 0 .../win32/coff/DebugVC50SSAlignSym.java | 0 .../win32/coff/DebugVC50SSFileIndex.java | 0 .../win32/coff/DebugVC50SSGlobalPub.java | 0 .../win32/coff/DebugVC50SSGlobalSym.java | 0 .../win32/coff/DebugVC50SSGlobalTypes.java | 0 .../win32/coff/DebugVC50SSLibraries.java | 0 .../debugger/win32/coff/DebugVC50SSMPC.java | 0 .../win32/coff/DebugVC50SSModule.java | 0 .../win32/coff/DebugVC50SSOffsetMap16.java | 0 .../win32/coff/DebugVC50SSOffsetMap32.java | 0 .../win32/coff/DebugVC50SSPreComp.java | 0 .../win32/coff/DebugVC50SSPublic.java | 0 .../win32/coff/DebugVC50SSPublicSym.java | 0 .../win32/coff/DebugVC50SSSegMap.java | 0 .../win32/coff/DebugVC50SSSegName.java | 0 .../win32/coff/DebugVC50SSSrcLnSeg.java | 0 .../win32/coff/DebugVC50SSSrcModule.java | 0 .../win32/coff/DebugVC50SSStaticSym.java | 0 .../win32/coff/DebugVC50SSSymbolBase.java | 0 .../win32/coff/DebugVC50SSSymbols.java | 0 .../debugger/win32/coff/DebugVC50SSTypes.java | 0 .../debugger/win32/coff/DebugVC50SegDesc.java | 0 .../win32/coff/DebugVC50SegDescEnums.java | 0 .../debugger/win32/coff/DebugVC50SegInfo.java | 0 .../win32/coff/DebugVC50SrcModFileDesc.java | 0 .../coff/DebugVC50SrcModLineNumberMap.java | 0 .../win32/coff/DebugVC50Subsection.java | 0 .../coff/DebugVC50SubsectionDirectory.java | 0 .../win32/coff/DebugVC50SubsectionTypes.java | 0 .../win32/coff/DebugVC50SymbolEnums.java | 0 .../win32/coff/DebugVC50SymbolIterator.java | 0 .../win32/coff/DebugVC50SymbolTypes.java | 0 .../win32/coff/DebugVC50TypeEnums.java | 0 .../win32/coff/DebugVC50TypeIterator.java | 0 .../win32/coff/DebugVC50TypeLeafIndices.java | 0 .../DebugVC50WrongNumericTypeException.java | 0 .../win32/coff/DebugVC50X86RegisterEnums.java | 0 .../debugger/win32/coff/DumpExports.java | 0 .../win32/coff/ExportDirectoryTable.java | 0 .../debugger/win32/coff/MachineTypes.java | 0 .../debugger/win32/coff/OptionalHeader.java | 0 .../coff/OptionalHeaderDataDirectories.java | 0 .../coff/OptionalHeaderStandardFields.java | 0 .../OptionalHeaderWindowsSpecificFields.java | 0 .../debugger/win32/coff/SectionFlags.java | 0 .../debugger/win32/coff/SectionHeader.java | 0 .../debugger/win32/coff/TestDebugInfo.java | 0 .../debugger/win32/coff/TestParser.java | 0 .../debugger/win32/coff/TypeIndicators.java | 0 .../win32/coff/WindowsNTSubsystem.java | 0 .../debugger/windbg/AddressDataSource.java | 0 .../sun/jvm/hotspot/debugger/windbg/DLL.java | 0 .../debugger/windbg/WindbgAddress.java | 0 .../windbg/WindbgCDebugInfoBuilder.java | 0 .../debugger/windbg/WindbgCDebugger.java | 0 .../debugger/windbg/WindbgDebugger.java | 0 .../debugger/windbg/WindbgDebuggerLocal.java | 0 .../debugger/windbg/WindbgOopHandle.java | 0 .../debugger/windbg/WindbgThreadFactory.java | 0 .../windbg/amd64/WindbgAMD64Thread.java | 0 .../amd64/WindbgAMD64ThreadContext.java | 0 .../amd64/WindbgAMD64ThreadFactory.java | 0 .../windbg/ia64/WindbgIA64Thread.java | 0 .../windbg/ia64/WindbgIA64ThreadContext.java | 0 .../windbg/ia64/WindbgIA64ThreadFactory.java | 0 .../debugger/windbg/x86/WindbgX86Thread.java | 0 .../windbg/x86/WindbgX86ThreadContext.java | 0 .../windbg/x86/WindbgX86ThreadFactory.java | 0 .../windows/amd64/WindowsAMD64CFrame.java | 0 .../windows/x86/WindowsX86CFrame.java | 0 .../debugger/x86/X86ThreadContext.java | 0 .../jvm/hotspot/gc/cms/AdaptiveFreeList.java | 0 .../sun/jvm/hotspot/gc/cms/CMSBitMap.java | 0 .../sun/jvm/hotspot/gc/cms/CMSCollector.java | 0 .../gc/cms/CompactibleFreeListSpace.java | 0 .../gc/cms/ConcurrentMarkSweepGeneration.java | 0 .../jvm/hotspot/gc/cms/LinearAllocBlock.java | 0 .../jvm/hotspot/gc/cms/ParNewGeneration.java | 0 .../jvm/hotspot/gc/g1/G1CollectedHeap.java | 0 .../jvm/hotspot/gc/g1/G1HeapRegionTable.java | 0 .../hotspot/gc/g1/G1MonitoringSupport.java | 0 .../sun/jvm/hotspot/gc/g1/HeapRegion.java | 0 .../jvm/hotspot/gc/g1/HeapRegionManager.java | 0 .../jvm/hotspot/gc/g1/HeapRegionSetBase.java | 0 .../hotspot/gc/parallel/ImmutableSpace.java | 0 .../jvm/hotspot/gc/parallel/MutableSpace.java | 0 .../sun/jvm/hotspot/gc/parallel/PSOldGen.java | 0 .../jvm/hotspot/gc/parallel/PSYoungGen.java | 0 .../gc/parallel/ParallelScavengeHeap.java | 0 .../hotspot/gc/serial/DefNewGeneration.java | 0 .../hotspot/gc/serial/TenuredGeneration.java | 0 .../jvm/hotspot/gc/shared/CardGeneration.java | 0 .../jvm/hotspot/gc/shared/CollectedHeap.java | 0 .../hotspot/gc/shared/CollectedHeapName.java | 0 .../hotspot/gc/shared/CompactibleSpace.java | 0 .../hotspot/gc/shared/ContiguousSpace.java | 0 .../sun/jvm/hotspot/gc/shared/G1YCType.java | 0 .../sun/jvm/hotspot/gc/shared/GCCause.java | 0 .../sun/jvm/hotspot/gc/shared/GCName.java | 0 .../sun/jvm/hotspot/gc/shared/GCWhen.java | 0 .../hotspot/gc/shared/GenCollectedHeap.java | 0 .../sun/jvm/hotspot/gc/shared/Generation.java | 0 .../hotspot/gc/shared/GenerationFactory.java | 0 .../gc/shared/GenerationIsInClosure.java | 0 .../jvm/hotspot/gc/shared/GenerationSpec.java | 0 .../gc/shared/OffsetTableContigSpace.java | 0 .../sun/jvm/hotspot/gc/shared/Space.java | 0 .../jvm/hotspot/gc/shared/SpaceClosure.java | 0 .../jvm/hotspot/gc/shared/TenuredSpace.java | 0 .../sun/jvm/hotspot/interpreter/Bytecode.java | 0 .../interpreter/BytecodeANewArray.java | 0 .../hotspot/interpreter/BytecodeBipush.java | 0 .../interpreter/BytecodeCheckCast.java | 0 .../interpreter/BytecodeDisassembler.java | 0 .../hotspot/interpreter/BytecodeGetField.java | 0 .../hotspot/interpreter/BytecodeGetPut.java | 0 .../interpreter/BytecodeGetStatic.java | 0 .../jvm/hotspot/interpreter/BytecodeGoto.java | 0 .../hotspot/interpreter/BytecodeGotoW.java | 0 .../jvm/hotspot/interpreter/BytecodeIf.java | 0 .../jvm/hotspot/interpreter/BytecodeIinc.java | 0 .../interpreter/BytecodeInstanceOf.java | 0 .../hotspot/interpreter/BytecodeInvoke.java | 0 .../jvm/hotspot/interpreter/BytecodeJmp.java | 0 .../jvm/hotspot/interpreter/BytecodeJsr.java | 0 .../jvm/hotspot/interpreter/BytecodeJsrW.java | 0 .../jvm/hotspot/interpreter/BytecodeLoad.java | 0 .../interpreter/BytecodeLoadConstant.java | 0 .../interpreter/BytecodeLoadStore.java | 0 .../interpreter/BytecodeLookupswitch.java | 0 .../interpreter/BytecodeMultiANewArray.java | 0 .../jvm/hotspot/interpreter/BytecodeNew.java | 0 .../hotspot/interpreter/BytecodeNewArray.java | 0 .../hotspot/interpreter/BytecodePutField.java | 0 .../interpreter/BytecodePutStatic.java | 0 .../jvm/hotspot/interpreter/BytecodeRet.java | 0 .../hotspot/interpreter/BytecodeSipush.java | 0 .../hotspot/interpreter/BytecodeStore.java | 0 .../hotspot/interpreter/BytecodeStream.java | 0 .../interpreter/BytecodeTableswitch.java | 0 .../hotspot/interpreter/BytecodeVisitor.java | 0 .../hotspot/interpreter/BytecodeWideable.java | 0 .../interpreter/BytecodeWithCPIndex.java | 0 .../interpreter/BytecodeWithKlass.java | 0 .../jvm/hotspot/interpreter/Bytecodes.java | 0 .../jvm/hotspot/interpreter/Interpreter.java | 0 .../interpreter/InterpreterCodelet.java | 0 .../hotspot/interpreter/LookupswitchPair.java | 0 .../interpreter/MaskFillerForNative.java | 0 .../hotspot/interpreter/OffsetClosure.java | 0 .../hotspot/interpreter/OopMapCacheEntry.java | 0 .../interpreter/OopMapForCacheEntry.java | 0 .../jvm/hotspot/jdi/ArrayReferenceImpl.java | 0 .../sun/jvm/hotspot/jdi/ArrayTypeImpl.java | 0 .../sun/jvm/hotspot/jdi/BaseLineInfo.java | 0 .../sun/jvm/hotspot/jdi/BooleanTypeImpl.java | 0 .../sun/jvm/hotspot/jdi/BooleanValueImpl.java | 0 .../sun/jvm/hotspot/jdi/ByteTypeImpl.java | 0 .../sun/jvm/hotspot/jdi/ByteValueImpl.java | 0 .../sun/jvm/hotspot/jdi/CharTypeImpl.java | 0 .../sun/jvm/hotspot/jdi/CharValueImpl.java | 0 .../hotspot/jdi/ClassLoaderReferenceImpl.java | 0 .../hotspot/jdi/ClassObjectReferenceImpl.java | 0 .../sun/jvm/hotspot/jdi/ClassTypeImpl.java | 0 .../jvm/hotspot/jdi/ConcreteMethodImpl.java | 0 .../sun/jvm/hotspot/jdi/ConnectorImpl.java | 0 .../sun/jvm/hotspot/jdi/DoubleTypeImpl.java | 0 .../sun/jvm/hotspot/jdi/DoubleValueImpl.java | 0 .../sun/jvm/hotspot/jdi/FieldImpl.java | 0 .../sun/jvm/hotspot/jdi/FloatTypeImpl.java | 0 .../sun/jvm/hotspot/jdi/FloatValueImpl.java | 0 .../sun/jvm/hotspot/jdi/IntegerTypeImpl.java | 0 .../sun/jvm/hotspot/jdi/IntegerValueImpl.java | 0 .../jvm/hotspot/jdi/InterfaceTypeImpl.java | 0 .../sun/jvm/hotspot/jdi/JNITypeParser.java | 0 .../sun/jvm/hotspot/jdi/JVMTIThreadState.java | 0 .../classes/sun/jvm/hotspot/jdi/LineInfo.java | 0 .../jvm/hotspot/jdi/LocalVariableImpl.java | 0 .../sun/jvm/hotspot/jdi/LocationImpl.java | 0 .../sun/jvm/hotspot/jdi/LongTypeImpl.java | 0 .../sun/jvm/hotspot/jdi/LongValueImpl.java | 0 .../sun/jvm/hotspot/jdi/MethodImpl.java | 0 .../sun/jvm/hotspot/jdi/MirrorImpl.java | 0 .../sun/jvm/hotspot/jdi/MonitorInfoImpl.java | 0 .../hotspot/jdi/NonConcreteMethodImpl.java | 0 .../jvm/hotspot/jdi/ObjectReferenceImpl.java | 0 .../jvm/hotspot/jdi/PrimitiveTypeImpl.java | 0 .../jvm/hotspot/jdi/PrimitiveValueImpl.java | 0 .../jvm/hotspot/jdi/ReferenceTypeImpl.java | 0 .../hotspot/jdi/SACoreAttachingConnector.java | 0 .../sun/jvm/hotspot/jdi/SADebugServer.java | 0 .../jdi/SADebugServerAttachingConnector.java | 0 .../sun/jvm/hotspot/jdi/SAJDIClassLoader.java | 0 .../hotspot/jdi/SAPIDAttachingConnector.java | 0 .../classes/sun/jvm/hotspot/jdi/SDE.java | 0 .../sun/jvm/hotspot/jdi/ShortTypeImpl.java | 0 .../sun/jvm/hotspot/jdi/ShortValueImpl.java | 0 .../sun/jvm/hotspot/jdi/StackFrameImpl.java | 0 .../sun/jvm/hotspot/jdi/StratumLineInfo.java | 0 .../jvm/hotspot/jdi/StringReferenceImpl.java | 0 .../hotspot/jdi/ThreadGroupReferenceImpl.java | 0 .../jvm/hotspot/jdi/ThreadReferenceImpl.java | 0 .../jvm/hotspot/jdi/TypeComponentImpl.java | 0 .../classes/sun/jvm/hotspot/jdi/TypeImpl.java | 0 .../sun/jvm/hotspot/jdi/VMModifiers.java | 0 .../sun/jvm/hotspot/jdi/ValueContainer.java | 0 .../sun/jvm/hotspot/jdi/ValueImpl.java | 0 .../jvm/hotspot/jdi/VirtualMachineImpl.java | 0 .../sun/jvm/hotspot/jdi/VoidTypeImpl.java | 0 .../sun/jvm/hotspot/jdi/VoidValueImpl.java | 0 .../memory/AFLBinaryTreeDictionary.java | 0 .../sun/jvm/hotspot/memory/CodeHeap.java | 0 .../sun/jvm/hotspot/memory/Dictionary.java | 0 .../jvm/hotspot/memory/DictionaryEntry.java | 0 .../sun/jvm/hotspot/memory/FreeChunk.java | 0 .../sun/jvm/hotspot/memory/HeapBlock.java | 0 .../hotspot/memory/LoaderConstraintEntry.java | 0 .../hotspot/memory/LoaderConstraintTable.java | 0 .../sun/jvm/hotspot/memory/MemRegion.java | 0 .../jvm/hotspot/memory/PlaceholderEntry.java | 0 .../jvm/hotspot/memory/PlaceholderTable.java | 0 .../memory/ProtectionDomainCacheEntry.java | 0 .../hotspot/memory/ProtectionDomainEntry.java | 0 .../sun/jvm/hotspot/memory/ReferenceType.java | 0 .../sun/jvm/hotspot/memory/StringTable.java | 0 .../sun/jvm/hotspot/memory/SymbolTable.java | 0 .../jvm/hotspot/memory/SystemDictionary.java | 0 .../sun/jvm/hotspot/memory/Universe.java | 0 .../sun/jvm/hotspot/memory/VirtualSpace.java | 0 .../sun/jvm/hotspot/oops/AccessFlags.java | 0 .../sun/jvm/hotspot/oops/ArgInfoData.java | 0 .../classes/sun/jvm/hotspot/oops/Array.java | 0 .../sun/jvm/hotspot/oops/ArrayData.java | 0 .../sun/jvm/hotspot/oops/ArrayKlass.java | 0 .../classes/sun/jvm/hotspot/oops/BitData.java | 0 .../sun/jvm/hotspot/oops/BooleanField.java | 0 .../sun/jvm/hotspot/oops/BranchData.java | 0 .../sun/jvm/hotspot/oops/BreakpointInfo.java | 0 .../sun/jvm/hotspot/oops/ByteField.java | 0 .../sun/jvm/hotspot/oops/CIntField.java | 0 .../sun/jvm/hotspot/oops/CallTypeData.java | 0 .../hotspot/oops/CallTypeDataInterface.java | 0 .../sun/jvm/hotspot/oops/CellTypeState.java | 0 .../jvm/hotspot/oops/CellTypeStateList.java | 0 .../sun/jvm/hotspot/oops/CharField.java | 0 .../hotspot/oops/CheckedExceptionElement.java | 0 .../jvm/hotspot/oops/CompiledICHolder.java | 0 .../oops/CompressedLineNumberReadStream.java | 0 .../sun/jvm/hotspot/oops/ConstMethod.java | 0 .../sun/jvm/hotspot/oops/ConstantPool.java | 0 .../jvm/hotspot/oops/ConstantPoolCache.java | 0 .../hotspot/oops/ConstantPoolCacheEntry.java | 0 .../sun/jvm/hotspot/oops/CounterData.java | 0 .../sun/jvm/hotspot/oops/DataLayout.java | 0 .../jvm/hotspot/oops/DefaultHeapVisitor.java | 0 .../hotspot/oops/DefaultMetadataVisitor.java | 0 .../jvm/hotspot/oops/DefaultOopVisitor.java | 0 .../sun/jvm/hotspot/oops/DoubleField.java | 0 .../hotspot/oops/ExceptionTableElement.java | 0 .../classes/sun/jvm/hotspot/oops/Field.java | 0 .../sun/jvm/hotspot/oops/FieldIdentifier.java | 0 .../sun/jvm/hotspot/oops/FieldType.java | 0 .../sun/jvm/hotspot/oops/FieldVisitor.java | 0 .../sun/jvm/hotspot/oops/FloatField.java | 0 .../sun/jvm/hotspot/oops/GenerateOopMap.java | 0 .../sun/jvm/hotspot/oops/HeapPrinter.java | 0 .../sun/jvm/hotspot/oops/HeapVisitor.java | 0 .../oops/IndexableFieldIdentifier.java | 0 .../sun/jvm/hotspot/oops/Instance.java | 0 .../oops/InstanceClassLoaderKlass.java | 0 .../sun/jvm/hotspot/oops/InstanceKlass.java | 0 .../jvm/hotspot/oops/InstanceMirrorKlass.java | 0 .../jvm/hotspot/oops/InstanceRefKlass.java | 0 .../sun/jvm/hotspot/oops/IntField.java | 0 .../jvm/hotspot/oops/JVMDIClassStatus.java | 0 .../sun/jvm/hotspot/oops/JumpData.java | 0 .../classes/sun/jvm/hotspot/oops/Klass.java | 0 .../hotspot/oops/LineNumberTableElement.java | 0 .../oops/LocalVariableTableElement.java | 0 .../sun/jvm/hotspot/oops/LongField.java | 0 .../classes/sun/jvm/hotspot/oops/Mark.java | 0 .../sun/jvm/hotspot/oops/Metadata.java | 0 .../sun/jvm/hotspot/oops/MetadataField.java | 0 .../sun/jvm/hotspot/oops/MetadataVisitor.java | 0 .../classes/sun/jvm/hotspot/oops/Method.java | 0 .../sun/jvm/hotspot/oops/MethodCounters.java | 0 .../sun/jvm/hotspot/oops/MethodData.java | 0 .../jvm/hotspot/oops/MethodDataInterface.java | 0 .../sun/jvm/hotspot/oops/MultiBranchData.java | 0 .../jvm/hotspot/oops/MutationException.java | 0 .../hotspot/oops/NamedFieldIdentifier.java | 0 .../jvm/hotspot/oops/NarrowKlassField.java | 0 .../sun/jvm/hotspot/oops/NarrowOopField.java | 0 .../sun/jvm/hotspot/oops/ObjArray.java | 0 .../sun/jvm/hotspot/oops/ObjArrayKlass.java | 0 .../sun/jvm/hotspot/oops/ObjectHeap.java | 0 .../sun/jvm/hotspot/oops/ObjectHistogram.java | 0 .../hotspot/oops/ObjectHistogramElement.java | 0 .../classes/sun/jvm/hotspot/oops/Oop.java | 0 .../sun/jvm/hotspot/oops/OopField.java | 0 .../sun/jvm/hotspot/oops/OopPrinter.java | 0 .../sun/jvm/hotspot/oops/OopUtilities.java | 0 .../sun/jvm/hotspot/oops/OopVisitor.java | 0 .../jvm/hotspot/oops/ParametersTypeData.java | 0 .../sun/jvm/hotspot/oops/ProfileData.java | 0 .../sun/jvm/hotspot/oops/RawHeapVisitor.java | 0 .../jvm/hotspot/oops/ReceiverTypeData.java | 0 .../classes/sun/jvm/hotspot/oops/RetData.java | 0 .../sun/jvm/hotspot/oops/ReturnTypeEntry.java | 0 .../sun/jvm/hotspot/oops/ShortField.java | 0 .../jvm/hotspot/oops/SpeculativeTrapData.java | 0 .../classes/sun/jvm/hotspot/oops/Symbol.java | 0 .../sun/jvm/hotspot/oops/TypeArray.java | 0 .../sun/jvm/hotspot/oops/TypeArrayKlass.java | 0 .../sun/jvm/hotspot/oops/TypeEntries.java | 0 .../jvm/hotspot/oops/TypeEntriesAtCall.java | 0 .../hotspot/oops/TypeStackSlotEntries.java | 0 .../jvm/hotspot/oops/UnknownOopException.java | 0 .../sun/jvm/hotspot/oops/VirtualCallData.java | 0 .../jvm/hotspot/oops/VirtualCallTypeData.java | 0 .../sun/jvm/hotspot/oops/java_lang_Class.java | 0 .../classes/sun/jvm/hotspot/opto/Block.java | 0 .../sun/jvm/hotspot/opto/Block_Array.java | 0 .../sun/jvm/hotspot/opto/Block_List.java | 0 .../jvm/hotspot/opto/CallDynamicJavaNode.java | 0 .../sun/jvm/hotspot/opto/CallJavaNode.java | 0 .../sun/jvm/hotspot/opto/CallNode.java | 0 .../sun/jvm/hotspot/opto/CallRuntimeNode.java | 0 .../jvm/hotspot/opto/CallStaticJavaNode.java | 0 .../classes/sun/jvm/hotspot/opto/Compile.java | 0 .../jvm/hotspot/opto/CompilerPhaseType.java | 0 .../sun/jvm/hotspot/opto/HaltNode.java | 0 .../sun/jvm/hotspot/opto/InlineTree.java | 0 .../sun/jvm/hotspot/opto/JVMState.java | 0 .../sun/jvm/hotspot/opto/LoopNode.java | 0 .../jvm/hotspot/opto/MachCallJavaNode.java | 0 .../sun/jvm/hotspot/opto/MachCallNode.java | 0 .../jvm/hotspot/opto/MachCallRuntimeNode.java | 0 .../hotspot/opto/MachCallStaticJavaNode.java | 0 .../sun/jvm/hotspot/opto/MachIfNode.java | 0 .../sun/jvm/hotspot/opto/MachNode.java | 0 .../sun/jvm/hotspot/opto/MachReturnNode.java | 0 .../jvm/hotspot/opto/MachSafePointNode.java | 0 .../sun/jvm/hotspot/opto/MultiNode.java | 0 .../classes/sun/jvm/hotspot/opto/Node.java | 0 .../sun/jvm/hotspot/opto/Node_Array.java | 0 .../sun/jvm/hotspot/opto/Node_List.java | 0 .../classes/sun/jvm/hotspot/opto/Phase.java | 0 .../sun/jvm/hotspot/opto/PhaseCFG.java | 0 .../sun/jvm/hotspot/opto/PhaseRegAlloc.java | 0 .../classes/sun/jvm/hotspot/opto/PhiNode.java | 0 .../sun/jvm/hotspot/opto/ProjNode.java | 0 .../sun/jvm/hotspot/opto/RegionNode.java | 0 .../sun/jvm/hotspot/opto/RootNode.java | 0 .../sun/jvm/hotspot/opto/SafePointNode.java | 0 .../sun/jvm/hotspot/opto/TypeNode.java | 0 .../sun/jvm/hotspot/prims/JvmtiExport.java | 0 .../jvm/hotspot/runtime/AddressVisitor.java | 0 .../hotspot/runtime/ArgumentSizeComputer.java | 0 .../sun/jvm/hotspot/runtime/Arguments.java | 0 .../sun/jvm/hotspot/runtime/BasicLock.java | 0 .../jvm/hotspot/runtime/BasicObjectLock.java | 0 .../sun/jvm/hotspot/runtime/BasicType.java | 0 .../jvm/hotspot/runtime/BasicTypeSize.java | 0 .../sun/jvm/hotspot/runtime/Bytes.java | 0 .../jvm/hotspot/runtime/ClassConstants.java | 0 .../runtime/CodeCacheSweeperThread.java | 0 .../jvm/hotspot/runtime/CompiledVFrame.java | 0 .../jvm/hotspot/runtime/CompilerThread.java | 0 .../runtime/ConcurrentLocksPrinter.java | 0 .../runtime/ConstructionException.java | 0 .../jvm/hotspot/runtime/DeadlockDetector.java | 0 .../jvm/hotspot/runtime/ExternalVFrame.java | 0 .../sun/jvm/hotspot/runtime/Flags.java | 0 .../sun/jvm/hotspot/runtime/Frame.java | 0 .../hotspot/runtime/InstanceConstructor.java | 0 .../hotspot/runtime/InterpretedVFrame.java | 0 .../jvm/hotspot/runtime/JNIHandleBlock.java | 0 .../sun/jvm/hotspot/runtime/JNIHandles.java | 0 .../sun/jvm/hotspot/runtime/JNIid.java | 0 .../jvm/hotspot/runtime/JavaCallWrapper.java | 0 .../sun/jvm/hotspot/runtime/JavaThread.java | 0 .../hotspot/runtime/JavaThreadFactory.java | 0 .../hotspot/runtime/JavaThreadPDAccess.java | 0 .../jvm/hotspot/runtime/JavaThreadState.java | 0 .../sun/jvm/hotspot/runtime/JavaVFrame.java | 0 .../jvm/hotspot/runtime/JvmtiAgentThread.java | 0 .../sun/jvm/hotspot/runtime/MonitorInfo.java | 0 .../runtime/NativeSignatureIterator.java | 0 .../sun/jvm/hotspot/runtime/OSThread.java | 0 .../jvm/hotspot/runtime/ObjectMonitor.java | 0 .../hotspot/runtime/ObjectSynchronizer.java | 0 .../jvm/hotspot/runtime/PerfDataEntry.java | 0 .../jvm/hotspot/runtime/PerfDataPrologue.java | 0 .../sun/jvm/hotspot/runtime/PerfMemory.java | 0 .../sun/jvm/hotspot/runtime/RegisterMap.java | 0 .../jvm/hotspot/runtime/ResultTypeFinder.java | 0 .../jvm/hotspot/runtime/ServiceThread.java | 0 .../hotspot/runtime/SignatureConverter.java | 0 .../jvm/hotspot/runtime/SignatureInfo.java | 0 .../hotspot/runtime/SignatureIterator.java | 0 .../jvm/hotspot/runtime/StackFrameStream.java | 0 .../sun/jvm/hotspot/runtime/StackValue.java | 0 .../hotspot/runtime/StackValueCollection.java | 0 .../runtime/StaticBaseConstructor.java | 0 .../sun/jvm/hotspot/runtime/StubRoutines.java | 0 .../sun/jvm/hotspot/runtime/Thread.java | 0 .../runtime/ThreadLocalAllocBuffer.java | 0 .../sun/jvm/hotspot/runtime/Threads.java | 0 .../sun/jvm/hotspot/runtime/VFrame.java | 0 .../classes/sun/jvm/hotspot/runtime/VM.java | 0 .../sun/jvm/hotspot/runtime/VMObject.java | 0 .../jvm/hotspot/runtime/VMObjectFactory.java | 0 .../sun/jvm/hotspot/runtime/VMOps.java | 0 .../sun/jvm/hotspot/runtime/VMReg.java | 0 .../runtime/VMVersionMismatchException.java | 0 .../runtime/VirtualBaseConstructor.java | 0 .../hotspot/runtime/VirtualConstructor.java | 0 .../jvm/hotspot/runtime/WatcherThread.java | 0 .../aarch64/AARCH64CurrentFrameGuess.java | 0 .../hotspot/runtime/aarch64/AARCH64Frame.java | 0 .../aarch64/AARCH64JavaCallWrapper.java | 0 .../runtime/aarch64/AARCH64RegisterMap.java | 0 .../runtime/amd64/AMD64CurrentFrameGuess.java | 0 .../runtime/amd64/AMD64JavaCallWrapper.java | 0 .../jvm/hotspot/runtime/bsd/BsdSignals.java | 0 .../bsd_amd64/BsdAMD64JavaThreadPDAccess.java | 0 .../hotspot/runtime/bsd_x86/BsdSignals.java | 0 .../bsd_x86/BsdX86JavaThreadPDAccess.java | 0 .../hotspot/runtime/linux/LinuxSignals.java | 0 .../LinuxAARCH64JavaThreadPDAccess.java | 0 .../LinuxAMD64JavaThreadPDAccess.java | 0 .../LinuxPPC64JavaThreadPDAccess.java | 0 .../LinuxSPARCJavaThreadPDAccess.java | 0 .../runtime/linux_x86/LinuxSignals.java | 0 .../linux_x86/LinuxX86JavaThreadPDAccess.java | 0 .../hotspot/runtime/posix/POSIXSignals.java | 0 .../runtime/ppc64/PPC64CurrentFrameGuess.java | 0 .../jvm/hotspot/runtime/ppc64/PPC64Frame.java | 0 .../runtime/ppc64/PPC64JavaCallWrapper.java | 0 .../runtime/ppc64/PPC64RegisterMap.java | 0 .../SolarisAMD64JavaThreadPDAccess.java | 0 .../SolarisSPARCJavaThreadPDAccess.java | 0 .../SolarisX86JavaThreadPDAccess.java | 0 .../jvm/hotspot/runtime/sparc/SPARCFrame.java | 0 .../runtime/sparc/SPARCRegisterMap.java | 0 .../sun/jvm/hotspot/runtime/vmSymbols.java | 0 .../Win32AMD64JavaThreadPDAccess.java | 0 .../win32_x86/Win32X86JavaThreadPDAccess.java | 0 .../runtime/x86/X86CurrentFrameGuess.java | 0 .../sun/jvm/hotspot/runtime/x86/X86Frame.java | 0 .../runtime/x86/X86JavaCallWrapper.java | 0 .../hotspot/runtime/x86/X86RegisterMap.java | 0 .../jvm/hotspot/tools/ClassLoaderStats.java | 0 .../sun/jvm/hotspot/tools/FinalizerInfo.java | 0 .../sun/jvm/hotspot/tools/FlagDumper.java | 0 .../sun/jvm/hotspot/tools/HeapDumper.java | 0 .../sun/jvm/hotspot/tools/HeapSummary.java | 0 .../classes/sun/jvm/hotspot/tools/JInfo.java | 0 .../classes/sun/jvm/hotspot/tools/JMap.java | 0 .../classes/sun/jvm/hotspot/tools/JSnap.java | 0 .../classes/sun/jvm/hotspot/tools/JStack.java | 0 .../jvm/hotspot/tools/ObjectHistogram.java | 0 .../classes/sun/jvm/hotspot/tools/PMap.java | 0 .../classes/sun/jvm/hotspot/tools/PStack.java | 0 .../sun/jvm/hotspot/tools/StackTrace.java | 0 .../sun/jvm/hotspot/tools/SysPropsDumper.java | 0 .../classes/sun/jvm/hotspot/tools/Tool.java | 0 .../hotspot/tools/jcore/ByteCodeRewriter.java | 0 .../jvm/hotspot/tools/jcore/ClassDump.java | 0 .../jvm/hotspot/tools/jcore/ClassFilter.java | 0 .../jvm/hotspot/tools/jcore/ClassWriter.java | 0 .../jvm/hotspot/tools/jcore/NameFilter.java | 0 .../tools/jcore/PackageNameFilter.java | 0 .../sun/jvm/hotspot/tools/soql/JSDB.java | 0 .../sun/jvm/hotspot/tools/soql/SOQL.java | 0 .../sun/jvm/hotspot/types/AddressField.java | 0 .../sun/jvm/hotspot/types/CIntegerField.java | 0 .../sun/jvm/hotspot/types/CIntegerType.java | 0 .../classes/sun/jvm/hotspot/types/Field.java | 0 .../sun/jvm/hotspot/types/JBooleanField.java | 0 .../sun/jvm/hotspot/types/JByteField.java | 0 .../sun/jvm/hotspot/types/JCharField.java | 0 .../sun/jvm/hotspot/types/JDoubleField.java | 0 .../sun/jvm/hotspot/types/JFloatField.java | 0 .../sun/jvm/hotspot/types/JIntField.java | 0 .../sun/jvm/hotspot/types/JLongField.java | 0 .../sun/jvm/hotspot/types/JShortField.java | 0 .../sun/jvm/hotspot/types/NarrowOopField.java | 0 .../sun/jvm/hotspot/types/OopField.java | 0 .../sun/jvm/hotspot/types/PointerType.java | 0 .../classes/sun/jvm/hotspot/types/Type.java | 0 .../sun/jvm/hotspot/types/TypeDataBase.java | 0 .../jvm/hotspot/types/WrongTypeException.java | 0 .../types/basic/BasicAddressFieldWrapper.java | 0 .../types/basic/BasicCIntegerField.java | 0 .../types/basic/BasicCIntegerType.java | 0 .../jvm/hotspot/types/basic/BasicField.java | 0 .../types/basic/BasicFieldWrapper.java | 0 .../types/basic/BasicJBooleanField.java | 0 .../hotspot/types/basic/BasicJByteField.java | 0 .../hotspot/types/basic/BasicJCharField.java | 0 .../types/basic/BasicJDoubleField.java | 0 .../hotspot/types/basic/BasicJFloatField.java | 0 .../hotspot/types/basic/BasicJIntField.java | 0 .../hotspot/types/basic/BasicJLongField.java | 0 .../hotspot/types/basic/BasicJShortField.java | 0 .../types/basic/BasicNarrowOopField.java | 0 .../hotspot/types/basic/BasicOopField.java | 0 .../hotspot/types/basic/BasicPointerType.java | 0 .../jvm/hotspot/types/basic/BasicType.java | 0 .../types/basic/BasicTypeDataBase.java | 0 .../hotspot/types/basic/BasicVtblAccess.java | 0 .../jvm/hotspot/types/basic/VtblAccess.java | 0 .../jvm/hotspot/ui/AnnotatedMemoryPanel.java | 0 .../sun/jvm/hotspot/ui/Annotation.java | 0 .../jvm/hotspot/ui/CommandProcessorPanel.java | 0 .../hotspot/ui/DeadlockDetectionPanel.java | 0 .../jvm/hotspot/ui/DebuggerConsolePanel.java | 0 .../jvm/hotspot/ui/EditableAtEndDocument.java | 0 .../classes/sun/jvm/hotspot/ui/Editor.java | 0 .../sun/jvm/hotspot/ui/EditorCommands.java | 0 .../sun/jvm/hotspot/ui/EditorFactory.java | 0 .../sun/jvm/hotspot/ui/FindByQueryPanel.java | 0 .../jvm/hotspot/ui/FindInCodeCachePanel.java | 0 .../sun/jvm/hotspot/ui/FindInHeapPanel.java | 0 .../classes/sun/jvm/hotspot/ui/FindPanel.java | 0 .../sun/jvm/hotspot/ui/FrameWrapper.java | 0 .../sun/jvm/hotspot/ui/GraphicsUtilities.java | 0 .../jvm/hotspot/ui/HeapParametersPanel.java | 0 .../hotspot/ui/HighPrecisionJScrollBar.java | 0 .../sun/jvm/hotspot/ui/HistoryComboBox.java | 0 .../classes/sun/jvm/hotspot/ui/Inspector.java | 0 .../sun/jvm/hotspot/ui/JFrameWrapper.java | 0 .../jvm/hotspot/ui/JInternalFrameWrapper.java | 0 .../jvm/hotspot/ui/JavaStackTracePanel.java | 0 .../sun/jvm/hotspot/ui/JavaThreadsPanel.java | 0 .../sun/jvm/hotspot/ui/MemoryPanel.java | 0 .../sun/jvm/hotspot/ui/MemoryViewer.java | 0 .../jvm/hotspot/ui/MonitorCacheDumpPanel.java | 0 .../jvm/hotspot/ui/ObjectHistogramPanel.java | 0 .../sun/jvm/hotspot/ui/ObjectListPanel.java | 0 .../sun/jvm/hotspot/ui/ProcessListPanel.java | 0 .../sun/jvm/hotspot/ui/ProgressBarPanel.java | 0 .../sun/jvm/hotspot/ui/SAEditorPane.java | 0 .../sun/jvm/hotspot/ui/SAListener.java | 0 .../classes/sun/jvm/hotspot/ui/SAPanel.java | 0 .../sun/jvm/hotspot/ui/SourceCodePanel.java | 0 .../jvm/hotspot/ui/StringTransferable.java | 0 .../sun/jvm/hotspot/ui/SysPropsPanel.java | 0 .../sun/jvm/hotspot/ui/ThreadInfoPanel.java | 0 .../sun/jvm/hotspot/ui/VMFlagsPanel.java | 0 .../jvm/hotspot/ui/VMVersionInfoPanel.java | 0 .../sun/jvm/hotspot/ui/action/FindAction.java | 0 .../hotspot/ui/action/FindClassesAction.java | 0 .../hotspot/ui/action/FindCrashesAction.java | 0 .../hotspot/ui/action/HSDBActionManager.java | 0 .../jvm/hotspot/ui/action/InspectAction.java | 0 .../ui/action/JavaStackTraceAction.java | 0 .../jvm/hotspot/ui/action/MemoryAction.java | 0 .../sun/jvm/hotspot/ui/action/ShowAction.java | 0 .../hotspot/ui/action/ThreadInfoAction.java | 0 .../ui/classbrowser/ClassBrowserPanel.java | 0 .../ui/classbrowser/CodeViewerPanel.java | 0 .../ui/classbrowser/HTMLGenerator.java | 0 .../sun/jvm/hotspot/ui/resources/arrow.png | Bin .../jvm/hotspot/ui/resources/breakpoint.png | Bin .../sun/jvm/hotspot/ui/resources/triangle.png | Bin .../hotspot/ui/table/LongCellRenderer.java | 0 .../ui/table/SortHeaderCellRenderer.java | 0 .../ui/table/SortHeaderMouseAdapter.java | 0 .../hotspot/ui/table/SortableTableModel.java | 0 .../ui/table/TableModelComparator.java | 0 .../ui/tree/BadAddressTreeNodeAdapter.java | 0 .../ui/tree/BooleanTreeNodeAdapter.java | 0 .../ui/tree/CStringTreeNodeAdapter.java | 0 .../hotspot/ui/tree/CTypeTreeNodeAdapter.java | 0 .../hotspot/ui/tree/CharTreeNodeAdapter.java | 0 .../ui/tree/DoubleTreeNodeAdapter.java | 0 .../hotspot/ui/tree/FieldTreeNodeAdapter.java | 0 .../hotspot/ui/tree/FloatTreeNodeAdapter.java | 0 .../hotspot/ui/tree/LongTreeNodeAdapter.java | 0 .../ui/tree/MetadataTreeNodeAdapter.java | 0 .../hotspot/ui/tree/OopTreeNodeAdapter.java | 0 .../ui/tree/RevPtrsTreeNodeAdapter.java | 0 .../hotspot/ui/tree/RootTreeNodeAdapter.java | 0 .../hotspot/ui/tree/SimpleTreeGroupNode.java | 0 .../jvm/hotspot/ui/tree/SimpleTreeModel.java | 0 .../jvm/hotspot/ui/tree/SimpleTreeNode.java | 0 .../ui/treetable/AbstractTreeTableModel.java | 0 .../jvm/hotspot/ui/treetable/JTreeTable.java | 0 .../ui/treetable/SimpleTreeTableModel.java | 0 .../hotspot/ui/treetable/TreeTableModel.java | 0 .../ui/treetable/TreeTableModelAdapter.java | 0 .../utilities/AbstractHeapGraphWriter.java | 0 .../sun/jvm/hotspot/utilities/AddressOps.java | 0 .../hotspot/utilities/AltPlatformInfo.java | 0 .../sun/jvm/hotspot/utilities/Assert.java | 0 .../hotspot/utilities/AssertionFailure.java | 0 .../jvm/hotspot/utilities/BasicHashtable.java | 0 .../utilities/BasicHashtableEntry.java | 0 .../sun/jvm/hotspot/utilities/BitMap.java | 0 .../jvm/hotspot/utilities/BitMapClosure.java | 0 .../sun/jvm/hotspot/utilities/Bits.java | 0 .../jvm/hotspot/utilities/CPPExpressions.java | 0 .../hotspot/utilities/CStringUtilities.java | 0 .../hotspot/utilities/CompactHashTable.java | 0 .../jvm/hotspot/utilities/ConstIterator.java | 0 .../jvm/hotspot/utilities/ConstantTag.java | 0 .../hotspot/utilities/FindObjectByType.java | 0 .../jvm/hotspot/utilities/GenericArray.java | 0 .../utilities/GenericGrowableArray.java | 0 .../jvm/hotspot/utilities/GrowableArray.java | 0 .../sun/jvm/hotspot/utilities/Hashtable.java | 0 .../hotspot/utilities/HashtableBucket.java | 0 .../jvm/hotspot/utilities/HashtableEntry.java | 0 .../jvm/hotspot/utilities/HeapGXLWriter.java | 0 .../hotspot/utilities/HeapGraphWriter.java | 0 .../hotspot/utilities/HeapHprofBinWriter.java | 0 .../hotspot/utilities/HeapProgressThunk.java | 0 .../sun/jvm/hotspot/utilities/IntArray.java | 0 .../jvm/hotspot/utilities/IntegerEnum.java | 0 .../sun/jvm/hotspot/utilities/Interval.java | 0 .../jvm/hotspot/utilities/IntervalNode.java | 0 .../jvm/hotspot/utilities/IntervalTree.java | 0 .../sun/jvm/hotspot/utilities/KlassArray.java | 0 .../hotspot/utilities/LivenessAnalysis.java | 0 .../jvm/hotspot/utilities/LivenessPath.java | 0 .../utilities/LivenessPathElement.java | 0 .../hotspot/utilities/LivenessPathList.java | 0 .../sun/jvm/hotspot/utilities/MarkBits.java | 0 .../jvm/hotspot/utilities/MessageQueue.java | 0 .../utilities/MessageQueueBackend.java | 0 .../jvm/hotspot/utilities/MethodArray.java | 0 .../jvm/hotspot/utilities/ObjectReader.java | 0 .../jvm/hotspot/utilities/PlatformInfo.java | 0 .../jvm/hotspot/utilities/PointerFinder.java | 0 .../hotspot/utilities/PointerLocation.java | 0 .../utilities/ProcImageClassLoader.java | 0 .../utilities/ProgressiveHeapVisitor.java | 0 .../sun/jvm/hotspot/utilities/RBColor.java | 0 .../sun/jvm/hotspot/utilities/RBNode.java | 0 .../sun/jvm/hotspot/utilities/RBTree.java | 0 .../jvm/hotspot/utilities/ReversePtrs.java | 0 .../utilities/ReversePtrsAnalysis.java | 0 .../utilities/RobustOopDeterminator.java | 0 .../jvm/hotspot/utilities/StreamMonitor.java | 0 .../utilities/SystemDictionaryHelper.java | 0 .../hotspot/utilities/TwoOopHashtable.java | 0 .../sun/jvm/hotspot/utilities/U1Array.java | 0 .../sun/jvm/hotspot/utilities/U2Array.java | 0 .../UnsupportedPlatformException.java | 0 .../jvm/hotspot/utilities/WorkerThread.java | 0 .../utilities/memo/MemoizedBoolean.java | 0 .../hotspot/utilities/memo/MemoizedByte.java | 0 .../hotspot/utilities/memo/MemoizedChar.java | 0 .../utilities/memo/MemoizedDouble.java | 0 .../hotspot/utilities/memo/MemoizedFloat.java | 0 .../hotspot/utilities/memo/MemoizedInt.java | 0 .../hotspot/utilities/memo/MemoizedLong.java | 0 .../utilities/memo/MemoizedObject.java | 0 .../hotspot/utilities/memo/MemoizedShort.java | 0 .../jvm/hotspot/utilities/soql/Callable.java | 0 .../utilities/soql/DefaultScriptObject.java | 0 .../utilities/soql/InvocableCallable.java | 0 .../hotspot/utilities/soql/JSJavaArray.java | 0 .../utilities/soql/JSJavaArrayKlass.java | 0 .../hotspot/utilities/soql/JSJavaClass.java | 0 .../hotspot/utilities/soql/JSJavaFactory.java | 0 .../utilities/soql/JSJavaFactoryImpl.java | 0 .../hotspot/utilities/soql/JSJavaField.java | 0 .../hotspot/utilities/soql/JSJavaFrame.java | 0 .../hotspot/utilities/soql/JSJavaHeap.java | 0 .../utilities/soql/JSJavaInstance.java | 0 .../utilities/soql/JSJavaInstanceKlass.java | 0 .../hotspot/utilities/soql/JSJavaKlass.java | 0 .../hotspot/utilities/soql/JSJavaMethod.java | 0 .../utilities/soql/JSJavaObjArray.java | 0 .../utilities/soql/JSJavaObjArrayKlass.java | 0 .../hotspot/utilities/soql/JSJavaObject.java | 0 .../utilities/soql/JSJavaScriptEngine.java | 0 .../hotspot/utilities/soql/JSJavaString.java | 0 .../hotspot/utilities/soql/JSJavaThread.java | 0 .../utilities/soql/JSJavaTypeArray.java | 0 .../utilities/soql/JSJavaTypeArrayKlass.java | 0 .../jvm/hotspot/utilities/soql/JSJavaVM.java | 0 .../jvm/hotspot/utilities/soql/JSList.java | 0 .../sun/jvm/hotspot/utilities/soql/JSMap.java | 0 .../hotspot/utilities/soql/JSMetadata.java | 0 .../utilities/soql/MapScriptObject.java | 0 .../utilities/soql/MethodCallable.java | 0 .../hotspot/utilities/soql/ObjectVisitor.java | 0 .../hotspot/utilities/soql/SOQLEngine.java | 0 .../hotspot/utilities/soql/SOQLException.java | 0 .../jvm/hotspot/utilities/soql/SOQLQuery.java | 0 .../hotspot/utilities/soql/ScriptObject.java | 0 .../sun/jvm/hotspot/utilities/soql/sa.js | 0 .../share/native/libsaproc}/sadis.c | 0 .../solaris/native/libsaproc}/libproc.h | 0 .../solaris/native/libsaproc}/salibproc.h | 0 .../solaris/native/libsaproc}/saproc.cpp | 0 .../native/libsaproc}/saproc_audit.cpp | 0 .../jdk.hotspot.agent}/test/jdi/README.jjh | 0 .../test/jdi/SASanityChecker.java | 0 .../jdk.hotspot.agent}/test/jdi/TEST.ROOT | 0 .../test/jdi/TargetAdapter.java | 0 .../test/jdi/TargetListener.java | 0 .../test/jdi/TestScaffold.java | 0 .../test/jdi/VMConnection.java | 0 .../jdk.hotspot.agent}/test/jdi/jstack.sh | 0 .../jdk.hotspot.agent}/test/jdi/jstack64.sh | 0 .../jdk.hotspot.agent}/test/jdi/multivm.java | 0 .../jdk.hotspot.agent}/test/jdi/multivm.sh | 0 .../jdk.hotspot.agent}/test/jdi/runjdb.sh | 0 .../jdk.hotspot.agent}/test/jdi/runjpda.sh | 0 .../jdk.hotspot.agent}/test/jdi/runsa.sh | 0 .../test/jdi/sagclient.java | 0 .../jdk.hotspot.agent}/test/jdi/sagdoit.java | 0 .../jdk.hotspot.agent}/test/jdi/sagtarg.java | 0 .../jdk.hotspot.agent}/test/jdi/sagtest.java | 0 .../jdk.hotspot.agent}/test/jdi/sasanity.sh | 0 .../jdk.hotspot.agent}/test/jdi/serialvm.java | 0 .../jdk.hotspot.agent}/test/jdi/serialvm.sh | 0 .../test/libproc/LibprocClient.java | 0 .../test/libproc/LibprocTest.java | 0 .../jdk.hotspot.agent}/test/libproc/Makefile | 0 .../jdk.hotspot.agent}/test/libproc/README | 0 .../test/libproc/libproctest.sh | 0 .../test/libproc/libproctest64.sh | 0 .../windows/native/libsaproc}/sawindbg.cpp | 0 1242 files changed, 4 insertions(+), 3895 deletions(-) delete mode 100644 hotspot/agent/make/Makefile delete mode 100644 hotspot/agent/make/README.txt delete mode 100644 hotspot/agent/make/build-filelist delete mode 100644 hotspot/agent/make/build-pkglist delete mode 100644 hotspot/agent/make/build.xml delete mode 100644 hotspot/agent/make/clhsdbproc.sh delete mode 100644 hotspot/agent/make/clhsdbproc64.sh delete mode 100644 hotspot/agent/make/clhsdbwindbg.bat delete mode 100644 hotspot/agent/make/clhsdbwindbg64.bat delete mode 100644 hotspot/agent/make/dumpflagsproc.sh delete mode 100644 hotspot/agent/make/dumpflagsproc64.sh delete mode 100644 hotspot/agent/make/dumpflagswindbg.bat delete mode 100644 hotspot/agent/make/dumpflagswindbg64.bat delete mode 100644 hotspot/agent/make/dumpsyspropsproc.sh delete mode 100644 hotspot/agent/make/dumpsyspropsproc64.sh delete mode 100644 hotspot/agent/make/dumpsyspropswindbg.bat delete mode 100644 hotspot/agent/make/dumpsyspropswindbg64.bat delete mode 100644 hotspot/agent/make/finalizerinfoproc.sh delete mode 100644 hotspot/agent/make/finalizerinfoproc64.sh delete mode 100644 hotspot/agent/make/finalizerinfowindbg.bat delete mode 100644 hotspot/agent/make/finalizerinfowindbg64.bat delete mode 100644 hotspot/agent/make/grantAll.policy delete mode 100644 hotspot/agent/make/heapdumpproc.sh delete mode 100644 hotspot/agent/make/heapdumpproc64.sh delete mode 100644 hotspot/agent/make/heapdumpwindbg.bat delete mode 100644 hotspot/agent/make/heapdumpwindbg64.bat delete mode 100644 hotspot/agent/make/heapsumproc.sh delete mode 100644 hotspot/agent/make/heapsumproc64.sh delete mode 100644 hotspot/agent/make/heapsumwindbg.bat delete mode 100644 hotspot/agent/make/heapsumwindbg64.bat delete mode 100644 hotspot/agent/make/hsdb.bat delete mode 100644 hotspot/agent/make/hsdb.sh delete mode 100644 hotspot/agent/make/hsdbproc.sh delete mode 100644 hotspot/agent/make/hsdbproc64.sh delete mode 100644 hotspot/agent/make/hsdbwindbg.bat delete mode 100644 hotspot/agent/make/hsdbwindbg64.bat delete mode 100644 hotspot/agent/make/index.html delete mode 100644 hotspot/agent/make/jcoreproc.sh delete mode 100644 hotspot/agent/make/jcoreproc64.sh delete mode 100644 hotspot/agent/make/jcorewindbg.bat delete mode 100644 hotspot/agent/make/jcorewindbg64.bat delete mode 100644 hotspot/agent/make/jdbcore.sh delete mode 100644 hotspot/agent/make/jdbcore64.sh delete mode 100644 hotspot/agent/make/jdbproc.sh delete mode 100644 hotspot/agent/make/jdbproc64.sh delete mode 100644 hotspot/agent/make/jhistoproc.sh delete mode 100644 hotspot/agent/make/jhistoproc64.sh delete mode 100644 hotspot/agent/make/jhistowindbg.bat delete mode 100644 hotspot/agent/make/jhistowindbg64.bat delete mode 100644 hotspot/agent/make/jsdbproc.sh delete mode 100644 hotspot/agent/make/jsdbproc64.sh delete mode 100644 hotspot/agent/make/jsdbwindbg.bat delete mode 100644 hotspot/agent/make/jsdbwindbg64.bat delete mode 100644 hotspot/agent/make/jstackproc.sh delete mode 100644 hotspot/agent/make/jstackproc64.sh delete mode 100644 hotspot/agent/make/jstackwindbg.bat delete mode 100644 hotspot/agent/make/jstackwindbg64.bat delete mode 100644 hotspot/agent/make/marks_notes.html delete mode 100644 hotspot/agent/make/mkinstall delete mode 100644 hotspot/agent/make/permstatproc.sh delete mode 100644 hotspot/agent/make/permstatproc64.sh delete mode 100644 hotspot/agent/make/permstatwindbg.bat delete mode 100644 hotspot/agent/make/permstatwindbg64.bat delete mode 100644 hotspot/agent/make/pmapproc.sh delete mode 100644 hotspot/agent/make/pmapproc64.sh delete mode 100644 hotspot/agent/make/pmapwindbg.bat delete mode 100644 hotspot/agent/make/pmapwindbg64.bat delete mode 100644 hotspot/agent/make/pstackproc.sh delete mode 100644 hotspot/agent/make/pstackproc64.sh delete mode 100644 hotspot/agent/make/pstackwindbg.bat delete mode 100644 hotspot/agent/make/pstackwindbg64.bat delete mode 100644 hotspot/agent/make/saenv.bat delete mode 100644 hotspot/agent/make/saenv.sh delete mode 100644 hotspot/agent/make/saenv64.bat delete mode 100644 hotspot/agent/make/saenv64.sh delete mode 100644 hotspot/agent/make/soqlproc.sh delete mode 100644 hotspot/agent/make/soqlproc64.sh delete mode 100644 hotspot/agent/make/soqlwindbg.bat delete mode 100644 hotspot/agent/make/soqlwindbg64.bat delete mode 100644 hotspot/agent/make/start-debug-server delete mode 100644 hotspot/agent/make/start-debug-server-proc.sh delete mode 100644 hotspot/agent/make/start-debug-server-proc64.sh delete mode 100644 hotspot/agent/make/start-debug-server-windbg.bat delete mode 100644 hotspot/agent/make/start-debug-server-windbg64.bat delete mode 100644 hotspot/agent/make/start-rmiregistry.bat delete mode 100644 hotspot/agent/make/start-rmiregistry.sh delete mode 100644 hotspot/agent/src/os/bsd/Makefile delete mode 100644 hotspot/agent/src/os/linux/Makefile delete mode 100644 hotspot/agent/src/os/solaris/Makefile delete mode 100644 hotspot/agent/src/os/solaris/proc/Makefile delete mode 100644 hotspot/agent/src/os/win32/windbg/Makefile rename hotspot/{agent/src/os/linux/mapfile => make/mapfiles/libsaproc/mapfile-linux} (100%) rename hotspot/{agent/src/os/bsd/mapfile => make/mapfiles/libsaproc/mapfile-macosx} (100%) rename hotspot/{agent/src/os/solaris/proc/mapfile => make/mapfiles/libsaproc/mapfile-solaris} (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/doc/ReadMe-JavaScript.text (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/doc/cireplay.html (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/doc/clhsdb.html (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/doc/hsdb.html (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/doc/index.html (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/doc/jsdb.html (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/doc/transported_core.html (100%) rename hotspot/{agent/src/os/linux => src/jdk.hotspot.agent/linux/native/libsaproc}/LinuxDebuggerLocal.c (100%) rename hotspot/{agent/src/os/linux => src/jdk.hotspot.agent/linux/native/libsaproc}/elfmacros.h (100%) rename hotspot/{agent/src/os/linux => src/jdk.hotspot.agent/linux/native/libsaproc}/libproc.h (100%) rename hotspot/{agent/src/os/linux => src/jdk.hotspot.agent/linux/native/libsaproc}/libproc_impl.c (100%) rename hotspot/{agent/src/os/linux => src/jdk.hotspot.agent/linux/native/libsaproc}/libproc_impl.h (100%) rename hotspot/{agent/src/os/linux => src/jdk.hotspot.agent/linux/native/libsaproc}/proc_service.h (100%) rename hotspot/{agent/src/os/linux => src/jdk.hotspot.agent/linux/native/libsaproc}/ps_core.c (100%) rename hotspot/{agent/src/os/linux => src/jdk.hotspot.agent/linux/native/libsaproc}/ps_proc.c (100%) rename hotspot/{agent/src/os/linux => src/jdk.hotspot.agent/linux/native/libsaproc}/salibelf.c (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/linux/native/libsaproc}/salibelf.h (100%) rename hotspot/{agent/src/os/linux => src/jdk.hotspot.agent/linux/native/libsaproc}/symtab.c (100%) rename hotspot/{agent/src/os/linux => src/jdk.hotspot.agent/linux/native/libsaproc}/symtab.h (100%) rename hotspot/{agent/src/os/linux => src/jdk.hotspot.agent/linux/native/libsaproc}/test.c (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/macosx/native/libsaproc}/BsdDebuggerLocal.c (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/macosx/native/libsaproc}/MacosxDebuggerLocal.m (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/macosx/native/libsaproc}/StubDebuggerLocal.c (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/macosx/native/libsaproc}/elfmacros.h (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/macosx/native/libsaproc}/libproc.h (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/macosx/native/libsaproc}/libproc_impl.c (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/macosx/native/libsaproc}/libproc_impl.h (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/macosx/native/libsaproc}/ps_core.c (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/macosx/native/libsaproc}/ps_proc.c (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/macosx/native/libsaproc}/salibelf.c (100%) rename hotspot/{agent/src/os/linux => src/jdk.hotspot.agent/macosx/native/libsaproc}/salibelf.h (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/macosx/native/libsaproc}/symtab.c (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/macosx/native/libsaproc}/symtab.h (100%) rename hotspot/{agent/src/os/bsd => src/jdk.hotspot.agent/macosx/native/libsaproc}/test.c (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/scripts/README (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/scripts/start-debug-server.bat (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/scripts/start-debug-server.sh (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/scripts/start-debug-server64.sh (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/scripts/start-rmiregistry.bat (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/scripts/start-rmiregistry.sh (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/scripts/start-rmiregistry64.sh (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/META-INF/services/com.sun.jdi.connect.Connector (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/AboutAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/ActionManager.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/ActionUtilities.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/AlignCenterAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/AlignLeftAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/AlignRightAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/ApplyAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/BackAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/CancelAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/DelegateAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/ExitAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/FileMenu.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/FinishAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/HelpAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/HelpMenu.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/NewAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/NextAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/OkAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/OpenAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/SaveAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/SaveAsAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/StateChangeAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/action/ViewMenu.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/ui/CommonMenuBar.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/ui/CommonToolBar.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/ui/CommonUI.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/ui/OkCancelButtonPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/ui/OkCancelDialog.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/ui/SplashScreen.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/ui/StatusBar.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/ui/TabsDlg.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/ui/ToggleActionPropertyChangeListener.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/com/sun/java/swing/ui/WizardDlg.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/development/Server16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/development/Server24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/About16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/About24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/Delete16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/Delete24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/Find16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/Help16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/Help24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/History16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/History24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/Information16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/Information24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/New16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/New24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/Open16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/Open24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/Save16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/Save24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/SaveAs16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/SaveAs24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/Zoom16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/ZoomIn16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/general/ZoomIn24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/navigation/Down16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/navigation/Up16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/text/AlignCenter16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/text/AlignCenter24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/text/AlignLeft16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/text/AlignLeft24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/text/AlignRight16.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/images/toolbarButtonGraphics/text/AlignRight24.gif (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/BsdVtblAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/CLHSDB.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/CommandProcessor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/DebugServer.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/HSDB.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/HelloWorld.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/HotSpotAgent.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/HotSpotSolarisVtblAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/LinuxVtblAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ObjectHistogram.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/RMIHelper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/SAGetopt.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/SALauncher.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/SALauncherLoader.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/StackTrace.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/Win32VtblAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/asm/Disassembler.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/asm/DummySymbolFinder.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/asm/ImmediateOrRegister.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/asm/InstructionVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/asm/Operand.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/asm/Register.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/asm/SymbolFinder.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/asm/sparc/SPARCArgument.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegister.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegisterType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegisters.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/c1/Runtime1.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciArrayKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciBaseObject.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciConstant.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciEnv.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciInstance.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciInstanceKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciMetadata.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciMethod.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciMethodData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciObjArrayKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciObject.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciObjectFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciSymbol.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ci/ciTypeArrayKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/classfile/ClassLoaderData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/AdapterBlob.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/BufferBlob.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/CodeBlob.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/CodeCache.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/CodeCacheVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/CompressedReadStream.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/CompressedStream.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/CompressedWriteStream.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/ConstantDoubleValue.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/ConstantIntValue.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/ConstantLongValue.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/ConstantOopReadValue.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/DebugInformationRecorder.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/DeoptimizationBlob.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/ExceptionBlob.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/Location.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/LocationValue.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/MethodHandlesAdapterBlob.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/MonitorValue.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/NMethod.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/ObjectValue.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/PCDesc.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/RuntimeStub.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/SafepointBlob.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/ScopeDesc.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/ScopeValue.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/SingletonBlob.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/Stub.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/StubQueue.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/UncommonTrapBlob.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/code/VMRegImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/compiler/CompileTask.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMapPair.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMapSet.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/compiler/OopMapStream.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/compiler/OopMapValue.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/compiler/OopMapVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/Address.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/AddressException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/DataSource.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/Debugger.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/DebuggerException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/DebuggerUtilities.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/InputLexer.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/JVMDebugger.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/LongHashMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/MachineDescription.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionAArch64.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionAMD64.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIA64.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIntelX86.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionPPC64.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC32Bit.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC64Bit.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionTwosComplement.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/MappedByteBufferDataSource.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/NoSuchSymbolException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/NotInHeapException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/OopHandle.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/Page.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/PageCache.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/PageFetcher.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/ProcessInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/RandomAccessFileDataSource.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/ReadResult.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/SymbolLookup.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/ThreadAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/ThreadProxy.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/UnalignedAddressException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/UnmappedAddressException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/aarch64/AARCH64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/amd64/AMD64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/bsd/BsdAddress.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebugger.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/bsd/BsdOopHandle.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/bsd/SharedObject.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64CFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86CFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/AccessControl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/ArrayType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/BaseClass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/BitType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/BlockSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/CDebugInfoDataBase.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/CDebugger.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/CFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/CVAttributes.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/ClosestSymbol.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/CompoundType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/DebugEvent.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/DefaultObjectVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/DoubleType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/EnumType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/Field.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/FieldIdentifier.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/FloatType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/FunctionSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/FunctionType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/GlobalSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/IndexableFieldIdentifier.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/IntType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/LineNumberInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/LineNumberVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/LoadObject.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/LoadObjectComparator.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/LocalSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/MemberFunctionType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/NamedFieldIdentifier.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/ObjectVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/PointerType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/ProcessControl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/RefType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/Sym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/TemplateType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/Type.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/TypeVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/VoidType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicArrayType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBaseClass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBitType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBlockSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCDebugInfoDataBase.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCompoundType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicDebugEvent.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicDoubleType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicEnumType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFloatType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFunctionSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFunctionType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicGlobalSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicIndexableFieldIdentifier.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicIntType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLineNumberInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLineNumberMapping.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLocalSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicMemberFunctionType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicNamedFieldIdentifier.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicPointerType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicRefType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicVoidType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/CompoundTypeKind.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/LazyBlockSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/LazyType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/ResolveListener.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/dummy/DummyAddress.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/dummy/DummyDebugger.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/dummy/DummyOopHandle.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/ia64/IA64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebugger.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/LinuxOopHandle.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/SharedObject.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64CFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/ia64/LinuxIA64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/ppc64/LinuxPPC64CFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/ppc64/LinuxPPC64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/sparc/LinuxSPARCCFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/sparc/LinuxSPARCThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/posix/AddressDataSource.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/posix/DSO.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFFile.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFFileParser.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHashTable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFProgramHeader.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFSectionHeader.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFStringTable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFSymbol.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/ppc64/PPC64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/ProcAddress.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/ProcCDebugger.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/ProcCFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebugger.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/ProcOopHandle.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/ProcThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/SharedObject.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64Thread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64ThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64Thread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64ThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64Thread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64ThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86Thread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86ThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/RemoteAddress.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebugger.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerServer.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/RemoteOopHandle.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/RemoteThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/RemoteThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64Thread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64ThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64Thread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64ThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64Thread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64ThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86Thread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86ThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/sparc/SPARCThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxBfEfRecord.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxFileRecord.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxFunctionDefinitionRecord.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxSectionDefinitionsRecord.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxSymbolRecord.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxWeakExternalRecord.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFFile.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFFileParser.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFHeader.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFLineNumber.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFRelocation.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFSymbol.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFSymbolConstants.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/COMDATSelectionTypes.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/Characteristics.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DLLCharacteristics.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DataDirectory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugDirectory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugDirectoryEntry.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugTypes.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50MemberAttributes.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50ReservedTypes.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSAlignSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSFileIndex.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalPub.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalTypes.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSLibraries.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSMPC.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSModule.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSOffsetMap16.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSOffsetMap32.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPreComp.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPublic.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPublicSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSegMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSegName.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSrcLnSeg.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSrcModule.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSStaticSym.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSymbolBase.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSymbols.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSTypes.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegDesc.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegDescEnums.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SrcModFileDesc.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SrcModLineNumberMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50Subsection.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SubsectionDirectory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SubsectionTypes.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolEnums.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolIterator.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolTypes.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeEnums.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeIterator.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeLeafIndices.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50WrongNumericTypeException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50X86RegisterEnums.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/DumpExports.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/ExportDirectoryTable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/MachineTypes.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeader.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderDataDirectories.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderStandardFields.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderWindowsSpecificFields.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/SectionFlags.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/SectionHeader.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/TestDebugInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/TestParser.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/TypeIndicators.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/win32/coff/WindowsNTSubsystem.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/AddressDataSource.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/DLL.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgAddress.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugInfoBuilder.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugger.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgOopHandle.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64Thread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64ThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64Thread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64ThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86Thread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86ThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windows/amd64/WindowsAMD64CFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/windows/x86/WindowsX86CFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/debugger/x86/X86ThreadContext.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/cms/AdaptiveFreeList.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/cms/CMSBitMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/cms/CMSCollector.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/cms/CompactibleFreeListSpace.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/cms/ConcurrentMarkSweepGeneration.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/cms/LinearAllocBlock.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/cms/ParNewGeneration.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/g1/G1HeapRegionTable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/g1/G1MonitoringSupport.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/g1/HeapRegion.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionManager.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionSetBase.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/parallel/ImmutableSpace.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/parallel/MutableSpace.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/parallel/PSOldGen.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/parallel/PSYoungGen.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/parallel/ParallelScavengeHeap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/serial/DefNewGeneration.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/serial/TenuredGeneration.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/CardGeneration.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeapName.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/CompactibleSpace.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/ContiguousSpace.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/G1YCType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/GCCause.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/GCName.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/GCWhen.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/GenCollectedHeap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/Generation.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/GenerationFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/GenerationIsInClosure.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/GenerationSpec.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/OffsetTableContigSpace.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/Space.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/SpaceClosure.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/gc/shared/TenuredSpace.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/Bytecode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeANewArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeBipush.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeCheckCast.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeDisassembler.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetPut.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetStatic.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeGoto.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeGotoW.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeIf.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeIinc.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeInstanceOf.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeJmp.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeJsr.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeJsrW.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoad.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadConstant.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadStore.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeLookupswitch.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeMultiANewArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeNew.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeNewArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodePutField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodePutStatic.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeRet.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeSipush.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeStore.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeStream.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeTableswitch.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeWideable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/Interpreter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/InterpreterCodelet.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/LookupswitchPair.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/MaskFillerForNative.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/OffsetClosure.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/OopMapCacheEntry.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/interpreter/OopMapForCacheEntry.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ArrayReferenceImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ArrayTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/BaseLineInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/BooleanTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/BooleanValueImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ByteTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ByteValueImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/CharTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/CharValueImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ClassLoaderReferenceImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ClassObjectReferenceImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ClassTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ConcreteMethodImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ConnectorImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/DoubleTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/DoubleValueImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/FieldImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/FloatTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/FloatValueImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/IntegerTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/IntegerValueImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/InterfaceTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/JNITypeParser.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/LineInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/LocalVariableImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/LocationImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/LongTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/LongValueImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/MethodImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/MirrorImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/MonitorInfoImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/NonConcreteMethodImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ObjectReferenceImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/PrimitiveTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/PrimitiveValueImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ReferenceTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/SACoreAttachingConnector.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/SADebugServer.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/SADebugServerAttachingConnector.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/SAJDIClassLoader.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/SAPIDAttachingConnector.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/SDE.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ShortTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ShortValueImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/StackFrameImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/StratumLineInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/StringReferenceImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ThreadGroupReferenceImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ThreadReferenceImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/TypeComponentImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/TypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/VMModifiers.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ValueContainer.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/ValueImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/VirtualMachineImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/VoidTypeImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/jdi/VoidValueImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/AFLBinaryTreeDictionary.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/CodeHeap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/Dictionary.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/FreeChunk.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/HeapBlock.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/LoaderConstraintEntry.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/LoaderConstraintTable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/MemRegion.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/PlaceholderEntry.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/PlaceholderTable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/ProtectionDomainCacheEntry.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/ProtectionDomainEntry.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/ReferenceType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/StringTable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/SymbolTable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/Universe.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/memory/VirtualSpace.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/AccessFlags.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ArgInfoData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/Array.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ArrayData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/BitData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/BooleanField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/BranchData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/BreakpointInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ByteField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/CIntField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/CallTypeData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/CallTypeDataInterface.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/CellTypeState.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/CellTypeStateList.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/CharField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/CheckedExceptionElement.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/CompiledICHolder.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/CompressedLineNumberReadStream.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ConstMethod.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ConstantPool.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/CounterData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/DataLayout.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/DefaultHeapVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/DefaultMetadataVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/DefaultOopVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/DoubleField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ExceptionTableElement.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/Field.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/FieldIdentifier.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/FieldType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/FieldVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/FloatField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/HeapPrinter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/HeapVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/IndexableFieldIdentifier.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/Instance.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/InstanceClassLoaderKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/InstanceMirrorKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/InstanceRefKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/IntField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/JVMDIClassStatus.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/JumpData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/Klass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/LineNumberTableElement.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/LocalVariableTableElement.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/LongField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/Mark.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/Metadata.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/MetadataField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/MetadataVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/Method.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/MethodCounters.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/MethodData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/MethodDataInterface.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/MultiBranchData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/MutationException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/NamedFieldIdentifier.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/NarrowKlassField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/NarrowOopField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ObjArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ObjArrayKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ObjectHistogram.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ObjectHistogramElement.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/Oop.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/OopField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/OopPrinter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/OopUtilities.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/OopVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ParametersTypeData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ProfileData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/RawHeapVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ReceiverTypeData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/RetData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ReturnTypeEntry.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/ShortField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/SpeculativeTrapData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/Symbol.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/TypeArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/TypeArrayKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/TypeEntries.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/TypeEntriesAtCall.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/TypeStackSlotEntries.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/UnknownOopException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/VirtualCallData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/VirtualCallTypeData.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/oops/java_lang_Class.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/Block.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/Block_Array.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/Block_List.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/CallDynamicJavaNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/CallJavaNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/CallNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/CallRuntimeNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/CallStaticJavaNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/Compile.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/CompilerPhaseType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/HaltNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/InlineTree.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/JVMState.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/LoopNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/MachCallJavaNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/MachCallNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/MachCallRuntimeNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/MachCallStaticJavaNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/MachIfNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/MachNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/MachReturnNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/MachSafePointNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/MultiNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/Node.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/Node_Array.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/Node_List.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/Phase.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/PhaseRegAlloc.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/PhiNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/ProjNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/RegionNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/RootNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/SafePointNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/opto/TypeNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/prims/JvmtiExport.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/AddressVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ArgumentSizeComputer.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/Arguments.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/BasicLock.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/BasicObjectLock.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/BasicType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/BasicTypeSize.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/Bytes.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/CodeCacheSweeperThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/CompiledVFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/CompilerThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ConcurrentLocksPrinter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ConstructionException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/DeadlockDetector.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ExternalVFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/Flags.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/Frame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/InstanceConstructor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/InterpretedVFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/JNIHandleBlock.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/JNIHandles.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/JNIid.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/JavaCallWrapper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/JavaThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/JavaThreadFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/JavaThreadPDAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/JavaThreadState.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/JavaVFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/JvmtiAgentThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/MonitorInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/NativeSignatureIterator.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/OSThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ObjectMonitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ObjectSynchronizer.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/PerfDataEntry.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/PerfDataPrologue.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/PerfMemory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/RegisterMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ResultTypeFinder.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ServiceThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/SignatureConverter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/SignatureInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/SignatureIterator.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/StackFrameStream.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/StackValue.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/StackValueCollection.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/StaticBaseConstructor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/StubRoutines.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/Thread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ThreadLocalAllocBuffer.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/Threads.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/VFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/VM.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/VMObject.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/VMObjectFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/VMOps.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/VMReg.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/VMVersionMismatchException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/VirtualBaseConstructor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/VirtualConstructor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/WatcherThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64CurrentFrameGuess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64Frame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64JavaCallWrapper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64RegisterMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64CurrentFrameGuess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64JavaCallWrapper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/bsd/BsdSignals.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/bsd_x86/BsdSignals.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/bsd_x86/BsdX86JavaThreadPDAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/linux/LinuxSignals.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/linux_aarch64/LinuxAARCH64JavaThreadPDAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/linux_amd64/LinuxAMD64JavaThreadPDAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/linux_ppc64/LinuxPPC64JavaThreadPDAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/linux_sparc/LinuxSPARCJavaThreadPDAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/linux_x86/LinuxSignals.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/linux_x86/LinuxX86JavaThreadPDAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/posix/POSIXSignals.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64CurrentFrameGuess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64Frame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64JavaCallWrapper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64RegisterMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/solaris_amd64/SolarisAMD64JavaThreadPDAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/solaris_sparc/SolarisSPARCJavaThreadPDAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/solaris_x86/SolarisX86JavaThreadPDAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCRegisterMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/vmSymbols.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/win32_amd64/Win32AMD64JavaThreadPDAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/win32_x86/Win32X86JavaThreadPDAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/x86/X86CurrentFrameGuess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/x86/X86JavaCallWrapper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/runtime/x86/X86RegisterMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/FlagDumper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/HeapDumper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/HeapSummary.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/JInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/JMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/JSnap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/JStack.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/PMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/PStack.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/StackTrace.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/Tool.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/jcore/ClassFilter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/jcore/NameFilter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/jcore/PackageNameFilter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/AddressField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/CIntegerField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/CIntegerType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/Field.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/JBooleanField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/JByteField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/JCharField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/JDoubleField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/JFloatField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/JIntField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/JLongField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/JShortField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/NarrowOopField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/OopField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/PointerType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/Type.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/TypeDataBase.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/WrongTypeException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicAddressFieldWrapper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicCIntegerField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicCIntegerType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicFieldWrapper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicJBooleanField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicJByteField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicJCharField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicJDoubleField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicJFloatField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicJIntField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicJLongField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicJShortField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicNarrowOopField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicOopField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicPointerType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicTypeDataBase.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/BasicVtblAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/types/basic/VtblAccess.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/AnnotatedMemoryPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/Annotation.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/CommandProcessorPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/DeadlockDetectionPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/DebuggerConsolePanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/EditableAtEndDocument.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/Editor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/EditorCommands.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/EditorFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/FindByQueryPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/FindInCodeCachePanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/FindInHeapPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/FindPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/FrameWrapper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/GraphicsUtilities.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/HeapParametersPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/HighPrecisionJScrollBar.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/HistoryComboBox.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/Inspector.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/JFrameWrapper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/JInternalFrameWrapper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/JavaStackTracePanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/JavaThreadsPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/MemoryPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/MemoryViewer.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/MonitorCacheDumpPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/ObjectHistogramPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/ObjectListPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/ProcessListPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/ProgressBarPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/SAEditorPane.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/SAListener.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/SAPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/SourceCodePanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/StringTransferable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/SysPropsPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/ThreadInfoPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/VMFlagsPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/VMVersionInfoPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/action/FindAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/action/FindClassesAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/action/FindCrashesAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/action/HSDBActionManager.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/action/InspectAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/action/JavaStackTraceAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/action/MemoryAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/action/ShowAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/action/ThreadInfoAction.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/classbrowser/ClassBrowserPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/classbrowser/CodeViewerPanel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/resources/arrow.png (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/resources/breakpoint.png (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/resources/triangle.png (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/table/LongCellRenderer.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/table/SortHeaderCellRenderer.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/table/SortHeaderMouseAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/table/SortableTableModel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/table/TableModelComparator.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/BadAddressTreeNodeAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/BooleanTreeNodeAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/CStringTreeNodeAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/CTypeTreeNodeAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/CharTreeNodeAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/DoubleTreeNodeAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/FieldTreeNodeAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/FloatTreeNodeAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/LongTreeNodeAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/MetadataTreeNodeAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/OopTreeNodeAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/RevPtrsTreeNodeAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/RootTreeNodeAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeGroupNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeModel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/treetable/AbstractTreeTableModel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/treetable/JTreeTable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/treetable/SimpleTreeTableModel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/treetable/TreeTableModel.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/ui/treetable/TreeTableModelAdapter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/AddressOps.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/AltPlatformInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/Assert.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/AssertionFailure.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/BasicHashtable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/BasicHashtableEntry.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/BitMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/BitMapClosure.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/Bits.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/CPPExpressions.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/CStringUtilities.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/CompactHashTable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/ConstIterator.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/FindObjectByType.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/GenericArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/GenericGrowableArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/GrowableArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/Hashtable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/HashtableBucket.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/HashtableEntry.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/HeapGraphWriter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/HeapProgressThunk.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/IntArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/IntegerEnum.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/Interval.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/IntervalNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/IntervalTree.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/KlassArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/LivenessAnalysis.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/LivenessPath.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/LivenessPathElement.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/LivenessPathList.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/MarkBits.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/MessageQueue.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/MessageQueueBackend.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/MethodArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/ObjectReader.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/PointerFinder.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/PointerLocation.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/ProcImageClassLoader.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/ProgressiveHeapVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/RBColor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/RBNode.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/RBTree.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/ReversePtrs.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/ReversePtrsAnalysis.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/RobustOopDeterminator.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/StreamMonitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/SystemDictionaryHelper.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/TwoOopHashtable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/U1Array.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/U2Array.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/UnsupportedPlatformException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/WorkerThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedBoolean.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedByte.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedChar.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedDouble.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedFloat.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedInt.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedLong.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedObject.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedShort.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/Callable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/DefaultScriptObject.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/InvocableCallable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaArrayKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaClass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFactory.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFactoryImpl.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaField.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFrame.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaHeap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstance.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaMethod.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObjArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObjArrayKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObject.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaScriptEngine.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaString.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaThread.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaTypeArray.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaTypeArrayKlass.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaVM.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSList.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSMap.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/JSMetadata.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/MapScriptObject.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/MethodCallable.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/ObjectVisitor.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/SOQLEngine.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/SOQLException.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/SOQLQuery.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/ScriptObject.java (100%) rename hotspot/{agent/src => src/jdk.hotspot.agent}/share/classes/sun/jvm/hotspot/utilities/soql/sa.js (100%) rename hotspot/{agent/src/share/native => src/jdk.hotspot.agent/share/native/libsaproc}/sadis.c (100%) rename hotspot/{agent/src/os/solaris/proc => src/jdk.hotspot.agent/solaris/native/libsaproc}/libproc.h (100%) rename hotspot/{agent/src/os/solaris/proc => src/jdk.hotspot.agent/solaris/native/libsaproc}/salibproc.h (100%) rename hotspot/{agent/src/os/solaris/proc => src/jdk.hotspot.agent/solaris/native/libsaproc}/saproc.cpp (100%) rename hotspot/{agent/src/os/solaris/proc => src/jdk.hotspot.agent/solaris/native/libsaproc}/saproc_audit.cpp (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/README.jjh (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/SASanityChecker.java (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/TEST.ROOT (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/TargetAdapter.java (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/TargetListener.java (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/TestScaffold.java (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/VMConnection.java (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/jstack.sh (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/jstack64.sh (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/multivm.java (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/multivm.sh (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/runjdb.sh (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/runjpda.sh (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/runsa.sh (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/sagclient.java (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/sagdoit.java (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/sagtarg.java (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/sagtest.java (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/sasanity.sh (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/serialvm.java (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/jdi/serialvm.sh (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/libproc/LibprocClient.java (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/libproc/LibprocTest.java (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/libproc/Makefile (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/libproc/README (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/libproc/libproctest.sh (100%) rename hotspot/{agent => src/jdk.hotspot.agent}/test/libproc/libproctest64.sh (100%) rename hotspot/{agent/src/os/win32/windbg => src/jdk.hotspot.agent/windows/native/libsaproc}/sawindbg.cpp (100%) diff --git a/hotspot/agent/make/Makefile b/hotspot/agent/make/Makefile deleted file mode 100644 index 9b5d03abc1e..00000000000 --- a/hotspot/agent/make/Makefile +++ /dev/null @@ -1,331 +0,0 @@ -# -# Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -# This guards against adding broken .java files to the directory -# hierarchy, but may be a pain to keep in sync - -# Generated using the build-pkglist script -ifeq "x$(GAMMADIR)" "x" -include ../../make/defs.make -else -include $(GAMMADIR)/make/defs.make -endif - -ifeq "x$(HOTSPOT_BUILD_VERSION)" "x" -SA_BUILD_VERSION=$(HOTSPOT_RELEASE_VERSION) -else -SA_BUILD_VERSION=$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION) -endif - -PKGLIST = \ -sun.jvm.hotspot \ -sun.jvm.hotspot.asm \ -sun.jvm.hotspot.asm.sparc \ -sun.jvm.hotspot.c1 \ -sun.jvm.hotspot.ci \ -sun.jvm.hotspot.code \ -sun.jvm.hotspot.compiler \ -sun.jvm.hotspot.debugger \ -sun.jvm.hotspot.debugger.amd64 \ -sun.jvm.hotspot.debugger.bsd \ -sun.jvm.hotspot.debugger.bsd.amd64 \ -sun.jvm.hotspot.debugger.bsd.x86 \ -sun.jvm.hotspot.debugger.cdbg \ -sun.jvm.hotspot.debugger.cdbg.basic \ -sun.jvm.hotspot.debugger.cdbg.basic.amd64 \ -sun.jvm.hotspot.debugger.cdbg.basic.x86 \ -sun.jvm.hotspot.debugger.dummy \ -sun.jvm.hotspot.debugger.linux \ -sun.jvm.hotspot.debugger.linux.amd64 \ -sun.jvm.hotspot.debugger.linux.aarch64 \ -sun.jvm.hotspot.debugger.linux.ppc64 \ -sun.jvm.hotspot.debugger.linux.x86 \ -sun.jvm.hotspot.debugger.posix \ -sun.jvm.hotspot.debugger.posix.elf \ -sun.jvm.hotspot.debugger.ppc64 \ -sun.jvm.hotspot.debugger.proc \ -sun.jvm.hotspot.debugger.proc.amd64 \ -sun.jvm.hotspot.debugger.proc.aarch64 \ -sun.jvm.hotspot.debugger.proc.ppc64 \ -sun.jvm.hotspot.debugger.proc.sparc \ -sun.jvm.hotspot.debugger.proc.x86 \ -sun.jvm.hotspot.debugger.remote \ -sun.jvm.hotspot.debugger.remote.amd64 \ -sun.jvm.hotspot.debugger.remote.ppc64 \ -sun.jvm.hotspot.debugger.remote.sparc \ -sun.jvm.hotspot.debugger.remote.x86 \ -sun.jvm.hotspot.debugger.sparc \ -sun.jvm.hotspot.debugger.win32.coff \ -sun.jvm.hotspot.debugger.windbg \ -sun.jvm.hotspot.debugger.windbg.amd64 \ -sun.jvm.hotspot.debugger.windbg.x86 \ -sun.jvm.hotspot.debugger.x86 \ -sun.jvm.hotspot.gc \ -sun.jvm.hotspot.gc.g1 \ -sun.jvm.hotspot.gc.parallel \ -sun.jvm.hotspot.gc.shared \ -sun.jvm.hotspot.interpreter \ -sun.jvm.hotspot.jdi \ -sun.jvm.hotspot.memory \ -sun.jvm.hotspot.opto \ -sun.jvm.hotspot.oops \ -sun.jvm.hotspot.prims \ -sun.jvm.hotspot.runtime \ -sun.jvm.hotspot.runtime.amd64 \ -sun.jvm.hotspot.runtime.aarch64 \ -sun.jvm.hotspot.runtime.bsd \ -sun.jvm.hotspot.runtime.bsd_amd64 \ -sun.jvm.hotspot.runtime.bsd_x86 \ -sun.jvm.hotspot.runtime.linux \ -sun.jvm.hotspot.runtime.linux_amd64 \ -sun.jvm.hotspot.runtime.linux_aarch64 \ -sun.jvm.hotspot.runtime.linux_ppc64 \ -sun.jvm.hotspot.runtime.linux_sparc \ -sun.jvm.hotspot.runtime.linux_x86 \ -sun.jvm.hotspot.runtime.posix \ -sun.jvm.hotspot.runtime.ppc64 \ -sun.jvm.hotspot.runtime.solaris_amd64 \ -sun.jvm.hotspot.runtime.solaris_sparc \ -sun.jvm.hotspot.runtime.solaris_x86 \ -sun.jvm.hotspot.runtime.sparc \ -sun.jvm.hotspot.runtime.win32_amd64 \ -sun.jvm.hotspot.runtime.win32_x86 \ -sun.jvm.hotspot.runtime.x86 \ -sun.jvm.hotspot.tools \ -sun.jvm.hotspot.tools.jcore \ -sun.jvm.hotspot.tools.soql \ -sun.jvm.hotspot.types \ -sun.jvm.hotspot.types.basic \ -sun.jvm.hotspot.ui \ -sun.jvm.hotspot.ui.action \ -sun.jvm.hotspot.ui.classbrowser \ -sun.jvm.hotspot.ui.resources \ -sun.jvm.hotspot.ui.table \ -sun.jvm.hotspot.ui.tree \ -sun.jvm.hotspot.ui.treetable \ -sun.jvm.hotspot.utilities \ -sun.jvm.hotspot.utilities.memo \ -sun.jvm.hotspot.utilities.soql \ -com.sun.java.swing.action \ -com.sun.java.swing.ui -#END PKGLIST - -# Generated using the build-filelist script -FILELIST = \ -sun/jvm/hotspot/*.java \ -sun/jvm/hotspot/asm/*.java \ -sun/jvm/hotspot/asm/sparc/*.java \ -sun/jvm/hotspot/c1/*.java \ -sun/jvm/hotspot/ci/*.java \ -sun/jvm/hotspot/code/*.java \ -sun/jvm/hotspot/compiler/*.java \ -sun/jvm/hotspot/debugger/*.java \ -sun/jvm/hotspot/debugger/amd64/*.java \ -sun/jvm/hotspot/debugger/bsd/*.java \ -sun/jvm/hotspot/debugger/bsd/amd64/*.java \ -sun/jvm/hotspot/debugger/bsd/x86/*.java \ -sun/jvm/hotspot/debugger/cdbg/*.java \ -sun/jvm/hotspot/debugger/cdbg/basic/*.java \ -sun/jvm/hotspot/debugger/cdbg/basic/amd64/*.java \ -sun/jvm/hotspot/debugger/cdbg/basic/x86/*.java \ -sun/jvm/hotspot/debugger/dummy/*.java \ -sun/jvm/hotspot/debugger/linux/*.java \ -sun/jvm/hotspot/debugger/linux/ppc64/*.java \ -sun/jvm/hotspot/debugger/linux/x86/*.java \ -sun/jvm/hotspot/debugger/linux/aarch64/*.java \ -sun/jvm/hotspot/debugger/posix/*.java \ -sun/jvm/hotspot/debugger/posix/elf/*.java \ -sun/jvm/hotspot/debugger/ppc64/*.java \ -sun/jvm/hotspot/debugger/proc/*.java \ -sun/jvm/hotspot/debugger/proc/amd64/*.java \ -sun/jvm/hotspot/debugger/proc/aarch64/*.java \ -sun/jvm/hotspot/debugger/proc/ppc64/*.java \ -sun/jvm/hotspot/debugger/proc/sparc/*.java \ -sun/jvm/hotspot/debugger/proc/x86/*.java \ -sun/jvm/hotspot/debugger/remote/*.java \ -sun/jvm/hotspot/debugger/remote/amd64/*.java \ -sun/jvm/hotspot/debugger/remote/aarch64/*.java \ -sun/jvm/hotspot/debugger/remote/ppc64/*.java \ -sun/jvm/hotspot/debugger/remote/sparc/*.java \ -sun/jvm/hotspot/debugger/remote/x86/*.java \ -sun/jvm/hotspot/debugger/sparc/*.java \ -sun/jvm/hotspot/debugger/win32/coff/*.java \ -sun/jvm/hotspot/debugger/windbg/*.java \ -sun/jvm/hotspot/debugger/windbg/x86/*.java \ -sun/jvm/hotspot/debugger/x86/*.java \ -sun/jvm/hotspot/gc/g1/*.java \ -sun/jvm/hotspot/gc/parallel/*.java \ -sun/jvm/hotspot/gc/shared/*.java \ -sun/jvm/hotspot/interpreter/*.java \ -sun/jvm/hotspot/jdi/*.java \ -sun/jvm/hotspot/memory/*.java \ -sun/jvm/hotspot/oops/*.java \ -sun/jvm/hotspot/opto/*.java \ -sun/jvm/hotspot/prims/*.java \ -sun/jvm/hotspot/runtime/*.java \ -sun/jvm/hotspot/runtime/amd64/*.java \ -sun/jvm/hotspot/runtime/aarch64/*.java \ -sun/jvm/hotspot/runtime/bsd/*.java \ -sun/jvm/hotspot/runtime/bsd_amd64/*.java \ -sun/jvm/hotspot/runtime/bsd_x86/*.java \ -sun/jvm/hotspot/runtime/linux/*.java \ -sun/jvm/hotspot/runtime/linux_amd64/*.java \ -sun/jvm/hotspot/runtime/linux_aarch64/*.java \ -sun/jvm/hotspot/runtime/linux_ppc64/*.java \ -sun/jvm/hotspot/runtime/linux_sparc/*.java \ -sun/jvm/hotspot/runtime/linux_x86/*.java \ -sun/jvm/hotspot/runtime/posix/*.java \ -sun/jvm/hotspot/runtime/ppc64/*.java \ -sun/jvm/hotspot/runtime/solaris_amd64/*.java \ -sun/jvm/hotspot/runtime/solaris_sparc/*.java \ -sun/jvm/hotspot/runtime/solaris_x86/*.java \ -sun/jvm/hotspot/runtime/sparc/*.java \ -sun/jvm/hotspot/runtime/win32_amd64/*.java \ -sun/jvm/hotspot/runtime/win32_x86/*.java \ -sun/jvm/hotspot/runtime/x86/*.java \ -sun/jvm/hotspot/tools/*.java \ -sun/jvm/hotspot/tools/jcore/*.java \ -sun/jvm/hotspot/tools/soql/*.java \ -sun/jvm/hotspot/types/*.java \ -sun/jvm/hotspot/types/basic/*.java \ -sun/jvm/hotspot/ui/*.java \ -sun/jvm/hotspot/ui/action/*.java \ -sun/jvm/hotspot/ui/classbrowser/*.java \ -sun/jvm/hotspot/ui/table/*.java \ -sun/jvm/hotspot/ui/tree/*.java \ -sun/jvm/hotspot/ui/treetable/*.java \ -sun/jvm/hotspot/utilities/*.java \ -sun/jvm/hotspot/utilities/memo/*.java \ -sun/jvm/hotspot/utilities/soql/*.java \ -com/sun/java/swing/action/*.java \ -com/sun/java/swing/ui/*.java -#END FILELIST - -ifneq "x$(ALT_BOOTDIR)" "x" - BOOTDIR := $(ALT_BOOTDIR) -endif - -ifeq "x$(BOOTDIR)" "x" - JDK_HOME := $(shell dirname $(shell which java))/.. -else - JDK_HOME := $(BOOTDIR) -endif - -isUnix := $(shell test -r c:/; echo $$?) - -ifeq "$(isUnix)" "1" - CPS := : -else - CPS := ";" -endif - -SRC_DIR = ../src/share/classes -BUILD_DIR = ../build -OUTPUT_DIR = $(BUILD_DIR)/classes -DOC_DIR = $(BUILD_DIR)/doc - -# gnumake 3.78.1 does not accept the *s, -# so use the shell to expand them -ALLFILES := $(patsubst %,$(SRC_DIR)/%,$(FILELIST)) -ALLFILES := $(shell /bin/ls $(ALLFILES)) - -# tools.jar is used by the sa-jdi binding -CLASSPATH = $(JDK_HOME)/lib/tools.jar - -CLASSPATH := $(subst \,/,$(CLASSPATH)) - -# FIXME: autogenerate call to rmic - -SA_BUILD_VERSION_PROP = "sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VERSION)" - -SA_PROPERTIES = $(OUTPUT_DIR)/sa.properties -JAVAC = $(JDK_HOME)/bin/javac -JAVA = $(JDK_HOME)/bin/java -JAVADOC = $(JDK_HOME)/bin/javadoc -RMIC = $(JDK_HOME)/bin/rmic - -# Tagging it on because there's no reason not to run it -all: filelist - @mkdir -p $(OUTPUT_DIR) - @echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES) - $(JAVAC) -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist - $(RMIC) -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer - rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql/sa.js - cp $(SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql - mkdir -p $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources - rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/* - cp $(SRC_DIR)/sun/jvm/hotspot/ui/resources/*.png $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/ - cp -r $(SRC_DIR)/images/* $(OUTPUT_DIR)/ - -allprof: filelist - @mkdir -p $(OUTPUT_DIR) - @echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES) - $(JAVAC) -J-Xprof -classpath $(CLASSPATH) -deprecation -sourcepath $(SRC_DIR) -g -d $(OUTPUT_DIR) @filelist - $(RMIC) -classpath $(OUTPUT_DIR) -d $(OUTPUT_DIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer - rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql/sa.js - cp $(SRC_DIR)/sun/jvm/hotspot/utilities/soql/sa.js $(OUTPUT_DIR)/sun/jvm/hotspot/utilities/soql - mkdir -p $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources - rm -f $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/* - cp $(SRC_DIR)/sun/jvm/hotspot/ui/resources/*.png $(OUTPUT_DIR)/sun/jvm/hotspot/ui/resources/ - cp -r $(SRC_DIR)/images/* $(OUTPUT_DIR)/ - -.PHONY: filelist -filelist: $(ALLFILES) - @if [ ! -f $(JDK_HOME)/lib/tools.jar ] ; then \ - echo "Missing $(JDK_HOME)/lib/tools.jar file. Use 1.6.0 or later version jdk to build SA."; \ - echo ""; \ - exit 1; \ - fi - @rm -f $@ - @echo $(ALLFILES) > $@ - -.PHONY: natives -natives: - cd ../src/os/`$(JAVA) -classpath $(OUTPUT_DIR) sun.jvm.hotspot.utilities.PlatformInfo`; $(MAKE) all - -.PHONY: sa-jdi.jar -sa-jdi.jar: - echo "sa-jdi.jar is built by a hotspot build." - -docs: - @$(JAVADOC) -private -classpath $(CLASSPATH) -sourcepath $(SRC_DIR) -d $(DOC_DIR) $(PKGLIST) - -sizes: $(ALLFILES) - wc -l $(ALLFILES) - -cscope: $(ALLFILES) - rm -f java.files - echo $(ALLFILES) > java.files - cscope -b -i java.files -f java.out - rm -f java.files - -.PHONY: sa.jar -sa.jar: - rm -f $(BUILD_DIR)/sa.jar - cd $(OUTPUT_DIR) ; jar cvf ../sa.jar * - -clean:: - rm -rf filelist - cd ../src/os/`$(JAVA) -classpath $(OUTPUT_DIR) sun.jvm.hotspot.utilities.PlatformInfo`; $(MAKE) clean - rm -rf $(BUILD_DIR)/* diff --git a/hotspot/agent/make/README.txt b/hotspot/agent/make/README.txt deleted file mode 100644 index 1ceb26b9339..00000000000 --- a/hotspot/agent/make/README.txt +++ /dev/null @@ -1,5 +0,0 @@ -These are the Java-level sources for the Serviceability Agent (SA). - -To build, type "gnumake all". - -For usage documentation, please refer to ../doc/index.html. diff --git a/hotspot/agent/make/build-filelist b/hotspot/agent/make/build-filelist deleted file mode 100644 index 34bd51422c8..00000000000 --- a/hotspot/agent/make/build-filelist +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -f - -SH=`which sh` -MKS_HOME=`dirname $SH` - -CD=cd -FIND=$MKS_HOME/find -SORT=$MKS_HOME/sort - -$CD ../src/share/classes; $FIND sun \( -name SCCS -prune \) -o \( -name "*.java" \) -print | $SORT > ../../../make/filelist.txt diff --git a/hotspot/agent/make/build-pkglist b/hotspot/agent/make/build-pkglist deleted file mode 100644 index c7cac3dfc05..00000000000 --- a/hotspot/agent/make/build-pkglist +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh -f - -SH=`which sh` -MKS_HOME=`dirname $SH` - -CD=cd -FIND=$MKS_HOME/find -SED=$MKS_HOME/sed -SORT=$MKS_HOME/sort - -$CD ../src/share/classes; $FIND sun/jvm/hotspot com/sun/java/swing -type d -print | $SED -e 's/\//./g' | $SORT > ../../../make/pkglist.txt diff --git a/hotspot/agent/make/build.xml b/hotspot/agent/make/build.xml deleted file mode 100644 index 71bfc5ba18b..00000000000 --- a/hotspot/agent/make/build.xml +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/hotspot/agent/make/clhsdbproc.sh b/hotspot/agent/make/clhsdbproc.sh deleted file mode 100644 index d3f4db0621b..00000000000 --- a/hotspot/agent/make/clhsdbproc.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - - -. `dirname $0`/saenv.sh - -$SA_JAVA_CMD sun.jvm.hotspot.CLHSDB $* diff --git a/hotspot/agent/make/clhsdbproc64.sh b/hotspot/agent/make/clhsdbproc64.sh deleted file mode 100644 index 66d8e26fa8a..00000000000 --- a/hotspot/agent/make/clhsdbproc64.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - - -. `dirname $0`/saenv64.sh - -$SA_JAVA_CMD sun.jvm.hotspot.CLHSDB $* diff --git a/hotspot/agent/make/clhsdbwindbg.bat b/hotspot/agent/make/clhsdbwindbg.bat deleted file mode 100644 index a1ba120a135..00000000000 --- a/hotspot/agent/make/clhsdbwindbg.bat +++ /dev/null @@ -1,29 +0,0 @@ -@echo off - -REM -REM Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.CLHSDB %1 %2 diff --git a/hotspot/agent/make/clhsdbwindbg64.bat b/hotspot/agent/make/clhsdbwindbg64.bat deleted file mode 100644 index 442a3ba89d1..00000000000 --- a/hotspot/agent/make/clhsdbwindbg64.bat +++ /dev/null @@ -1,29 +0,0 @@ -@echo off - -REM -REM Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.CLHSDB %1 %2 diff --git a/hotspot/agent/make/dumpflagsproc.sh b/hotspot/agent/make/dumpflagsproc.sh deleted file mode 100644 index 88b1072dd00..00000000000 --- a/hotspot/agent/make/dumpflagsproc.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -. `dirname $0`/saenv.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.FlagDumper $* diff --git a/hotspot/agent/make/dumpflagsproc64.sh b/hotspot/agent/make/dumpflagsproc64.sh deleted file mode 100644 index 31b1204f56a..00000000000 --- a/hotspot/agent/make/dumpflagsproc64.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -. `dirname $0`/saenv64.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.FlagDumper $* diff --git a/hotspot/agent/make/dumpflagswindbg.bat b/hotspot/agent/make/dumpflagswindbg.bat deleted file mode 100644 index 6ae97409c63..00000000000 --- a/hotspot/agent/make/dumpflagswindbg.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.FlagDumper %1 %2 diff --git a/hotspot/agent/make/dumpflagswindbg64.bat b/hotspot/agent/make/dumpflagswindbg64.bat deleted file mode 100644 index c5c1a3bb97f..00000000000 --- a/hotspot/agent/make/dumpflagswindbg64.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.FlagDumper %1 %2 diff --git a/hotspot/agent/make/dumpsyspropsproc.sh b/hotspot/agent/make/dumpsyspropsproc.sh deleted file mode 100644 index 2f8d892ed16..00000000000 --- a/hotspot/agent/make/dumpsyspropsproc.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -. `dirname $0`/saenv.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.SysPropsDumper $* - diff --git a/hotspot/agent/make/dumpsyspropsproc64.sh b/hotspot/agent/make/dumpsyspropsproc64.sh deleted file mode 100644 index 3967bbed119..00000000000 --- a/hotspot/agent/make/dumpsyspropsproc64.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -. `dirname $0`/saenv64.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.SysPropsDumper $* diff --git a/hotspot/agent/make/dumpsyspropswindbg.bat b/hotspot/agent/make/dumpsyspropswindbg.bat deleted file mode 100644 index 4f6c1994118..00000000000 --- a/hotspot/agent/make/dumpsyspropswindbg.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.SysPropsDumper %1 %2 diff --git a/hotspot/agent/make/dumpsyspropswindbg64.bat b/hotspot/agent/make/dumpsyspropswindbg64.bat deleted file mode 100644 index 91f90c54d79..00000000000 --- a/hotspot/agent/make/dumpsyspropswindbg64.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.SysPropsDumper %1 %2 diff --git a/hotspot/agent/make/finalizerinfoproc.sh b/hotspot/agent/make/finalizerinfoproc.sh deleted file mode 100644 index 94d064ebbef..00000000000 --- a/hotspot/agent/make/finalizerinfoproc.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -. `dirname $0`/saenv.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.FinalizerInfo $* diff --git a/hotspot/agent/make/finalizerinfoproc64.sh b/hotspot/agent/make/finalizerinfoproc64.sh deleted file mode 100644 index 58b4369fa4a..00000000000 --- a/hotspot/agent/make/finalizerinfoproc64.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -. `dirname $0`/saenv64.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.FinalizerInfo $* diff --git a/hotspot/agent/make/finalizerinfowindbg.bat b/hotspot/agent/make/finalizerinfowindbg.bat deleted file mode 100644 index 5d529885766..00000000000 --- a/hotspot/agent/make/finalizerinfowindbg.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.FinalizerInfo %1 %2 diff --git a/hotspot/agent/make/finalizerinfowindbg64.bat b/hotspot/agent/make/finalizerinfowindbg64.bat deleted file mode 100644 index be306c65bea..00000000000 --- a/hotspot/agent/make/finalizerinfowindbg64.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.FinalizerInfo %1 %2 diff --git a/hotspot/agent/make/grantAll.policy b/hotspot/agent/make/grantAll.policy deleted file mode 100644 index ae67772f74e..00000000000 --- a/hotspot/agent/make/grantAll.policy +++ /dev/null @@ -1,30 +0,0 @@ -// -// Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved. -// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -// -// This code is free software; you can redistribute it and/or modify it -// under the terms of the GNU General Public License version 2 only, as -// published by the Free Software Foundation. -// -// This code is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -// version 2 for more details (a copy is included in the LICENSE file that -// accompanied this code). -// -// You should have received a copy of the GNU General Public License version -// 2 along with this work; if not, write to the Free Software Foundation, -// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -// -// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -// or visit www.oracle.com if you need additional information or have any -// questions. -// -// - -// Do NOT use this policy file in a production system! - -grant { - // Allow everything for now - permission java.security.AllPermission; -}; diff --git a/hotspot/agent/make/heapdumpproc.sh b/hotspot/agent/make/heapdumpproc.sh deleted file mode 100644 index 44c7f18b7a3..00000000000 --- a/hotspot/agent/make/heapdumpproc.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - - -. `dirname $0`/saenv.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.HeapDumper $* diff --git a/hotspot/agent/make/heapdumpproc64.sh b/hotspot/agent/make/heapdumpproc64.sh deleted file mode 100644 index d68ad2e6a3d..00000000000 --- a/hotspot/agent/make/heapdumpproc64.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - - -. `dirname $0`/saenv64.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.HeapDumper $* - diff --git a/hotspot/agent/make/heapdumpwindbg.bat b/hotspot/agent/make/heapdumpwindbg.bat deleted file mode 100644 index a7b3b0d18ee..00000000000 --- a/hotspot/agent/make/heapdumpwindbg.bat +++ /dev/null @@ -1,29 +0,0 @@ -@echo off - -REM -REM Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.HeapDumper %1 %2 %3 %4 diff --git a/hotspot/agent/make/heapdumpwindbg64.bat b/hotspot/agent/make/heapdumpwindbg64.bat deleted file mode 100644 index f648a10b05d..00000000000 --- a/hotspot/agent/make/heapdumpwindbg64.bat +++ /dev/null @@ -1,29 +0,0 @@ -@echo off - -REM -REM Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.HeapDumper %1 %2 %3 %4 diff --git a/hotspot/agent/make/heapsumproc.sh b/hotspot/agent/make/heapsumproc.sh deleted file mode 100644 index 787e791ce2d..00000000000 --- a/hotspot/agent/make/heapsumproc.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -. `dirname $0`/saenv.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.HeapSummary $* diff --git a/hotspot/agent/make/heapsumproc64.sh b/hotspot/agent/make/heapsumproc64.sh deleted file mode 100644 index 3915260a3b0..00000000000 --- a/hotspot/agent/make/heapsumproc64.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -. `dirname $0`/saenv64.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.HeapSummary $* diff --git a/hotspot/agent/make/heapsumwindbg.bat b/hotspot/agent/make/heapsumwindbg.bat deleted file mode 100644 index ab468509e88..00000000000 --- a/hotspot/agent/make/heapsumwindbg.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.HeapSummary %1 %2 diff --git a/hotspot/agent/make/heapsumwindbg64.bat b/hotspot/agent/make/heapsumwindbg64.bat deleted file mode 100644 index e887cbb5064..00000000000 --- a/hotspot/agent/make/heapsumwindbg64.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.HeapSummary %1 %2 diff --git a/hotspot/agent/make/hsdb.bat b/hotspot/agent/make/hsdb.bat deleted file mode 100644 index 92a2c1d683d..00000000000 --- a/hotspot/agent/make/hsdb.bat +++ /dev/null @@ -1,25 +0,0 @@ -REM -REM Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -java -showversion -cp ..\build\classes;..\src\share\lib\js.jar;.\sa.jar;lib\js.jar sun.jvm.hotspot.HSDB %1 %2 diff --git a/hotspot/agent/make/hsdb.sh b/hotspot/agent/make/hsdb.sh deleted file mode 100644 index ffb07fe246e..00000000000 --- a/hotspot/agent/make/hsdb.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -STARTDIR=`dirname $0` - -if [ "x$SA_JAVA" = "x" ]; then - SA_JAVA=java -fi - -$SA_JAVA -showversion -cp $STARTDIR/../build/classes:$STARTDIR/../src/share/lib/js.jar:$STARTDIR/sa.jar:$STARTDIR/lib/js.jar sun.jvm.hotspot.HSDB $* diff --git a/hotspot/agent/make/hsdbproc.sh b/hotspot/agent/make/hsdbproc.sh deleted file mode 100644 index 29a0e220806..00000000000 --- a/hotspot/agent/make/hsdbproc.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -. `dirname $0`/saenv.sh - -$SA_JAVA_CMD sun.jvm.hotspot.HSDB $* diff --git a/hotspot/agent/make/hsdbproc64.sh b/hotspot/agent/make/hsdbproc64.sh deleted file mode 100644 index 5e79a967142..00000000000 --- a/hotspot/agent/make/hsdbproc64.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -. `dirname $0`/saenv64.sh - -$SA_JAVA_CMD sun.jvm.hotspot.HSDB $* diff --git a/hotspot/agent/make/hsdbwindbg.bat b/hotspot/agent/make/hsdbwindbg.bat deleted file mode 100644 index 4cb1f5e917a..00000000000 --- a/hotspot/agent/make/hsdbwindbg.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.HSDB %1 %2 diff --git a/hotspot/agent/make/hsdbwindbg64.bat b/hotspot/agent/make/hsdbwindbg64.bat deleted file mode 100644 index 0f6c01576c2..00000000000 --- a/hotspot/agent/make/hsdbwindbg64.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.HSDB %1 %2 diff --git a/hotspot/agent/make/index.html b/hotspot/agent/make/index.html deleted file mode 100644 index 436daaa2b8c..00000000000 --- a/hotspot/agent/make/index.html +++ /dev/null @@ -1,262 +0,0 @@ - - - - - -Using The HotSpot Serviceability Agent - - - - -

-Using The HotSpot Serviceability Agent -

- -

-

-Contents -

-

- -
- -

- -Introduction - -

- -

-The HotSpot Serviceability Agent (SA) is a set of Java APIs which -mirror the internal APIs of the HotSpot VM and which can be used to -examine the state of a HotSpot VM. -

- -

-The system understands the layout of certain VM data structures and is -able to traverse these structures in an examination-only fashion; that -is, it does not rely on being able to run code in the target VM. For -this reason it transparently works with either a running VM or a core -file. -

- -

-The system can reconstruct information about Java frames on the stack -and objects in the heap. Many of the important data structures in the -VM like the CodeCache, Universe, StubQueue, Frames, and VFrames have -been exposed and have relatively complete (or at least useful) -implementations. -

- -

-A small graphical debugger called HSDB (the "HotSpot Debugger") has -been written using these APIs. It provides stack memory dumps -annotated with method invocations, compiled-code inlining (if -present), interpreted vs. compiled code, interpreter codelets (if -interpreted), and live oops from oop-map information. It also provides -a tree-based oop inspector. More information will be added as -necessary; please send -email with suggestions on what would be useful. -

- -

-The SA currently only works on Solaris. It uses dbx to connect to the -remote process or core file and communicates with a small piece of -code (an "import module") loaded into the debugger. -

- -

- -Organization of the sources - -

- -

-The Java-side source code, which is the bulk of the SA, is in -src/share/vm/agent. The organization of the sun.jvm.hotspot package -hierarchy mirrors the organization in the VM. This should allow -engineers familiar with the HotSpot sources to quickly understand how -the SA works and to make modifications if necessary. To build these -sources, cd to src/share/vm/agent and type "make". -

- -

- -The SA on Solaris works by communicating with a small piece of code -(an "import module") loaded into dbx. The source code for this import -module is in src/os/solaris/agent. To build this library, cd to -src/os/solaris/agent and type "make 32bit" or "make 64bit". The -distinction is necessary because the SPARC version of dbx ships with -two versions of its executable, and depending on which architecture -(v8 or v9) the debugger is running on selects the appropriate -executable. The SA tries the v8 version first, but if you are running -on a v9 machine you must provide both versions to the SA. -

- -

- -The system is currently hardwired to look on jano for its dbx -executable and import module. The relevant directory structure looks -like this: - -

    -
  • .../hotspot/sa/ -
      -
    • solaris/ -
        -
      • sparc/ -
          -
        • bin/ -
            -
          • dbx: symlink to (v8) dbx 7.0 executable -
          -
        -
          -
        • lib/ -
            -
          • libsvc_agent_dbx.so: 32-bit version of import module -
          -
        -
      • sparcv9/ -
          -
        • lib/ -
            -
          • libsvc_agent_dbx.so: 32-bit version of import module -
          -
        -
      -
    -
-

- -

-The code which builds up path names to these executables is contained -in sun.jvm.hotspot.HotSpotAgent.java. There are hardcoded paths in -this file to jano, but the rest of the system is isolated from this. -

- -

-(It would be nice to have a panel in the debugger allowing -configuration of all of the known operating systems' options; right -now Solaris is the only supported OS, making that easier.) -

- -

- -Running HSDB - -

- -

-An installation of HSDB has been placed on jano. To access it, add the -following directory to your PATH: -

- -

-

-    /net/jano/export/disk05/hotspot/sa/bin/common
-
-

- -

-To start the debugger, type "hsdb". -

- -

-Alternatively, you can start a local build of the debugger by building -the sources in src/share/vm/agent, cd'ing to that directory, and -typing "java sun.jvm.hotspot.HSDB". -

- -

-There are three modes for the debugger: attaching to a local process, -opening a core file, and attaching to a remote "debug server". The -remote case requires two programs to be running on the remote machine: -the rmiregistry (see the script "start-rmiregistry" in this directory; -run this in the background) and the debug server (see the script -"start-debug-server"), in that order. start-rmiregistry takes no -arguments; start-debug-server takes as argument the process ID or the -executable and core file names to allow remote debugging of. Make sure -you do NOT have a CLASSPATH environment variable set when you run -these scripts. (The classes put into the rmiregistry are in sun.*, and -there are permissions problems if they aren't placed on the boot -classpath.) -

- -

-NOTE that the SA currently only works against VMs on Solaris/SPARC. -Remote debugging of Solaris/SPARC VMs on arbitrary platforms is -possible using the debug server; select "Connect to debug server..." -in HSDB. -

- -

-Once the debugger has been launched, the threads list is displayed. -The current set of functionality allows: -

- -
    -
  • Browsing of the annotated stack memory ("Stack Memory" button). It - is currently annotated with the following information: -
      -
    • Method names of the Java frames and their extents (supporting - inlined compiled methods) -
    • Locations and types of oops, found using the oop map information - from compiled methods (interpreter oop maps coming soon) -
    • If a Java frame was interrupted by a signal (e.g., because of a - crash), annotates the frame with the signal name and number -
    • Interpreter codelet descriptions for interpreted frames -
    -
  • Finding which thread or threads caused a crash (currently - identified by the presence of a signal handler frame) -
  • Browsing of oops using the Oop Inspector. -
  • Browsing of the java.lang.Thread object's oop. -
  • Object histogram and inspection of objects therein. -
-

- -

-More functionality is planned. Please send email with suggestions on what -would be useful, with any questions or comments, or if the debugger -crashes. -

- -

- -Notes - -

- -

-HSDB does not suspend the system at a safepoint, but at an arbitrary -point. This means that many of the invariants in the VM's code are not -followed. -

- -

-As it happens, most of the places where the code ported over from the -VM has failed involve the topmost frame on the stack. Some -modifications have been made to allow the system to recognize -problematic situations. -

- -

-Certainly, not all of the failure modes of the debugger have been -found. Please send email if -HSDB throws an exception. The best debugging aid in these situations -is a core file since it is a static view of the VM to which we can -then adapt the debugger code, as opposed to having to try to suspend -the VM over and over to reproduce the failure. gcore (1) is a useful -tool. (NOTE: do not try gcore with any application using the DGA X -server extension (example: Java2Demo); the kernel will panic. See bug -4343237.) -

- - - diff --git a/hotspot/agent/make/jcoreproc.sh b/hotspot/agent/make/jcoreproc.sh deleted file mode 100644 index 48e236681d0..00000000000 --- a/hotspot/agent/make/jcoreproc.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -. `dirname $0`/saenv.sh - -# set the environment variable JCORE_PACKAGES to a comma separated list of -# packages whose classes have to be retrieved from the core file. - -$SA_JAVA_CMD -Dsun.jvm.hotspot.tools.jcore.filter=sun.jvm.hotspot.tools.jcore.PackageNameFilter -Dsun.jvm.hotspot.tools.jcore.PackageNameFilter.pkgList=$JCORE_PACKAGES sun.jvm.hotspot.tools.jcore.ClassDump $* diff --git a/hotspot/agent/make/jcoreproc64.sh b/hotspot/agent/make/jcoreproc64.sh deleted file mode 100644 index 54c46c7d6df..00000000000 --- a/hotspot/agent/make/jcoreproc64.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -. `dirname $0`/saenv64.sh - -# set the environment variable JCORE_PACKAGES to a comma separated list of -# packages whose classes have to be retrieved from the core file. - -$SA_JAVA_CMD -Dsun.jvm.hotspot.tools.jcore.filter=sun.jvm.hotspot.tools.jcore.PackageNameFilter -Dsun.jvm.hotspot.tools.jcore.PackageNameFilter.pkgList=$JCORE_PACKAGES sun.jvm.hotspot.tools.jcore.ClassDump $* diff --git a/hotspot/agent/make/jcorewindbg.bat b/hotspot/agent/make/jcorewindbg.bat deleted file mode 100644 index b8ed4504b92..00000000000 --- a/hotspot/agent/make/jcorewindbg.bat +++ /dev/null @@ -1,33 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -REM set the environment variable JCORE_PACKAGES to comman separated list of -REM packages whose classes have to be retrieved from the core file. - -%SA_JAVA_CMD% -Dsun.jvm.hotspot.tools.jcore.filter=sun.jvm.hotspot.tools.jcore.PackageNameFilter -Dsun.jvm.hotspot.tools.jcore.PackageNameFilter.pkgList=%JCORE_PACKAGES% sun.jvm.hotspot.tools.jcore.ClassDump %1 %2 - - diff --git a/hotspot/agent/make/jcorewindbg64.bat b/hotspot/agent/make/jcorewindbg64.bat deleted file mode 100644 index 61913238814..00000000000 --- a/hotspot/agent/make/jcorewindbg64.bat +++ /dev/null @@ -1,33 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -REM set the environment variable JCORE_PACKAGES to comman separated list of -REM packages whose classes have to be retrieved from the core file. - -%SA_JAVA_CMD% -Dsun.jvm.hotspot.tools.jcore.filter=sun.jvm.hotspot.tools.jcore.PackageNameFilter -Dsun.jvm.hotspot.tools.jcore.PackageNameFilter.pkgList=%JCORE_PACKAGES% sun.jvm.hotspot.tools.jcore.ClassDump %1 %2 - - diff --git a/hotspot/agent/make/jdbcore.sh b/hotspot/agent/make/jdbcore.sh deleted file mode 100644 index 3d9b16567a0..00000000000 --- a/hotspot/agent/make/jdbcore.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -usage() -{ - echo "usage: $0 " - exit 1 -} -# -if [ $# -lt 2 ]; then - usage -else - EXEC_FILE="${1}" - CORE_FILE="${2}" - echo "$0 attaching to core=${CORE_FILE}" -fi -# - -. `dirname $0`/saenv.sh - -$JAVA_HOME/bin/jdb -J-Xbootclasspath/a:$SA_CLASSPATH:$JAVA_HOME/lib/tools.jar \ - -J-Dsun.boot.library.path=$JAVA_HOME/jre/lib/$CPU:$SA_LIBPATH \ - -connect sun.jvm.hotspot.jdi.SACoreAttachingConnector:core=${CORE_FILE},javaExecutable=${EXEC_FILE} diff --git a/hotspot/agent/make/jdbcore64.sh b/hotspot/agent/make/jdbcore64.sh deleted file mode 100644 index 0a3ac0909a8..00000000000 --- a/hotspot/agent/make/jdbcore64.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -usage() -{ - echo "usage: $0 " - exit 1 -} -# -if [ $# -lt 2 ]; then - usage -else - EXEC_FILE="${1}" - CORE_FILE="${2}" - echo "$0 attaching to core=${CORE_FILE}" -fi -# - -. `dirname $0`/saenv64.sh - -$JAVA_HOME/bin/jdb -J-d64 -J-Xbootclasspath/a:$SA_CLASSPATH:$JAVA_HOME/lib/tools.jar \ - -J-Dsun.boot.library.path=$JAVA_HOME/jre/lib/$CPU:$SA_LIBPATH \ - -connect sun.jvm.hotspot.jdi.SACoreAttachingConnector:core=${CORE_FILE},javaExecutable=${EXEC_FILE} diff --git a/hotspot/agent/make/jdbproc.sh b/hotspot/agent/make/jdbproc.sh deleted file mode 100644 index 86a1644a86f..00000000000 --- a/hotspot/agent/make/jdbproc.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -usage() -{ - echo "usage: $0 " - exit 1 -} -# -if [ $# -lt 1 ]; then - usage -else - PID="${1}" - echo "$0 attaching to PID=${PID}" -fi -# - -. `dirname $0`/saenv.sh - -$JAVA_HOME/bin/jdb -J-Xbootclasspath/a:$SA_CLASSPATH:$JAVA_HOME/lib/tools.jar \ - -J-Dsun.boot.library.path=$JAVA_HOME/jre/lib/$CPU:$SA_LIBPATH \ - -connect sun.jvm.hotspot.jdi.SAPIDAttachingConnector:pid=${PID} diff --git a/hotspot/agent/make/jdbproc64.sh b/hotspot/agent/make/jdbproc64.sh deleted file mode 100644 index 9d9592bc1e8..00000000000 --- a/hotspot/agent/make/jdbproc64.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -usage() -{ - echo "usage: $0 " - exit 1 -} -# -if [ $# -lt 1 ]; then - usage -else - PID="${1}" - echo "$0 attaching to PID=${PID}" -fi - -. `dirname $0`/saenv64.sh - -$JAVA_HOME/bin/jdb -J-d64 -J-Xbootclasspath/a:$SA_CLASSPATH:$JAVA_HOME/lib/tools.jar \ - -J-Dsun.boot.library.path=$JAVA_HOME/jre/lib/$CPU:$SA_LIBPATH \ - -connect sun.jvm.hotspot.jdi.SAPIDAttachingConnector:pid=${PID} - diff --git a/hotspot/agent/make/jhistoproc.sh b/hotspot/agent/make/jhistoproc.sh deleted file mode 100644 index 23e46dc1960..00000000000 --- a/hotspot/agent/make/jhistoproc.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -. `dirname $0`/saenv.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.ObjectHistogram $* diff --git a/hotspot/agent/make/jhistoproc64.sh b/hotspot/agent/make/jhistoproc64.sh deleted file mode 100644 index 6c50624913c..00000000000 --- a/hotspot/agent/make/jhistoproc64.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -. `dirname $0`/saenv64.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.ObjectHistogram $* diff --git a/hotspot/agent/make/jhistowindbg.bat b/hotspot/agent/make/jhistowindbg.bat deleted file mode 100644 index ad1975ca540..00000000000 --- a/hotspot/agent/make/jhistowindbg.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.ObjectHistogram %1 %2 diff --git a/hotspot/agent/make/jhistowindbg64.bat b/hotspot/agent/make/jhistowindbg64.bat deleted file mode 100644 index 813afe88340..00000000000 --- a/hotspot/agent/make/jhistowindbg64.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.ObjectHistogram %1 %2 diff --git a/hotspot/agent/make/jsdbproc.sh b/hotspot/agent/make/jsdbproc.sh deleted file mode 100644 index 657d3993cd5..00000000000 --- a/hotspot/agent/make/jsdbproc.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - - -. `dirname $0`/saenv.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.soql.JSDB $* diff --git a/hotspot/agent/make/jsdbproc64.sh b/hotspot/agent/make/jsdbproc64.sh deleted file mode 100644 index ac7d9c3b6ba..00000000000 --- a/hotspot/agent/make/jsdbproc64.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -# -# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - - -. `dirname $0`/saenv64.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.soql.JSDB $* diff --git a/hotspot/agent/make/jsdbwindbg.bat b/hotspot/agent/make/jsdbwindbg.bat deleted file mode 100644 index 2c6e66bdb83..00000000000 --- a/hotspot/agent/make/jsdbwindbg.bat +++ /dev/null @@ -1,29 +0,0 @@ -@echo off - -REM -REM Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.soql.JSDB %1 %2 diff --git a/hotspot/agent/make/jsdbwindbg64.bat b/hotspot/agent/make/jsdbwindbg64.bat deleted file mode 100644 index 10582b524a3..00000000000 --- a/hotspot/agent/make/jsdbwindbg64.bat +++ /dev/null @@ -1,29 +0,0 @@ -@echo off - -REM -REM Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.soql.JSDB %1 %2 diff --git a/hotspot/agent/make/jstackproc.sh b/hotspot/agent/make/jstackproc.sh deleted file mode 100644 index cdffc725a02..00000000000 --- a/hotspot/agent/make/jstackproc.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -. `dirname $0`/saenv.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.StackTrace $* diff --git a/hotspot/agent/make/jstackproc64.sh b/hotspot/agent/make/jstackproc64.sh deleted file mode 100644 index fb4cde33fc3..00000000000 --- a/hotspot/agent/make/jstackproc64.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -. `dirname $0`/saenv64.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.StackTrace $* diff --git a/hotspot/agent/make/jstackwindbg.bat b/hotspot/agent/make/jstackwindbg.bat deleted file mode 100644 index edf82aa6ccc..00000000000 --- a/hotspot/agent/make/jstackwindbg.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.StackTrace %1 %2 diff --git a/hotspot/agent/make/jstackwindbg64.bat b/hotspot/agent/make/jstackwindbg64.bat deleted file mode 100644 index 387b41f4927..00000000000 --- a/hotspot/agent/make/jstackwindbg64.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.StackTrace %1 %2 diff --git a/hotspot/agent/make/marks_notes.html b/hotspot/agent/make/marks_notes.html deleted file mode 100644 index 76fd46c8036..00000000000 --- a/hotspot/agent/make/marks_notes.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Hotspot SA User Interface Notes - - - -

Hotspot SA User Interface Notes

- -

Workspace and Building

- -

- All the source code for the Serviceability Agent is in - src/share/vm/agent in the HotSport workspace - /net/jano.sfbay/export/disk05/hotspot/ws/1.4/sa_baseline -

- You can build the project by typing gnumake in the - src/share/vm/agent directory. -

- You can also use the default build target using the Ant build file (build.xml). You can download Ant from - http://jakarta.apache.org/ant. Documentation for Ant can be - found at http://jakarta.apache.org/ant/manual/index.html - - -

Running the project

- -
    -
  • java -cp classes sun.jvm.hotspot.HSDB -
- -

Feedback

-

- Refactoring of package hierarchy. All user interface components should be in - the ui package. Perhaps: sun.jvm.hotspot.ui.hsdb.Main for the HSDB. -

- The src\share\vm\agent area seems like a workspace so it should be organized like - one. In particular, I'd like to suggest the following directory layout:
- -

    -
  • src: All sources that are curently under the sun directory. -
  • classes: compiled class files. -
  • lib: Resources like images, icons and jar files. -
  • docs: Documentation -
  • deploy: distribution bundles for Java Web Start. -
- -

- Seems like there is a lot of redundant functionality. Perhaps - this can be consolidated with a javax.swing.Actions architecture. - -

Tasklist

- -

- Stack memory pane: - It's one of the more useful JVM debugging tools in the SA. However, it - doesn't support any interaction with the text. -

- Integrations with the NetBeans architecture (plug in). See the - Netbeans Open APIs homepage - - -

- HSDB: Object Histogram. Column sizes should be sized according the the - contents. i.e, The size and count columns should be narrow enought to - handle the largest window. Since there is a lot of data, sorting - and searching should be implemented. -

- -

Log

- - Last modified: Tue Feb 05 19:15:12 Pacific Standard Time 2002 -

- sun.jvm.hotspot.oops.ObjectHistogram should be the underlying data - structure for the TableModels. It shouldnt bother with sorting the data - - the table model should do that. It should implement these methods: - -

-      public int getSize()
-      public ObjectHistogramElement getElementAt(int row);
-    
-

- ObjectHistogramElement should return the String that represents - the third column - - -


-
Mark Davidson
- - -Last modified: Tue Feb 05 20:05:13 Pacific Standard Time 2002 - - - diff --git a/hotspot/agent/make/mkinstall b/hotspot/agent/make/mkinstall deleted file mode 100644 index 4277e54f1f6..00000000000 --- a/hotspot/agent/make/mkinstall +++ /dev/null @@ -1,148 +0,0 @@ - -# make the directories - -SA_NAME=sa17 -SA_TEST=$SA_NAME/test - -mkdir $SA_NAME -mkdir $SA_NAME/solaris -mkdir $SA_NAME/solaris/amd64 -mkdir $SA_NAME/solaris/sparc -mkdir $SA_NAME/solaris/sparcv9 -mkdir $SA_NAME/solaris/i386 -mkdir $SA_NAME/linux -mkdir $SA_NAME/linux/i386 -mkdir $SA_NAME/linux/ia64 -mkdir $SA_NAME/linux/amd64 -mkdir $SA_NAME/win32 -mkdir $SA_NAME/win32/i386 -mkdir $SA_NAME/win32/ia64 -mkdir $SA_NAME/win32/amd64 -mkdir $SA_TEST - -# make sa.jar -jar -cvf $SA_NAME/sa.jar -C ../build/classes . - -# copy the native libraries - -cp ../src/os/solaris/proc/amd64/libsaproc.so $SA_NAME/solaris/amd64 -cp ../src/os/solaris/proc/sparc/libsaproc.so $SA_NAME/solaris/sparc -cp ../src/os/solaris/proc/sparc/libsaproc_audit.so $SA_NAME/solaris/sparc -cp ../src/os/solaris/proc/sparcv9/libsaproc.so $SA_NAME/solaris/sparcv9 -cp ../src/os/solaris/proc/sparcv9/libsaproc_audit.so $SA_NAME/solaris/sparcv9 -cp ../src/os/solaris/proc/i386/libsaproc.so $SA_NAME/solaris/i386 -cp ../src/os/linux/i386/libsaproc.so $SA_NAME/linux/i386 -cp ../src/os/linux/ia64/libsaproc.so $SA_NAME/linux/ia64 -cp ../src/os/linux/amd64/libsaproc.so $SA_NAME/linux/amd64 -cp ../src/os/win32/windbg/i386/sawindbg.dll $SA_NAME/win32/i386 -cp ../src/os/win32/windbg/ia64/sawindbg.dll $SA_NAME/win32/ia64 -cp ../src/os/win32/windbg/amd64/sawindbg.dll $SA_NAME/win32/amd64 - -# copy Unix (Solaris and Linux) shell scripts -cp saenv.sh $SA_NAME ; chmod 755 $SA_NAME/saenv.sh -cp saenv64.sh $SA_NAME ; chmod 755 $SA_NAME/saenv64.sh -cp clhsdbproc.sh $SA_NAME ; chmod 755 $SA_NAME/clhsdbproc.sh -cp clhsdbproc64.sh $SA_NAME ; chmod 755 $SA_NAME/clhsdbproc64.sh -cp dumpflagsproc.sh $SA_NAME ; chmod 755 $SA_NAME/dumpflagsproc.sh -cp dumpflagsproc64.sh $SA_NAME ; chmod 755 $SA_NAME/dumpflagsproc64.sh -cp dumpsyspropsproc.sh $SA_NAME ; chmod 755 $SA_NAME/dumpsyspropsproc.sh -cp dumpsyspropsproc64.sh $SA_NAME ; chmod 755 $SA_NAME/dumpsyspropsproc64.sh -cp finalizerinfoproc.sh $SA_NAME ; chmod 755 $SA_NAME/finalizerinfoproc.sh -cp finalizerinfoproc64.sh $SA_NAME ; chmod 755 $SA_NAME/finalizerinfoproc64.sh -cp heapdumpproc.sh $SA_NAME ; chmod 755 $SA_NAME/heapdumpproc.sh -cp heapdumpproc64.sh $SA_NAME ; chmod 755 $SA_NAME/heapdumpproc64.sh -cp heapsumproc.sh $SA_NAME ; chmod 755 $SA_NAME/heapsumproc.sh -cp heapsumproc64.sh $SA_NAME ; chmod 755 $SA_NAME/heapsumproc64.sh -cp hsdbproc.sh $SA_NAME ; chmod 755 $SA_NAME/hsdbproc.sh -cp hsdbproc64.sh $SA_NAME ; chmod 755 $SA_NAME/hsdbproc64.sh -cp jcoreproc.sh $SA_NAME ; chmod 755 $SA_NAME/jcoreproc.sh -cp jcoreproc64.sh $SA_NAME ; chmod 755 $SA_NAME/jcoreproc64.sh -cp jdbcore.sh $SA_NAME ; chmod 755 $SA_NAME/jdbcore.sh -cp jdbcore64.sh $SA_NAME ; chmod 755 $SA_NAME/jdbcore64.sh -cp jdbproc.sh $SA_NAME ; chmod 755 $SA_NAME/jdbproc.sh -cp jdbproc64.sh $SA_NAME ; chmod 755 $SA_NAME/jdbproc64.sh -cp jhistoproc.sh $SA_NAME ; chmod 755 $SA_NAME/jhistoproc.sh -cp jhistoproc64.sh $SA_NAME ; chmod 755 $SA_NAME/jhistoproc64.sh -cp jsdbproc.sh $SA_NAME ; chmod 755 $SA_NAME/jsdbproc.sh -cp jsdbproc64.sh $SA_NAME ; chmod 755 $SA_NAME/jsdbproc64.sh -cp jstackproc.sh $SA_NAME ; chmod 755 $SA_NAME/jstackproc.sh -cp jstackproc64.sh $SA_NAME ; chmod 755 $SA_NAME/jstackproc64.sh -cp permstatproc.sh $SA_NAME ; chmod 755 $SA_NAME/permstatproc.sh -cp permstatproc64.sh $SA_NAME ; chmod 755 $SA_NAME/permstatproc64.sh -cp pmapproc.sh $SA_NAME ; chmod 755 $SA_NAME/pmapproc.sh -cp pmapproc64.sh $SA_NAME ; chmod 755 $SA_NAME/pmapproc64.sh -cp pstackproc.sh $SA_NAME ; chmod 755 $SA_NAME/pstackproc.sh -cp pstackproc64.sh $SA_NAME ; chmod 755 $SA_NAME/pstackproc64.sh -cp soqlproc.sh $SA_NAME ; chmod 755 $SA_NAME/soqlproc.sh -cp soqlproc64.sh $SA_NAME ; chmod 755 $SA_NAME/soqlproc64.sh -cp start-debug-server $SA_NAME ; chmod 755 $SA_NAME/start-debug-server -cp start-debug-server-proc.sh $SA_NAME ; chmod 755 $SA_NAME/start-debug-server-proc.sh -cp start-debug-server-proc64.sh $SA_NAME ; chmod 755 $SA_NAME/start-debug-server-proc64.sh -cp start-rmiregistry.sh $SA_NAME ; chmod 755 $SA_NAME/start-rmiregistry.sh - -# copy Windows batch files -cp saenv.bat $SA_NAME ; chmod 755 $SA_NAME/saenv.bat -cp saenv64.bat $SA_NAME ; chmod 755 $SA_NAME/saenv64.bat -cp clhsdbwindbg.bat $SA_NAME ; chmod 755 $SA_NAME/clhsdbwindbg.bat -cp clhsdbwindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/clhsdbwindbg64.bat -cp dumpflagswindbg.bat $SA_NAME ; chmod 755 $SA_NAME/dumpflagswindbg.bat -cp dumpflagswindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/dumpflagswindbg64.bat -cp dumpsyspropswindbg.bat $SA_NAME ; chmod 755 $SA_NAME/dumpsyspropswindbg.bat -cp dumpsyspropswindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/dumpsyspropswindbg64.bat -cp finalizerinfowindbg.bat $SA_NAME ; chmod 755 $SA_NAME/finalizerinfowindbg.bat -cp finalizerinfowindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/finalizerinfowindbg64.bat -cp heapdumpwindbg.bat $SA_NAME ; chmod 755 $SA_NAME/heapdumpwindbg.bat -cp heapdumpwindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/heapdumpwindbg64.bat -cp heapsumwindbg.bat $SA_NAME ; chmod 755 $SA_NAME/heapsumwindbg.bat -cp heapsumwindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/heapsumwindbg64.bat -cp hsdbwindbg.bat $SA_NAME ; chmod 755 $SA_NAME/hsdbwindbg.bat -cp hsdbwindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/hsdbwindbg64.bat -cp jcorewindbg.bat $SA_NAME ; chmod 755 $SA_NAME/jcorewindbg.bat -cp jcorewindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/jcorewindbg64.bat -cp jhistowindbg.bat $SA_NAME ; chmod 755 $SA_NAME/jhistowindbg.bat -cp jhistowindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/jhistowindbg64.bat -cp jsdbwindbg.bat $SA_NAME ; chmod 755 $SA_NAME/jsdbwindbg.bat -cp jsdbwindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/jsdbwindbg64.bat -cp jstackwindbg.bat $SA_NAME ; chmod 755 $SA_NAME/jstackwindbg.bat -cp jstackwindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/jstackwindbg64.bat -cp permstatwindbg.bat $SA_NAME ; chmod 755 $SA_NAME/permstatwindbg.bat -cp permstatwindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/permstatwindbg64.bat -cp pmapwindbg.bat $SA_NAME ; chmod 755 $SA_NAME/pmapwindbg.bat -cp pmapwindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/pmapwindbg64.bat -cp pstackwindbg.bat $SA_NAME ; chmod 755 $SA_NAME/pstackwindbg.bat -cp pstackwindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/pstackwindbg64.bat -cp soqlwindbg.bat $SA_NAME ; chmod 755 $SA_NAME/soqlwindbg.bat -cp soqlwindbg64.bat $SA_NAME ; chmod 755 $SA_NAME/soqlwindbg64.bat -cp start-debug-server-windbg.bat $SA_NAME ; chmod 755 $SA_NAME/start-debug-server-windbg.bat -cp start-debug-server-windbg64.bat $SA_NAME ; chmod 755 $SA_NAME/start-debug-server-windbg64.bat -cp start-rmiregistry.bat $SA_NAME ; chmod 755 $SA_NAME/start-rmiregistry.bat - - -# make the libproc test -cd ../test/libproc ; make; cd ../../make - -# copy libproc test suite - -cp ../test/libproc/README $SA_TEST/README-libproc -cp ../test/libproc/libproctest.sh $SA_TEST ; chmod 755 $SA_TEST/libproctest.sh -cp ../test/libproc/libproctest64.sh $SA_TEST ; chmod 755 $SA_TEST/libproctest64.sh -cp ../test/libproc/*.class $SA_TEST - -# copy RMI security policy file -cp grantAll.policy $SA_NAME - -# copy documentation -mkdir $SA_NAME/doc -cp ../doc/*.html $SA_NAME/doc -chmod 644 $SA_NAME/doc/*.html - -# make lib dir and copy other jar files -mkdir $SA_NAME/lib -cp ../src/share/lib/*.jar $SA_NAME/lib - -# tar and gzip -tar -cvf $SA_NAME.tar $SA_NAME -gzip $SA_NAME.tar - -# cleanup -\rm -rf $SA_NAME diff --git a/hotspot/agent/make/permstatproc.sh b/hotspot/agent/make/permstatproc.sh deleted file mode 100644 index 7aeff637fef..00000000000 --- a/hotspot/agent/make/permstatproc.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -. `dirname $0`/saenv.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.PermStat $* diff --git a/hotspot/agent/make/permstatproc64.sh b/hotspot/agent/make/permstatproc64.sh deleted file mode 100644 index 04754abedd8..00000000000 --- a/hotspot/agent/make/permstatproc64.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -. `dirname $0`/saenv64.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.PermStat $* diff --git a/hotspot/agent/make/permstatwindbg.bat b/hotspot/agent/make/permstatwindbg.bat deleted file mode 100644 index c296cd6580c..00000000000 --- a/hotspot/agent/make/permstatwindbg.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.PermStat %1 %2 diff --git a/hotspot/agent/make/permstatwindbg64.bat b/hotspot/agent/make/permstatwindbg64.bat deleted file mode 100644 index b1a2ad549b8..00000000000 --- a/hotspot/agent/make/permstatwindbg64.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.PermStat %1 %2 diff --git a/hotspot/agent/make/pmapproc.sh b/hotspot/agent/make/pmapproc.sh deleted file mode 100644 index 193f039ea68..00000000000 --- a/hotspot/agent/make/pmapproc.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -. `dirname $0`/saenv.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.PMap $* diff --git a/hotspot/agent/make/pmapproc64.sh b/hotspot/agent/make/pmapproc64.sh deleted file mode 100644 index c55acd7027b..00000000000 --- a/hotspot/agent/make/pmapproc64.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -. `dirname $0`/saenv64.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.PMap $* - diff --git a/hotspot/agent/make/pmapwindbg.bat b/hotspot/agent/make/pmapwindbg.bat deleted file mode 100644 index abc771a551b..00000000000 --- a/hotspot/agent/make/pmapwindbg.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.PMap %1 %2 diff --git a/hotspot/agent/make/pmapwindbg64.bat b/hotspot/agent/make/pmapwindbg64.bat deleted file mode 100644 index 6a8e3aa7483..00000000000 --- a/hotspot/agent/make/pmapwindbg64.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.PMap %1 %2 diff --git a/hotspot/agent/make/pstackproc.sh b/hotspot/agent/make/pstackproc.sh deleted file mode 100644 index a78c1d48d1b..00000000000 --- a/hotspot/agent/make/pstackproc.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -. `dirname $0`/saenv.sh - -type c++filt 1>/dev/null 2>/dev/null -if [ $? -eq 0 ]; then - $SA_JAVA_CMD sun.jvm.hotspot.tools.PStack $* | c++filt -else - $SA_JAVA_CMD sun.jvm.hotspot.tools.PStack $* -fi - diff --git a/hotspot/agent/make/pstackproc64.sh b/hotspot/agent/make/pstackproc64.sh deleted file mode 100644 index c2a14ed0d90..00000000000 --- a/hotspot/agent/make/pstackproc64.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -. `dirname $0`/saenv64.sh - -type c++filt 1>/dev/null 2>/dev/null -if [ $? -eq 0 ]; then - $SA_JAVA_CMD sun.jvm.hotspot.tools.PStack $* | c++filt -else - $SA_JAVA_CMD sun.jvm.hotspot.tools.PStack $* -fi - diff --git a/hotspot/agent/make/pstackwindbg.bat b/hotspot/agent/make/pstackwindbg.bat deleted file mode 100644 index 5180424758d..00000000000 --- a/hotspot/agent/make/pstackwindbg.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.PStack %1 %2 diff --git a/hotspot/agent/make/pstackwindbg64.bat b/hotspot/agent/make/pstackwindbg64.bat deleted file mode 100644 index 659788c230a..00000000000 --- a/hotspot/agent/make/pstackwindbg64.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.PStack %1 %2 diff --git a/hotspot/agent/make/saenv.bat b/hotspot/agent/make/saenv.bat deleted file mode 100644 index 65f09530f6d..00000000000 --- a/hotspot/agent/make/saenv.bat +++ /dev/null @@ -1,54 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -REM This is common environment settings for all SA -REM windows batch scripts - -REM set jre\bin and jre\bin\client (or server) in PATH -REM WINDBG_HOME must point to the Windows Debugging Tools -REM installation directory - -if "%SA_JAVA%" == "" goto no_sa_java - -goto sa_java_set - -:no_sa_java -set SA_JAVA=java - -:sa_java_set - -set SA_CLASSPATH=..\build\classes;..\src\share\lib\js.jar;sa.jar;lib\js.jar - -set SA_LIBPATH=..\src\os\win32\windbg\i386;.\win32\i386 - -set OPTIONS=-Dsun.jvm.hotspot.debugger.useWindbgDebugger -set OPTIONS=-Dsun.jvm.hotspot.debugger.windbg.imagePath="%PATH%" %OPTIONS% -set OPTIONS=-Dsun.jvm.hotspot.debugger.windbg.sdkHome="%WINDBG_HOME%" %OPTIONS% - -if "%SA_DISABLE_VERS_CHK%" == "" goto vers_chk -set OPTIONS="-Dsun.jvm.hotspot.runtime.VM.disableVersionCheck %OPTIONS%" - -:vers_chk -set SA_JAVA_CMD=%SA_JAVA% -showversion -cp %SA_CLASSPATH% -Djava.library.path=%SA_LIBPATH% %OPTIONS% diff --git a/hotspot/agent/make/saenv.sh b/hotspot/agent/make/saenv.sh deleted file mode 100644 index 15fb0aca2b0..00000000000 --- a/hotspot/agent/make/saenv.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -# This file sets common environment variables for all SA scripts - -OS=`uname` -STARTDIR=`(cd \`dirname $0 \`; pwd)` -ARCH=`uname -m` - -if [ "x$SA_JAVA" = "x" ]; then - SA_JAVA=java -fi - -if [ "$OS" = "Linux" ]; then - if [ "$ARCH" = "ia64" ] ; then - SA_LIBPATH=$STARTDIR/../src/os/linux/ia64:$STARTDIR/linux/ia64 - OPTIONS="-Dsa.library.path=$SA_LIBPATH" - CPU=ia64 - elif [ "$ARCH" = "x86_64" ] ; then - SA_LIBPATH=$STARTDIR/../src/os/linux/amd64:$STARTDIR/linux/amd64 - OPTIONS="-Dsa.library.path=$SA_LIBPATH" - CPU=amd64 - else - SA_LIBPATH=$STARTDIR/../src/os/linux/i386:$STARTDIR/linux/i386 - OPTIONS="-Dsa.library.path=$SA_LIBPATH" - CPU=i386 - fi -else - # configure audit helper library for solaris - LD_AUDIT_32=$STARTDIR/../src/os/solaris/proc/`uname -p`/libsaproc_audit.so - if [ ! -f $LD_AUDIT_32 ]; then - LD_AUDIT_32=$STARTDIR/solaris/`uname -p`/libsaproc_audit.so - fi - if [ ! -f $LD_AUDIT_32 ]; then - echo "Can't find libsaproc_audit.so." - echo "Make sure to build it with 'make natives'." - exit 1 - fi - export LD_AUDIT_32 - SA_LIBPATH=$STARTDIR/../src/os/solaris/proc/`uname -p`:$STARTDIR/solaris/`uname -p` - OPTIONS="-Dsa.library.path=$SA_LIBPATH -Dsun.jvm.hotspot.debugger.useProcDebugger" - CPU=sparc -fi - -if [ "x$SA_DISABLE_VERS_CHK" != "x" ]; then - OPTIONS="-Dsun.jvm.hotspot.runtime.VM.disableVersionCheck ${OPTIONS}" -fi - - -SA_CLASSPATH=$STARTDIR/../build/classes:$STARTDIR/../src/share/lib/js.jar:$STARTDIR/sa.jar:$STARTDIR/lib/js.jar - -if [ ! -z "$SA_TYPEDB" ]; then - if [ ! -f $SA_TYPEDB ]; then - echo "$SA_TYPEDB is unreadable" - exit 1 - fi - OPTIONS="-Dsun.jvm.hotspot.typedb=$SA_TYPEDB ${OPTIONS}" -fi - -OPTIONS="-Djava.system.class.loader=sun.jvm.hotspot.SALauncherLoader ${OPTIONS}" - -SA_JAVA_CMD="$SA_PREFIX_CMD $SA_JAVA -showversion ${OPTIONS} -cp $SA_CLASSPATH $SA_OPTIONS" diff --git a/hotspot/agent/make/saenv64.bat b/hotspot/agent/make/saenv64.bat deleted file mode 100644 index 414a92496d7..00000000000 --- a/hotspot/agent/make/saenv64.bat +++ /dev/null @@ -1,60 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -REM FIXME: How do I detect processor on Windows so that -REM AMD-64/IA-64 could be detected? Should I assume -REM MKS/Cygwin here? - -REM This is common environment settings for all SA -REM windows batch scripts - -REM set jre\bin and jre\bin\client (or server) in PATH -REM WINDBG_HOME must point to the Windows Debugging Tools -REM installation directory. - -if "%SA_JAVA%" == "" goto no_sa_java - -goto sa_java_set - -:no_sa_java -set SA_JAVA=java - -:sa_java_set - -set SA_CLASSPATH=..\build\classes;..\src\share\lib\js.jar;sa.jar;lib\js.jar - -REM For now, only AMD-64, IA-64 stack walking is not working anyway -set SA_LIBPATH=.\src\os\win32\windbg\amd64;.\win32\amd64 - -set OPTIONS=-Dsun.jvm.hotspot.debugger.useWindbgDebugger -set OPTIONS=-Dsun.jvm.hotspot.debugger.windbg.imagePath="%PATH%" %OPTIONS% -set OPTIONS=-Dsun.jvm.hotspot.debugger.windbg.sdkHome="%WINDBG_HOME%" %OPTIONS% - -if "%SA_DISABLE_VERS_CHK%" == "" goto vers_chk -set OPTIONS="-Dsun.jvm.hotspot.runtime.VM.disableVersionCheck %OPTIONS%" - -:vers_chk - -set SA_JAVA_CMD=%SA_JAVA% -showversion -cp %SA_CLASSPATH% -Djava.library.path=.%SA_LIBPATH% %OPTIONS% diff --git a/hotspot/agent/make/saenv64.sh b/hotspot/agent/make/saenv64.sh deleted file mode 100644 index a68d34c99a2..00000000000 --- a/hotspot/agent/make/saenv64.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -# This file sets common environment variables for all 64-bit Solaris [sparcv9, -# amd64] SA scripts. Please note that for 64-bit Linux use saenv.sh. - -OS=`uname` -STARTDIR=`dirname $0` - -CPU=`isainfo | grep sparcv9` - -if [ "x$CPU" != "x" ]; then - CPU=sparcv9 -else - CPU=`isainfo | grep amd64` - if [ "x$CPU" != "x" ]; then - CPU=amd64 - else - echo "unknown CPU, only sparcv9, amd64 are supported!" - exit 1 - fi -fi - -# configure audit helper library -LD_AUDIT_64=$STARTDIR/../src/os/solaris/proc/$CPU/libsaproc_audit.so -if [ ! -f $LD_AUDIT_64 ]; then - LD_AUDIT_64=$STARTDIR/solaris/$CPU/libsaproc_audit.so -fi - -if [ ! -f $LD_AUDIT_64 ]; then - echo "Can't find libsaproc_audit.so." - echo "Make sure to build it with 'make natives'." - exit 1 -fi - -export LD_AUDIT_64 -SA_LIBPATH=$STARTDIR/../src/os/solaris/proc/$CPU:$STARTDIR/solaris/$CPU - -OPTIONS="-Dsa.library.path=$SA_LIBPATH -Dsun.jvm.hotspot.debugger.useProcDebugger" - -if [ "x$SA_JAVA" = "x" ]; then - SA_JAVA=java -fi - -if [ "x$SA_DISABLE_VERS_CHK" != "x" ]; then - OPTIONS="-Dsun.jvm.hotspot.runtime.VM.disableVersionCheck ${OPTIONS}" -fi - -SA_CLASSPATH=$STARTDIR/../build/classes:$STARTDIR/../src/share/lib/js.jar:$STARTDIR/sa.jar::$STARTDIR/lib/js.jar - -if [ ! -z "$SA_TYPEDB" ]; then - if [ ! -f $SA_TYPEDB ]; then - echo "$SA_TYPEDB is unreadable" - exit 1 - fi - OPTIONS="-Dsun.jvm.hotspot.typedb=$SA_TYPEDB ${OPTIONS}" -fi - -OPTIONS="-Djava.system.class.loader=sun.jvm.hotspot.SALauncherLoader ${OPTIONS}" - -SA_JAVA_CMD="$SA_PREFIX_CMD $SA_JAVA -d64 -showversion ${OPTIONS} -cp $SA_CLASSPATH $SA_OPTIONS" diff --git a/hotspot/agent/make/soqlproc.sh b/hotspot/agent/make/soqlproc.sh deleted file mode 100644 index 9e9540549fd..00000000000 --- a/hotspot/agent/make/soqlproc.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -. `dirname $0`/saenv.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.soql.SOQL $* diff --git a/hotspot/agent/make/soqlproc64.sh b/hotspot/agent/make/soqlproc64.sh deleted file mode 100644 index 1a2fa1756b0..00000000000 --- a/hotspot/agent/make/soqlproc64.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -. `dirname $0`/saenv64.sh - -$SA_JAVA_CMD sun.jvm.hotspot.tools.soql.SOQL $* diff --git a/hotspot/agent/make/soqlwindbg.bat b/hotspot/agent/make/soqlwindbg.bat deleted file mode 100644 index 1abc3ce9ce0..00000000000 --- a/hotspot/agent/make/soqlwindbg.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.soql.SOQL %1 %2 diff --git a/hotspot/agent/make/soqlwindbg64.bat b/hotspot/agent/make/soqlwindbg64.bat deleted file mode 100644 index 5f084335c9f..00000000000 --- a/hotspot/agent/make/soqlwindbg64.bat +++ /dev/null @@ -1,28 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -%SA_JAVA_CMD% sun.jvm.hotspot.tools.soql.SOQL %1 %2 diff --git a/hotspot/agent/make/start-debug-server b/hotspot/agent/make/start-debug-server deleted file mode 100644 index dfaf5d91515..00000000000 --- a/hotspot/agent/make/start-debug-server +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -STARTDIR=`dirname $0` - -if [ "x$SA_JAVA" = "x" ]; then - SA_JAVA=java -fi - -if [ -f $STARTDIR/sa.jar ] ; then - CP=$STARTDIR/sa.jar -else - CP=$STARTDIR/../build/classes -fi - -# License file for development version of dbx -setenv LM_LICENSE_FILE 7588@extend.eng:/usr/dist/local/config/sparcworks/license.dat:7588@setlicense - -$SA_JAVA -Xbootclasspath/p:$CP -Djava.rmi.server.codebase=file:/$CP -Djava.security.policy=$STARTDIR\/grantAll.policy sun.jvm.hotspot.DebugServer $* diff --git a/hotspot/agent/make/start-debug-server-proc.sh b/hotspot/agent/make/start-debug-server-proc.sh deleted file mode 100644 index 73152e3404d..00000000000 --- a/hotspot/agent/make/start-debug-server-proc.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -. `dirname $0`/saenv.sh - -if [ -f $STARTDIR/../lib/sa-jdi.jar ] ; then - CP=$STARTDIR/../lib/sa-jdi.jar -else - CP=$STARTDIR/../build/classes -fi - -$STARTDIR/java -classpath $CP ${OPTIONS} -Djava.rmi.server.codebase=file://$CP -Djava.security.policy=${STARTDIR}/grantAll.policy sun.jvm.hotspot.DebugServer $* - diff --git a/hotspot/agent/make/start-debug-server-proc64.sh b/hotspot/agent/make/start-debug-server-proc64.sh deleted file mode 100644 index 56c78d4be88..00000000000 --- a/hotspot/agent/make/start-debug-server-proc64.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -. `dirname $0`/saenv64.sh - -if [ -f $STARTDIR/sa.jar ] ; then - CP=$STARTDIR/sa.jar -else - CP=$STARTDIR/../build/classes -fi - -$SA_JAVA -d64 -classpath $CP ${OPTIONS} -Djava.rmi.server.codebase=file:/$CP -Djava.security.policy=$STARTDIR\/grantAll.policy sun.jvm.hotspot.DebugServer $* diff --git a/hotspot/agent/make/start-debug-server-windbg.bat b/hotspot/agent/make/start-debug-server-windbg.bat deleted file mode 100644 index 17fcebca8e3..00000000000 --- a/hotspot/agent/make/start-debug-server-windbg.bat +++ /dev/null @@ -1,39 +0,0 @@ -@echo off -REM -REM Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv.bat - -REM check for .\sa.jar, if it does not exist -REM assume that we are in build configuration. - -if not exist .\sa.jar goto IN_BUILD_CONF -set SA_CLASSPATH=.\sa.jar -goto EXEC_CMD - -:IN_BUILD_CONF -set SA_CLASSPATH=..\build\classes - -:EXEC_CMD -%SA_JAVA% -classpath %SA_CLASSPATH% -Djava.rmi.server.codebase=file:/%SA_CLASSPATH% -Djava.security.policy=grantAll.policy -Djava.library.path=%SA_LIBPATH% %OPTIONS% sun.jvm.hotspot.DebugServer %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/hotspot/agent/make/start-debug-server-windbg64.bat b/hotspot/agent/make/start-debug-server-windbg64.bat deleted file mode 100644 index d8b6690ebaf..00000000000 --- a/hotspot/agent/make/start-debug-server-windbg64.bat +++ /dev/null @@ -1,39 +0,0 @@ -@echo off -REM -REM Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -call saenv64.bat - -REM check for .\sa.jar, if it does not exist -REM assume that we are in build configuration. - -if not exist .\sa.jar goto IN_BUILD_CONF -set SA_CLASSPATH=.\sa.jar -goto EXEC_CMD - -:IN_BUILD_CONF -set SA_CLASSPATH=..\build\classes - -:EXEC_CMD -%SA_JAVA% -classpath %SA_CLASSPATH% -Djava.rmi.server.codebase=file:/%SA_CLASSPATH% -Djava.security.policy=grantAll.policy -Djava.library.path=%SA_LIBPATH% %OPTIONS% sun.jvm.hotspot.DebugServer %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/hotspot/agent/make/start-rmiregistry.bat b/hotspot/agent/make/start-rmiregistry.bat deleted file mode 100644 index eab92583e95..00000000000 --- a/hotspot/agent/make/start-rmiregistry.bat +++ /dev/null @@ -1,37 +0,0 @@ -@echo off -REM -REM Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -REM -REM This code is free software; you can redistribute it and/or modify it -REM under the terms of the GNU General Public License version 2 only, as -REM published by the Free Software Foundation. -REM -REM This code is distributed in the hope that it will be useful, but WITHOUT -REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -REM version 2 for more details (a copy is included in the LICENSE file that -REM accompanied this code). -REM -REM You should have received a copy of the GNU General Public License version -REM 2 along with this work; if not, write to the Free Software Foundation, -REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -REM -REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -REM or visit www.oracle.com if you need additional information or have any -REM questions. -REM -REM - -REM check for .\sa.jar, if it does not exist -REM assume that we are in build configuration. - -if not exist .\sa.jar goto IN_BUILD_CONF -set CLASSPATH=.\sa.jar -goto EXEC_CMD - -:IN_BUILD_CONF -set CLASSPATH=..\build\classes - -:EXEC_CMD -start rmiregistry -J-Xbootclasspath/p:%CLASSPATH% diff --git a/hotspot/agent/make/start-rmiregistry.sh b/hotspot/agent/make/start-rmiregistry.sh deleted file mode 100644 index a1d9080d5d7..00000000000 --- a/hotspot/agent/make/start-rmiregistry.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -STARTDIR=`dirname $0` - -if [ -f $STARTDIR/sa.jar ] ; then - CP=$STARTDIR/sa.jar -else - CP=$STARTDIR/../build/classes -fi - -rmiregistry -J-Xbootclasspath/p:$CP diff --git a/hotspot/agent/src/os/bsd/Makefile b/hotspot/agent/src/os/bsd/Makefile deleted file mode 100644 index eabe1f7730d..00000000000 --- a/hotspot/agent/src/os/bsd/Makefile +++ /dev/null @@ -1,102 +0,0 @@ -# -# Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -ARCH := $(shell if ([ `uname -m` = "ia64" ]) ; then echo ia64 ; elif ([ `uname -m` = "amd64" ]) ; then echo amd64; elif ([ `uname -m` = "x86_64" ]) ; then echo amd64; elif ([ `uname -m` = "sparc64" ]) ; then echo sparc; else echo i386 ; fi ) - -OS := $(shell uname -s) - -GCC = gcc - -JAVAH = ${JAVA_HOME}/bin/javah - -ifneq ($(OS), Darwin) -SOURCES = salibelf.c \ - symtab.c \ - libproc_impl.c \ - ps_proc.c \ - ps_core.c \ - BsdDebuggerLocal.c -OBJS = $(SOURCES:.c=.o) -OBJSPLUS = $(OBJS) sadis.o -LIBSA = $(ARCH)/libsaproc.so - -LIBS = -lutil -lthread_db - -else - -SOURCES = symtab.c \ - libproc_impl.c \ - ps_core.c -OBJS = $(SOURCES:.c=.o) -OBJSPLUS = MacosxDebuggerLocal.o sadis.o $(OBJS) -EXTINCLUDE = -I. -EXTCFLAGS = -m64 -D__APPLE__ -framework JavaNativeFoundation -FOUNDATIONFLAGS = -framework Foundation -framework JavaNativeFoundation -framework Security -framework CoreFoundation -LIBSA = $(ARCH)/libsaproc.dylib -endif # Darwin - -INCLUDES = -I${JAVA_HOME}/include -I${JAVA_HOME}/include/$(shell uname -s | tr "[:upper:]" "[:lower:]") $(EXTINCLUDE) - - - -CFLAGS = -c -fPIC -g -Wall -D_ALLBSD_SOURCE -D_GNU_SOURCE -D$(ARCH) $(INCLUDES) $(EXTCFLAGS) - - - -all: $(LIBSA) - -MacosxDebuggerLocal.o: MacosxDebuggerLocal.m - echo "OS="$(OS) - $(JAVAH) -jni -classpath ../../../build/classes \ - sun.jvm.hotspot.debugger.x86.X86ThreadContext \ - sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext - $(GCC) $(CFLAGS) $(FOUNDATIONFLAGS) $< - -sadis.o: ../../share/native/sadis.c - $(JAVAH) -jni -classpath ../../../build/classes \ - sun.jvm.hotspot.asm.Disassembler - $(GCC) $(CFLAGS) $< - -.c.obj: - $(GCC) $(CFLAGS) - -ifndef LDNOMAP - LFLAGS_LIBSA = -Xlinker --version-script=mapfile -endif - -$(LIBSA): $(OBJSPLUS) mapfile - if [ ! -d $(ARCH) ] ; then mkdir $(ARCH) ; fi - $(GCC) -shared $(LFLAGS_LIBSA) -o $(LIBSA) $(FOUNDATIONFLAGS) $(OBJSPLUS) $(LIBS) $(SALIBS) - -test.o: $(LIBSA) test.c - $(GCC) -c -o test.o -g -D_GNU_SOURCE -D$(ARCH) $(INCLUDES) test.c - -test: test.o - $(GCC) -o test test.o -L$(ARCH) -lsaproc $(LIBS) - -clean: - rm -f $(LIBSA) - rm -f *.o - rm -f test.o - -rmdir $(ARCH) diff --git a/hotspot/agent/src/os/linux/Makefile b/hotspot/agent/src/os/linux/Makefile deleted file mode 100644 index 9eeabe661e5..00000000000 --- a/hotspot/agent/src/os/linux/Makefile +++ /dev/null @@ -1,90 +0,0 @@ -# -# Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -ARCH := $(shell if ([ `uname -m` = "ia64" ]) ; then echo ia64 ; elif ([ `uname -m` = "x86_64" ]) ; then echo amd64; elif ([ `uname -m` = "sparc64" ]) ; then echo sparc; else echo i386 ; fi ) -GCC = gcc - -JAVAH = ${JAVA_HOME}/bin/javah - -SOURCES = salibelf.c \ - symtab.c \ - libproc_impl.c \ - ps_proc.c \ - ps_core.c \ - LinuxDebuggerLocal.c - -INCLUDES = -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux - -OBJS = $(SOURCES:%.c=$(ARCH)/%.o) $(ARCH)/sadis.o - -LIBS = -lthread_db - -CFLAGS = -c -fPIC -g -D_GNU_SOURCE -D$(ARCH) $(INCLUDES) -I$(ARCH) - -LIBSA = $(ARCH)/libsaproc.so - -all: $(LIBSA) - -$(ARCH): - mkdir $(ARCH) - -$(ARCH)/LinuxDebuggerLocal.o: LinuxDebuggerLocal.c - $(JAVAH) -jni -classpath ../../../build/classes -d $(ARCH) \ - sun.jvm.hotspot.debugger.x86.X86ThreadContext \ - sun.jvm.hotspot.debugger.sparc.SPARCThreadContext \ - sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext \ - sun.jvm.hotspot.debugger.aarch64.AARCH64ThreadContext - $(GCC) $(CFLAGS) $< -o $@ - -$(ARCH)/sadis.o: ../../share/native/sadis.c - $(JAVAH) -jni -classpath ../../../build/classes -d $(ARCH) \ - sun.jvm.hotspot.asm.Disassembler - $(GCC) $(CFLAGS) $< -o $@ - -$(ARCH)/%.o: %.c - $(GCC) $(CFLAGS) $< -o $@ - -ifndef LDNOMAP - LFLAGS_LIBSA = -Xlinker --version-script=mapfile -endif - -# If this is a --hash-style=gnu system, use --hash-style=both -# The gnu .hash section won't work on some Linux systems like SuSE 10. -_HAS_HASH_STYLE_GNU:=$(shell $(CC) -dumpspecs | grep -- '--hash-style=gnu') -ifneq ($(_HAS_HASH_STYLE_GNU),) - LDFLAGS_HASH_STYLE = -Wl,--hash-style=both -endif -LFLAGS_LIBSA += $(LDFLAGS_HASH_STYLE) - -$(LIBSA): $(ARCH) $(OBJS) mapfile - $(GCC) -shared $(LFLAGS_LIBSA) -o $(LIBSA) $(OBJS) $(LIBS) - -test.o: test.c - $(GCC) -c -o test.o -g -D_GNU_SOURCE -D$(ARCH) $(INCLUDES) test.c - -test: test.o - $(GCC) -o test test.o -L$(ARCH) -lsaproc $(LIBS) - -clean: - rm -fr $(ARCH) diff --git a/hotspot/agent/src/os/solaris/Makefile b/hotspot/agent/src/os/solaris/Makefile deleted file mode 100644 index 0e964bf2c60..00000000000 --- a/hotspot/agent/src/os/solaris/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -# -# Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - - -all: - cd proc; $(MAKE) all - -clean: - cd proc; $(MAKE) clean diff --git a/hotspot/agent/src/os/solaris/proc/Makefile b/hotspot/agent/src/os/solaris/proc/Makefile deleted file mode 100644 index 60ba88eb47b..00000000000 --- a/hotspot/agent/src/os/solaris/proc/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -# -# Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -# Targets are: -# sparc: Build the 32 bit sparc version in ./sparc -# sparcv9: Build the 64 bit sparcv9 version in ./sparcv9 -# i386: Build the 32 bit i386 version in ./i386 - -.PHONY: sparc sparcv9 i386 amd64 - -ARCH_ORIG = $(shell uname -p) - -C++ := CC -RM := /usr/bin/rm -MKDIRS := /usr/bin/mkdir -p - -CLASSES_DIR = ../../../../build/classes -SAPROC_INCLUDES=-I${JAVA_HOME}/include -I${JAVA_HOME}/include/solaris -SADIS=../../../share/native/sadis.c - -ifeq "$(ARCH_ORIG)" "i386" - ALL_TARGET = i386 $(filter amd64,$(shell isalist)) -else - ALL_TARGET = sparc sparcv9 -endif - -CFLAGS/i386 = -CFLAGS/amd64 = -xarch=amd64 -CFLAGS/sparc = -xarch=v8 -CFLAGS/sparv9 = -xarch=v9 - -all:: $(ALL_TARGET) - -javahomecheck:: - @if [ "x$(JAVA_HOME)" = "x" ] ; then \ - echo You must set the environment variable JAVA_HOME before executing this Makefile ; \ - exit 1 ; \ - fi - -i386 amd64 sparc sparcv9:: javahomecheck - $(MKDIRS) $@ - @$(JAVA_HOME)/bin/javah -classpath $(CLASSES_DIR) -d $@ -jni sun.jvm.hotspot.asm.Disassembler sun.jvm.hotspot.debugger.proc.ProcDebuggerLocal - CC $(CFLAGS/$@) -c -g -Kpic ${SAPROC_INCLUDES} -I$@ saproc.cpp -o $@/saproc.o - cc $(CFLAGS/$@) -c -g -Kpic ${SAPROC_INCLUDES} -I$@ $(SADIS) -o $@/sadis.o - CC $(CFLAGS/$@) -g -G -Kpic $@/saproc.o $@/sadis.o -M mapfile -o $@/libsaproc.so -ldemangle - CC $(CFLAGS/$@) -o $@/libsaproc_audit.so -G -Kpic -z defs saproc_audit.cpp -lmapmalloc -ldl -lc - -clean:: - $(RM) -rf sparc sparcv9 i386 amd64 diff --git a/hotspot/agent/src/os/win32/windbg/Makefile b/hotspot/agent/src/os/win32/windbg/Makefile deleted file mode 100644 index 877913a478d..00000000000 --- a/hotspot/agent/src/os/win32/windbg/Makefile +++ /dev/null @@ -1,91 +0,0 @@ -# -# Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - -# set WINDBG_HOME and JAVA_HOME environment variables before this make. - -SAWINDBGDLL = sawindbg.dll -CPP32=cl.exe -CPP64=cl.exe -LINK32=link.exe -LINK64=link.exe -JAVAH=$(JAVA_HOME)/bin/javah -WINDBG_INCLUDE=$(WINDBG_HOME)/sdk/inc -WINDBG_LIB32=$(WINDBG_HOME)/sdk/lib/i386 -WINDBG_LIB_IA64=$(WINDBG_HOME)/sdk/lib/ia64 -WINDBG_LIB_AMD64=$(WINDBG_HOME)/sdk/lib/amd64 - -SADIS=../../../share/native/sadis.c - -# These do not need to be optimized (don't run a lot of code) and it -# will be useful to have the assertion checks in place - -CFLAGS32=/nologo /MD /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c - -CFLAGS64=/nologo /MD /W3 /GX /Od /D "WIN32" /D "WIN64" /D "_WINDOWS" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c - -LIBS32= $(WINDBG_LIB32)/dbgeng.lib \ - /nologo /subsystem:console /debug /machine:I386 - -LIBS_IA64= $(WINDBG_LIB_IA64)/dbgeng.lib \ - /nologo /subsystem:console /debug /machine:IA64 - -LIBS_AMD64= $(WINDBG_LIB_AMD64)/dbgeng.lib bufferoverflowU.lib \ - /nologo /subsystem:console /debug /machine:AMD64 - -default: i386/$(SAWINDBGDLL) - -ia64: ia64/$(SAWINDBGDLL) - -amd64: amd64/$(SAWINDBGDLL) - -i386/$(SAWINDBGDLL) : sawindbg.cpp $(SADIS) - @ mkdir -p i386 - @ $(JAVAH) -jni -classpath ../../../../build/classes sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal sun.jvm.hotspot.debugger.x86.X86ThreadContext - @ $(JAVAH) -jni -classpath ../../../../build/classes sun.jvm.hotspot.asm.Disassembler - @ $(CPP32) /I$(JAVA_HOME)/include /I$(JAVA_HOME)/include/win32 /I$(WINDBG_INCLUDE) $(CFLAGS32) /Fp"i386/sawindbg.pch" /Fo"i386/" /Fd"i386/" /c sawindbg.cpp - @ $(CPP32) /I$(JAVA_HOME)/include /I$(JAVA_HOME)/include/win32 /I$(WINDBG_INCLUDE) $(CFLAGS32) /Fp"i386/sadis.pch" /Fo"i386/" /Fd"i386/" /c $(SADIS) - $(LINK32) /out:$@ /DLL i386/sawindbg.obj i386/sadis.obj $(LIBS32) - -ia64/$(SAWINDBGDLL) : sawindbg.cpp $(SADIS) - @ mkdir -p ia64 - @ $(JAVAH) -jni -classpath ../../../../build/classes sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal sun.jvm.hotspot.debugger.ia64.IA64ThreadContext - @ $(JAVAH) -jni -classpath ../../../../build/classes sun.jvm.hotspot.asm.Disassembler - @ $(CPP64) /I$(JAVA_HOME)/include /I$(JAVA_HOME)/include/win32 /I$(WINDBG_INCLUDE) $(CFLAGS64) /Fp"ia64/sawindbg.pch" /Fo"ia64/" /Fd"ia64/" /c sawindbg.cpp - @ $(CPP64) /I$(JAVA_HOME)/include /I$(JAVA_HOME)/include/win32 /I$(WINDBG_INCLUDE) $(CFLAGS64) /Fp"ia64/sadis.pch" /Fo"ia64/" /Fd"ia64/" /c $(SADIS) - $(LINK64) /out:$@ /DLL ia64/sawindbg.obj ia64/sadis.obj $(LIBS_IA64) - -amd64/$(SAWINDBGDLL) : sawindbg.cpp $(SADIS) - @ mkdir -p amd64 - @ $(JAVAH) -jni -classpath ../../../../build/classes sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext - @ $(JAVAH) -jni -classpath ../../../../build/classes sun.jvm.hotspot.asm.Disassembler - @ $(CPP64) /I$(JAVA_HOME)/include /I$(JAVA_HOME)/include/win32 /I$(WINDBG_INCLUDE) $(CFLAGS64) /Fp"amd64/sawindbg.pch" /Fo"amd64/" /Fd"amd64/" /c sawindbg.cpp - @ $(CPP64) /I$(JAVA_HOME)/include /I$(JAVA_HOME)/include/win32 /I$(WINDBG_INCLUDE) $(CFLAGS64) /Fp"amd64/sadis.pch" /Fo"amd64/" /Fd"amd64/" /c $(SADIS) - $(LINK64) /out:$@ /DLL amd64/sawindbg.obj amd64/sadis.obj $(LIBS_AMD64) - -clean: - rm *.h - rm -rf i386 - rm -rf ia64 - rm -rf amd64 - diff --git a/hotspot/make/lib/Lib-jdk.hotspot.agent.gmk b/hotspot/make/lib/Lib-jdk.hotspot.agent.gmk index a3febc1c302..8a2402c29d1 100644 --- a/hotspot/make/lib/Lib-jdk.hotspot.agent.gmk +++ b/hotspot/make/lib/Lib-jdk.hotspot.agent.gmk @@ -29,22 +29,13 @@ $(eval $(call IncludeCustomExtension, hotspot, lib/Lib-jdk.hotspot.agent.gmk)) ################################################################################ -SA_TOPDIR := $(HOTSPOT_TOPDIR)/agent - -# SA has a slightly different OS naming scheme -ifeq ($(OPENJDK_TARGET_OS), windows) - SA_TARGET_OS := win32 -else ifeq ($(OPENJDK_TARGET_OS), macosx) - SA_TARGET_OS := bsd -else - SA_TARGET_OS := $(OPENJDK_TARGET_OS) -endif +SA_TOPDIR := $(HOTSPOT_TOPDIR)/src/jdk.hotspot.agent # Defaults for most platforms SA_TOOLCHAIN := TOOLCHAIN_DEFAULT SA_NAME := saproc -SA_SRC += $(SA_TOPDIR)/src/share/native $(SA_TOPDIR)/src/os/$(SA_TARGET_OS) -SA_MAPFILE := $(SA_TOPDIR)/src/os/$(OPENJDK_TARGET_OS)/mapfile +SA_SRC += $(SA_TOPDIR)/share/native/libsaproc $(SA_TOPDIR)/$(OPENJDK_TARGET_OS)/native/libsaproc +SA_MAPFILE := $(HOTSPOT_TOPDIR)/make/mapfiles/libsaproc/mapfile-$(OPENJDK_TARGET_OS) SA_INCLUDES := \ $(addprefix -I, $(SA_SRC)) \ -I$(SUPPORT_OUTPUTDIR)/headers/jdk.hotspot.agent \ @@ -66,9 +57,7 @@ ifeq ($(OPENJDK_TARGET_OS), linux) else ifeq ($(OPENJDK_TARGET_OS), solaris) SA_TOOLCHAIN := TOOLCHAIN_LINK_CXX - SA_MAPFILE := $(SA_TOPDIR)/src/os/solaris/proc/mapfile - COMMON_CFLAGS := -I$(SA_TOPDIR)/src/os/$(OPENJDK_TARGET_OS)/proc \ - -DSOLARIS_11_B159_OR_LATER + COMMON_CFLAGS := -DSOLARIS_11_B159_OR_LATER SA_CFLAGS := $(CFLAGS_JDKLIB) $(COMMON_CFLAGS) SA_CXXFLAGS := $(CXXFLAGS_JDKLIB) $(COMMON_CFLAGS) SA_LDFLAGS := $(subst -z defs,, $(LDFLAGS_JDKLIB)) \ diff --git a/hotspot/agent/src/os/linux/mapfile b/hotspot/make/mapfiles/libsaproc/mapfile-linux similarity index 100% rename from hotspot/agent/src/os/linux/mapfile rename to hotspot/make/mapfiles/libsaproc/mapfile-linux diff --git a/hotspot/agent/src/os/bsd/mapfile b/hotspot/make/mapfiles/libsaproc/mapfile-macosx similarity index 100% rename from hotspot/agent/src/os/bsd/mapfile rename to hotspot/make/mapfiles/libsaproc/mapfile-macosx diff --git a/hotspot/agent/src/os/solaris/proc/mapfile b/hotspot/make/mapfiles/libsaproc/mapfile-solaris similarity index 100% rename from hotspot/agent/src/os/solaris/proc/mapfile rename to hotspot/make/mapfiles/libsaproc/mapfile-solaris diff --git a/hotspot/agent/doc/ReadMe-JavaScript.text b/hotspot/src/jdk.hotspot.agent/doc/ReadMe-JavaScript.text similarity index 100% rename from hotspot/agent/doc/ReadMe-JavaScript.text rename to hotspot/src/jdk.hotspot.agent/doc/ReadMe-JavaScript.text diff --git a/hotspot/agent/doc/cireplay.html b/hotspot/src/jdk.hotspot.agent/doc/cireplay.html similarity index 100% rename from hotspot/agent/doc/cireplay.html rename to hotspot/src/jdk.hotspot.agent/doc/cireplay.html diff --git a/hotspot/agent/doc/clhsdb.html b/hotspot/src/jdk.hotspot.agent/doc/clhsdb.html similarity index 100% rename from hotspot/agent/doc/clhsdb.html rename to hotspot/src/jdk.hotspot.agent/doc/clhsdb.html diff --git a/hotspot/agent/doc/hsdb.html b/hotspot/src/jdk.hotspot.agent/doc/hsdb.html similarity index 100% rename from hotspot/agent/doc/hsdb.html rename to hotspot/src/jdk.hotspot.agent/doc/hsdb.html diff --git a/hotspot/agent/doc/index.html b/hotspot/src/jdk.hotspot.agent/doc/index.html similarity index 100% rename from hotspot/agent/doc/index.html rename to hotspot/src/jdk.hotspot.agent/doc/index.html diff --git a/hotspot/agent/doc/jsdb.html b/hotspot/src/jdk.hotspot.agent/doc/jsdb.html similarity index 100% rename from hotspot/agent/doc/jsdb.html rename to hotspot/src/jdk.hotspot.agent/doc/jsdb.html diff --git a/hotspot/agent/doc/transported_core.html b/hotspot/src/jdk.hotspot.agent/doc/transported_core.html similarity index 100% rename from hotspot/agent/doc/transported_core.html rename to hotspot/src/jdk.hotspot.agent/doc/transported_core.html diff --git a/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/LinuxDebuggerLocal.c similarity index 100% rename from hotspot/agent/src/os/linux/LinuxDebuggerLocal.c rename to hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/LinuxDebuggerLocal.c diff --git a/hotspot/agent/src/os/linux/elfmacros.h b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/elfmacros.h similarity index 100% rename from hotspot/agent/src/os/linux/elfmacros.h rename to hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/elfmacros.h diff --git a/hotspot/agent/src/os/linux/libproc.h b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc.h similarity index 100% rename from hotspot/agent/src/os/linux/libproc.h rename to hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc.h diff --git a/hotspot/agent/src/os/linux/libproc_impl.c b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c similarity index 100% rename from hotspot/agent/src/os/linux/libproc_impl.c rename to hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c diff --git a/hotspot/agent/src/os/linux/libproc_impl.h b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.h similarity index 100% rename from hotspot/agent/src/os/linux/libproc_impl.h rename to hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.h diff --git a/hotspot/agent/src/os/linux/proc_service.h b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/proc_service.h similarity index 100% rename from hotspot/agent/src/os/linux/proc_service.h rename to hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/proc_service.h diff --git a/hotspot/agent/src/os/linux/ps_core.c b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c similarity index 100% rename from hotspot/agent/src/os/linux/ps_core.c rename to hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c diff --git a/hotspot/agent/src/os/linux/ps_proc.c b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_proc.c similarity index 100% rename from hotspot/agent/src/os/linux/ps_proc.c rename to hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_proc.c diff --git a/hotspot/agent/src/os/linux/salibelf.c b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/salibelf.c similarity index 100% rename from hotspot/agent/src/os/linux/salibelf.c rename to hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/salibelf.c diff --git a/hotspot/agent/src/os/bsd/salibelf.h b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/salibelf.h similarity index 100% rename from hotspot/agent/src/os/bsd/salibelf.h rename to hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/salibelf.h diff --git a/hotspot/agent/src/os/linux/symtab.c b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/symtab.c similarity index 100% rename from hotspot/agent/src/os/linux/symtab.c rename to hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/symtab.c diff --git a/hotspot/agent/src/os/linux/symtab.h b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/symtab.h similarity index 100% rename from hotspot/agent/src/os/linux/symtab.h rename to hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/symtab.h diff --git a/hotspot/agent/src/os/linux/test.c b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/test.c similarity index 100% rename from hotspot/agent/src/os/linux/test.c rename to hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/test.c diff --git a/hotspot/agent/src/os/bsd/BsdDebuggerLocal.c b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/BsdDebuggerLocal.c similarity index 100% rename from hotspot/agent/src/os/bsd/BsdDebuggerLocal.c rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/BsdDebuggerLocal.c diff --git a/hotspot/agent/src/os/bsd/MacosxDebuggerLocal.m b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m similarity index 100% rename from hotspot/agent/src/os/bsd/MacosxDebuggerLocal.m rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m diff --git a/hotspot/agent/src/os/bsd/StubDebuggerLocal.c b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/StubDebuggerLocal.c similarity index 100% rename from hotspot/agent/src/os/bsd/StubDebuggerLocal.c rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/StubDebuggerLocal.c diff --git a/hotspot/agent/src/os/bsd/elfmacros.h b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/elfmacros.h similarity index 100% rename from hotspot/agent/src/os/bsd/elfmacros.h rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/elfmacros.h diff --git a/hotspot/agent/src/os/bsd/libproc.h b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/libproc.h similarity index 100% rename from hotspot/agent/src/os/bsd/libproc.h rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/libproc.h diff --git a/hotspot/agent/src/os/bsd/libproc_impl.c b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/libproc_impl.c similarity index 100% rename from hotspot/agent/src/os/bsd/libproc_impl.c rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/libproc_impl.c diff --git a/hotspot/agent/src/os/bsd/libproc_impl.h b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/libproc_impl.h similarity index 100% rename from hotspot/agent/src/os/bsd/libproc_impl.h rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/libproc_impl.h diff --git a/hotspot/agent/src/os/bsd/ps_core.c b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/ps_core.c similarity index 100% rename from hotspot/agent/src/os/bsd/ps_core.c rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/ps_core.c diff --git a/hotspot/agent/src/os/bsd/ps_proc.c b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/ps_proc.c similarity index 100% rename from hotspot/agent/src/os/bsd/ps_proc.c rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/ps_proc.c diff --git a/hotspot/agent/src/os/bsd/salibelf.c b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/salibelf.c similarity index 100% rename from hotspot/agent/src/os/bsd/salibelf.c rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/salibelf.c diff --git a/hotspot/agent/src/os/linux/salibelf.h b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/salibelf.h similarity index 100% rename from hotspot/agent/src/os/linux/salibelf.h rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/salibelf.h diff --git a/hotspot/agent/src/os/bsd/symtab.c b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/symtab.c similarity index 100% rename from hotspot/agent/src/os/bsd/symtab.c rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/symtab.c diff --git a/hotspot/agent/src/os/bsd/symtab.h b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/symtab.h similarity index 100% rename from hotspot/agent/src/os/bsd/symtab.h rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/symtab.h diff --git a/hotspot/agent/src/os/bsd/test.c b/hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/test.c similarity index 100% rename from hotspot/agent/src/os/bsd/test.c rename to hotspot/src/jdk.hotspot.agent/macosx/native/libsaproc/test.c diff --git a/hotspot/agent/src/scripts/README b/hotspot/src/jdk.hotspot.agent/scripts/README similarity index 100% rename from hotspot/agent/src/scripts/README rename to hotspot/src/jdk.hotspot.agent/scripts/README diff --git a/hotspot/agent/src/scripts/start-debug-server.bat b/hotspot/src/jdk.hotspot.agent/scripts/start-debug-server.bat similarity index 100% rename from hotspot/agent/src/scripts/start-debug-server.bat rename to hotspot/src/jdk.hotspot.agent/scripts/start-debug-server.bat diff --git a/hotspot/agent/src/scripts/start-debug-server.sh b/hotspot/src/jdk.hotspot.agent/scripts/start-debug-server.sh similarity index 100% rename from hotspot/agent/src/scripts/start-debug-server.sh rename to hotspot/src/jdk.hotspot.agent/scripts/start-debug-server.sh diff --git a/hotspot/agent/src/scripts/start-debug-server64.sh b/hotspot/src/jdk.hotspot.agent/scripts/start-debug-server64.sh similarity index 100% rename from hotspot/agent/src/scripts/start-debug-server64.sh rename to hotspot/src/jdk.hotspot.agent/scripts/start-debug-server64.sh diff --git a/hotspot/agent/src/scripts/start-rmiregistry.bat b/hotspot/src/jdk.hotspot.agent/scripts/start-rmiregistry.bat similarity index 100% rename from hotspot/agent/src/scripts/start-rmiregistry.bat rename to hotspot/src/jdk.hotspot.agent/scripts/start-rmiregistry.bat diff --git a/hotspot/agent/src/scripts/start-rmiregistry.sh b/hotspot/src/jdk.hotspot.agent/scripts/start-rmiregistry.sh similarity index 100% rename from hotspot/agent/src/scripts/start-rmiregistry.sh rename to hotspot/src/jdk.hotspot.agent/scripts/start-rmiregistry.sh diff --git a/hotspot/agent/src/scripts/start-rmiregistry64.sh b/hotspot/src/jdk.hotspot.agent/scripts/start-rmiregistry64.sh similarity index 100% rename from hotspot/agent/src/scripts/start-rmiregistry64.sh rename to hotspot/src/jdk.hotspot.agent/scripts/start-rmiregistry64.sh diff --git a/hotspot/agent/src/share/classes/META-INF/services/com.sun.jdi.connect.Connector b/hotspot/src/jdk.hotspot.agent/share/classes/META-INF/services/com.sun.jdi.connect.Connector similarity index 100% rename from hotspot/agent/src/share/classes/META-INF/services/com.sun.jdi.connect.Connector rename to hotspot/src/jdk.hotspot.agent/share/classes/META-INF/services/com.sun.jdi.connect.Connector diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/AboutAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/AboutAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/AboutAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/AboutAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/ActionManager.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/ActionManager.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/ActionManager.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/ActionManager.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/ActionUtilities.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/ActionUtilities.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/ActionUtilities.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/ActionUtilities.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/AlignCenterAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/AlignCenterAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/AlignCenterAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/AlignCenterAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/AlignLeftAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/AlignLeftAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/AlignLeftAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/AlignLeftAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/AlignRightAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/AlignRightAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/AlignRightAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/AlignRightAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/ApplyAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/ApplyAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/ApplyAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/ApplyAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/BackAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/BackAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/BackAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/BackAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/CancelAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/CancelAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/CancelAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/CancelAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/DelegateAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/DelegateAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/DelegateAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/DelegateAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/ExitAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/ExitAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/ExitAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/ExitAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/FileMenu.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/FileMenu.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/FileMenu.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/FileMenu.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/FinishAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/FinishAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/FinishAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/FinishAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/HelpAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/HelpAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/HelpAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/HelpAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/HelpMenu.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/HelpMenu.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/HelpMenu.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/HelpMenu.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/NewAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/NewAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/NewAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/NewAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/NextAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/NextAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/NextAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/NextAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/OkAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/OkAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/OkAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/OkAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/OpenAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/OpenAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/OpenAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/OpenAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/SaveAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/SaveAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/SaveAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/SaveAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/SaveAsAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/SaveAsAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/SaveAsAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/SaveAsAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/StateChangeAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/StateChangeAction.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/StateChangeAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/StateChangeAction.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/action/ViewMenu.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/ViewMenu.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/action/ViewMenu.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/action/ViewMenu.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/ui/CommonMenuBar.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/CommonMenuBar.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/ui/CommonMenuBar.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/CommonMenuBar.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/ui/CommonToolBar.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/CommonToolBar.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/ui/CommonToolBar.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/CommonToolBar.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/ui/CommonUI.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/CommonUI.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/ui/CommonUI.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/CommonUI.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/ui/OkCancelButtonPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/OkCancelButtonPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/ui/OkCancelButtonPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/OkCancelButtonPanel.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/ui/OkCancelDialog.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/OkCancelDialog.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/ui/OkCancelDialog.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/OkCancelDialog.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/ui/SplashScreen.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/SplashScreen.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/ui/SplashScreen.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/SplashScreen.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/ui/StatusBar.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/StatusBar.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/ui/StatusBar.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/StatusBar.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/ui/TabsDlg.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/TabsDlg.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/ui/TabsDlg.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/TabsDlg.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/ui/ToggleActionPropertyChangeListener.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/ToggleActionPropertyChangeListener.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/ui/ToggleActionPropertyChangeListener.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/ToggleActionPropertyChangeListener.java diff --git a/hotspot/agent/src/share/classes/com/sun/java/swing/ui/WizardDlg.java b/hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/WizardDlg.java similarity index 100% rename from hotspot/agent/src/share/classes/com/sun/java/swing/ui/WizardDlg.java rename to hotspot/src/jdk.hotspot.agent/share/classes/com/sun/java/swing/ui/WizardDlg.java diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/development/Server16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/development/Server16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/development/Server16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/development/Server16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/development/Server24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/development/Server24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/development/Server24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/development/Server24.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/About16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/About16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/About16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/About16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/About24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/About24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/About24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/About24.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Delete16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Delete16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Delete16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Delete16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Delete24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Delete24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Delete24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Delete24.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Find16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Find16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Find16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Find16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Help16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Help16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Help16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Help16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Help24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Help24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Help24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Help24.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/History16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/History16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/History16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/History16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/History24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/History24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/History24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/History24.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Information16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Information16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Information16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Information16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Information24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Information24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Information24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Information24.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/New16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/New16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/New16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/New16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/New24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/New24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/New24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/New24.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Open16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Open16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Open16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Open16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Open24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Open24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Open24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Open24.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Save16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Save16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Save16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Save16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Save24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Save24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Save24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Save24.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/SaveAs16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/SaveAs16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/SaveAs16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/SaveAs16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/SaveAs24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/SaveAs24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/SaveAs24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/SaveAs24.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Zoom16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Zoom16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/Zoom16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/Zoom16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/ZoomIn16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/ZoomIn16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/ZoomIn16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/ZoomIn16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/ZoomIn24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/ZoomIn24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/general/ZoomIn24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/general/ZoomIn24.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/navigation/Down16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/navigation/Down16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/navigation/Down16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/navigation/Down16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/navigation/Up16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/navigation/Up16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/navigation/Up16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/navigation/Up16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/text/AlignCenter16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/text/AlignCenter16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/text/AlignCenter16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/text/AlignCenter16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/text/AlignCenter24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/text/AlignCenter24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/text/AlignCenter24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/text/AlignCenter24.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/text/AlignLeft16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/text/AlignLeft16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/text/AlignLeft16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/text/AlignLeft16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/text/AlignLeft24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/text/AlignLeft24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/text/AlignLeft24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/text/AlignLeft24.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/text/AlignRight16.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/text/AlignRight16.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/text/AlignRight16.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/text/AlignRight16.gif diff --git a/hotspot/agent/src/share/classes/images/toolbarButtonGraphics/text/AlignRight24.gif b/hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/text/AlignRight24.gif similarity index 100% rename from hotspot/agent/src/share/classes/images/toolbarButtonGraphics/text/AlignRight24.gif rename to hotspot/src/jdk.hotspot.agent/share/classes/images/toolbarButtonGraphics/text/AlignRight24.gif diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/BsdVtblAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/BsdVtblAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/BsdVtblAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/BsdVtblAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/CLHSDB.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/CLHSDB.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/CLHSDB.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/CLHSDB.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/CommandProcessor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/CommandProcessor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/DebugServer.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/DebugServer.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/DebugServer.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/DebugServer.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HSDB.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/HSDB.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HSDB.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HelloWorld.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HelloWorld.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/HelloWorld.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HelloWorld.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotAgent.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotAgent.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotSolarisVtblAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotSolarisVtblAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotSolarisVtblAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotSolarisVtblAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/LinuxVtblAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/LinuxVtblAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/LinuxVtblAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/LinuxVtblAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ObjectHistogram.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ObjectHistogram.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ObjectHistogram.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ObjectHistogram.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/RMIHelper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/RMIHelper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/RMIHelper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/RMIHelper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/SAGetopt.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/SAGetopt.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/SAGetopt.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/SAGetopt.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/SALauncher.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/SALauncher.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/SALauncher.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/SALauncher.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/SALauncherLoader.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/SALauncherLoader.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/SALauncherLoader.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/SALauncherLoader.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/StackTrace.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/StackTrace.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/StackTrace.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/StackTrace.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/Win32VtblAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/Win32VtblAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/Win32VtblAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/Win32VtblAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/Disassembler.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/Disassembler.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/DummySymbolFinder.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/DummySymbolFinder.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/DummySymbolFinder.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/DummySymbolFinder.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ImmediateOrRegister.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/ImmediateOrRegister.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ImmediateOrRegister.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/ImmediateOrRegister.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/InstructionVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/InstructionVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/InstructionVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/InstructionVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Operand.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/Operand.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Operand.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/Operand.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Register.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/Register.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Register.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/Register.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/SymbolFinder.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/SymbolFinder.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/SymbolFinder.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/SymbolFinder.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCArgument.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/sparc/SPARCArgument.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCArgument.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/sparc/SPARCArgument.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegister.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegister.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegister.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegister.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegisterType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegisterType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegisterType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegisterType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegisters.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegisters.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegisters.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegisters.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/c1/Runtime1.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/c1/Runtime1.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/c1/Runtime1.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/c1/Runtime1.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciArrayKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciArrayKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciArrayKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciArrayKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciBaseObject.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciBaseObject.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciBaseObject.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciBaseObject.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciConstant.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciConstant.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciConstant.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciConstant.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciEnv.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciEnv.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciEnv.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciEnv.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciInstance.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciInstance.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciInstance.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciInstance.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciInstanceKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciInstanceKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciInstanceKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciInstanceKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMetadata.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciMetadata.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMetadata.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciMetadata.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethod.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciMethod.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethod.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciMethod.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethodData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciMethodData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciMethodData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciMethodData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciObjArrayKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciObjArrayKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciObjArrayKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciObjArrayKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciObject.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciObject.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciObject.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciObject.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciObjectFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciObjectFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciObjectFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciObjectFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciSymbol.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciSymbol.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciSymbol.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciSymbol.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciTypeArrayKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciTypeArrayKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ci/ciTypeArrayKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ci/ciTypeArrayKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/classfile/ClassLoaderData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/classfile/ClassLoaderData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/classfile/ClassLoaderData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/classfile/ClassLoaderData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/AdapterBlob.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/AdapterBlob.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/AdapterBlob.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/AdapterBlob.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/BufferBlob.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/BufferBlob.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/BufferBlob.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/BufferBlob.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CodeBlob.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CodeBlob.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CodeBlob.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CodeBlob.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CodeCache.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CodeCache.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CodeCache.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CodeCache.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CodeCacheVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CodeCacheVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CodeCacheVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CodeCacheVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CompressedReadStream.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CompressedReadStream.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CompressedReadStream.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CompressedReadStream.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CompressedStream.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CompressedStream.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CompressedStream.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CompressedStream.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CompressedWriteStream.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CompressedWriteStream.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CompressedWriteStream.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/CompressedWriteStream.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ConstantDoubleValue.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ConstantDoubleValue.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ConstantDoubleValue.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ConstantDoubleValue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ConstantIntValue.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ConstantIntValue.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ConstantIntValue.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ConstantIntValue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ConstantLongValue.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ConstantLongValue.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ConstantLongValue.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ConstantLongValue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ConstantOopReadValue.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ConstantOopReadValue.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ConstantOopReadValue.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ConstantOopReadValue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/DebugInfoReadStream.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/DebugInformationRecorder.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/DebugInformationRecorder.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/DebugInformationRecorder.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/DebugInformationRecorder.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/DeoptimizationBlob.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/DeoptimizationBlob.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/DeoptimizationBlob.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/DeoptimizationBlob.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ExceptionBlob.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ExceptionBlob.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ExceptionBlob.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ExceptionBlob.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/Location.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/Location.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/Location.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/Location.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/LocationValue.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/LocationValue.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/LocationValue.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/LocationValue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/MethodHandlesAdapterBlob.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/MethodHandlesAdapterBlob.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/MethodHandlesAdapterBlob.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/MethodHandlesAdapterBlob.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/MonitorValue.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/MonitorValue.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/MonitorValue.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/MonitorValue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/NMethod.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/NMethod.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ObjectValue.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ObjectValue.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ObjectValue.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ObjectValue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/PCDesc.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/PCDesc.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/PCDesc.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/PCDesc.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/RuntimeStub.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/RuntimeStub.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/RuntimeStub.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/RuntimeStub.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/SafepointBlob.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/SafepointBlob.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/SafepointBlob.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/SafepointBlob.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ScopeDesc.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ScopeDesc.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ScopeDesc.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ScopeDesc.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ScopeValue.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ScopeValue.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/ScopeValue.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/ScopeValue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/SingletonBlob.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/SingletonBlob.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/SingletonBlob.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/SingletonBlob.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/Stub.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/Stub.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/Stub.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/Stub.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/StubQueue.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/StubQueue.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/StubQueue.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/StubQueue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/UncommonTrapBlob.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/UncommonTrapBlob.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/UncommonTrapBlob.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/UncommonTrapBlob.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/VMRegImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/VMRegImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/code/VMRegImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/code/VMRegImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/CompileTask.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/CompileTask.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/CompileTask.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/CompileTask.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMapPair.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMapPair.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMapPair.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMapPair.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMapSet.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMapSet.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMapSet.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/ImmutableOopMapSet.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/OopMapStream.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/OopMapStream.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/OopMapStream.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/OopMapStream.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/OopMapValue.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/OopMapValue.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/OopMapValue.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/OopMapValue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/OopMapVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/OopMapVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/compiler/OopMapVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/compiler/OopMapVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Address.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/Address.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Address.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/Address.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/AddressException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/AddressException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/AddressException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/AddressException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DataSource.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/DataSource.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DataSource.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/DataSource.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Debugger.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/Debugger.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Debugger.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/Debugger.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/DebuggerException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/DebuggerException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerUtilities.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/DebuggerUtilities.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerUtilities.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/DebuggerUtilities.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/InputLexer.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/InputLexer.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/InputLexer.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/InputLexer.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/JVMDebugger.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/JVMDebugger.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/JVMDebugger.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/JVMDebugger.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/LongHashMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/LongHashMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/LongHashMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/LongHashMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescription.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescription.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescription.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescription.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionAArch64.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionAArch64.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionAArch64.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionAArch64.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionAMD64.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionAMD64.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionAMD64.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionAMD64.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIA64.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIA64.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIA64.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIA64.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIntelX86.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIntelX86.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIntelX86.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionIntelX86.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionPPC64.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionPPC64.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionPPC64.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionPPC64.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC32Bit.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC32Bit.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC32Bit.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC32Bit.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC64Bit.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC64Bit.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC64Bit.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionSPARC64Bit.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionTwosComplement.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionTwosComplement.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionTwosComplement.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionTwosComplement.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MappedByteBufferDataSource.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MappedByteBufferDataSource.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MappedByteBufferDataSource.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/MappedByteBufferDataSource.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/NoSuchSymbolException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/NoSuchSymbolException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/NoSuchSymbolException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/NoSuchSymbolException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/NotInHeapException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/NotInHeapException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/NotInHeapException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/NotInHeapException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/OopHandle.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/OopHandle.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/OopHandle.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/OopHandle.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Page.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/Page.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Page.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/Page.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/PageCache.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/PageCache.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/PageCache.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/PageCache.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/PageFetcher.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/PageFetcher.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/PageFetcher.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/PageFetcher.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ProcessInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ProcessInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ProcessInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ProcessInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/RandomAccessFileDataSource.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/RandomAccessFileDataSource.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/RandomAccessFileDataSource.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/RandomAccessFileDataSource.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ReadResult.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ReadResult.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ReadResult.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ReadResult.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/SymbolLookup.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/SymbolLookup.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/SymbolLookup.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/SymbolLookup.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ThreadAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ThreadAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ThreadAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ThreadAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ThreadProxy.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ThreadProxy.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ThreadProxy.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ThreadProxy.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/UnalignedAddressException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/UnalignedAddressException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/UnalignedAddressException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/UnalignedAddressException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/UnmappedAddressException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/UnmappedAddressException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/UnmappedAddressException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/UnmappedAddressException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/aarch64/AARCH64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/aarch64/AARCH64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/aarch64/AARCH64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/aarch64/AARCH64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/amd64/AMD64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/amd64/AMD64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/amd64/AMD64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/amd64/AMD64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdAddress.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdAddress.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdAddress.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdAddress.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebugger.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebugger.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebugger.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebugger.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdOopHandle.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdOopHandle.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdOopHandle.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdOopHandle.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/SharedObject.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/SharedObject.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/SharedObject.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/SharedObject.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64CFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64CFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64CFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64CFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/amd64/BsdAMD64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86CFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86CFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86CFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86CFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/bsd/x86/BsdX86ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/AccessControl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/AccessControl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/AccessControl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/AccessControl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/ArrayType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/ArrayType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/ArrayType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/ArrayType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/BaseClass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/BaseClass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/BaseClass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/BaseClass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/BitType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/BitType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/BitType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/BitType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/BlockSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/BlockSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/BlockSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/BlockSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/CDebugInfoDataBase.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/CDebugInfoDataBase.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/CDebugInfoDataBase.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/CDebugInfoDataBase.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/CDebugger.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/CDebugger.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/CDebugger.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/CDebugger.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/CFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/CFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/CFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/CFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/CVAttributes.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/CVAttributes.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/CVAttributes.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/CVAttributes.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/ClosestSymbol.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/ClosestSymbol.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/ClosestSymbol.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/ClosestSymbol.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/CompoundType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/CompoundType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/CompoundType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/CompoundType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/DebugEvent.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/DebugEvent.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/DebugEvent.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/DebugEvent.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/DefaultObjectVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/DefaultObjectVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/DefaultObjectVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/DefaultObjectVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/DoubleType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/DoubleType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/DoubleType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/DoubleType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/EnumType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/EnumType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/EnumType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/EnumType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/Field.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/Field.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/Field.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/Field.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/FieldIdentifier.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/FieldIdentifier.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/FieldIdentifier.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/FieldIdentifier.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/FloatType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/FloatType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/FloatType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/FloatType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/FunctionSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/FunctionSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/FunctionSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/FunctionSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/FunctionType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/FunctionType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/FunctionType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/FunctionType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/GlobalSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/GlobalSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/GlobalSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/GlobalSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/IndexableFieldIdentifier.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/IndexableFieldIdentifier.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/IndexableFieldIdentifier.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/IndexableFieldIdentifier.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/IntType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/IntType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/IntType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/IntType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/LineNumberInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/LineNumberInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/LineNumberInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/LineNumberInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/LineNumberVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/LineNumberVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/LineNumberVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/LineNumberVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/LoadObject.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/LoadObject.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/LoadObject.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/LoadObject.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/LoadObjectComparator.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/LoadObjectComparator.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/LoadObjectComparator.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/LoadObjectComparator.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/LocalSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/LocalSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/LocalSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/LocalSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/MemberFunctionType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/MemberFunctionType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/MemberFunctionType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/MemberFunctionType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/NamedFieldIdentifier.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/NamedFieldIdentifier.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/NamedFieldIdentifier.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/NamedFieldIdentifier.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/ObjectVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/ObjectVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/ObjectVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/ObjectVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/PointerType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/PointerType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/PointerType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/PointerType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/ProcessControl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/ProcessControl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/ProcessControl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/ProcessControl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/RefType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/RefType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/RefType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/RefType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/Sym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/Sym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/Sym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/Sym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/TemplateType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/TemplateType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/TemplateType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/TemplateType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/Type.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/Type.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/Type.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/Type.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/TypeVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/TypeVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/TypeVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/TypeVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/VoidType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/VoidType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/VoidType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/VoidType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicArrayType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicArrayType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicArrayType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicArrayType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBaseClass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBaseClass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBaseClass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBaseClass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBitType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBitType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBitType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBitType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBlockSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBlockSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBlockSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicBlockSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCDebugInfoDataBase.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCDebugInfoDataBase.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCDebugInfoDataBase.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCDebugInfoDataBase.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCompoundType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCompoundType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCompoundType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicCompoundType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicDebugEvent.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicDebugEvent.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicDebugEvent.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicDebugEvent.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicDoubleType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicDoubleType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicDoubleType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicDoubleType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicEnumType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicEnumType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicEnumType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicEnumType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFloatType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFloatType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFloatType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFloatType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFunctionSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFunctionSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFunctionSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFunctionSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFunctionType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFunctionType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFunctionType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicFunctionType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicGlobalSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicGlobalSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicGlobalSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicGlobalSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicIndexableFieldIdentifier.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicIndexableFieldIdentifier.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicIndexableFieldIdentifier.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicIndexableFieldIdentifier.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicIntType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicIntType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicIntType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicIntType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLineNumberInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLineNumberInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLineNumberInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLineNumberInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLineNumberMapping.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLineNumberMapping.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLineNumberMapping.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLineNumberMapping.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLocalSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLocalSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLocalSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicLocalSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicMemberFunctionType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicMemberFunctionType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicMemberFunctionType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicMemberFunctionType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicNamedFieldIdentifier.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicNamedFieldIdentifier.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicNamedFieldIdentifier.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicNamedFieldIdentifier.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicPointerType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicPointerType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicPointerType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicPointerType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicRefType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicRefType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicRefType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicRefType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicVoidType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicVoidType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicVoidType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/BasicVoidType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/CompoundTypeKind.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/CompoundTypeKind.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/CompoundTypeKind.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/CompoundTypeKind.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/LazyBlockSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/LazyBlockSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/LazyBlockSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/LazyBlockSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/LazyType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/LazyType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/LazyType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/LazyType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/ResolveListener.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/ResolveListener.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/ResolveListener.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/cdbg/basic/ResolveListener.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dummy/DummyAddress.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/dummy/DummyAddress.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dummy/DummyAddress.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/dummy/DummyAddress.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dummy/DummyDebugger.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/dummy/DummyDebugger.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dummy/DummyDebugger.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/dummy/DummyDebugger.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dummy/DummyOopHandle.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/dummy/DummyOopHandle.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dummy/DummyOopHandle.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/dummy/DummyOopHandle.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ia64/IA64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ia64/IA64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ia64/IA64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ia64/IA64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebugger.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebugger.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebugger.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebugger.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxOopHandle.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxOopHandle.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxOopHandle.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxOopHandle.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/SharedObject.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/SharedObject.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/SharedObject.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/SharedObject.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64CFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64CFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64CFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64CFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/aarch64/LinuxAARCH64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64CFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/amd64/LinuxAMD64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/ia64/LinuxIA64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/ia64/LinuxIA64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/ia64/LinuxIA64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/ia64/LinuxIA64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/ppc64/LinuxPPC64CFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/ppc64/LinuxPPC64CFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/ppc64/LinuxPPC64CFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/ppc64/LinuxPPC64CFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/ppc64/LinuxPPC64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/ppc64/LinuxPPC64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/ppc64/LinuxPPC64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/ppc64/LinuxPPC64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/sparc/LinuxSPARCCFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/sparc/LinuxSPARCCFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/sparc/LinuxSPARCCFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/sparc/LinuxSPARCCFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/sparc/LinuxSPARCThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/sparc/LinuxSPARCThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/sparc/LinuxSPARCThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/sparc/LinuxSPARCThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86CFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/linux/x86/LinuxX86ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/AddressDataSource.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/AddressDataSource.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/AddressDataSource.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/AddressDataSource.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/DSO.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/DSO.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/DSO.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/DSO.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFFile.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFFile.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFFile.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFFile.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFFileParser.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFFileParser.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFFileParser.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFFileParser.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHashTable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHashTable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHashTable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHashTable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFProgramHeader.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFProgramHeader.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFProgramHeader.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFProgramHeader.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFSectionHeader.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFSectionHeader.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFSectionHeader.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFSectionHeader.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFStringTable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFStringTable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFStringTable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFStringTable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFSymbol.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFSymbol.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFSymbol.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFSymbol.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ppc64/PPC64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ppc64/PPC64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ppc64/PPC64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/ppc64/PPC64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcAddress.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcAddress.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcAddress.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcAddress.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcCDebugger.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcCDebugger.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcCDebugger.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcCDebugger.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcCFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcCFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcCFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcCFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebugger.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebugger.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebugger.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebugger.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcOopHandle.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcOopHandle.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcOopHandle.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcOopHandle.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ProcThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/SharedObject.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/SharedObject.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/SharedObject.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/SharedObject.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64Thread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64Thread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64Thread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64Thread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64ThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64ThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64ThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/aarch64/ProcAARCH64ThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64Thread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64Thread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64Thread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64Thread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64ThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64ThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64ThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/amd64/ProcAMD64ThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64Thread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64Thread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64Thread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64Thread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64ThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64ThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64ThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/ppc64/ProcPPC64ThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/sparc/ProcSPARCThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86Thread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86Thread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86Thread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86Thread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86ThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86ThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86ThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/proc/x86/ProcX86ThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteAddress.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteAddress.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteAddress.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteAddress.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebugger.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebugger.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebugger.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebugger.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerServer.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerServer.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerServer.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerServer.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteOopHandle.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteOopHandle.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteOopHandle.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteOopHandle.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/RemoteThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64Thread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64Thread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64Thread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64Thread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64ThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64ThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64ThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/aarch64/RemoteAARCH64ThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64Thread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64Thread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64Thread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64Thread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64ThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64ThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64ThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/amd64/RemoteAMD64ThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64Thread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64Thread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64Thread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64Thread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64ThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64ThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64ThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/ppc64/RemotePPC64ThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/sparc/RemoteSPARCThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86Thread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86Thread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86Thread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86Thread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86ThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86ThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86ThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/remote/x86/RemoteX86ThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/sparc/SPARCThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/sparc/SPARCThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/sparc/SPARCThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/sparc/SPARCThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxBfEfRecord.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxBfEfRecord.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxBfEfRecord.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxBfEfRecord.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxFileRecord.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxFileRecord.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxFileRecord.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxFileRecord.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxFunctionDefinitionRecord.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxFunctionDefinitionRecord.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxFunctionDefinitionRecord.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxFunctionDefinitionRecord.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxSectionDefinitionsRecord.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxSectionDefinitionsRecord.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxSectionDefinitionsRecord.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxSectionDefinitionsRecord.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxSymbolRecord.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxSymbolRecord.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxSymbolRecord.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxSymbolRecord.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxWeakExternalRecord.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxWeakExternalRecord.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxWeakExternalRecord.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/AuxWeakExternalRecord.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFFile.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFFile.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFFile.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFFile.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFFileParser.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFFileParser.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFFileParser.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFFileParser.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFHeader.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFHeader.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFHeader.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFHeader.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFLineNumber.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFLineNumber.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFLineNumber.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFLineNumber.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFRelocation.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFRelocation.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFRelocation.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFRelocation.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFSymbol.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFSymbol.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFSymbol.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFSymbol.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFSymbolConstants.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFSymbolConstants.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFSymbolConstants.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFSymbolConstants.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COMDATSelectionTypes.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COMDATSelectionTypes.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COMDATSelectionTypes.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/COMDATSelectionTypes.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/Characteristics.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/Characteristics.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/Characteristics.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/Characteristics.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DLLCharacteristics.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DLLCharacteristics.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DLLCharacteristics.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DLLCharacteristics.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DataDirectory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DataDirectory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DataDirectory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DataDirectory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugDirectory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugDirectory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugDirectory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugDirectory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugDirectoryEntry.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugDirectoryEntry.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugDirectoryEntry.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugDirectoryEntry.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugTypes.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugTypes.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugTypes.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugTypes.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50MemberAttributes.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50MemberAttributes.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50MemberAttributes.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50MemberAttributes.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50ReservedTypes.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50ReservedTypes.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50ReservedTypes.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50ReservedTypes.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSAlignSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSAlignSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSAlignSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSAlignSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSFileIndex.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSFileIndex.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSFileIndex.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSFileIndex.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalPub.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalPub.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalPub.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalPub.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalTypes.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalTypes.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalTypes.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSGlobalTypes.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSLibraries.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSLibraries.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSLibraries.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSLibraries.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSMPC.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSMPC.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSMPC.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSMPC.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSModule.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSModule.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSModule.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSModule.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSOffsetMap16.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSOffsetMap16.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSOffsetMap16.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSOffsetMap16.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSOffsetMap32.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSOffsetMap32.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSOffsetMap32.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSOffsetMap32.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPreComp.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPreComp.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPreComp.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPreComp.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPublic.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPublic.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPublic.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPublic.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPublicSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPublicSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPublicSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSPublicSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSegMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSegMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSegMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSegMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSegName.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSegName.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSegName.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSegName.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSrcLnSeg.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSrcLnSeg.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSrcLnSeg.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSrcLnSeg.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSrcModule.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSrcModule.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSrcModule.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSrcModule.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSStaticSym.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSStaticSym.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSStaticSym.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSStaticSym.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSymbolBase.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSymbolBase.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSymbolBase.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSymbolBase.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSymbols.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSymbols.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSymbols.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSSymbols.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSTypes.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSTypes.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSTypes.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SSTypes.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegDesc.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegDesc.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegDesc.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegDesc.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegDescEnums.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegDescEnums.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegDescEnums.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegDescEnums.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SegInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SrcModFileDesc.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SrcModFileDesc.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SrcModFileDesc.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SrcModFileDesc.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SrcModLineNumberMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SrcModLineNumberMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SrcModLineNumberMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SrcModLineNumberMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50Subsection.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50Subsection.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50Subsection.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50Subsection.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SubsectionDirectory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SubsectionDirectory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SubsectionDirectory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SubsectionDirectory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SubsectionTypes.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SubsectionTypes.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SubsectionTypes.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SubsectionTypes.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolEnums.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolEnums.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolEnums.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolEnums.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolIterator.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolIterator.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolIterator.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolIterator.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolTypes.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolTypes.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolTypes.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50SymbolTypes.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeEnums.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeEnums.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeEnums.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeEnums.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeIterator.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeIterator.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeIterator.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeIterator.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeLeafIndices.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeLeafIndices.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeLeafIndices.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50TypeLeafIndices.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50WrongNumericTypeException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50WrongNumericTypeException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50WrongNumericTypeException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50WrongNumericTypeException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50X86RegisterEnums.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50X86RegisterEnums.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50X86RegisterEnums.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DebugVC50X86RegisterEnums.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DumpExports.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DumpExports.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DumpExports.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/DumpExports.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/ExportDirectoryTable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/ExportDirectoryTable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/ExportDirectoryTable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/ExportDirectoryTable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/MachineTypes.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/MachineTypes.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/MachineTypes.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/MachineTypes.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeader.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeader.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeader.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeader.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderDataDirectories.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderDataDirectories.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderDataDirectories.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderDataDirectories.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderStandardFields.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderStandardFields.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderStandardFields.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderStandardFields.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderWindowsSpecificFields.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderWindowsSpecificFields.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderWindowsSpecificFields.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/OptionalHeaderWindowsSpecificFields.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/SectionFlags.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/SectionFlags.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/SectionFlags.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/SectionFlags.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/SectionHeader.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/SectionHeader.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/SectionHeader.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/SectionHeader.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/TestDebugInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/TestDebugInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/TestDebugInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/TestDebugInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/TestParser.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/TestParser.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/TestParser.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/TestParser.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/TypeIndicators.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/TypeIndicators.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/TypeIndicators.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/TypeIndicators.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/WindowsNTSubsystem.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/WindowsNTSubsystem.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/WindowsNTSubsystem.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/win32/coff/WindowsNTSubsystem.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/AddressDataSource.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/AddressDataSource.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/AddressDataSource.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/AddressDataSource.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/DLL.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/DLL.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/DLL.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/DLL.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgAddress.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgAddress.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgAddress.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgAddress.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugInfoBuilder.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugInfoBuilder.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugInfoBuilder.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugInfoBuilder.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugger.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugger.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugger.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgCDebugger.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgOopHandle.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgOopHandle.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgOopHandle.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgOopHandle.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64Thread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64Thread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64Thread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64Thread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64ThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64ThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64ThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/amd64/WindbgAMD64ThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64Thread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64Thread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64Thread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64Thread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64ThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64ThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64ThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/ia64/WindbgIA64ThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86Thread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86Thread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86Thread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86Thread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86ThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86ThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86ThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/x86/WindbgX86ThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windows/amd64/WindowsAMD64CFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windows/amd64/WindowsAMD64CFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windows/amd64/WindowsAMD64CFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windows/amd64/WindowsAMD64CFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windows/x86/WindowsX86CFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windows/x86/WindowsX86CFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windows/x86/WindowsX86CFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windows/x86/WindowsX86CFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/x86/X86ThreadContext.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/x86/X86ThreadContext.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/x86/X86ThreadContext.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/x86/X86ThreadContext.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/AdaptiveFreeList.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/AdaptiveFreeList.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/AdaptiveFreeList.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/AdaptiveFreeList.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/CMSBitMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/CMSBitMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/CMSBitMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/CMSBitMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/CMSCollector.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/CMSCollector.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/CMSCollector.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/CMSCollector.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/CompactibleFreeListSpace.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/CompactibleFreeListSpace.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/CompactibleFreeListSpace.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/CompactibleFreeListSpace.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/ConcurrentMarkSweepGeneration.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/ConcurrentMarkSweepGeneration.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/ConcurrentMarkSweepGeneration.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/ConcurrentMarkSweepGeneration.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/LinearAllocBlock.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/LinearAllocBlock.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/LinearAllocBlock.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/LinearAllocBlock.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/ParNewGeneration.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/ParNewGeneration.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/cms/ParNewGeneration.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/cms/ParNewGeneration.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1CollectedHeap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/G1HeapRegionTable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1HeapRegionTable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/G1HeapRegionTable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1HeapRegionTable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/G1MonitoringSupport.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1MonitoringSupport.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/G1MonitoringSupport.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/G1MonitoringSupport.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegion.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/HeapRegion.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegion.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/HeapRegion.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionManager.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionManager.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionManager.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionManager.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionSetBase.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionSetBase.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionSetBase.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/HeapRegionSetBase.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/parallel/ImmutableSpace.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/ImmutableSpace.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/parallel/ImmutableSpace.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/ImmutableSpace.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/parallel/MutableSpace.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/MutableSpace.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/parallel/MutableSpace.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/MutableSpace.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/parallel/PSOldGen.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/PSOldGen.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/parallel/PSOldGen.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/PSOldGen.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/parallel/PSYoungGen.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/PSYoungGen.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/parallel/PSYoungGen.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/PSYoungGen.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/parallel/ParallelScavengeHeap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/ParallelScavengeHeap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/parallel/ParallelScavengeHeap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/parallel/ParallelScavengeHeap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/serial/DefNewGeneration.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/serial/DefNewGeneration.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/serial/DefNewGeneration.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/serial/DefNewGeneration.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/serial/TenuredGeneration.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/serial/TenuredGeneration.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/serial/TenuredGeneration.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/serial/TenuredGeneration.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/CardGeneration.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CardGeneration.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/CardGeneration.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CardGeneration.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeapName.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeapName.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeapName.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CollectedHeapName.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/CompactibleSpace.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CompactibleSpace.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/CompactibleSpace.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/CompactibleSpace.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/ContiguousSpace.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/ContiguousSpace.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/ContiguousSpace.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/ContiguousSpace.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/G1YCType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/G1YCType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/G1YCType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/G1YCType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GCCause.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GCCause.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GCCause.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GCCause.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GCName.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GCName.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GCName.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GCName.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GCWhen.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GCWhen.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GCWhen.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GCWhen.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GenCollectedHeap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GenCollectedHeap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GenCollectedHeap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GenCollectedHeap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/Generation.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/Generation.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/Generation.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/Generation.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GenerationFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GenerationFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GenerationFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GenerationFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GenerationIsInClosure.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GenerationIsInClosure.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GenerationIsInClosure.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GenerationIsInClosure.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GenerationSpec.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GenerationSpec.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/GenerationSpec.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GenerationSpec.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/OffsetTableContigSpace.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/OffsetTableContigSpace.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/OffsetTableContigSpace.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/OffsetTableContigSpace.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/Space.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/Space.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/Space.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/Space.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/SpaceClosure.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/SpaceClosure.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/SpaceClosure.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/SpaceClosure.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/TenuredSpace.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/TenuredSpace.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/gc/shared/TenuredSpace.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/TenuredSpace.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/Bytecode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/Bytecode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeANewArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeANewArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeANewArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeANewArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeBipush.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeBipush.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeBipush.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeBipush.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeCheckCast.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeCheckCast.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeCheckCast.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeCheckCast.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeDisassembler.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeDisassembler.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeDisassembler.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeDisassembler.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetPut.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetPut.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetPut.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetPut.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetStatic.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetStatic.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetStatic.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeGetStatic.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeGoto.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeGoto.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeGoto.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeGoto.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeGotoW.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeGotoW.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeGotoW.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeGotoW.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeIf.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeIf.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeIf.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeIf.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeIinc.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeIinc.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeIinc.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeIinc.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInstanceOf.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeInstanceOf.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInstanceOf.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeInstanceOf.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeJmp.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeJmp.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeJmp.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeJmp.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeJsr.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeJsr.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeJsr.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeJsr.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeJsrW.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeJsrW.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeJsrW.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeJsrW.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoad.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoad.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoad.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoad.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadConstant.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadConstant.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadConstant.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadConstant.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadStore.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadStore.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadStore.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadStore.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLookupswitch.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeLookupswitch.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLookupswitch.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeLookupswitch.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeMultiANewArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeMultiANewArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeMultiANewArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeMultiANewArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeNew.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeNew.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeNew.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeNew.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeNewArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeNewArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeNewArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeNewArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodePutField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodePutField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodePutField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodePutField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodePutStatic.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodePutStatic.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodePutStatic.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodePutStatic.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeRet.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeRet.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeRet.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeRet.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeSipush.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeSipush.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeSipush.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeSipush.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeStore.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeStore.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeStore.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeStore.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeStream.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeStream.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeStream.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeStream.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeTableswitch.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeTableswitch.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeTableswitch.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeTableswitch.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWideable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeWideable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWideable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeWideable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/Interpreter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/Interpreter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/Interpreter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/Interpreter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/InterpreterCodelet.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/InterpreterCodelet.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/InterpreterCodelet.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/InterpreterCodelet.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/LookupswitchPair.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/LookupswitchPair.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/LookupswitchPair.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/LookupswitchPair.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/MaskFillerForNative.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/MaskFillerForNative.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/MaskFillerForNative.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/MaskFillerForNative.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/OffsetClosure.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/OffsetClosure.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/OffsetClosure.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/OffsetClosure.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/OopMapCacheEntry.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/OopMapCacheEntry.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/OopMapCacheEntry.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/OopMapCacheEntry.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/OopMapForCacheEntry.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/OopMapForCacheEntry.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/OopMapForCacheEntry.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/interpreter/OopMapForCacheEntry.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ArrayReferenceImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ArrayReferenceImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ArrayReferenceImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ArrayReferenceImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ArrayTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ArrayTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ArrayTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ArrayTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/BaseLineInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/BaseLineInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/BaseLineInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/BaseLineInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/BooleanTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/BooleanTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/BooleanTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/BooleanTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/BooleanValueImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/BooleanValueImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/BooleanValueImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/BooleanValueImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ByteTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ByteTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ByteTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ByteTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ByteValueImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ByteValueImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ByteValueImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ByteValueImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/CharTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/CharTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/CharTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/CharTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/CharValueImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/CharValueImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/CharValueImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/CharValueImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ClassLoaderReferenceImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ClassLoaderReferenceImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ClassLoaderReferenceImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ClassLoaderReferenceImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ClassObjectReferenceImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ClassObjectReferenceImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ClassObjectReferenceImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ClassObjectReferenceImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ClassTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ClassTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ClassTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ClassTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ConcreteMethodImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ConcreteMethodImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ConcreteMethodImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ConcreteMethodImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ConnectorImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ConnectorImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ConnectorImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ConnectorImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/DoubleTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/DoubleTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/DoubleTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/DoubleTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/DoubleValueImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/DoubleValueImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/DoubleValueImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/DoubleValueImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/FieldImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/FieldImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/FieldImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/FieldImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/FloatTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/FloatTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/FloatTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/FloatTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/FloatValueImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/FloatValueImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/FloatValueImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/FloatValueImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/IntegerTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/IntegerTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/IntegerTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/IntegerTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/IntegerValueImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/IntegerValueImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/IntegerValueImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/IntegerValueImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/InterfaceTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/InterfaceTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/InterfaceTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/InterfaceTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/JNITypeParser.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/JNITypeParser.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/JNITypeParser.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/JNITypeParser.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/JVMTIThreadState.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/LineInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LineInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/LineInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LineInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/LocalVariableImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LocalVariableImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/LocalVariableImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LocalVariableImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/LocationImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LocationImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/LocationImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LocationImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/LongTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LongTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/LongTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LongTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/LongValueImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LongValueImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/LongValueImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/LongValueImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/MethodImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/MethodImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/MethodImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/MethodImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/MirrorImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/MirrorImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/MirrorImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/MirrorImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/MonitorInfoImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/MonitorInfoImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/MonitorInfoImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/MonitorInfoImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/NonConcreteMethodImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/NonConcreteMethodImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/NonConcreteMethodImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/NonConcreteMethodImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ObjectReferenceImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ObjectReferenceImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ObjectReferenceImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ObjectReferenceImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/PrimitiveTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/PrimitiveTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/PrimitiveTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/PrimitiveTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/PrimitiveValueImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/PrimitiveValueImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/PrimitiveValueImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/PrimitiveValueImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ReferenceTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ReferenceTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ReferenceTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ReferenceTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SACoreAttachingConnector.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SACoreAttachingConnector.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SACoreAttachingConnector.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SACoreAttachingConnector.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SADebugServer.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SADebugServer.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SADebugServer.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SADebugServer.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SADebugServerAttachingConnector.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SADebugServerAttachingConnector.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SADebugServerAttachingConnector.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SADebugServerAttachingConnector.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SAJDIClassLoader.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SAJDIClassLoader.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SAJDIClassLoader.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SAJDIClassLoader.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SAPIDAttachingConnector.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SAPIDAttachingConnector.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SAPIDAttachingConnector.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SAPIDAttachingConnector.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SDE.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SDE.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SDE.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/SDE.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ShortTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ShortTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ShortTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ShortTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ShortValueImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ShortValueImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ShortValueImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ShortValueImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/StackFrameImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/StackFrameImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/StackFrameImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/StackFrameImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/StratumLineInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/StratumLineInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/StratumLineInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/StratumLineInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/StringReferenceImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/StringReferenceImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/StringReferenceImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/StringReferenceImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ThreadGroupReferenceImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ThreadGroupReferenceImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ThreadGroupReferenceImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ThreadGroupReferenceImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ThreadReferenceImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ThreadReferenceImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ThreadReferenceImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ThreadReferenceImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/TypeComponentImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/TypeComponentImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/TypeComponentImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/TypeComponentImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/TypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/TypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/TypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/TypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/VMModifiers.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VMModifiers.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/VMModifiers.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VMModifiers.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ValueContainer.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ValueContainer.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ValueContainer.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ValueContainer.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ValueImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ValueImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/ValueImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/ValueImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/VirtualMachineImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VirtualMachineImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/VirtualMachineImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VirtualMachineImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/VoidTypeImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VoidTypeImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/VoidTypeImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VoidTypeImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/VoidValueImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VoidValueImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/VoidValueImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/jdi/VoidValueImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/AFLBinaryTreeDictionary.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/AFLBinaryTreeDictionary.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/AFLBinaryTreeDictionary.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/AFLBinaryTreeDictionary.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/CodeHeap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/CodeHeap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/CodeHeap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/CodeHeap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/Dictionary.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/Dictionary.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/Dictionary.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/Dictionary.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/DictionaryEntry.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/FreeChunk.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/FreeChunk.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/FreeChunk.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/FreeChunk.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/HeapBlock.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/HeapBlock.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/HeapBlock.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/HeapBlock.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/LoaderConstraintEntry.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/LoaderConstraintEntry.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/LoaderConstraintEntry.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/LoaderConstraintEntry.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/LoaderConstraintTable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/LoaderConstraintTable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/LoaderConstraintTable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/LoaderConstraintTable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/MemRegion.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/MemRegion.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/MemRegion.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/MemRegion.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/PlaceholderEntry.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/PlaceholderEntry.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/PlaceholderEntry.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/PlaceholderEntry.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/PlaceholderTable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/PlaceholderTable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/PlaceholderTable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/PlaceholderTable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/ProtectionDomainCacheEntry.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/ProtectionDomainCacheEntry.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/ProtectionDomainCacheEntry.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/ProtectionDomainCacheEntry.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/ProtectionDomainEntry.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/ProtectionDomainEntry.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/ProtectionDomainEntry.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/ProtectionDomainEntry.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/ReferenceType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/ReferenceType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/ReferenceType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/ReferenceType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/StringTable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/StringTable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/StringTable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/StringTable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/SymbolTable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SymbolTable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/SymbolTable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/Universe.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/Universe.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/Universe.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/Universe.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/VirtualSpace.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/VirtualSpace.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/VirtualSpace.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/VirtualSpace.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/AccessFlags.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/AccessFlags.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/AccessFlags.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/AccessFlags.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArgInfoData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ArgInfoData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArgInfoData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ArgInfoData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Array.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Array.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Array.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Array.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ArrayData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ArrayData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/BitData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/BitData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/BitData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/BitData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/BooleanField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/BooleanField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/BooleanField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/BooleanField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/BranchData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/BranchData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/BranchData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/BranchData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/BreakpointInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/BreakpointInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/BreakpointInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/BreakpointInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ByteField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ByteField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ByteField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ByteField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CIntField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CIntField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CIntField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CIntField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CallTypeData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CallTypeData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CallTypeData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CallTypeData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CallTypeDataInterface.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CallTypeDataInterface.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CallTypeDataInterface.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CallTypeDataInterface.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CellTypeState.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CellTypeState.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CellTypeState.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CellTypeState.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CellTypeStateList.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CellTypeStateList.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CellTypeStateList.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CellTypeStateList.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CharField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CharField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CharField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CharField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CheckedExceptionElement.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CheckedExceptionElement.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CheckedExceptionElement.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CheckedExceptionElement.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CompiledICHolder.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CompiledICHolder.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CompiledICHolder.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CompiledICHolder.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CompressedLineNumberReadStream.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CompressedLineNumberReadStream.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CompressedLineNumberReadStream.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CompressedLineNumberReadStream.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethod.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstMethod.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethod.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstMethod.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPool.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPool.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CounterData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CounterData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CounterData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/CounterData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/DataLayout.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DataLayout.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/DataLayout.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DataLayout.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/DefaultHeapVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DefaultHeapVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/DefaultHeapVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DefaultHeapVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/DefaultMetadataVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DefaultMetadataVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/DefaultMetadataVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DefaultMetadataVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/DefaultOopVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DefaultOopVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/DefaultOopVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DefaultOopVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/DoubleField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DoubleField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/DoubleField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/DoubleField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ExceptionTableElement.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ExceptionTableElement.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ExceptionTableElement.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ExceptionTableElement.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Field.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Field.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Field.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Field.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/FieldIdentifier.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/FieldIdentifier.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/FieldIdentifier.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/FieldIdentifier.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/FieldType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/FieldType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/FieldType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/FieldType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/FieldVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/FieldVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/FieldVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/FieldVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/FloatField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/FloatField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/FloatField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/FloatField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/HeapPrinter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/HeapPrinter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/HeapPrinter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/HeapPrinter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/HeapVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/HeapVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/HeapVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/HeapVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/IndexableFieldIdentifier.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/IndexableFieldIdentifier.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/IndexableFieldIdentifier.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/IndexableFieldIdentifier.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Instance.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Instance.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Instance.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Instance.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceClassLoaderKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceClassLoaderKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceClassLoaderKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceClassLoaderKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceMirrorKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceMirrorKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceMirrorKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceMirrorKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceRefKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceRefKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/InstanceRefKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/InstanceRefKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/IntField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/IntField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/IntField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/IntField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/JVMDIClassStatus.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/JVMDIClassStatus.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/JVMDIClassStatus.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/JVMDIClassStatus.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/JumpData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/JumpData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/JumpData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/JumpData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Klass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Klass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/LineNumberTableElement.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/LineNumberTableElement.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/LineNumberTableElement.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/LineNumberTableElement.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/LocalVariableTableElement.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/LocalVariableTableElement.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/LocalVariableTableElement.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/LocalVariableTableElement.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/LongField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/LongField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/LongField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/LongField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Mark.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Mark.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Mark.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Mark.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Metadata.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Metadata.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Metadata.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Metadata.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MetadataField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MetadataField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MetadataField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MetadataField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MetadataVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MetadataVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MetadataVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MetadataVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Method.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Method.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Method.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Method.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodCounters.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodCounters.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodCounters.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodCounters.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodDataInterface.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodDataInterface.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MethodDataInterface.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MethodDataInterface.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MultiBranchData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MultiBranchData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MultiBranchData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MultiBranchData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MutationException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MutationException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MutationException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/MutationException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/NamedFieldIdentifier.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/NamedFieldIdentifier.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/NamedFieldIdentifier.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/NamedFieldIdentifier.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/NarrowKlassField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/NarrowKlassField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/NarrowKlassField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/NarrowKlassField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/NarrowOopField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/NarrowOopField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/NarrowOopField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/NarrowOopField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjArrayKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjArrayKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjArrayKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjArrayKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHeap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHistogram.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHistogram.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHistogram.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHistogram.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHistogramElement.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHistogramElement.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjectHistogramElement.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ObjectHistogramElement.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Oop.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Oop.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Oop.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Oop.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/OopField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/OopField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopPrinter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/OopPrinter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopPrinter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/OopPrinter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/OopUtilities.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopUtilities.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/OopUtilities.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/OopVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/OopVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/OopVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ParametersTypeData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ParametersTypeData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ParametersTypeData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ParametersTypeData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ProfileData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ProfileData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ProfileData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ProfileData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/RawHeapVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/RawHeapVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/RawHeapVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/RawHeapVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ReceiverTypeData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ReceiverTypeData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ReceiverTypeData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ReceiverTypeData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/RetData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/RetData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/RetData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/RetData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ReturnTypeEntry.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ReturnTypeEntry.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ReturnTypeEntry.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ReturnTypeEntry.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ShortField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ShortField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ShortField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ShortField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/SpeculativeTrapData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/SpeculativeTrapData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/SpeculativeTrapData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/SpeculativeTrapData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Symbol.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Symbol.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Symbol.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/Symbol.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeArrayKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeArrayKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeArrayKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeArrayKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeEntries.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeEntries.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeEntries.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeEntries.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeEntriesAtCall.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeEntriesAtCall.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeEntriesAtCall.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeEntriesAtCall.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeStackSlotEntries.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeStackSlotEntries.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeStackSlotEntries.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/TypeStackSlotEntries.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/UnknownOopException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/UnknownOopException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/UnknownOopException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/UnknownOopException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/VirtualCallData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/VirtualCallData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/VirtualCallData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/VirtualCallData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/VirtualCallTypeData.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/VirtualCallTypeData.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/VirtualCallTypeData.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/VirtualCallTypeData.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/java_lang_Class.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/java_lang_Class.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/java_lang_Class.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/java_lang_Class.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Block.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Block.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Block.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Block.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Block_Array.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Block_Array.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Block_Array.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Block_Array.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Block_List.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Block_List.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Block_List.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Block_List.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallDynamicJavaNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/CallDynamicJavaNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallDynamicJavaNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/CallDynamicJavaNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallJavaNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/CallJavaNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallJavaNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/CallJavaNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/CallNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/CallNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallRuntimeNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/CallRuntimeNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallRuntimeNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/CallRuntimeNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallStaticJavaNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/CallStaticJavaNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CallStaticJavaNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/CallStaticJavaNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Compile.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Compile.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Compile.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Compile.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CompilerPhaseType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/CompilerPhaseType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/CompilerPhaseType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/CompilerPhaseType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/HaltNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/HaltNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/HaltNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/HaltNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/InlineTree.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/InlineTree.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/InlineTree.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/InlineTree.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/JVMState.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/JVMState.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/JVMState.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/JVMState.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/LoopNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/LoopNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/LoopNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/LoopNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachCallJavaNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachCallJavaNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachCallJavaNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachCallJavaNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachCallNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachCallNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachCallNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachCallNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachCallRuntimeNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachCallRuntimeNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachCallRuntimeNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachCallRuntimeNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachCallStaticJavaNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachCallStaticJavaNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachCallStaticJavaNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachCallStaticJavaNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachIfNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachIfNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachIfNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachIfNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachReturnNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachReturnNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachReturnNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachReturnNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachSafePointNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachSafePointNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MachSafePointNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MachSafePointNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MultiNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MultiNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/MultiNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/MultiNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Node.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Node.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Node.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Node.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Node_Array.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Node_Array.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Node_Array.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Node_Array.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Node_List.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Node_List.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Node_List.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Node_List.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Phase.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Phase.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/Phase.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/Phase.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/PhaseCFG.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseRegAlloc.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/PhaseRegAlloc.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhaseRegAlloc.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/PhaseRegAlloc.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhiNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/PhiNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/PhiNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/PhiNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/ProjNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/ProjNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/ProjNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/ProjNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/RegionNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/RegionNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/RegionNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/RegionNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/RootNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/RootNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/RootNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/RootNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/SafePointNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/SafePointNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/SafePointNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/SafePointNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/TypeNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/TypeNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/opto/TypeNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/opto/TypeNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/prims/JvmtiExport.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/prims/JvmtiExport.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/prims/JvmtiExport.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/prims/JvmtiExport.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/AddressVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/AddressVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/AddressVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/AddressVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ArgumentSizeComputer.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ArgumentSizeComputer.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ArgumentSizeComputer.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ArgumentSizeComputer.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Arguments.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Arguments.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Arguments.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Arguments.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/BasicLock.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/BasicLock.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/BasicLock.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/BasicLock.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/BasicObjectLock.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/BasicObjectLock.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/BasicObjectLock.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/BasicObjectLock.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/BasicType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/BasicType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/BasicType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/BasicType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/BasicTypeSize.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/BasicTypeSize.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/BasicTypeSize.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/BasicTypeSize.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Bytes.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Bytes.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Bytes.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Bytes.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/CodeCacheSweeperThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/CodeCacheSweeperThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/CodeCacheSweeperThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/CodeCacheSweeperThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/CompiledVFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/CompiledVFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/CompiledVFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/CompiledVFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/CompilerThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/CompilerThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/CompilerThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/CompilerThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ConcurrentLocksPrinter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ConcurrentLocksPrinter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ConcurrentLocksPrinter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ConcurrentLocksPrinter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ConstructionException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ConstructionException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ConstructionException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ConstructionException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/DeadlockDetector.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/DeadlockDetector.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/DeadlockDetector.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/DeadlockDetector.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ExternalVFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ExternalVFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ExternalVFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ExternalVFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Flags.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Flags.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Flags.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Flags.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Frame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Frame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Frame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Frame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/InstanceConstructor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/InstanceConstructor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/InstanceConstructor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/InstanceConstructor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/InterpretedVFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/InterpretedVFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/InterpretedVFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/InterpretedVFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JNIHandleBlock.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JNIHandleBlock.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JNIHandleBlock.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JNIHandleBlock.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JNIHandles.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JNIHandles.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JNIHandles.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JNIHandles.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JNIid.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JNIid.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JNIid.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JNIid.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaCallWrapper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaCallWrapper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaCallWrapper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaCallWrapper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThreadFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaThreadFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThreadFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaThreadFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThreadPDAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaThreadPDAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThreadPDAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaThreadPDAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThreadState.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaThreadState.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaThreadState.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaThreadState.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaVFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaVFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JavaVFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaVFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JvmtiAgentThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JvmtiAgentThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/JvmtiAgentThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JvmtiAgentThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/MonitorInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/MonitorInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/MonitorInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/MonitorInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/NativeSignatureIterator.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/NativeSignatureIterator.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/NativeSignatureIterator.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/NativeSignatureIterator.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/OSThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/OSThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/OSThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/OSThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ObjectMonitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ObjectMonitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ObjectMonitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ObjectMonitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ObjectSynchronizer.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ObjectSynchronizer.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ObjectSynchronizer.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ObjectSynchronizer.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/PerfDataEntry.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/PerfDataEntry.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/PerfDataEntry.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/PerfDataEntry.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/PerfDataPrologue.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/PerfDataPrologue.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/PerfDataPrologue.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/PerfDataPrologue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/PerfMemory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/PerfMemory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/PerfMemory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/PerfMemory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/RegisterMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/RegisterMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/RegisterMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/RegisterMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ResultTypeFinder.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ResultTypeFinder.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ResultTypeFinder.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ResultTypeFinder.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ServiceThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ServiceThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ServiceThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ServiceThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/SignatureConverter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/SignatureConverter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/SignatureConverter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/SignatureConverter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/SignatureInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/SignatureInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/SignatureInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/SignatureInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/SignatureIterator.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/SignatureIterator.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/SignatureIterator.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/SignatureIterator.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StackFrameStream.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StackFrameStream.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StackFrameStream.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StackFrameStream.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StackValue.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StackValue.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StackValue.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StackValue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StackValueCollection.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StackValueCollection.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StackValueCollection.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StackValueCollection.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StaticBaseConstructor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StaticBaseConstructor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StaticBaseConstructor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StaticBaseConstructor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StubRoutines.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StubRoutines.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/StubRoutines.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/StubRoutines.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Thread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Thread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Thread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Thread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ThreadLocalAllocBuffer.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ThreadLocalAllocBuffer.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ThreadLocalAllocBuffer.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ThreadLocalAllocBuffer.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Threads.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Threads.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VM.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VM.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VMObject.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMObject.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VMObject.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMObject.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VMObjectFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMObjectFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VMObjectFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMObjectFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VMOps.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMOps.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VMOps.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMOps.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VMReg.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMReg.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VMReg.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMReg.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VMVersionMismatchException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMVersionMismatchException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VMVersionMismatchException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VMVersionMismatchException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VirtualBaseConstructor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VirtualBaseConstructor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VirtualBaseConstructor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VirtualBaseConstructor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VirtualConstructor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VirtualConstructor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VirtualConstructor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/VirtualConstructor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/WatcherThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/WatcherThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/WatcherThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/WatcherThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64CurrentFrameGuess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64CurrentFrameGuess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64CurrentFrameGuess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64CurrentFrameGuess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64Frame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64Frame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64Frame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64Frame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64JavaCallWrapper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64JavaCallWrapper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64JavaCallWrapper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64JavaCallWrapper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64RegisterMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64RegisterMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64RegisterMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/aarch64/AARCH64RegisterMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64CurrentFrameGuess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64CurrentFrameGuess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64CurrentFrameGuess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64CurrentFrameGuess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64JavaCallWrapper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64JavaCallWrapper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64JavaCallWrapper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/amd64/AMD64JavaCallWrapper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd/BsdSignals.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/bsd/BsdSignals.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd/BsdSignals.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/bsd/BsdSignals.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/bsd_amd64/BsdAMD64JavaThreadPDAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_x86/BsdSignals.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/bsd_x86/BsdSignals.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_x86/BsdSignals.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/bsd_x86/BsdSignals.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_x86/BsdX86JavaThreadPDAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/bsd_x86/BsdX86JavaThreadPDAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/bsd_x86/BsdX86JavaThreadPDAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/bsd_x86/BsdX86JavaThreadPDAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux/LinuxSignals.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux/LinuxSignals.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux/LinuxSignals.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux/LinuxSignals.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_aarch64/LinuxAARCH64JavaThreadPDAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_aarch64/LinuxAARCH64JavaThreadPDAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_aarch64/LinuxAARCH64JavaThreadPDAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_aarch64/LinuxAARCH64JavaThreadPDAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_amd64/LinuxAMD64JavaThreadPDAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_amd64/LinuxAMD64JavaThreadPDAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_amd64/LinuxAMD64JavaThreadPDAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_amd64/LinuxAMD64JavaThreadPDAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_ppc64/LinuxPPC64JavaThreadPDAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_ppc64/LinuxPPC64JavaThreadPDAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_ppc64/LinuxPPC64JavaThreadPDAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_ppc64/LinuxPPC64JavaThreadPDAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_sparc/LinuxSPARCJavaThreadPDAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_sparc/LinuxSPARCJavaThreadPDAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_sparc/LinuxSPARCJavaThreadPDAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_sparc/LinuxSPARCJavaThreadPDAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_x86/LinuxSignals.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_x86/LinuxSignals.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_x86/LinuxSignals.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_x86/LinuxSignals.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_x86/LinuxX86JavaThreadPDAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_x86/LinuxX86JavaThreadPDAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_x86/LinuxX86JavaThreadPDAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/linux_x86/LinuxX86JavaThreadPDAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/posix/POSIXSignals.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/posix/POSIXSignals.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/posix/POSIXSignals.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/posix/POSIXSignals.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64CurrentFrameGuess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64CurrentFrameGuess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64CurrentFrameGuess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64CurrentFrameGuess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64Frame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64Frame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64Frame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64Frame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64JavaCallWrapper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64JavaCallWrapper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64JavaCallWrapper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64JavaCallWrapper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64RegisterMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64RegisterMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64RegisterMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ppc64/PPC64RegisterMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/solaris_amd64/SolarisAMD64JavaThreadPDAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/solaris_amd64/SolarisAMD64JavaThreadPDAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/solaris_amd64/SolarisAMD64JavaThreadPDAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/solaris_amd64/SolarisAMD64JavaThreadPDAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/solaris_sparc/SolarisSPARCJavaThreadPDAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/solaris_sparc/SolarisSPARCJavaThreadPDAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/solaris_sparc/SolarisSPARCJavaThreadPDAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/solaris_sparc/SolarisSPARCJavaThreadPDAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/solaris_x86/SolarisX86JavaThreadPDAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/solaris_x86/SolarisX86JavaThreadPDAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/solaris_x86/SolarisX86JavaThreadPDAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/solaris_x86/SolarisX86JavaThreadPDAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCRegisterMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCRegisterMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCRegisterMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCRegisterMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/vmSymbols.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/vmSymbols.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/vmSymbols.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/vmSymbols.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/win32_amd64/Win32AMD64JavaThreadPDAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/win32_amd64/Win32AMD64JavaThreadPDAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/win32_amd64/Win32AMD64JavaThreadPDAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/win32_amd64/Win32AMD64JavaThreadPDAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/win32_x86/Win32X86JavaThreadPDAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/win32_x86/Win32X86JavaThreadPDAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/win32_x86/Win32X86JavaThreadPDAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/win32_x86/Win32X86JavaThreadPDAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86CurrentFrameGuess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/x86/X86CurrentFrameGuess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86CurrentFrameGuess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/x86/X86CurrentFrameGuess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/x86/X86Frame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86JavaCallWrapper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/x86/X86JavaCallWrapper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86JavaCallWrapper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/x86/X86JavaCallWrapper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86RegisterMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/x86/X86RegisterMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86RegisterMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/x86/X86RegisterMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/FinalizerInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FlagDumper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/FlagDumper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/FlagDumper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/FlagDumper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapDumper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapDumper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapDumper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/HeapSummary.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/JInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/JInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/JMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/JMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JSnap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/JSnap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JSnap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/JSnap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JStack.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/JStack.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/JStack.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/JStack.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/ObjectHistogram.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/PMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/PMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/PStack.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/PStack.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/PStack.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/StackTrace.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/StackTrace.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/StackTrace.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/StackTrace.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/SysPropsDumper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/Tool.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/Tool.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/Tool.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/Tool.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/ClassDump.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassFilter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/ClassFilter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassFilter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/ClassFilter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/NameFilter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/NameFilter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/NameFilter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/NameFilter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/PackageNameFilter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/PackageNameFilter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/PackageNameFilter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/jcore/PackageNameFilter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/soql/JSDB.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/soql/SOQL.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/AddressField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/AddressField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/AddressField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/AddressField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/CIntegerField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/CIntegerField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/CIntegerField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/CIntegerField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/CIntegerType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/CIntegerType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/CIntegerType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/CIntegerType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/Field.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/Field.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/Field.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/Field.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JBooleanField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JBooleanField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JBooleanField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JBooleanField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JByteField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JByteField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JByteField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JByteField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JCharField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JCharField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JCharField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JCharField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JDoubleField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JDoubleField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JDoubleField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JDoubleField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JFloatField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JFloatField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JFloatField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JFloatField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JIntField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JIntField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JIntField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JIntField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JLongField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JLongField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JLongField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JLongField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JShortField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JShortField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/JShortField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/JShortField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/NarrowOopField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/NarrowOopField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/NarrowOopField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/NarrowOopField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/OopField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/OopField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/OopField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/OopField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/PointerType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/PointerType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/PointerType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/PointerType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/Type.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/Type.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/Type.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/Type.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/TypeDataBase.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/TypeDataBase.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/TypeDataBase.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/TypeDataBase.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/WrongTypeException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/WrongTypeException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/WrongTypeException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/WrongTypeException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicAddressFieldWrapper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicAddressFieldWrapper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicAddressFieldWrapper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicAddressFieldWrapper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicCIntegerField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicCIntegerField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicCIntegerField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicCIntegerField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicCIntegerType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicCIntegerType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicCIntegerType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicCIntegerType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicFieldWrapper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicFieldWrapper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicFieldWrapper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicFieldWrapper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJBooleanField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJBooleanField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJBooleanField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJBooleanField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJByteField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJByteField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJByteField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJByteField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJCharField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJCharField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJCharField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJCharField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJDoubleField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJDoubleField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJDoubleField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJDoubleField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJFloatField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJFloatField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJFloatField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJFloatField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJIntField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJIntField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJIntField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJIntField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJLongField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJLongField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJLongField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJLongField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJShortField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJShortField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicJShortField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicJShortField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicNarrowOopField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicNarrowOopField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicNarrowOopField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicNarrowOopField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicOopField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicOopField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicOopField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicOopField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicPointerType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicPointerType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicPointerType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicPointerType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicTypeDataBase.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicTypeDataBase.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicTypeDataBase.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicTypeDataBase.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicVtblAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicVtblAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/BasicVtblAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicVtblAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/VtblAccess.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/VtblAccess.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/types/basic/VtblAccess.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/VtblAccess.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/AnnotatedMemoryPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/AnnotatedMemoryPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/AnnotatedMemoryPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/AnnotatedMemoryPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/Annotation.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/Annotation.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/Annotation.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/Annotation.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/CommandProcessorPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/CommandProcessorPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/CommandProcessorPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/CommandProcessorPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/DeadlockDetectionPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/DeadlockDetectionPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/DeadlockDetectionPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/DeadlockDetectionPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/DebuggerConsolePanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/DebuggerConsolePanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/DebuggerConsolePanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/DebuggerConsolePanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/EditableAtEndDocument.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/EditableAtEndDocument.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/EditableAtEndDocument.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/EditableAtEndDocument.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/Editor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/Editor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/Editor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/Editor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/EditorCommands.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/EditorCommands.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/EditorCommands.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/EditorCommands.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/EditorFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/EditorFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/EditorFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/EditorFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/FindByQueryPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/FindByQueryPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/FindByQueryPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/FindByQueryPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/FindInCodeCachePanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/FindInCodeCachePanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/FindInCodeCachePanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/FindInCodeCachePanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/FindInHeapPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/FindInHeapPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/FindInHeapPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/FindInHeapPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/FindPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/FindPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/FindPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/FindPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/FrameWrapper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/FrameWrapper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/FrameWrapper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/FrameWrapper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/GraphicsUtilities.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/GraphicsUtilities.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/GraphicsUtilities.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/GraphicsUtilities.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/HeapParametersPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/HeapParametersPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/HeapParametersPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/HeapParametersPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/HighPrecisionJScrollBar.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/HighPrecisionJScrollBar.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/HighPrecisionJScrollBar.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/HighPrecisionJScrollBar.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/HistoryComboBox.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/HistoryComboBox.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/HistoryComboBox.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/HistoryComboBox.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/Inspector.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/Inspector.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/Inspector.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/Inspector.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/JFrameWrapper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/JFrameWrapper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/JFrameWrapper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/JFrameWrapper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/JInternalFrameWrapper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/JInternalFrameWrapper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/JInternalFrameWrapper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/JInternalFrameWrapper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/JavaStackTracePanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/JavaStackTracePanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/JavaStackTracePanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/JavaStackTracePanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/JavaThreadsPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/JavaThreadsPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/JavaThreadsPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/JavaThreadsPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/MemoryPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/MemoryPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/MemoryPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/MemoryPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/MemoryViewer.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/MemoryViewer.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/MemoryViewer.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/MemoryViewer.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/MonitorCacheDumpPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/MonitorCacheDumpPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/MonitorCacheDumpPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/MonitorCacheDumpPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/ObjectHistogramPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/ObjectHistogramPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/ObjectHistogramPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/ObjectHistogramPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/ObjectListPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/ObjectListPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/ObjectListPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/ObjectListPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/ProcessListPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/ProcessListPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/ProcessListPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/ProcessListPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/ProgressBarPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/ProgressBarPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/ProgressBarPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/ProgressBarPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SAEditorPane.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/SAEditorPane.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SAEditorPane.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/SAEditorPane.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SAListener.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/SAListener.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SAListener.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/SAListener.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SAPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/SAPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SAPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/SAPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SourceCodePanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/SourceCodePanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SourceCodePanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/SourceCodePanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/StringTransferable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/StringTransferable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/StringTransferable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/StringTransferable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SysPropsPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/SysPropsPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/SysPropsPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/SysPropsPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/ThreadInfoPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/ThreadInfoPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/ThreadInfoPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/ThreadInfoPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/VMFlagsPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/VMFlagsPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/VMFlagsPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/VMFlagsPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/VMVersionInfoPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/VMVersionInfoPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/VMVersionInfoPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/VMVersionInfoPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/FindAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/FindAction.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/FindAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/FindAction.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/FindClassesAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/FindClassesAction.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/FindClassesAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/FindClassesAction.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/FindCrashesAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/FindCrashesAction.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/FindCrashesAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/FindCrashesAction.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/HSDBActionManager.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/HSDBActionManager.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/HSDBActionManager.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/HSDBActionManager.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/InspectAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/InspectAction.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/InspectAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/InspectAction.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/JavaStackTraceAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/JavaStackTraceAction.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/JavaStackTraceAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/JavaStackTraceAction.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/MemoryAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/MemoryAction.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/MemoryAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/MemoryAction.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/ShowAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/ShowAction.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/ShowAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/ShowAction.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/ThreadInfoAction.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/ThreadInfoAction.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/action/ThreadInfoAction.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/action/ThreadInfoAction.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/ClassBrowserPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/classbrowser/ClassBrowserPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/ClassBrowserPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/classbrowser/ClassBrowserPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/CodeViewerPanel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/classbrowser/CodeViewerPanel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/CodeViewerPanel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/classbrowser/CodeViewerPanel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/resources/arrow.png b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/resources/arrow.png similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/resources/arrow.png rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/resources/arrow.png diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/resources/breakpoint.png b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/resources/breakpoint.png similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/resources/breakpoint.png rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/resources/breakpoint.png diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/resources/triangle.png b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/resources/triangle.png similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/resources/triangle.png rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/resources/triangle.png diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/table/LongCellRenderer.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/table/LongCellRenderer.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/table/LongCellRenderer.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/table/LongCellRenderer.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/table/SortHeaderCellRenderer.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/table/SortHeaderCellRenderer.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/table/SortHeaderCellRenderer.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/table/SortHeaderCellRenderer.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/table/SortHeaderMouseAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/table/SortHeaderMouseAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/table/SortHeaderMouseAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/table/SortHeaderMouseAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/table/SortableTableModel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/table/SortableTableModel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/table/SortableTableModel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/table/SortableTableModel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/table/TableModelComparator.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/table/TableModelComparator.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/table/TableModelComparator.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/table/TableModelComparator.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/BadAddressTreeNodeAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/BadAddressTreeNodeAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/BadAddressTreeNodeAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/BadAddressTreeNodeAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/BooleanTreeNodeAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/BooleanTreeNodeAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/BooleanTreeNodeAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/BooleanTreeNodeAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/CStringTreeNodeAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/CStringTreeNodeAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/CStringTreeNodeAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/CStringTreeNodeAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/CTypeTreeNodeAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/CTypeTreeNodeAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/CTypeTreeNodeAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/CTypeTreeNodeAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/CharTreeNodeAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/CharTreeNodeAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/CharTreeNodeAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/CharTreeNodeAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/DoubleTreeNodeAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/DoubleTreeNodeAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/DoubleTreeNodeAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/DoubleTreeNodeAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/FieldTreeNodeAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/FieldTreeNodeAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/FieldTreeNodeAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/FieldTreeNodeAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/FloatTreeNodeAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/FloatTreeNodeAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/FloatTreeNodeAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/FloatTreeNodeAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/LongTreeNodeAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/LongTreeNodeAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/LongTreeNodeAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/LongTreeNodeAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/MetadataTreeNodeAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/MetadataTreeNodeAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/MetadataTreeNodeAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/MetadataTreeNodeAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/OopTreeNodeAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/OopTreeNodeAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/OopTreeNodeAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/OopTreeNodeAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/RevPtrsTreeNodeAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/RevPtrsTreeNodeAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/RevPtrsTreeNodeAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/RevPtrsTreeNodeAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/RootTreeNodeAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/RootTreeNodeAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/RootTreeNodeAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/RootTreeNodeAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeGroupNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeGroupNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeGroupNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeGroupNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeModel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeModel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeModel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeModel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/tree/SimpleTreeNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/AbstractTreeTableModel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/treetable/AbstractTreeTableModel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/AbstractTreeTableModel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/treetable/AbstractTreeTableModel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/JTreeTable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/treetable/JTreeTable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/JTreeTable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/treetable/JTreeTable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/SimpleTreeTableModel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/treetable/SimpleTreeTableModel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/SimpleTreeTableModel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/treetable/SimpleTreeTableModel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/TreeTableModel.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/treetable/TreeTableModel.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/TreeTableModel.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/treetable/TreeTableModel.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/TreeTableModelAdapter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/treetable/TreeTableModelAdapter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/treetable/TreeTableModelAdapter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/ui/treetable/TreeTableModelAdapter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AddressOps.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AddressOps.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AddressOps.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AddressOps.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AltPlatformInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AltPlatformInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AltPlatformInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AltPlatformInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/Assert.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/Assert.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/Assert.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/Assert.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AssertionFailure.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AssertionFailure.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/AssertionFailure.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AssertionFailure.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/BasicHashtable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/BasicHashtable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtableEntry.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/BasicHashtableEntry.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtableEntry.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/BasicHashtableEntry.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BitMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/BitMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BitMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/BitMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BitMapClosure.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/BitMapClosure.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BitMapClosure.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/BitMapClosure.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/Bits.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/Bits.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/Bits.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/Bits.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/CPPExpressions.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/CPPExpressions.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/CPPExpressions.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/CPPExpressions.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/CStringUtilities.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/CStringUtilities.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/CStringUtilities.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/CStringUtilities.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/CompactHashTable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/CompactHashTable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/CompactHashTable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/CompactHashTable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ConstIterator.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ConstIterator.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ConstIterator.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ConstIterator.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/FindObjectByType.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/FindObjectByType.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/FindObjectByType.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/FindObjectByType.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/GenericArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/GenericArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/GenericArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/GenericArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/GenericGrowableArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/GenericGrowableArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/GenericGrowableArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/GenericGrowableArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/GrowableArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/GrowableArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/GrowableArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/GrowableArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/Hashtable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/Hashtable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/Hashtable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/Hashtable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableBucket.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HashtableBucket.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableBucket.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HashtableBucket.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableEntry.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HashtableEntry.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableEntry.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HashtableEntry.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapGXLWriter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapGraphWriter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapGraphWriter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapGraphWriter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapGraphWriter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapProgressThunk.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapProgressThunk.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HeapProgressThunk.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapProgressThunk.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/IntArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/IntArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/IntArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/IntArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/IntegerEnum.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/IntegerEnum.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/IntegerEnum.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/IntegerEnum.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/Interval.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/Interval.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/Interval.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/Interval.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/IntervalNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/IntervalNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/IntervalNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/IntervalNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/IntervalTree.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/IntervalTree.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/IntervalTree.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/IntervalTree.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/KlassArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/KlassArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/KlassArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/KlassArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/LivenessAnalysis.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/LivenessAnalysis.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/LivenessAnalysis.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/LivenessAnalysis.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/LivenessPath.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/LivenessPath.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/LivenessPath.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/LivenessPath.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/LivenessPathElement.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/LivenessPathElement.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/LivenessPathElement.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/LivenessPathElement.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/LivenessPathList.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/LivenessPathList.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/LivenessPathList.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/LivenessPathList.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/MarkBits.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/MarkBits.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/MarkBits.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/MarkBits.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/MessageQueue.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/MessageQueue.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/MessageQueue.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/MessageQueue.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/MessageQueueBackend.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/MessageQueueBackend.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/MessageQueueBackend.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/MessageQueueBackend.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/MethodArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/MethodArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/MethodArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/MethodArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ObjectReader.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ObjectReader.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ObjectReader.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ObjectReader.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PointerFinder.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/PointerFinder.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PointerFinder.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/PointerFinder.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PointerLocation.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/PointerLocation.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PointerLocation.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/PointerLocation.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ProcImageClassLoader.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ProcImageClassLoader.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ProcImageClassLoader.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ProcImageClassLoader.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ProgressiveHeapVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ProgressiveHeapVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ProgressiveHeapVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ProgressiveHeapVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/RBColor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/RBColor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/RBColor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/RBColor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/RBNode.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/RBNode.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/RBNode.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/RBNode.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/RBTree.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/RBTree.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/RBTree.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/RBTree.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ReversePtrs.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ReversePtrs.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ReversePtrs.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ReversePtrs.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ReversePtrsAnalysis.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ReversePtrsAnalysis.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ReversePtrsAnalysis.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/ReversePtrsAnalysis.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/RobustOopDeterminator.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/RobustOopDeterminator.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/RobustOopDeterminator.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/RobustOopDeterminator.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/StreamMonitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/StreamMonitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/StreamMonitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/StreamMonitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/SystemDictionaryHelper.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/SystemDictionaryHelper.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/SystemDictionaryHelper.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/SystemDictionaryHelper.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/TwoOopHashtable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/TwoOopHashtable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/TwoOopHashtable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/TwoOopHashtable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/U1Array.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/U1Array.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/U1Array.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/U1Array.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/U2Array.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/U2Array.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/U2Array.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/U2Array.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/UnsupportedPlatformException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/UnsupportedPlatformException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/UnsupportedPlatformException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/UnsupportedPlatformException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/WorkerThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/WorkerThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/WorkerThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/WorkerThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedBoolean.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedBoolean.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedBoolean.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedBoolean.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedByte.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedByte.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedByte.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedByte.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedChar.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedChar.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedChar.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedChar.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedDouble.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedDouble.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedDouble.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedDouble.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedFloat.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedFloat.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedFloat.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedFloat.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedInt.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedInt.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedInt.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedInt.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedLong.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedLong.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedLong.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedLong.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedObject.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedObject.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedObject.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedObject.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedShort.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedShort.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedShort.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/memo/MemoizedShort.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/Callable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/Callable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/Callable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/Callable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/DefaultScriptObject.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/DefaultScriptObject.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/DefaultScriptObject.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/DefaultScriptObject.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/InvocableCallable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/InvocableCallable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/InvocableCallable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/InvocableCallable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaArrayKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaArrayKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaArrayKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaArrayKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaClass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaClass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaClass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaClass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFactory.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFactory.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFactory.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFactory.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFactoryImpl.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFactoryImpl.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFactoryImpl.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFactoryImpl.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaField.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaField.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaField.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaField.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFrame.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFrame.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFrame.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaFrame.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaHeap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaHeap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaHeap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaHeap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstance.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstance.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstance.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstance.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaInstanceKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaMethod.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaMethod.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaMethod.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaMethod.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObjArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObjArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObjArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObjArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObjArrayKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObjArrayKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObjArrayKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObjArrayKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObject.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObject.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObject.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaObject.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaScriptEngine.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaScriptEngine.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaScriptEngine.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaScriptEngine.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaString.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaString.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaString.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaString.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaThread.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaThread.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaThread.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaThread.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaTypeArray.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaTypeArray.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaTypeArray.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaTypeArray.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaTypeArrayKlass.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaTypeArrayKlass.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaTypeArrayKlass.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaTypeArrayKlass.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaVM.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaVM.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaVM.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSJavaVM.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSList.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSList.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSList.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSList.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSMap.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSMap.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSMap.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSMap.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSMetadata.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSMetadata.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/JSMetadata.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/JSMetadata.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/MapScriptObject.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/MapScriptObject.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/MapScriptObject.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/MapScriptObject.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/MethodCallable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/MethodCallable.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/MethodCallable.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/MethodCallable.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/ObjectVisitor.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/ObjectVisitor.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/ObjectVisitor.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/ObjectVisitor.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/SOQLEngine.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/SOQLEngine.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/SOQLEngine.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/SOQLEngine.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/SOQLException.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/SOQLException.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/SOQLException.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/SOQLException.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/SOQLQuery.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/SOQLQuery.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/SOQLQuery.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/SOQLQuery.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/ScriptObject.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/ScriptObject.java similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/ScriptObject.java rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/ScriptObject.java diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/sa.js similarity index 100% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js rename to hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/soql/sa.js diff --git a/hotspot/agent/src/share/native/sadis.c b/hotspot/src/jdk.hotspot.agent/share/native/libsaproc/sadis.c similarity index 100% rename from hotspot/agent/src/share/native/sadis.c rename to hotspot/src/jdk.hotspot.agent/share/native/libsaproc/sadis.c diff --git a/hotspot/agent/src/os/solaris/proc/libproc.h b/hotspot/src/jdk.hotspot.agent/solaris/native/libsaproc/libproc.h similarity index 100% rename from hotspot/agent/src/os/solaris/proc/libproc.h rename to hotspot/src/jdk.hotspot.agent/solaris/native/libsaproc/libproc.h diff --git a/hotspot/agent/src/os/solaris/proc/salibproc.h b/hotspot/src/jdk.hotspot.agent/solaris/native/libsaproc/salibproc.h similarity index 100% rename from hotspot/agent/src/os/solaris/proc/salibproc.h rename to hotspot/src/jdk.hotspot.agent/solaris/native/libsaproc/salibproc.h diff --git a/hotspot/agent/src/os/solaris/proc/saproc.cpp b/hotspot/src/jdk.hotspot.agent/solaris/native/libsaproc/saproc.cpp similarity index 100% rename from hotspot/agent/src/os/solaris/proc/saproc.cpp rename to hotspot/src/jdk.hotspot.agent/solaris/native/libsaproc/saproc.cpp diff --git a/hotspot/agent/src/os/solaris/proc/saproc_audit.cpp b/hotspot/src/jdk.hotspot.agent/solaris/native/libsaproc/saproc_audit.cpp similarity index 100% rename from hotspot/agent/src/os/solaris/proc/saproc_audit.cpp rename to hotspot/src/jdk.hotspot.agent/solaris/native/libsaproc/saproc_audit.cpp diff --git a/hotspot/agent/test/jdi/README.jjh b/hotspot/src/jdk.hotspot.agent/test/jdi/README.jjh similarity index 100% rename from hotspot/agent/test/jdi/README.jjh rename to hotspot/src/jdk.hotspot.agent/test/jdi/README.jjh diff --git a/hotspot/agent/test/jdi/SASanityChecker.java b/hotspot/src/jdk.hotspot.agent/test/jdi/SASanityChecker.java similarity index 100% rename from hotspot/agent/test/jdi/SASanityChecker.java rename to hotspot/src/jdk.hotspot.agent/test/jdi/SASanityChecker.java diff --git a/hotspot/agent/test/jdi/TEST.ROOT b/hotspot/src/jdk.hotspot.agent/test/jdi/TEST.ROOT similarity index 100% rename from hotspot/agent/test/jdi/TEST.ROOT rename to hotspot/src/jdk.hotspot.agent/test/jdi/TEST.ROOT diff --git a/hotspot/agent/test/jdi/TargetAdapter.java b/hotspot/src/jdk.hotspot.agent/test/jdi/TargetAdapter.java similarity index 100% rename from hotspot/agent/test/jdi/TargetAdapter.java rename to hotspot/src/jdk.hotspot.agent/test/jdi/TargetAdapter.java diff --git a/hotspot/agent/test/jdi/TargetListener.java b/hotspot/src/jdk.hotspot.agent/test/jdi/TargetListener.java similarity index 100% rename from hotspot/agent/test/jdi/TargetListener.java rename to hotspot/src/jdk.hotspot.agent/test/jdi/TargetListener.java diff --git a/hotspot/agent/test/jdi/TestScaffold.java b/hotspot/src/jdk.hotspot.agent/test/jdi/TestScaffold.java similarity index 100% rename from hotspot/agent/test/jdi/TestScaffold.java rename to hotspot/src/jdk.hotspot.agent/test/jdi/TestScaffold.java diff --git a/hotspot/agent/test/jdi/VMConnection.java b/hotspot/src/jdk.hotspot.agent/test/jdi/VMConnection.java similarity index 100% rename from hotspot/agent/test/jdi/VMConnection.java rename to hotspot/src/jdk.hotspot.agent/test/jdi/VMConnection.java diff --git a/hotspot/agent/test/jdi/jstack.sh b/hotspot/src/jdk.hotspot.agent/test/jdi/jstack.sh similarity index 100% rename from hotspot/agent/test/jdi/jstack.sh rename to hotspot/src/jdk.hotspot.agent/test/jdi/jstack.sh diff --git a/hotspot/agent/test/jdi/jstack64.sh b/hotspot/src/jdk.hotspot.agent/test/jdi/jstack64.sh similarity index 100% rename from hotspot/agent/test/jdi/jstack64.sh rename to hotspot/src/jdk.hotspot.agent/test/jdi/jstack64.sh diff --git a/hotspot/agent/test/jdi/multivm.java b/hotspot/src/jdk.hotspot.agent/test/jdi/multivm.java similarity index 100% rename from hotspot/agent/test/jdi/multivm.java rename to hotspot/src/jdk.hotspot.agent/test/jdi/multivm.java diff --git a/hotspot/agent/test/jdi/multivm.sh b/hotspot/src/jdk.hotspot.agent/test/jdi/multivm.sh similarity index 100% rename from hotspot/agent/test/jdi/multivm.sh rename to hotspot/src/jdk.hotspot.agent/test/jdi/multivm.sh diff --git a/hotspot/agent/test/jdi/runjdb.sh b/hotspot/src/jdk.hotspot.agent/test/jdi/runjdb.sh similarity index 100% rename from hotspot/agent/test/jdi/runjdb.sh rename to hotspot/src/jdk.hotspot.agent/test/jdi/runjdb.sh diff --git a/hotspot/agent/test/jdi/runjpda.sh b/hotspot/src/jdk.hotspot.agent/test/jdi/runjpda.sh similarity index 100% rename from hotspot/agent/test/jdi/runjpda.sh rename to hotspot/src/jdk.hotspot.agent/test/jdi/runjpda.sh diff --git a/hotspot/agent/test/jdi/runsa.sh b/hotspot/src/jdk.hotspot.agent/test/jdi/runsa.sh similarity index 100% rename from hotspot/agent/test/jdi/runsa.sh rename to hotspot/src/jdk.hotspot.agent/test/jdi/runsa.sh diff --git a/hotspot/agent/test/jdi/sagclient.java b/hotspot/src/jdk.hotspot.agent/test/jdi/sagclient.java similarity index 100% rename from hotspot/agent/test/jdi/sagclient.java rename to hotspot/src/jdk.hotspot.agent/test/jdi/sagclient.java diff --git a/hotspot/agent/test/jdi/sagdoit.java b/hotspot/src/jdk.hotspot.agent/test/jdi/sagdoit.java similarity index 100% rename from hotspot/agent/test/jdi/sagdoit.java rename to hotspot/src/jdk.hotspot.agent/test/jdi/sagdoit.java diff --git a/hotspot/agent/test/jdi/sagtarg.java b/hotspot/src/jdk.hotspot.agent/test/jdi/sagtarg.java similarity index 100% rename from hotspot/agent/test/jdi/sagtarg.java rename to hotspot/src/jdk.hotspot.agent/test/jdi/sagtarg.java diff --git a/hotspot/agent/test/jdi/sagtest.java b/hotspot/src/jdk.hotspot.agent/test/jdi/sagtest.java similarity index 100% rename from hotspot/agent/test/jdi/sagtest.java rename to hotspot/src/jdk.hotspot.agent/test/jdi/sagtest.java diff --git a/hotspot/agent/test/jdi/sasanity.sh b/hotspot/src/jdk.hotspot.agent/test/jdi/sasanity.sh similarity index 100% rename from hotspot/agent/test/jdi/sasanity.sh rename to hotspot/src/jdk.hotspot.agent/test/jdi/sasanity.sh diff --git a/hotspot/agent/test/jdi/serialvm.java b/hotspot/src/jdk.hotspot.agent/test/jdi/serialvm.java similarity index 100% rename from hotspot/agent/test/jdi/serialvm.java rename to hotspot/src/jdk.hotspot.agent/test/jdi/serialvm.java diff --git a/hotspot/agent/test/jdi/serialvm.sh b/hotspot/src/jdk.hotspot.agent/test/jdi/serialvm.sh similarity index 100% rename from hotspot/agent/test/jdi/serialvm.sh rename to hotspot/src/jdk.hotspot.agent/test/jdi/serialvm.sh diff --git a/hotspot/agent/test/libproc/LibprocClient.java b/hotspot/src/jdk.hotspot.agent/test/libproc/LibprocClient.java similarity index 100% rename from hotspot/agent/test/libproc/LibprocClient.java rename to hotspot/src/jdk.hotspot.agent/test/libproc/LibprocClient.java diff --git a/hotspot/agent/test/libproc/LibprocTest.java b/hotspot/src/jdk.hotspot.agent/test/libproc/LibprocTest.java similarity index 100% rename from hotspot/agent/test/libproc/LibprocTest.java rename to hotspot/src/jdk.hotspot.agent/test/libproc/LibprocTest.java diff --git a/hotspot/agent/test/libproc/Makefile b/hotspot/src/jdk.hotspot.agent/test/libproc/Makefile similarity index 100% rename from hotspot/agent/test/libproc/Makefile rename to hotspot/src/jdk.hotspot.agent/test/libproc/Makefile diff --git a/hotspot/agent/test/libproc/README b/hotspot/src/jdk.hotspot.agent/test/libproc/README similarity index 100% rename from hotspot/agent/test/libproc/README rename to hotspot/src/jdk.hotspot.agent/test/libproc/README diff --git a/hotspot/agent/test/libproc/libproctest.sh b/hotspot/src/jdk.hotspot.agent/test/libproc/libproctest.sh similarity index 100% rename from hotspot/agent/test/libproc/libproctest.sh rename to hotspot/src/jdk.hotspot.agent/test/libproc/libproctest.sh diff --git a/hotspot/agent/test/libproc/libproctest64.sh b/hotspot/src/jdk.hotspot.agent/test/libproc/libproctest64.sh similarity index 100% rename from hotspot/agent/test/libproc/libproctest64.sh rename to hotspot/src/jdk.hotspot.agent/test/libproc/libproctest64.sh diff --git a/hotspot/agent/src/os/win32/windbg/sawindbg.cpp b/hotspot/src/jdk.hotspot.agent/windows/native/libsaproc/sawindbg.cpp similarity index 100% rename from hotspot/agent/src/os/win32/windbg/sawindbg.cpp rename to hotspot/src/jdk.hotspot.agent/windows/native/libsaproc/sawindbg.cpp From f42b84bc7e27fe99d8e56b06d3bfb93f8242242a Mon Sep 17 00:00:00 2001 From: Harold Seigel Date: Wed, 23 Dec 2015 13:02:15 -0500 Subject: [PATCH 130/146] 8042660: vm/mlvm/anonloader/stress/byteMutation failed with: assert(index >=0 && index < _length) failed: symbol index overflow Detect zero length signatures and throw ClassFormatError before bad dereference occurs Reviewed-by: coleenp, lfoltan, acorn, gtriantafill --- .../share/vm/classfile/classFileParser.cpp | 16 ++- .../classFileParserBug/BadNameAndType.java | 57 ++++++++ .../classFileParserBug/emptyNameUtf8.jcod | 131 ++++++++++++++++++ .../classFileParserBug/emptySigUtf8.jcod | 131 ++++++++++++++++++ 4 files changed, 329 insertions(+), 6 deletions(-) create mode 100644 hotspot/test/runtime/classFileParserBug/BadNameAndType.java create mode 100644 hotspot/test/runtime/classFileParserBug/emptyNameUtf8.jcod create mode 100644 hotspot/test/runtime/classFileParserBug/emptySigUtf8.jcod diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp index cd4518cf201..08bc677ad0c 100644 --- a/hotspot/src/share/vm/classfile/classFileParser.cpp +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp @@ -567,6 +567,9 @@ void ClassFileParser::parse_constant_pool(const ClassFileStream* const stream, const int name_index = cp->name_ref_index_at(index); const Symbol* const name = cp->symbol_at(name_index); const Symbol* const sig = cp->symbol_at(sig_index); + guarantee_property(sig->utf8_length() != 0, + "Illegal zero length constant pool entry at %d in class %s", + sig_index, CHECK); if (sig->byte_at(0) == JVM_SIGNATURE_FUNC) { verify_legal_method_signature(name, sig, CHECK); } else { @@ -593,8 +596,9 @@ void ClassFileParser::parse_constant_pool(const ClassFileStream* const stream, verify_legal_field_name(name, CHECK); if (_need_verify && _major_version >= JAVA_7_VERSION) { // Signature is verified above, when iterating NameAndType_info. - // Need only to be sure it's the right type. - if (signature->byte_at(0) == JVM_SIGNATURE_FUNC) { + // Need only to be sure it's non-zero length and the right type. + if (signature->utf8_length() == 0 || + signature->byte_at(0) == JVM_SIGNATURE_FUNC) { throwIllegalSignature( "Field", name, signature, CHECK); } @@ -605,8 +609,9 @@ void ClassFileParser::parse_constant_pool(const ClassFileStream* const stream, verify_legal_method_name(name, CHECK); if (_need_verify && _major_version >= JAVA_7_VERSION) { // Signature is verified above, when iterating NameAndType_info. - // Need only to be sure it's the right type. - if (signature->byte_at(0) != JVM_SIGNATURE_FUNC) { + // Need only to be sure it's non-zero length and the right type. + if (signature->utf8_length() == 0 || + signature->byte_at(0) != JVM_SIGNATURE_FUNC) { throwIllegalSignature( "Method", name, signature, CHECK); } @@ -617,8 +622,7 @@ void ClassFileParser::parse_constant_pool(const ClassFileStream* const stream, // 4509014: If a class method name begins with '<', it must be "". assert(name != NULL, "method name in constant pool is null"); const unsigned int name_len = name->utf8_length(); - assert(name_len > 0, "bad method name"); // already verified as legal name - if (name->byte_at(0) == '<') { + if (name_len != 0 && name->byte_at(0) == '<') { if (name != vmSymbols::object_initializer_name()) { classfile_parse_error( "Bad method name at constant pool index %u in class file %s", diff --git a/hotspot/test/runtime/classFileParserBug/BadNameAndType.java b/hotspot/test/runtime/classFileParserBug/BadNameAndType.java new file mode 100644 index 00000000000..03efc1c7d38 --- /dev/null +++ b/hotspot/test/runtime/classFileParserBug/BadNameAndType.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* + * @test + * @bug 8042660 + * @summary Constant pool NameAndType entries must point to non-zero length Utf8 strings + * @compile emptySigUtf8.jcod + * @compile emptyNameUtf8.jcod + * @run main/othervm -Xverify:all BadNameAndType + */ + +// Test that a constant pool NameAndType descriptor_index and/or name_index +// that points to a zero length Utf8 string causes a ClassFormatError. +public class BadNameAndType { + public static void main(String args[]) throws Throwable { + + System.out.println("Regression test for bug 8042660"); + + // Test descriptor_index pointing to zero-length string. + try { + Class newClass = Class.forName("emptySigUtf8"); + throw new RuntimeException("Expected ClassFormatError exception not thrown"); + } catch (java.lang.ClassFormatError e) { + System.out.println("Test BadNameAndType passed test case emptySigUtf8"); + } + + // Test name_index pointing to zero-length string. + try { + Class newClass = Class.forName("emptyNameUtf8"); + throw new RuntimeException("Expected ClassFormatError exception not thrown"); + } catch (java.lang.ClassFormatError e) { + System.out.println("Test BadNameAndType passed test case emptyNameUtf8"); + } + } +} diff --git a/hotspot/test/runtime/classFileParserBug/emptyNameUtf8.jcod b/hotspot/test/runtime/classFileParserBug/emptyNameUtf8.jcod new file mode 100644 index 00000000000..9d5664f8657 --- /dev/null +++ b/hotspot/test/runtime/classFileParserBug/emptyNameUtf8.jcod @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// This class has an illegal NameAndType at constant pool #4. It's illegal because +// the Utf8 that it points to at #27 is a zero length string which is not a valid +// name. Loading this class should cause a ClassFormatError exception. +class emptyNameUtf8 { + 0xCAFEBABE; + 0; // minor version + 52; // version + [29] { // Constant Pool + ; // first element is empty + Method #6 #15; // #1 at 0x0A + Field #16 #17; // #2 at 0x0F + String #18; // #3 at 0x14 + NameAndType #27 #28; // #4 at 0x9F + class #21; // #5 at 0x1C + class #22; // #6 at 0x1F + Utf8 ""; // #7 at 0x22 + Utf8 "()V"; // #8 at 0x2B + Utf8 "Code"; // #9 at 0x2E + Utf8 "LineNumberTable"; // #10 at 0x35 + Utf8 "main"; // #11 at 0x47 + Utf8 "([Ljava/lang/String;)V"; // #12 at 0x4E + Utf8 "SourceFile"; // #13 at 0x67 + Utf8 "emptyNameUtf8.java"; // #14 at 0x74 + NameAndType #7 #8; // #15 at 0x81 + class #23; // #16 at 0x86 + NameAndType #24 #25; // #17 at 0x89 + Utf8 "Hello World"; // #18 at 0x8E + class #26; // #19 at 0x9C + Method #19 #4; // #20 at 0x17 + Utf8 "emptyNameUtf8"; // #21 at 0xA4 + Utf8 "java/lang/Object"; // #22 at 0xAC + Utf8 "java/lang/System"; // #23 at 0xBF + Utf8 "out"; // #24 at 0xD2 + Utf8 "Ljava/io/PrintStream;"; // #25 at 0xD8 + Utf8 "java/io/PrintStream"; // #26 at 0xF0 + Utf8 ""; // #27 at 0x0106 + Utf8 "()V"; // #28 at 0x0110 + } // Constant Pool + + 0x0021; // access + #5;// this_cpx + #6;// super_cpx + + [0] { // Interfaces + } // Interfaces + + [0] { // fields + } // fields + + [2] { // methods + { // Member at 0x0134 + 0x0001; // access + #7; // name_cpx + #8; // sig_cpx + [1] { // Attributes + Attr(#9, 29) { // Code at 0x013C + 1; // max_stack + 1; // max_locals + Bytes[5]{ + 0x2AB70001B1; + }; + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 6) { // LineNumberTable at 0x0153 + [1] { // LineNumberTable + 0 2; // at 0x015F + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member at 0x015F + 0x0009; // access + #11; // name_cpx + #12; // sig_cpx + [1] { // Attributes + Attr(#9, 37) { // Code at 0x0167 + 2; // max_stack + 1; // max_locals + Bytes[9]{ + 0xB200021203B60004; + 0xB1; + }; + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 10) { // LineNumberTable at 0x0182 + [2] { // LineNumberTable + 0 4; // at 0x018E + 8 5; // at 0x0192 + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [1] { // Attributes + Attr(#13, 2) { // SourceFile at 0x0194 + #14; + } // end SourceFile + } // Attributes +} // end class emptyNameUtf8 diff --git a/hotspot/test/runtime/classFileParserBug/emptySigUtf8.jcod b/hotspot/test/runtime/classFileParserBug/emptySigUtf8.jcod new file mode 100644 index 00000000000..cf5b040c6b7 --- /dev/null +++ b/hotspot/test/runtime/classFileParserBug/emptySigUtf8.jcod @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// This class has an illegal NameAndType at constant pool #4. It's illegal because +// the type that it points to at #28 is a zero length Utf8 string which is not a +// valid signature. Loading this class should cause a ClassFormatError exception. +class emptySigUtf8 { + 0xCAFEBABE; + 0; // minor version + 52; // version + [29] { // Constant Pool + ; // first element is empty + Method #6 #15; // #1 at 0x0A + Field #16 #17; // #2 at 0x0F + String #18; // #3 at 0x14 + NameAndType #27 #28; // #4 at 0x9F + class #21; // #5 at 0x1C + class #22; // #6 at 0x1F + Utf8 ""; // #7 at 0x22 + Utf8 "()V"; // #8 at 0x2B + Utf8 "Code"; // #9 at 0x2E + Utf8 "LineNumberTable"; // #10 at 0x35 + Utf8 "main"; // #11 at 0x47 + Utf8 "([Ljava/lang/String;)V"; // #12 at 0x4E + Utf8 "SourceFile"; // #13 at 0x67 + Utf8 "emptySigUtf8.java"; // #14 at 0x74 + NameAndType #7 #8; // #15 at 0x81 + class #23; // #16 at 0x86 + NameAndType #24 #25; // #17 at 0x89 + Utf8 "Hello World"; // #18 at 0x8E + class #26; // #19 at 0x9C + Method #19 #4; // #20 at 0x17 + Utf8 "emptySigUtf8"; // #21 at 0xA4 + Utf8 "java/lang/Object"; // #22 at 0xAC + Utf8 "java/lang/System"; // #23 at 0xBF + Utf8 "out"; // #24 at 0xD2 + Utf8 "Ljava/io/PrintStream;"; // #25 at 0xD8 + Utf8 "java/io/PrintStream"; // #26 at 0xF0 + Utf8 "hi"; // #27 at 0x0106 + Utf8 ""; // #28 at 0x0110 + } // Constant Pool + + 0x0021; // access + #5;// this_cpx + #6;// super_cpx + + [0] { // Interfaces + } // Interfaces + + [0] { // fields + } // fields + + [2] { // methods + { // Member at 0x0134 + 0x0001; // access + #7; // name_cpx + #8; // sig_cpx + [1] { // Attributes + Attr(#9, 29) { // Code at 0x013C + 1; // max_stack + 1; // max_locals + Bytes[5]{ + 0x2AB70001B1; + }; + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 6) { // LineNumberTable at 0x0153 + [1] { // LineNumberTable + 0 2; // at 0x015F + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member at 0x015F + 0x0009; // access + #11; // name_cpx + #12; // sig_cpx + [1] { // Attributes + Attr(#9, 37) { // Code at 0x0167 + 2; // max_stack + 1; // max_locals + Bytes[9]{ + 0xB200021203B60004; + 0xB1; + }; + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 10) { // LineNumberTable at 0x0182 + [2] { // LineNumberTable + 0 4; // at 0x018E + 8 5; // at 0x0192 + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [1] { // Attributes + Attr(#13, 2) { // SourceFile at 0x0194 + #14; + } // end SourceFile + } // Attributes +} // end class emptySigUtf8 From de7d9e821cc1a3e470d4cee59cf9444fd969f06a Mon Sep 17 00:00:00 2001 From: Max Ockner Date: Wed, 23 Dec 2015 15:05:38 -0500 Subject: [PATCH 131/146] 8144874: Reimplement TraceClassResolution with Unified Logging TraceClassResolution reimplemented with classresolve tag. Reviewed-by: coleenp, dholmes, iklam, rprotacio --- hotspot/src/share/vm/classfile/classFileParser.cpp | 6 +++--- .../src/share/vm/classfile/verificationType.cpp | 4 ++-- hotspot/src/share/vm/classfile/verifier.cpp | 8 ++++---- hotspot/src/share/vm/classfile/verifier.hpp | 2 +- hotspot/src/share/vm/logging/logTag.hpp | 1 + hotspot/src/share/vm/oops/constantPool.cpp | 6 +++--- hotspot/src/share/vm/prims/jni.cpp | 6 +++--- hotspot/src/share/vm/prims/jvm.cpp | 14 +++++++------- hotspot/src/share/vm/runtime/arguments.cpp | 2 ++ hotspot/src/share/vm/runtime/globals.hpp | 3 --- hotspot/src/share/vm/runtime/reflection.cpp | 8 ++++---- hotspot/test/runtime/verifier/TraceClassRes.java | 2 +- 12 files changed, 31 insertions(+), 31 deletions(-) diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp index cd4518cf201..011827dde7f 100644 --- a/hotspot/src/share/vm/classfile/classFileParser.cpp +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp @@ -5369,12 +5369,12 @@ void ClassFileParser::fill_instance_klass(InstanceKlass* ik, TRAPS) { } } - if (TraceClassResolution) { + if (log_is_enabled(Info, classresolve)) { ResourceMark rm; // print out the superclass. const char * from = ik->external_name(); if (ik->java_super() != NULL) { - tty->print("RESOLVE %s %s (super)\n", + log_info(classresolve)("%s %s (super)", from, ik->java_super()->external_name()); } @@ -5385,7 +5385,7 @@ void ClassFileParser::fill_instance_klass(InstanceKlass* ik, TRAPS) { for (int i = 0; i < length; i++) { const Klass* const k = local_interfaces->at(i); const char * to = k->external_name(); - tty->print("RESOLVE %s %s (interface)\n", from, to); + log_info(classresolve)("%s %s (interface)", from, to); } } } diff --git a/hotspot/src/share/vm/classfile/verificationType.cpp b/hotspot/src/share/vm/classfile/verificationType.cpp index 96f4970be08..2d26c47e2ba 100644 --- a/hotspot/src/share/vm/classfile/verificationType.cpp +++ b/hotspot/src/share/vm/classfile/verificationType.cpp @@ -61,7 +61,7 @@ bool VerificationType::is_reference_assignable_from( Klass* obj = SystemDictionary::resolve_or_fail( name(), Handle(THREAD, klass->class_loader()), Handle(THREAD, klass->protection_domain()), true, CHECK_false); - if (TraceClassResolution) { + if (log_is_enabled(Info, classresolve)) { Verifier::trace_class_resolution(obj, klass()); } @@ -80,7 +80,7 @@ bool VerificationType::is_reference_assignable_from( Klass* from_class = SystemDictionary::resolve_or_fail( from.name(), Handle(THREAD, klass->class_loader()), Handle(THREAD, klass->protection_domain()), true, CHECK_false); - if (TraceClassResolution) { + if (log_is_enabled(Info, classresolve)) { Verifier::trace_class_resolution(from_class, klass()); } return InstanceKlass::cast(from_class)->is_subclass_of(this_class()); diff --git a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp index 5db828ce66e..6a49093918a 100644 --- a/hotspot/src/share/vm/classfile/verifier.cpp +++ b/hotspot/src/share/vm/classfile/verifier.cpp @@ -106,9 +106,9 @@ void Verifier::trace_class_resolution(Klass* resolve_class, InstanceKlass* verif const char* resolve = resolve_class->external_name(); // print in a single call to reduce interleaving between threads if (source_file != NULL) { - tty->print("RESOLVE %s %s %s (verification)\n", verify, resolve, source_file); + log_info(classresolve)("%s %s %s (verification)", verify, resolve, source_file); } else { - tty->print("RESOLVE %s %s (verification)\n", verify, resolve); + log_info(classresolve)("%s %s (verification)", verify, resolve); } } @@ -206,7 +206,7 @@ bool Verifier::verify(instanceKlassHandle klass, Verifier::Mode mode, bool shoul ResourceMark rm(THREAD); instanceKlassHandle kls = SystemDictionary::resolve_or_fail(exception_name, true, CHECK_false); - if (TraceClassResolution) { + if (log_is_enabled(Info, classresolve)) { Verifier::trace_class_resolution(kls(), klass()); } @@ -1992,7 +1992,7 @@ Klass* ClassVerifier::load_class(Symbol* name, TRAPS) { name, Handle(THREAD, loader), Handle(THREAD, protection_domain), true, THREAD); - if (TraceClassResolution) { + if (log_is_enabled(Info, classresolve)) { instanceKlassHandle cur_class = current_class(); Verifier::trace_class_resolution(kls, cur_class()); } diff --git a/hotspot/src/share/vm/classfile/verifier.hpp b/hotspot/src/share/vm/classfile/verifier.hpp index 8580cddbe41..531ef93f21a 100644 --- a/hotspot/src/share/vm/classfile/verifier.hpp +++ b/hotspot/src/share/vm/classfile/verifier.hpp @@ -61,7 +61,7 @@ class Verifier : AllStatic { // Relax certain verifier checks to enable some broken 1.1 apps to run on 1.2. static bool relax_verify_for(oop class_loader); - // Print output for -XX:+TraceClassResolution + // Print output for classresolve static void trace_class_resolution(Klass* resolve_class, InstanceKlass* verify_class); private: diff --git a/hotspot/src/share/vm/logging/logTag.hpp b/hotspot/src/share/vm/logging/logTag.hpp index 02304afe98b..f723b3548d7 100644 --- a/hotspot/src/share/vm/logging/logTag.hpp +++ b/hotspot/src/share/vm/logging/logTag.hpp @@ -37,6 +37,7 @@ LOG_TAG(bot) \ LOG_TAG(census) \ LOG_TAG(classhisto) \ + LOG_TAG(classresolve) \ LOG_TAG(classinit) \ LOG_TAG(comp) \ LOG_TAG(compaction) \ diff --git a/hotspot/src/share/vm/oops/constantPool.cpp b/hotspot/src/share/vm/oops/constantPool.cpp index ceb76f571f4..26b5e3abe07 100644 --- a/hotspot/src/share/vm/oops/constantPool.cpp +++ b/hotspot/src/share/vm/oops/constantPool.cpp @@ -204,11 +204,11 @@ void ConstantPool::trace_class_resolution(const constantPoolHandle& this_cp, Kla if (k() != this_cp->pool_holder()) { // only print something if the classes are different if (source_file != NULL) { - tty->print("RESOLVE %s %s %s:%d\n", + log_info(classresolve)("%s %s %s:%d", this_cp->pool_holder()->external_name(), k->external_name(), source_file, line_number); } else { - tty->print("RESOLVE %s %s\n", + log_info(classresolve)("%s %s", this_cp->pool_holder()->external_name(), k->external_name()); } @@ -277,7 +277,7 @@ Klass* ConstantPool::klass_at_impl(const constantPoolHandle& this_cp, int which, ClassLoaderData* this_key = this_cp->pool_holder()->class_loader_data(); this_key->record_dependency(k(), CHECK_NULL); // Can throw OOM - if (TraceClassResolution && !k->is_array_klass()) { + if (log_is_enabled(Info, classresolve) && !k->is_array_klass()) { // skip resolving the constant pool so that this code gets // called the next time some bytecodes refer to this class. trace_class_resolution(this_cp, k); diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp index a0f5665d276..54d8248e718 100644 --- a/hotspot/src/share/vm/prims/jni.cpp +++ b/hotspot/src/share/vm/prims/jni.cpp @@ -345,7 +345,7 @@ JNI_ENTRY(jclass, jni_DefineClass(JNIEnv *env, const char *name, jobject loaderR &st, CHECK_NULL); - if (TraceClassResolution && k != NULL) { + if (log_is_enabled(Info, classresolve) && k != NULL) { trace_class_resolution(k); } @@ -415,7 +415,7 @@ JNI_ENTRY(jclass, jni_FindClass(JNIEnv *env, const char *name)) result = find_class_from_class_loader(env, sym, true, loader, protection_domain, true, thread); - if (TraceClassResolution && result != NULL) { + if (log_is_enabled(Info, classresolve) && result != NULL) { trace_class_resolution(java_lang_Class::as_Klass(JNIHandles::resolve_non_null(result))); } @@ -3277,7 +3277,7 @@ static jclass lookupOne(JNIEnv* env, const char* name, TRAPS) { TempNewSymbol sym = SymbolTable::new_symbol(name, CHECK_NULL); jclass result = find_class_from_class_loader(env, sym, true, loader, protection_domain, true, CHECK_NULL); - if (TraceClassResolution && result != NULL) { + if (log_is_enabled(Info, classresolve) && result != NULL) { trace_class_resolution(java_lang_Class::as_Klass(JNIHandles::resolve_non_null(result))); } return result; diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp index c867df135c1..afbb1daee44 100644 --- a/hotspot/src/share/vm/prims/jvm.cpp +++ b/hotspot/src/share/vm/prims/jvm.cpp @@ -206,9 +206,9 @@ static void trace_class_resolution_impl(Klass* to_class, TRAPS) { const char * to = to_class->external_name(); // print in a single call to reduce interleaving between threads if (source_file != NULL) { - tty->print("RESOLVE %s %s %s:%d (%s)\n", from, to, source_file, line_number, trace); + log_info(classresolve)("%s %s %s:%d (%s)", from, to, source_file, line_number, trace); } else { - tty->print("RESOLVE %s %s (%s)\n", from, to, trace); + log_info(classresolve)("%s %s (%s)", from, to, trace); } } } @@ -835,7 +835,7 @@ JVM_ENTRY(jclass, JVM_FindClassFromBootLoader(JNIEnv* env, return NULL; } - if (TraceClassResolution) { + if (log_is_enabled(Info, classresolve)) { trace_class_resolution(k); } return (jclass) JNIHandles::make_local(env, k->java_mirror()); @@ -872,7 +872,7 @@ JVM_ENTRY(jclass, JVM_FindClassFromCaller(JNIEnv* env, const char* name, jclass result = find_class_from_class_loader(env, h_name, init, h_loader, h_prot, false, THREAD); - if (TraceClassResolution && result != NULL) { + if (log_is_enabled(Info, classresolve) && result != NULL) { trace_class_resolution(java_lang_Class::as_Klass(JNIHandles::resolve_non_null(result))); } return result; @@ -902,7 +902,7 @@ JVM_ENTRY(jclass, JVM_FindClassFromClass(JNIEnv *env, const char *name, jclass result = find_class_from_class_loader(env, h_name, init, h_loader, h_prot, true, thread); - if (TraceClassResolution && result != NULL) { + if (log_is_enabled(Info, classresolve) && result != NULL) { // this function is generally only used for class loading during verification. ResourceMark rm; oop from_mirror = JNIHandles::resolve_non_null(from); @@ -912,7 +912,7 @@ JVM_ENTRY(jclass, JVM_FindClassFromClass(JNIEnv *env, const char *name, oop mirror = JNIHandles::resolve_non_null(result); Klass* to_class = java_lang_Class::as_Klass(mirror); const char * to = to_class->external_name(); - tty->print("RESOLVE %s %s (verification)\n", from_name, to); + log_info(classresolve)("%s %s (verification)", from_name, to); } return result; @@ -980,7 +980,7 @@ static jclass jvm_define_class_common(JNIEnv *env, const char *name, &st, CHECK_NULL); - if (TraceClassResolution && k != NULL) { + if (log_is_enabled(Info, classresolve) && k != NULL) { trace_class_resolution(k); } diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index 334f6eadb33..7fc37d0865c 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -400,6 +400,8 @@ static AliasedFlag const aliased_jvm_flags[] = { }; static AliasedFlag const aliased_jvm_logging_flags[] = { + { "-XX:+TraceClassResolution", "-Xlog:classresolve=info"}, + { "-XX:-TraceClassResolution", "-Xlog:classresolve=off"}, { "-XX:+TraceExceptions", "-Xlog:exceptions=info" }, { "-XX:-TraceExceptions", "-Xlog:exceptions=off" }, { "-XX:+TraceMonitorInflation", "-Xlog:monitorinflation=debug" }, diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index 25d94b07eb8..9a444cb7c1d 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -1496,9 +1496,6 @@ public: develop(bool, TraceClearedExceptions, false, \ "Print when an exception is forcibly cleared") \ \ - product(bool, TraceClassResolution, false, \ - "Trace all constant pool resolutions (for debugging)") \ - \ product(bool, TraceBiasedLocking, false, \ "Trace biased locking in JVM") \ \ diff --git a/hotspot/src/share/vm/runtime/reflection.cpp b/hotspot/src/share/vm/runtime/reflection.cpp index dcd90d7980c..5c12e122566 100644 --- a/hotspot/src/share/vm/runtime/reflection.cpp +++ b/hotspot/src/share/vm/runtime/reflection.cpp @@ -74,9 +74,9 @@ static void trace_class_resolution(const Klass* to_class) { const char * to = to_class->external_name(); // print in a single call to reduce interleaving between threads if (source_file != NULL) { - tty->print("RESOLVE %s %s %s:%d (reflection)\n", from, to, source_file, line_number); + log_info(classresolve)("%s %s %s:%d (reflection)", from, to, source_file, line_number); } else { - tty->print("RESOLVE %s %s (reflection)\n", from, to); + log_info(classresolve)("%s %s (reflection)", from, to); } } } @@ -599,7 +599,7 @@ static oop get_mirror_from_signature(methodHandle method, Handle(THREAD, protection_domain), true, CHECK_NULL); - if (TraceClassResolution) { + if (log_is_enabled(Info, classresolve)) { trace_class_resolution(k); } return k->java_mirror(); @@ -654,7 +654,7 @@ static Handle new_type(Symbol* signature, KlassHandle k, TRAPS) { Handle(THREAD, k->protection_domain()), true, CHECK_(Handle())); - if (TraceClassResolution) { + if (log_is_enabled(Info, classresolve)) { trace_class_resolution(result); } diff --git a/hotspot/test/runtime/verifier/TraceClassRes.java b/hotspot/test/runtime/verifier/TraceClassRes.java index 153a0908bfc..ef18a5cfe4e 100644 --- a/hotspot/test/runtime/verifier/TraceClassRes.java +++ b/hotspot/test/runtime/verifier/TraceClassRes.java @@ -38,7 +38,7 @@ public class TraceClassRes { "-XX:+TraceClassResolution", "-verify", "-Xshare:off", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("RESOLVE java.lang.ClassLoader java.lang.Throwable ClassLoader.java (verification)"); + output.shouldContain("[classresolve] java.lang.ClassLoader java.lang.Throwable ClassLoader.java (verification)"); output.shouldHaveExitValue(0); } } From 384ecfad72e7675637547748cfcee144a30f550d Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Wed, 23 Dec 2015 20:07:39 +0000 Subject: [PATCH 132/146] 8146011: sun/management/jmxremote/bootstrap/CustomLauncherTest crash at assert(stack_size) We were setting stack_overflow_limit before initialization completed which may change the stack base for some solaris systems with unlimited stack Reviewed-by: goetz, hseigel, gthornbr --- hotspot/src/share/vm/runtime/thread.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index 160f61226c1..94b363d774b 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -306,10 +306,6 @@ void Thread::clear_thread_current() { void Thread::record_stack_base_and_size() { set_stack_base(os::current_stack_base()); set_stack_size(os::current_stack_size()); - if (is_Java_thread()) { - ((JavaThread*) this)->set_stack_overflow_limit(); - ((JavaThread*) this)->set_reserved_stack_activation(stack_base()); - } // CR 7190089: on Solaris, primordial thread's stack is adjusted // in initialize_thread(). Without the adjustment, stack size is // incorrect if stack is set to unlimited (ulimit -s unlimited). @@ -318,6 +314,11 @@ void Thread::record_stack_base_and_size() { // set up any platform-specific state. os::initialize_thread(this); + // Set stack limits after thread is initialized. + if (is_Java_thread()) { + ((JavaThread*) this)->set_stack_overflow_limit(); + ((JavaThread*) this)->set_reserved_stack_activation(stack_base()); + } #if INCLUDE_NMT // record thread's native stack, stack grows downward MemTracker::record_thread_stack(stack_end(), stack_size()); From dbab9fe1f8c1cbe5264b6a0d98c7bb1834d83bb5 Mon Sep 17 00:00:00 2001 From: Rachel Protacio Date: Wed, 23 Dec 2015 17:12:04 -0500 Subject: [PATCH 133/146] 8145606: [TESTBUG] MonitorInflationTest.java should be rewritten to be more predictable Logging/MonitorInflationTest.java now forced an object inflation and looks for that object. It no longer tests for object deflation. Reviewed-by: gtriantafill, coleenp, iklam --- .../runtime/logging/MonitorInflationTest.java | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/hotspot/test/runtime/logging/MonitorInflationTest.java b/hotspot/test/runtime/logging/MonitorInflationTest.java index 07ff1c3b864..7399ea6dce9 100644 --- a/hotspot/test/runtime/logging/MonitorInflationTest.java +++ b/hotspot/test/runtime/logging/MonitorInflationTest.java @@ -26,7 +26,6 @@ * @bug 8133885 * @summary monitorinflation=debug should have logging from each of the statements in the code * @library /testlibrary - * @ignore 8145587 * @modules java.base/sun.misc * java.management * @build jdk.test.lib.OutputAnalyzer jdk.test.lib.ProcessTools @@ -40,7 +39,8 @@ public class MonitorInflationTest { static void analyzeOutputOn(ProcessBuilder pb) throws Exception { OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("Inflating object"); - output.shouldContain("Deflating object "); + output.shouldContain("type MonitorInflationTest$Waiter"); + output.shouldContain("I've been waiting."); output.shouldHaveExitValue(0); } @@ -52,19 +52,34 @@ public class MonitorInflationTest { public static void main(String[] args) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-Xlog:monitorinflation=debug", "-version"); + "-Xlog:monitorinflation=debug", InnerClass.class.getName()); analyzeOutputOn(pb); pb = ProcessTools.createJavaProcessBuilder( - "-XX:+TraceMonitorInflation", "-version"); + "-XX:+TraceMonitorInflation", InnerClass.class.getName()); analyzeOutputOn(pb); pb = ProcessTools.createJavaProcessBuilder( - "-Xlog:monitorinflation=off", "-version"); + "-Xlog:monitorinflation=off", InnerClass.class.getName()); analyzeOutputOff(pb); pb = ProcessTools.createJavaProcessBuilder( - "-XX:-TraceMonitorInflation", "-version"); + "-XX:-TraceMonitorInflation", InnerClass.class.getName()); analyzeOutputOff(pb); } + + public static class Waiter { + public static void foo() { + System.out.println("I've been waiting."); + } + } + public static class InnerClass { + public static void main(String[] args) throws Exception { + Waiter w = new Waiter(); + synchronized (w) { + w.wait(100); + w.foo(); + } + } + } } From 4d2c80f12e15f29d5cd4245a9f7b06f696dc122e Mon Sep 17 00:00:00 2001 From: Christian Tornqvist Date: Thu, 24 Dec 2015 07:35:18 -0800 Subject: [PATCH 134/146] 8146098: Visual Studio build fails after SA restructure Reviewed-by: goetz, hseigel, dsamersoff --- hotspot/make/windows/makefiles/projectcreator.make | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/make/windows/makefiles/projectcreator.make b/hotspot/make/windows/makefiles/projectcreator.make index e6a19e818d0..e48a07b14dc 100644 --- a/hotspot/make/windows/makefiles/projectcreator.make +++ b/hotspot/make/windows/makefiles/projectcreator.make @@ -104,6 +104,7 @@ ProjectCreatorIDEOptions=\ -define ALIGN_STACK_FRAMES \ -define VM_LITTLE_ENDIAN \ -prelink "" "Generating vm.def..." "cd $(HOTSPOTBUILDSPACE)\%f\%b set HOTSPOTMKSHOME=$(HOTSPOTMKSHOME) set JAVA_HOME=$(HOTSPOTJDKDIST) $(HOTSPOTMKSHOME)\sh $(HOTSPOTWORKSPACE)\make\windows\build_vm_def.sh $(LD_VER)" \ + -ignorePath src\jdk.hotspot.agent \ -ignoreFile jsig.c \ -ignoreFile jvmtiEnvRecommended.cpp \ -ignoreFile jvmtiEnvStub.cpp \ From 3767315e7505313e9be9943cd8e6b3e3ad91cc0a Mon Sep 17 00:00:00 2001 From: Hui Shi Date: Sun, 27 Dec 2015 05:15:14 -0800 Subject: [PATCH 135/146] 8144993: Elide redundant memory barrier after AllocationNode Elide memory barrier for AllocationNode when it doesn't escape in initializer and has an MemBarRelease node at exit of initializer method. Reviewed-by: aph, mdoerr, goetz, kvn, asiebenborn --- hotspot/src/share/vm/opto/callnode.cpp | 18 ++++++++++++++++++ hotspot/src/share/vm/opto/callnode.hpp | 9 +++++++++ hotspot/src/share/vm/opto/macro.cpp | 17 +++++++++++++---- hotspot/src/share/vm/opto/parse1.cpp | 8 ++++++++ 4 files changed, 48 insertions(+), 4 deletions(-) diff --git a/hotspot/src/share/vm/opto/callnode.cpp b/hotspot/src/share/vm/opto/callnode.cpp index 581b6d3bd67..ffdf6a2d29b 100644 --- a/hotspot/src/share/vm/opto/callnode.cpp +++ b/hotspot/src/share/vm/opto/callnode.cpp @@ -1333,6 +1333,7 @@ AllocateNode::AllocateNode(Compile* C, const TypeFunc *atype, init_flags(Flag_is_macro); _is_scalar_replaceable = false; _is_non_escaping = false; + _is_allocation_MemBar_redundant = false; Node *topnode = C->top(); init_req( TypeFunc::Control , ctrl ); @@ -1347,6 +1348,23 @@ AllocateNode::AllocateNode(Compile* C, const TypeFunc *atype, C->add_macro_node(this); } +void AllocateNode::compute_MemBar_redundancy(ciMethod* initializer) +{ + assert(initializer != NULL && + initializer->is_initializer() && + !initializer->is_static(), + "unexpected initializer method"); + BCEscapeAnalyzer* analyzer = initializer->get_bcea(); + if (analyzer == NULL) { + return; + } + + // Allocation node is first parameter in its initializer + if (analyzer->is_arg_stack(0) || analyzer->is_arg_local(0)) { + _is_allocation_MemBar_redundant = true; + } +} + //============================================================================= Node* AllocateArrayNode::Ideal(PhaseGVN *phase, bool can_reshape) { if (remove_dead_region(phase, can_reshape)) return this; diff --git a/hotspot/src/share/vm/opto/callnode.hpp b/hotspot/src/share/vm/opto/callnode.hpp index 40f939a1160..cbe9d90e773 100644 --- a/hotspot/src/share/vm/opto/callnode.hpp +++ b/hotspot/src/share/vm/opto/callnode.hpp @@ -858,6 +858,8 @@ public: // Result of Escape Analysis bool _is_scalar_replaceable; bool _is_non_escaping; + // True when MemBar for new is redundant with MemBar at initialzer exit + bool _is_allocation_MemBar_redundant; virtual uint size_of() const; // Size is bigger AllocateNode(Compile* C, const TypeFunc *atype, Node *ctrl, Node *mem, Node *abio, @@ -923,6 +925,13 @@ public: InitializeNode* init = NULL; return _is_non_escaping || (((init = initialization()) != NULL) && init->does_not_escape()); } + + // If object doesn't escape in <.init> method and there is memory barrier + // inserted at exit of its <.init>, memory barrier for new is not necessary. + // Inovke this method when MemBar at exit of initializer and post-dominate + // allocation node. + void compute_MemBar_redundancy(ciMethod* initializer); + bool is_allocation_MemBar_redundant() { return _is_allocation_MemBar_redundant; } }; //------------------------------AllocateArray--------------------------------- diff --git a/hotspot/src/share/vm/opto/macro.cpp b/hotspot/src/share/vm/opto/macro.cpp index 4551560a6e4..93c93b58206 100644 --- a/hotspot/src/share/vm/opto/macro.cpp +++ b/hotspot/src/share/vm/opto/macro.cpp @@ -1522,11 +1522,20 @@ void PhaseMacroExpand::expand_allocate_common( // If initialization is performed by an array copy, any required // MemBarStoreStore was already added. If the object does not - // escape no need for a MemBarStoreStore. Otherwise we need a - // MemBarStoreStore so that stores that initialize this object - // can't be reordered with a subsequent store that makes this - // object accessible by other threads. + // escape no need for a MemBarStoreStore. If the object does not + // escape in its initializer and memory barrier (MemBarStoreStore or + // stronger) is already added at exit of initializer, also no need + // for a MemBarStoreStore. Otherwise we need a MemBarStoreStore + // so that stores that initialize this object can't be reordered + // with a subsequent store that makes this object accessible by + // other threads. + // Other threads include java threads and JVM internal threads + // (for example concurrent GC threads). Current concurrent GC + // implementation: CMS and G1 will not scan newly created object, + // so it's safe to skip storestore barrier when allocation does + // not escape. if (!alloc->does_not_escape_thread() && + !alloc->is_allocation_MemBar_redundant() && (init == NULL || !init->is_complete_with_arraycopy())) { if (init == NULL || init->req() < InitializeNode::RawStores) { // No InitializeNode or no stores captured by zeroing diff --git a/hotspot/src/share/vm/opto/parse1.cpp b/hotspot/src/share/vm/opto/parse1.cpp index 77154c5da07..e051b5e1e5c 100644 --- a/hotspot/src/share/vm/opto/parse1.cpp +++ b/hotspot/src/share/vm/opto/parse1.cpp @@ -962,6 +962,14 @@ void Parse::do_exits() { PPC64_ONLY(wrote_volatile() ||) (AlwaysSafeConstructors && wrote_fields()))) { _exits.insert_mem_bar(Op_MemBarRelease, alloc_with_final()); + + // If Memory barrier is created for final fields write + // and allocation node does not escape the initialize method, + // then barrier introduced by allocation node can be removed. + if (DoEscapeAnalysis && alloc_with_final()) { + AllocateNode *alloc = AllocateNode::Ideal_allocation(alloc_with_final(), &_gvn); + alloc->compute_MemBar_redundancy(method()); + } if (PrintOpto && (Verbose || WizardMode)) { method()->print_name(); tty->print_cr(" writes finals and needs a memory barrier"); From 1b5adfa94972145cfed63141e65605d1dca8a1be Mon Sep 17 00:00:00 2001 From: Kim Barrett Date: Mon, 28 Dec 2015 13:48:43 -0500 Subject: [PATCH 136/146] 8071507: (ref) Clear phantom reference as soft and weak references do GC clears phantom refs on notification; update spec accordingly. Reviewed-by: mchung, jmasa --- hotspot/src/share/vm/gc/shared/referenceProcessor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp b/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp index 1b71b4d3d29..58e73f237ed 100644 --- a/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp +++ b/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp @@ -235,7 +235,7 @@ ReferenceProcessorStats ReferenceProcessor::process_discovered_references( // Final references { - GCTraceTime(Debug, gc, ref) tt("FinalReference", gc_timer); + GCTraceTime(Debug, gc, ref) tt("FinalReference", gc_timer); process_discovered_reflist(_discoveredFinalRefs, NULL, false, is_alive, keep_alive, complete_gc, task_executor); } @@ -243,7 +243,7 @@ ReferenceProcessorStats ReferenceProcessor::process_discovered_references( // Phantom references { GCTraceTime(Debug, gc, ref) tt("PhantomReference", gc_timer); - process_discovered_reflist(_discoveredPhantomRefs, NULL, false, + process_discovered_reflist(_discoveredPhantomRefs, NULL, true, is_alive, keep_alive, complete_gc, task_executor); // Process cleaners, but include them in phantom timing. We expect From 4e6b2ee594f59a385eabe738c5525ad009ee3a3c Mon Sep 17 00:00:00 2001 From: Martin Doerr Date: Tue, 29 Dec 2015 11:54:21 +0100 Subject: [PATCH 137/146] 8145913: PPC64: add Montgomery multiply intrinsic Reviewed-by: aph, goetz --- hotspot/src/cpu/ppc/vm/assembler_ppc.hpp | 2 + .../src/cpu/ppc/vm/assembler_ppc.inline.hpp | 2 + hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp | 6 + hotspot/src/cpu/ppc/vm/ppc.ad | 14 +- hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp | 244 ++++++++++++++++++ hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp | 9 + .../vm/templateInterpreterGenerator_ppc.cpp | 8 +- hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp | 7 + 8 files changed, 281 insertions(+), 11 deletions(-) diff --git a/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp index 41cb7a16316..035bd4abf26 100644 --- a/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp @@ -1224,6 +1224,8 @@ class Assembler : public AbstractAssembler { inline void mullw_( Register d, Register a, Register b); inline void mulhw( Register d, Register a, Register b); inline void mulhw_( Register d, Register a, Register b); + inline void mulhwu( Register d, Register a, Register b); + inline void mulhwu_(Register d, Register a, Register b); inline void mulhd( Register d, Register a, Register b); inline void mulhd_( Register d, Register a, Register b); inline void mulhdu( Register d, Register a, Register b); diff --git a/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp b/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp index 2a4b03f760b..9248ae5cb6f 100644 --- a/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp +++ b/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp @@ -117,6 +117,8 @@ inline void Assembler::mullw( Register d, Register a, Register b) { emit_int32( inline void Assembler::mullw_( Register d, Register a, Register b) { emit_int32(MULLW_OPCODE | rt(d) | ra(a) | rb(b) | oe(0) | rc(1)); } inline void Assembler::mulhw( Register d, Register a, Register b) { emit_int32(MULHW_OPCODE | rt(d) | ra(a) | rb(b) | rc(0)); } inline void Assembler::mulhw_( Register d, Register a, Register b) { emit_int32(MULHW_OPCODE | rt(d) | ra(a) | rb(b) | rc(1)); } +inline void Assembler::mulhwu( Register d, Register a, Register b) { emit_int32(MULHWU_OPCODE | rt(d) | ra(a) | rb(b) | rc(0)); } +inline void Assembler::mulhwu_(Register d, Register a, Register b) { emit_int32(MULHWU_OPCODE | rt(d) | ra(a) | rb(b) | rc(1)); } inline void Assembler::mulhd( Register d, Register a, Register b) { emit_int32(MULHD_OPCODE | rt(d) | ra(a) | rb(b) | rc(0)); } inline void Assembler::mulhd_( Register d, Register a, Register b) { emit_int32(MULHD_OPCODE | rt(d) | ra(a) | rb(b) | rc(1)); } inline void Assembler::mulhdu( Register d, Register a, Register b) { emit_int32(MULHDU_OPCODE | rt(d) | ra(a) | rb(b) | rc(0)); } diff --git a/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp b/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp index 9bfe48dd887..a9fe522671c 100644 --- a/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/c2_init_ppc.cpp @@ -49,4 +49,10 @@ void Compile::pd_compiler2_init() { if (!VM_Version::has_isel() && FLAG_IS_DEFAULT(ConditionalMoveLimit)) { FLAG_SET_ERGO(intx, ConditionalMoveLimit, 0); } + + if (OptimizeFill) { + warning("OptimizeFill is not supported on this CPU."); + FLAG_SET_DEFAULT(OptimizeFill, false); + } + } diff --git a/hotspot/src/cpu/ppc/vm/ppc.ad b/hotspot/src/cpu/ppc/vm/ppc.ad index 682474c05a3..870f7425de6 100644 --- a/hotspot/src/cpu/ppc/vm/ppc.ad +++ b/hotspot/src/cpu/ppc/vm/ppc.ad @@ -10897,16 +10897,16 @@ instruct partialSubtypeCheck(iRegPdst result, iRegP_N2P subklass, iRegP_N2P supe // inlined locking and unlocking -instruct cmpFastLock(flagsReg crx, iRegPdst oop, iRegPdst box, iRegPdst tmp1, iRegPdst tmp2, iRegPdst tmp3) %{ +instruct cmpFastLock(flagsReg crx, iRegPdst oop, iRegPdst box, iRegPdst tmp1, iRegPdst tmp2) %{ match(Set crx (FastLock oop box)); - effect(TEMP tmp1, TEMP tmp2, TEMP tmp3); + effect(TEMP tmp1, TEMP tmp2); predicate(!Compile::current()->use_rtm()); - format %{ "FASTLOCK $oop, $box, $tmp1, $tmp2, $tmp3" %} + format %{ "FASTLOCK $oop, $box, $tmp1, $tmp2" %} ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_compound); __ compiler_fast_lock_object($crx$$CondRegister, $oop$$Register, $box$$Register, - $tmp3$$Register, $tmp1$$Register, $tmp2$$Register, + $tmp1$$Register, $tmp2$$Register, /*tmp3*/ R0, UseBiasedLocking && !UseOptoBiasInlining); // If locking was successfull, crx should indicate 'EQ'. // The compiler generates a branch to the runtime call to @@ -10925,7 +10925,7 @@ instruct cmpFastLock_tm(flagsReg crx, iRegPdst oop, rarg2RegP box, iRegPdst tmp1 ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_compound); __ compiler_fast_lock_object($crx$$CondRegister, $oop$$Register, $box$$Register, - $tmp3$$Register, $tmp1$$Register, $tmp2$$Register, + $tmp1$$Register, $tmp2$$Register, $tmp3$$Register, /*Biased Locking*/ false, _rtm_counters, _stack_rtm_counters, ((Method*)(ra_->C->method()->constant_encoding()))->method_data(), @@ -10946,7 +10946,7 @@ instruct cmpFastUnlock(flagsReg crx, iRegPdst oop, iRegPdst box, iRegPdst tmp1, ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_compound); __ compiler_fast_unlock_object($crx$$CondRegister, $oop$$Register, $box$$Register, - $tmp3$$Register, $tmp1$$Register, $tmp2$$Register, + $tmp1$$Register, $tmp2$$Register, $tmp3$$Register, UseBiasedLocking && !UseOptoBiasInlining, false); // If unlocking was successfull, crx should indicate 'EQ'. @@ -10965,7 +10965,7 @@ instruct cmpFastUnlock_tm(flagsReg crx, iRegPdst oop, iRegPdst box, iRegPdst tmp ins_encode %{ // TODO: PPC port $archOpcode(ppc64Opcode_compound); __ compiler_fast_unlock_object($crx$$CondRegister, $oop$$Register, $box$$Register, - $tmp3$$Register, $tmp1$$Register, $tmp2$$Register, + $tmp1$$Register, $tmp2$$Register, $tmp3$$Register, /*Biased Locking*/ false, /*TM*/ true); // If unlocking was successfull, crx should indicate 'EQ'. // The compiler generates a branch to the runtime call to diff --git a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp index ec9f568516e..60d6bfc6202 100644 --- a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp @@ -44,6 +44,8 @@ #include "opto/runtime.hpp" #endif +#include + #define __ masm-> #ifdef PRODUCT @@ -3251,3 +3253,245 @@ RuntimeStub* SharedRuntime::generate_resolve_blob(address destination, const cha return RuntimeStub::new_runtime_stub(name, &buffer, frame_complete, frame_size_in_bytes/wordSize, oop_maps, true); } + + +//------------------------------Montgomery multiplication------------------------ +// + +// Subtract 0:b from carry:a. Return carry. +static unsigned long +sub(unsigned long a[], unsigned long b[], unsigned long carry, long len) { + long i = 0; + unsigned long tmp, tmp2; + __asm__ __volatile__ ( + "subfc %[tmp], %[tmp], %[tmp] \n" // pre-set CA + "mtctr %[len] \n" + "0: \n" + "ldx %[tmp], %[i], %[a] \n" + "ldx %[tmp2], %[i], %[b] \n" + "subfe %[tmp], %[tmp2], %[tmp] \n" // subtract extended + "stdx %[tmp], %[i], %[a] \n" + "addi %[i], %[i], 8 \n" + "bdnz 0b \n" + "addme %[tmp], %[carry] \n" // carry + CA - 1 + : [i]"+b"(i), [tmp]"=&r"(tmp), [tmp2]"=&r"(tmp2) + : [a]"r"(a), [b]"r"(b), [carry]"r"(carry), [len]"r"(len) + : "ctr", "xer", "memory" + ); + return tmp; +} + +// Multiply (unsigned) Long A by Long B, accumulating the double- +// length result into the accumulator formed of T0, T1, and T2. +inline void MACC(unsigned long A, unsigned long B, unsigned long &T0, unsigned long &T1, unsigned long &T2) { + unsigned long hi, lo; + __asm__ __volatile__ ( + "mulld %[lo], %[A], %[B] \n" + "mulhdu %[hi], %[A], %[B] \n" + "addc %[T0], %[T0], %[lo] \n" + "adde %[T1], %[T1], %[hi] \n" + "addze %[T2], %[T2] \n" + : [hi]"=&r"(hi), [lo]"=&r"(lo), [T0]"+r"(T0), [T1]"+r"(T1), [T2]"+r"(T2) + : [A]"r"(A), [B]"r"(B) + : "xer" + ); +} + +// As above, but add twice the double-length result into the +// accumulator. +inline void MACC2(unsigned long A, unsigned long B, unsigned long &T0, unsigned long &T1, unsigned long &T2) { + unsigned long hi, lo; + __asm__ __volatile__ ( + "mulld %[lo], %[A], %[B] \n" + "mulhdu %[hi], %[A], %[B] \n" + "addc %[T0], %[T0], %[lo] \n" + "adde %[T1], %[T1], %[hi] \n" + "addze %[T2], %[T2] \n" + "addc %[T0], %[T0], %[lo] \n" + "adde %[T1], %[T1], %[hi] \n" + "addze %[T2], %[T2] \n" + : [hi]"=&r"(hi), [lo]"=&r"(lo), [T0]"+r"(T0), [T1]"+r"(T1), [T2]"+r"(T2) + : [A]"r"(A), [B]"r"(B) + : "xer" + ); +} + +// Fast Montgomery multiplication. The derivation of the algorithm is +// in "A Cryptographic Library for the Motorola DSP56000, +// Dusse and Kaliski, Proc. EUROCRYPT 90, pp. 230-237". +static void +montgomery_multiply(unsigned long a[], unsigned long b[], unsigned long n[], + unsigned long m[], unsigned long inv, int len) { + unsigned long t0 = 0, t1 = 0, t2 = 0; // Triple-precision accumulator + int i; + + assert(inv * n[0] == -1UL, "broken inverse in Montgomery multiply"); + + for (i = 0; i < len; i++) { + int j; + for (j = 0; j < i; j++) { + MACC(a[j], b[i-j], t0, t1, t2); + MACC(m[j], n[i-j], t0, t1, t2); + } + MACC(a[i], b[0], t0, t1, t2); + m[i] = t0 * inv; + MACC(m[i], n[0], t0, t1, t2); + + assert(t0 == 0, "broken Montgomery multiply"); + + t0 = t1; t1 = t2; t2 = 0; + } + + for (i = len; i < 2*len; i++) { + int j; + for (j = i-len+1; j < len; j++) { + MACC(a[j], b[i-j], t0, t1, t2); + MACC(m[j], n[i-j], t0, t1, t2); + } + m[i-len] = t0; + t0 = t1; t1 = t2; t2 = 0; + } + + while (t0) { + t0 = sub(m, n, t0, len); + } +} + +// Fast Montgomery squaring. This uses asymptotically 25% fewer +// multiplies so it should be up to 25% faster than Montgomery +// multiplication. However, its loop control is more complex and it +// may actually run slower on some machines. +static void +montgomery_square(unsigned long a[], unsigned long n[], + unsigned long m[], unsigned long inv, int len) { + unsigned long t0 = 0, t1 = 0, t2 = 0; // Triple-precision accumulator + int i; + + assert(inv * n[0] == -1UL, "broken inverse in Montgomery multiply"); + + for (i = 0; i < len; i++) { + int j; + int end = (i+1)/2; + for (j = 0; j < end; j++) { + MACC2(a[j], a[i-j], t0, t1, t2); + MACC(m[j], n[i-j], t0, t1, t2); + } + if ((i & 1) == 0) { + MACC(a[j], a[j], t0, t1, t2); + } + for (; j < i; j++) { + MACC(m[j], n[i-j], t0, t1, t2); + } + m[i] = t0 * inv; + MACC(m[i], n[0], t0, t1, t2); + + assert(t0 == 0, "broken Montgomery square"); + + t0 = t1; t1 = t2; t2 = 0; + } + + for (i = len; i < 2*len; i++) { + int start = i-len+1; + int end = start + (len - start)/2; + int j; + for (j = start; j < end; j++) { + MACC2(a[j], a[i-j], t0, t1, t2); + MACC(m[j], n[i-j], t0, t1, t2); + } + if ((i & 1) == 0) { + MACC(a[j], a[j], t0, t1, t2); + } + for (; j < len; j++) { + MACC(m[j], n[i-j], t0, t1, t2); + } + m[i-len] = t0; + t0 = t1; t1 = t2; t2 = 0; + } + + while (t0) { + t0 = sub(m, n, t0, len); + } +} + +// The threshold at which squaring is advantageous was determined +// experimentally on an i7-3930K (Ivy Bridge) CPU @ 3.5GHz. +// Doesn't seem to be relevant for Power8 so we use the same value. +#define MONTGOMERY_SQUARING_THRESHOLD 64 + +// Copy len longwords from s to d, word-swapping as we go. The +// destination array is reversed. +static void reverse_words(unsigned long *s, unsigned long *d, int len) { + d += len; + while(len-- > 0) { + d--; + unsigned long s_val = *s; + // Swap words in a longword on little endian machines. +#ifdef VM_LITTLE_ENDIAN + s_val = (s_val << 32) | (s_val >> 32); +#endif + *d = s_val; + s++; + } +} + +void SharedRuntime::montgomery_multiply(jint *a_ints, jint *b_ints, jint *n_ints, + jint len, jlong inv, + jint *m_ints) { + assert(len % 2 == 0, "array length in montgomery_multiply must be even"); + int longwords = len/2; + assert(longwords > 0, "unsupported"); + + // Make very sure we don't use so much space that the stack might + // overflow. 512 jints corresponds to an 16384-bit integer and + // will use here a total of 8k bytes of stack space. + int total_allocation = longwords * sizeof (unsigned long) * 4; + guarantee(total_allocation <= 8192, "must be"); + unsigned long *scratch = (unsigned long *)alloca(total_allocation); + + // Local scratch arrays + unsigned long + *a = scratch + 0 * longwords, + *b = scratch + 1 * longwords, + *n = scratch + 2 * longwords, + *m = scratch + 3 * longwords; + + reverse_words((unsigned long *)a_ints, a, longwords); + reverse_words((unsigned long *)b_ints, b, longwords); + reverse_words((unsigned long *)n_ints, n, longwords); + + ::montgomery_multiply(a, b, n, m, (unsigned long)inv, longwords); + + reverse_words(m, (unsigned long *)m_ints, longwords); +} + +void SharedRuntime::montgomery_square(jint *a_ints, jint *n_ints, + jint len, jlong inv, + jint *m_ints) { + assert(len % 2 == 0, "array length in montgomery_square must be even"); + int longwords = len/2; + assert(longwords > 0, "unsupported"); + + // Make very sure we don't use so much space that the stack might + // overflow. 512 jints corresponds to an 16384-bit integer and + // will use here a total of 6k bytes of stack space. + int total_allocation = longwords * sizeof (unsigned long) * 3; + guarantee(total_allocation <= 8192, "must be"); + unsigned long *scratch = (unsigned long *)alloca(total_allocation); + + // Local scratch arrays + unsigned long + *a = scratch + 0 * longwords, + *n = scratch + 1 * longwords, + *m = scratch + 2 * longwords; + + reverse_words((unsigned long *)a_ints, a, longwords); + reverse_words((unsigned long *)n_ints, n, longwords); + + if (len >= MONTGOMERY_SQUARING_THRESHOLD) { + ::montgomery_square(a, n, m, (unsigned long)inv, longwords); + } else { + ::montgomery_multiply(a, a, n, m, (unsigned long)inv, longwords); + } + + reverse_words(m, (unsigned long *)m_ints, longwords); +} diff --git a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp index 28f2ca60425..19dd372f083 100644 --- a/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/stubGenerator_ppc.cpp @@ -2681,6 +2681,15 @@ class StubGenerator: public StubCodeGenerator { StubRoutines::_multiplyToLen = generate_multiplyToLen(); } #endif + + if (UseMontgomeryMultiplyIntrinsic) { + StubRoutines::_montgomeryMultiply + = CAST_FROM_FN_PTR(address, SharedRuntime::montgomery_multiply); + } + if (UseMontgomerySquareIntrinsic) { + StubRoutines::_montgomerySquare + = CAST_FROM_FN_PTR(address, SharedRuntime::montgomery_square); + } } public: diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp index a6f09282c11..949c1b11b0c 100644 --- a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp @@ -263,7 +263,7 @@ void TemplateInterpreterGenerator::generate_counter_incr(Label* overflow, Label* __ cmpdi(CCR0, Rmdo, 0); __ beq(CCR0, no_mdo); - // Increment backedge counter in the MDO. + // Increment invocation counter in the MDO. const int mdo_ic_offs = in_bytes(MethodData::invocation_counter_offset()) + in_bytes(InvocationCounter::counter_offset()); __ lwz(Rscratch2, mdo_ic_offs, Rmdo); __ lwz(Rscratch1, in_bytes(MethodData::invoke_mask_offset()), Rmdo); @@ -275,13 +275,13 @@ void TemplateInterpreterGenerator::generate_counter_incr(Label* overflow, Label* } // Increment counter in MethodCounters*. - const int mo_bc_offs = in_bytes(MethodCounters::invocation_counter_offset()) + in_bytes(InvocationCounter::counter_offset()); + const int mo_ic_offs = in_bytes(MethodCounters::invocation_counter_offset()) + in_bytes(InvocationCounter::counter_offset()); __ bind(no_mdo); __ get_method_counters(R19_method, R3_counters, done); - __ lwz(Rscratch2, mo_bc_offs, R3_counters); + __ lwz(Rscratch2, mo_ic_offs, R3_counters); __ lwz(Rscratch1, in_bytes(MethodCounters::invoke_mask_offset()), R3_counters); __ addi(Rscratch2, Rscratch2, increment); - __ stw(Rscratch2, mo_bc_offs, R3_counters); + __ stw(Rscratch2, mo_ic_offs, R3_counters); __ and_(Rscratch1, Rscratch2, Rscratch1); __ beq(CCR0, *overflow); diff --git a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp index 3acbec86ad1..fec10b9268e 100644 --- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp @@ -225,12 +225,19 @@ void VM_Version::initialize() { if (FLAG_IS_DEFAULT(UseMultiplyToLenIntrinsic)) { UseMultiplyToLenIntrinsic = true; } + if (FLAG_IS_DEFAULT(UseMontgomeryMultiplyIntrinsic)) { + UseMontgomeryMultiplyIntrinsic = true; + } + if (FLAG_IS_DEFAULT(UseMontgomerySquareIntrinsic)) { + UseMontgomerySquareIntrinsic = true; + } if (UseVectorizedMismatchIntrinsic) { warning("UseVectorizedMismatchIntrinsic specified, but not available on this CPU."); FLAG_SET_DEFAULT(UseVectorizedMismatchIntrinsic, false); } + // Adjust RTM (Restricted Transactional Memory) flags. if (UseRTMLocking) { // If CPU or OS are too old: From ea1091ca761a7a9e39b0c12ad0e22a048c7a30d7 Mon Sep 17 00:00:00 2001 From: Ed Nevill Date: Tue, 29 Dec 2015 16:47:34 +0000 Subject: [PATCH 138/146] 8146286: aarch64: guarantee failures with large code cache sizes on jtreg test java/lang/invoke/LFCaching/LFMultiThreadCachingTest.java Patch trampoline calls with special case bl to itself which does not cause guarantee failure Reviewed-by: aph --- hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp | 2 +- hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp index 9510a3f3fed..703fed835c7 100644 --- a/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/macroAssembler_aarch64.cpp @@ -678,7 +678,7 @@ address MacroAssembler::trampoline_call(Address entry, CodeBuffer *cbuf) { if (cbuf) cbuf->set_insts_mark(); relocate(entry.rspec()); - if (Assembler::reachable_from_branch_at(pc(), entry.target())) { + if (!far_branches()) { bl(entry.target()); } else { bl(pc()); diff --git a/hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp index 42d2977b1b5..40b53127487 100644 --- a/hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/relocInfo_aarch64.cpp @@ -66,7 +66,13 @@ address Relocation::pd_call_destination(address orig_addr) { } } if (orig_addr != NULL) { - return MacroAssembler::pd_call_destination(orig_addr); + address new_addr = MacroAssembler::pd_call_destination(orig_addr); + // If call is branch to self, don't try to relocate it, just leave it + // as branch to self. This happens during code generation if the code + // buffer expands. It will be relocated to the trampoline above once + // code generation is complete. + new_addr = (new_addr == orig_addr) ? addr() : new_addr; + return new_addr; } return MacroAssembler::pd_call_destination(addr()); } From 803c430cee36c720d31c016a9407bac8c0dbe66e Mon Sep 17 00:00:00 2001 From: Marcus Larsson Date: Mon, 4 Jan 2016 11:27:02 +0100 Subject: [PATCH 139/146] 8065331: Add trace events for failed allocations Reviewed-by: brutisso, ehelin --- .../src/share/vm/gc/shared/allocTracer.cpp | 9 ++++++++ .../src/share/vm/gc/shared/allocTracer.hpp | 1 + hotspot/src/share/vm/gc/shared/gcId.cpp | 4 ++++ hotspot/src/share/vm/gc/shared/gcId.hpp | 2 ++ .../src/share/vm/gc/shared/vmGCOperations.cpp | 22 +++++++++++++++++++ .../src/share/vm/gc/shared/vmGCOperations.hpp | 8 ++----- hotspot/src/share/vm/trace/trace.xml | 6 +++++ 7 files changed, 46 insertions(+), 6 deletions(-) diff --git a/hotspot/src/share/vm/gc/shared/allocTracer.cpp b/hotspot/src/share/vm/gc/shared/allocTracer.cpp index 4c6c30d75fd..af427a8289f 100644 --- a/hotspot/src/share/vm/gc/shared/allocTracer.cpp +++ b/hotspot/src/share/vm/gc/shared/allocTracer.cpp @@ -46,3 +46,12 @@ void AllocTracer::send_allocation_in_new_tlab_event(KlassHandle klass, size_t tl event.commit(); } } + +void AllocTracer::send_allocation_requiring_gc_event(size_t size, uint gcId) { + EventAllocationRequiringGC event; + if (event.should_commit()) { + event.set_gcId(gcId); + event.set_size(size); + event.commit(); + } +} diff --git a/hotspot/src/share/vm/gc/shared/allocTracer.hpp b/hotspot/src/share/vm/gc/shared/allocTracer.hpp index aba0a1ed579..bd34c9bfd64 100644 --- a/hotspot/src/share/vm/gc/shared/allocTracer.hpp +++ b/hotspot/src/share/vm/gc/shared/allocTracer.hpp @@ -32,6 +32,7 @@ class AllocTracer : AllStatic { public: static void send_allocation_outside_tlab_event(KlassHandle klass, size_t alloc_size); static void send_allocation_in_new_tlab_event(KlassHandle klass, size_t tlab_size, size_t alloc_size); + static void send_allocation_requiring_gc_event(size_t size, uint gcId); }; #endif // SHARE_VM_GC_SHARED_ALLOCTRACER_HPP diff --git a/hotspot/src/share/vm/gc/shared/gcId.cpp b/hotspot/src/share/vm/gc/shared/gcId.cpp index f6ef9bce386..1fd75130b80 100644 --- a/hotspot/src/share/vm/gc/shared/gcId.cpp +++ b/hotspot/src/share/vm/gc/shared/gcId.cpp @@ -39,6 +39,10 @@ const uint GCId::create() { return _next_id++; } +const uint GCId::peek() { + return _next_id; +} + const uint GCId::current() { assert(currentNamedthread()->gc_id() != undefined(), "Using undefined GC id."); return current_raw(); diff --git a/hotspot/src/share/vm/gc/shared/gcId.hpp b/hotspot/src/share/vm/gc/shared/gcId.hpp index 8fc525a31de..f8ac5b3db89 100644 --- a/hotspot/src/share/vm/gc/shared/gcId.hpp +++ b/hotspot/src/share/vm/gc/shared/gcId.hpp @@ -39,6 +39,8 @@ class GCId : public AllStatic { static const uint current(); // Same as current() but can return undefined() if no GC id is currently active static const uint current_raw(); + // Returns the next expected GCId. + static const uint peek(); static const uint undefined() { return UNDEFINED; } static size_t print_prefix(char* buf, size_t len); }; diff --git a/hotspot/src/share/vm/gc/shared/vmGCOperations.cpp b/hotspot/src/share/vm/gc/shared/vmGCOperations.cpp index 7b022a7e23e..57ffc4eb40a 100644 --- a/hotspot/src/share/vm/gc/shared/vmGCOperations.cpp +++ b/hotspot/src/share/vm/gc/shared/vmGCOperations.cpp @@ -25,6 +25,8 @@ #include "precompiled.hpp" #include "classfile/classLoader.hpp" #include "classfile/javaClasses.hpp" +#include "gc/shared/allocTracer.hpp" +#include "gc/shared/gcId.hpp" #include "gc/shared/gcLocker.inline.hpp" #include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/vmGCOperations.hpp" @@ -188,6 +190,18 @@ void VM_GenCollectFull::doit() { gch->do_full_collection(gch->must_clear_all_soft_refs(), _max_generation); } +VM_CollectForMetadataAllocation::VM_CollectForMetadataAllocation(ClassLoaderData* loader_data, + size_t size, + Metaspace::MetadataType mdtype, + uint gc_count_before, + uint full_gc_count_before, + GCCause::Cause gc_cause) + : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true), + _loader_data(loader_data), _size(size), _mdtype(mdtype), _result(NULL) { + assert(_size != 0, "An allocation should always be requested with this operation."); + AllocTracer::send_allocation_requiring_gc_event(_size * HeapWordSize, GCId::peek()); +} + // Returns true iff concurrent GCs unloads metadata. bool VM_CollectForMetadataAllocation::initiate_concurrent_GC() { #if INCLUDE_ALL_GCS @@ -279,3 +293,11 @@ void VM_CollectForMetadataAllocation::doit() { set_gc_locked(); } } + +VM_CollectForAllocation::VM_CollectForAllocation(size_t word_size, uint gc_count_before, GCCause::Cause cause) + : VM_GC_Operation(gc_count_before, cause), _result(NULL), _word_size(word_size) { + // Only report if operation was really caused by an allocation. + if (_word_size != 0) { + AllocTracer::send_allocation_requiring_gc_event(_word_size * HeapWordSize, GCId::peek()); + } +} diff --git a/hotspot/src/share/vm/gc/shared/vmGCOperations.hpp b/hotspot/src/share/vm/gc/shared/vmGCOperations.hpp index 76c75c24e77..e43a3889bac 100644 --- a/hotspot/src/share/vm/gc/shared/vmGCOperations.hpp +++ b/hotspot/src/share/vm/gc/shared/vmGCOperations.hpp @@ -166,8 +166,7 @@ class VM_CollectForAllocation : public VM_GC_Operation { HeapWord* _result; // Allocation result (NULL if allocation failed) public: - VM_CollectForAllocation(size_t word_size, uint gc_count_before, GCCause::Cause cause) - : VM_GC_Operation(gc_count_before, cause), _result(NULL), _word_size(word_size) {} + VM_CollectForAllocation(size_t word_size, uint gc_count_before, GCCause::Cause cause); HeapWord* result() const { return _result; @@ -220,10 +219,7 @@ class VM_CollectForMetadataAllocation: public VM_GC_Operation { Metaspace::MetadataType mdtype, uint gc_count_before, uint full_gc_count_before, - GCCause::Cause gc_cause) - : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true), - _loader_data(loader_data), _size(size), _mdtype(mdtype), _result(NULL) { - } + GCCause::Cause gc_cause); virtual VMOp_Type type() const { return VMOp_CollectForMetadataAllocation; } virtual void doit(); diff --git a/hotspot/src/share/vm/trace/trace.xml b/hotspot/src/share/vm/trace/trace.xml index 798814b9ac8..fdaaaa78b9b 100644 --- a/hotspot/src/share/vm/trace/trace.xml +++ b/hotspot/src/share/vm/trace/trace.xml @@ -465,6 +465,12 @@ Declares a structure type that can be used in other events. + + + + + Date: Mon, 4 Jan 2016 11:37:18 +0100 Subject: [PATCH 140/146] 8145083: Use semaphore instead of mutex for synchronization of Unified Logging configuration Reviewed-by: dholmes, kbarrett, mgronlun --- hotspot/src/share/vm/logging/log.cpp | 1 - .../src/share/vm/logging/logConfiguration.cpp | 69 ++++++++++++------- .../share/vm/logging/logDiagnosticCommand.cpp | 4 -- hotspot/src/share/vm/logging/logOutput.cpp | 9 --- hotspot/src/share/vm/logging/logOutput.hpp | 17 +++-- hotspot/src/share/vm/prims/jvmtiEnv.cpp | 19 ++--- hotspot/src/share/vm/runtime/mutexLocker.cpp | 2 - hotspot/src/share/vm/runtime/mutexLocker.hpp | 1 - .../src/share/vm/services/memoryService.cpp | 1 - 9 files changed, 59 insertions(+), 64 deletions(-) diff --git a/hotspot/src/share/vm/logging/log.cpp b/hotspot/src/share/vm/logging/log.cpp index eda1877c88c..71ca3a3e22f 100644 --- a/hotspot/src/share/vm/logging/log.cpp +++ b/hotspot/src/share/vm/logging/log.cpp @@ -36,7 +36,6 @@ void Test_log_length() { remove("loglengthoutput.txt"); // Write long message to output file - MutexLocker ml(LogConfiguration_lock); LogConfiguration::parse_log_arguments("loglengthoutput.txt", "logging=trace", NULL, NULL, NULL); ResourceMark rm; diff --git a/hotspot/src/share/vm/logging/logConfiguration.cpp b/hotspot/src/share/vm/logging/logConfiguration.cpp index d109a50ae7b..53cd891f9b6 100644 --- a/hotspot/src/share/vm/logging/logConfiguration.cpp +++ b/hotspot/src/share/vm/logging/logConfiguration.cpp @@ -33,23 +33,50 @@ #include "logging/logTagSet.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" -#include "runtime/mutexLocker.hpp" #include "runtime/os.inline.hpp" +#include "runtime/semaphore.hpp" #include "utilities/globalDefinitions.hpp" LogOutput** LogConfiguration::_outputs = NULL; size_t LogConfiguration::_n_outputs = 0; bool LogConfiguration::_post_initialized = false; +// Stack object to take the lock for configuring the logging. +// Should only be held during the critical parts of the configuration +// (when calling configure_output or reading/modifying the outputs array). +// Thread must never block when holding this lock. +class ConfigurationLock : public StackObj { + private: + // Semaphore used as lock + static Semaphore _semaphore; + debug_only(static intx _locking_thread_id;) + public: + ConfigurationLock() { + _semaphore.wait(); + debug_only(_locking_thread_id = os::current_thread_id()); + } + ~ConfigurationLock() { + debug_only(_locking_thread_id = -1); + _semaphore.signal(); + } + debug_only(static bool current_thread_has_lock();) +}; + +Semaphore ConfigurationLock::_semaphore(1); +#ifdef ASSERT +intx ConfigurationLock::_locking_thread_id = -1; +bool ConfigurationLock::current_thread_has_lock() { + return _locking_thread_id == os::current_thread_id(); +} +#endif + void LogConfiguration::post_initialize() { - assert(LogConfiguration_lock != NULL, "Lock must be initialized before post-initialization"); LogDiagnosticCommand::registerCommand(); LogHandle(logging) log; log.info("Log configuration fully initialized."); log_develop_info(logging)("Develop logging is available."); if (log.is_trace()) { ResourceMark rm; - MutexLocker ml(LogConfiguration_lock); describe(log.trace_stream()); } @@ -129,6 +156,7 @@ void LogConfiguration::delete_output(size_t idx) { } void LogConfiguration::configure_output(size_t idx, const LogTagLevelExpression& tag_level_expression, const LogDecorators& decorators) { + assert(ConfigurationLock::current_thread_has_lock(), "Must hold configuration lock to call this function."); assert(idx < _n_outputs, "Invalid index, idx = " SIZE_FORMAT " and _n_outputs = " SIZE_FORMAT, idx, _n_outputs); LogOutput* output = _outputs[idx]; @@ -208,17 +236,13 @@ void LogConfiguration::disable_output(size_t idx) { } void LogConfiguration::disable_logging() { - assert(LogConfiguration_lock == NULL || LogConfiguration_lock->owned_by_self(), - "LogConfiguration lock must be held when calling this function"); + ConfigurationLock cl; for (size_t i = 0; i < _n_outputs; i++) { disable_output(i); } } void LogConfiguration::configure_stdout(LogLevelType level, bool exact_match, ...) { - assert(LogConfiguration_lock == NULL || LogConfiguration_lock->owned_by_self(), - "LogConfiguration lock must be held when calling this function"); - size_t i; va_list ap; LogTagLevelExpression expr; @@ -242,6 +266,7 @@ void LogConfiguration::configure_stdout(LogLevelType level, bool exact_match, .. expr.new_combination(); // Apply configuration to stdout (output #0), with the same decorators as before. + ConfigurationLock cl; configure_output(0, expr, LogOutput::Stdout->decorators()); } @@ -289,12 +314,21 @@ bool LogConfiguration::parse_log_arguments(const char* outputstr, const char* decoratorstr, const char* output_options, outputStream* errstream) { - assert(LogConfiguration_lock == NULL || LogConfiguration_lock->owned_by_self(), - "LogConfiguration lock must be held when calling this function"); if (outputstr == NULL || strlen(outputstr) == 0) { outputstr = "stdout"; } + LogTagLevelExpression expr; + if (!expr.parse(what, errstream)) { + return false; + } + + LogDecorators decorators; + if (!decorators.parse(decoratorstr, errstream)) { + return false; + } + + ConfigurationLock cl; size_t idx; if (outputstr[0] == '#') { int ret = sscanf(outputstr+1, SIZE_FORMAT, &idx); @@ -321,25 +355,11 @@ bool LogConfiguration::parse_log_arguments(const char* outputstr, errstream->print_cr("Output options for existing outputs are ignored."); } } - - LogTagLevelExpression expr; - if (!expr.parse(what, errstream)) { - return false; - } - - LogDecorators decorators; - if (!decorators.parse(decoratorstr, errstream)) { - return false; - } - configure_output(idx, expr, decorators); return true; } void LogConfiguration::describe(outputStream* out) { - assert(LogConfiguration_lock == NULL || LogConfiguration_lock->owned_by_self(), - "LogConfiguration lock must be held when calling this function"); - out->print("Available log levels:"); for (size_t i = 0; i < LogLevel::Count; i++) { out->print("%s %s", (i == 0 ? "" : ","), LogLevel::name(static_cast(i))); @@ -359,6 +379,7 @@ void LogConfiguration::describe(outputStream* out) { } out->cr(); + ConfigurationLock cl; out->print_cr("Log output configuration:"); for (size_t i = 0; i < _n_outputs; i++) { out->print("#" SIZE_FORMAT ": %s %s ", i, _outputs[i]->name(), _outputs[i]->config_string()); diff --git a/hotspot/src/share/vm/logging/logDiagnosticCommand.cpp b/hotspot/src/share/vm/logging/logDiagnosticCommand.cpp index fe27defa826..84c1b80afcc 100644 --- a/hotspot/src/share/vm/logging/logDiagnosticCommand.cpp +++ b/hotspot/src/share/vm/logging/logDiagnosticCommand.cpp @@ -25,7 +25,6 @@ #include "logging/logConfiguration.hpp" #include "logging/logDiagnosticCommand.hpp" #include "memory/resourceArea.hpp" -#include "runtime/mutexLocker.hpp" #include "utilities/globalDefinitions.hpp" LogDiagnosticCommand::LogDiagnosticCommand(outputStream* output, bool heap_allocated) @@ -65,13 +64,11 @@ void LogDiagnosticCommand::registerCommand() { void LogDiagnosticCommand::execute(DCmdSource source, TRAPS) { bool any_command = false; if (_disable.has_value()) { - MutexLocker ml(LogConfiguration_lock); LogConfiguration::disable_logging(); any_command = true; } if (_output.has_value() || _what.has_value() || _decorators.has_value()) { - MutexLocker ml(LogConfiguration_lock); if (!LogConfiguration::parse_log_arguments(_output.value(), _what.value(), _decorators.value(), @@ -83,7 +80,6 @@ void LogDiagnosticCommand::execute(DCmdSource source, TRAPS) { } if (_list.has_value()) { - MutexLocker ml(LogConfiguration_lock); LogConfiguration::describe(output()); any_command = true; } diff --git a/hotspot/src/share/vm/logging/logOutput.cpp b/hotspot/src/share/vm/logging/logOutput.cpp index 0b9a3bf0db9..ba0ce383fa8 100644 --- a/hotspot/src/share/vm/logging/logOutput.cpp +++ b/hotspot/src/share/vm/logging/logOutput.cpp @@ -37,9 +37,6 @@ LogOutput::~LogOutput() { } void LogOutput::clear_config_string() { - assert(LogConfiguration_lock == NULL || LogConfiguration_lock->owned_by_self(), - "Must hold configuration lock to modify config string"); - os::free(_config_string); _config_string_buffer_size = InitialConfigBufferSize; _config_string = NEW_C_HEAP_ARRAY(char, _config_string_buffer_size, mtLogging); @@ -47,18 +44,12 @@ void LogOutput::clear_config_string() { } void LogOutput::set_config_string(const char* string) { - assert(LogConfiguration_lock == NULL || LogConfiguration_lock->owned_by_self(), - "Must hold configuration lock to modify config string"); - os::free(_config_string); _config_string = os::strdup(string, mtLogging); _config_string_buffer_size = strlen(_config_string) + 1; } void LogOutput::add_to_config_string(const LogTagSet* ts, LogLevelType level) { - assert(LogConfiguration_lock == NULL || LogConfiguration_lock->owned_by_self(), - "Must hold configuration lock to modify config string"); - if (_config_string_buffer_size < InitialConfigBufferSize) { _config_string_buffer_size = InitialConfigBufferSize; _config_string = REALLOC_C_HEAP_ARRAY(char, _config_string, _config_string_buffer_size, mtLogging); diff --git a/hotspot/src/share/vm/logging/logOutput.hpp b/hotspot/src/share/vm/logging/logOutput.hpp index 3cecaddc903..3850a62f939 100644 --- a/hotspot/src/share/vm/logging/logOutput.hpp +++ b/hotspot/src/share/vm/logging/logOutput.hpp @@ -36,6 +36,9 @@ class LogTagSet; // Keeps track of the latest configuration string, // and its selected decorators. class LogOutput : public CHeapObj { + // Make LogConfiguration a friend to allow it to modify the configuration string. + friend class LogConfiguration; + private: static const size_t InitialConfigBufferSize = 256; char* _config_string; @@ -44,6 +47,13 @@ class LogOutput : public CHeapObj { protected: LogDecorators _decorators; + // Clears any previous config description in preparation of reconfiguration. + void clear_config_string(); + // Adds the tagset on the given level to the config description (e.g. "tag1+tag2=level"). + void add_to_config_string(const LogTagSet* ts, LogLevelType level); + // Replaces the current config description with the given string. + void set_config_string(const char* string); + public: static LogOutput* const Stdout; static LogOutput* const Stderr; @@ -65,13 +75,6 @@ class LogOutput : public CHeapObj { virtual ~LogOutput(); - // Clears any previous config description in preparation of reconfiguration. - void clear_config_string(); - // Adds the tagset on the given level to the config description (e.g. "tag1+tag2=level"). - void add_to_config_string(const LogTagSet* ts, LogLevelType level); - // Replaces the current config description with the given string. - void set_config_string(const char* string); - virtual const char* name() const = 0; virtual bool initialize(const char* options) = 0; virtual int write(const LogDecorations &decorations, const char* msg) = 0; diff --git a/hotspot/src/share/vm/prims/jvmtiEnv.cpp b/hotspot/src/share/vm/prims/jvmtiEnv.cpp index ab6d8258358..bc3dd3ccfc4 100644 --- a/hotspot/src/share/vm/prims/jvmtiEnv.cpp +++ b/hotspot/src/share/vm/prims/jvmtiEnv.cpp @@ -629,21 +629,10 @@ JvmtiEnv::SetVerboseFlag(jvmtiVerboseFlag flag, jboolean value) { TraceClassUnloading = value != 0; break; case JVMTI_VERBOSE_GC: - { - // This is a temporary solution to work around initialization issues. - // JDK-8145083 will fix this. - Mutex* conf_mutex = LogConfiguration_lock; - if (Threads::number_of_threads() == 0) { - // We're too early in the initialization to use mutexes - LogConfiguration_lock = NULL; - } - MutexLockerEx ml(LogConfiguration_lock); - if (value == 0) { - LogConfiguration::parse_log_arguments("stdout", "gc=off", NULL, NULL, NULL); - } else { - LogConfiguration::parse_log_arguments("stdout", "gc", NULL, NULL, NULL); - } - LogConfiguration_lock = conf_mutex; + if (value == 0) { + LogConfiguration::parse_log_arguments("stdout", "gc=off", NULL, NULL, NULL); + } else { + LogConfiguration::parse_log_arguments("stdout", "gc", NULL, NULL, NULL); } break; case JVMTI_VERBOSE_JNI: diff --git a/hotspot/src/share/vm/runtime/mutexLocker.cpp b/hotspot/src/share/vm/runtime/mutexLocker.cpp index 71557ddd910..ae1d213b6e5 100644 --- a/hotspot/src/share/vm/runtime/mutexLocker.cpp +++ b/hotspot/src/share/vm/runtime/mutexLocker.cpp @@ -127,7 +127,6 @@ Monitor* GCTaskManager_lock = NULL; Mutex* Management_lock = NULL; Monitor* Service_lock = NULL; Monitor* PeriodicTask_lock = NULL; -Mutex* LogConfiguration_lock = NULL; #ifdef INCLUDE_TRACE Mutex* JfrStacktrace_lock = NULL; @@ -284,7 +283,6 @@ void mutex_init() { if (WhiteBoxAPI) { def(Compilation_lock , Monitor, leaf, false, Monitor::_safepoint_check_never); } - def(LogConfiguration_lock , Mutex, nonleaf, false, Monitor::_safepoint_check_always); #ifdef INCLUDE_TRACE def(JfrMsg_lock , Monitor, leaf, true, Monitor::_safepoint_check_always); diff --git a/hotspot/src/share/vm/runtime/mutexLocker.hpp b/hotspot/src/share/vm/runtime/mutexLocker.hpp index 5f90aff1bb1..bbf6f143312 100644 --- a/hotspot/src/share/vm/runtime/mutexLocker.hpp +++ b/hotspot/src/share/vm/runtime/mutexLocker.hpp @@ -127,7 +127,6 @@ extern Mutex* MMUTracker_lock; // protects the MMU extern Mutex* Management_lock; // a lock used to serialize JVM management extern Monitor* Service_lock; // a lock used for service thread operation extern Monitor* PeriodicTask_lock; // protects the periodic task structure -extern Mutex* LogConfiguration_lock; // protects configuration of logging #ifdef INCLUDE_TRACE extern Mutex* JfrStacktrace_lock; // used to guard access to the JFR stacktrace table diff --git a/hotspot/src/share/vm/services/memoryService.cpp b/hotspot/src/share/vm/services/memoryService.cpp index ea2ae889563..11a4d569057 100644 --- a/hotspot/src/share/vm/services/memoryService.cpp +++ b/hotspot/src/share/vm/services/memoryService.cpp @@ -518,7 +518,6 @@ void MemoryService::oops_do(OopClosure* f) { bool MemoryService::set_verbose(bool verbose) { MutexLocker m(Management_lock); // verbose will be set to the previous value - MutexLocker ml(LogConfiguration_lock); if (verbose) { LogConfiguration::parse_log_arguments("stdout", "gc", NULL, NULL, NULL); } else { From 5e5def838e0d12b1c9453bcf689f9bf99e6d4bc4 Mon Sep 17 00:00:00 2001 From: Marcus Larsson Date: Mon, 4 Jan 2016 11:31:42 +0100 Subject: [PATCH 141/146] 8144220: UL does not support full path names for log files on windows Reviewed-by: sla, mgronlun --- .../src/share/vm/logging/logConfiguration.cpp | 75 +++++++----- .../src/share/vm/logging/logConfiguration.hpp | 2 +- .../logging/TestQuotedLogOutputs.java | 109 ++++++++++++++++++ 3 files changed, 158 insertions(+), 28 deletions(-) create mode 100644 hotspot/test/serviceability/logging/TestQuotedLogOutputs.java diff --git a/hotspot/src/share/vm/logging/logConfiguration.cpp b/hotspot/src/share/vm/logging/logConfiguration.cpp index 53cd891f9b6..dd0d0133ef5 100644 --- a/hotspot/src/share/vm/logging/logConfiguration.cpp +++ b/hotspot/src/share/vm/logging/logConfiguration.cpp @@ -110,7 +110,7 @@ size_t LogConfiguration::find_output(const char* name) { return SIZE_MAX; } -LogOutput* LogConfiguration::new_output(char* name, const char* options) { +LogOutput* LogConfiguration::new_output(char* name, const char* options, outputStream* errstream) { const char* type; char* equals_pos = strchr(name, '='); if (equals_pos == NULL) { @@ -121,16 +121,34 @@ LogOutput* LogConfiguration::new_output(char* name, const char* options) { name = equals_pos + 1; } + // Check if name is quoted, and if so, strip the quotes + char* quote = strchr(name, '"'); + if (quote != NULL) { + char* end_quote = strchr(name + 1, '"'); + if (end_quote == NULL) { + errstream->print_cr("Output name has opening quote but is missing a terminating quote."); + return NULL; + } else if (quote != name || end_quote[1] != '\0') { + errstream->print_cr("Output name can not be partially quoted." + " Either surround the whole name with quotation marks," + " or do not use quotation marks at all."); + return NULL; + } + name++; + *end_quote = '\0'; + } + LogOutput* output; if (strcmp(type, "file") == 0) { output = new LogFileOutput(name); } else { - // unsupported log output type + errstream->print_cr("Unsupported log output type."); return NULL; } bool success = output->initialize(options); if (!success) { + errstream->print_cr("Initialization of output '%s' using options '%s' failed.", name, options); delete output; return NULL; } @@ -274,32 +292,40 @@ bool LogConfiguration::parse_command_line_arguments(const char* opts) { char* copy = os::strdup_check_oom(opts, mtLogging); // Split the option string to its colon separated components. - char* what = NULL; - char* output_str = NULL; - char* decorators_str = NULL; - char* output_options = NULL; + char* str = copy; + char* substrings[4] = {0}; + for (int i = 0 ; i < 4; i++) { + substrings[i] = str; - what = copy; - char* colon = strchr(what, ':'); - if (colon != NULL) { - *colon = '\0'; - output_str = colon + 1; - colon = strchr(output_str, ':'); - if (colon != NULL) { - *colon = '\0'; - decorators_str = colon + 1; - colon = strchr(decorators_str, ':'); - if (colon != NULL) { - *colon = '\0'; - output_options = colon + 1; + // Find the next colon or quote + char* next = strpbrk(str, ":\""); + while (next != NULL && *next == '"') { + char* end_quote = strchr(next + 1, '"'); + if (end_quote == NULL) { + log_error(logging)("Missing terminating quote in -Xlog option '%s'", str); + os::free(copy); + return false; } + // Keep searching after the quoted substring + next = strpbrk(end_quote + 1, ":\""); + } + + if (next != NULL) { + *next = '\0'; + str = next + 1; + } else { + break; } } - // Parse each argument + // Parse and apply the separated configuration options + char* what = substrings[0]; + char* output = substrings[1]; + char* decorators = substrings[2]; + char* output_options = substrings[3]; char errbuf[512]; stringStream ss(errbuf, sizeof(errbuf)); - bool success = parse_log_arguments(output_str, what, decorators_str, output_options, &ss); + bool success = parse_log_arguments(output, what, decorators, output_options, &ss); if (!success) { errbuf[strlen(errbuf) - 1] = '\0'; // Strip trailing newline. log_error(logging)("%s", errbuf); @@ -340,14 +366,9 @@ bool LogConfiguration::parse_log_arguments(const char* outputstr, idx = find_output(outputstr); if (idx == SIZE_MAX) { char* tmp = os::strdup_check_oom(outputstr, mtLogging); - LogOutput* output = new_output(tmp, output_options); + LogOutput* output = new_output(tmp, output_options, errstream); os::free(tmp); if (output == NULL) { - errstream->print("Unable to add output '%s'", outputstr); - if (output_options != NULL && strlen(output_options) > 0) { - errstream->print(" with options '%s'", output_options); - } - errstream->cr(); return false; } idx = add_output(output); diff --git a/hotspot/src/share/vm/logging/logConfiguration.hpp b/hotspot/src/share/vm/logging/logConfiguration.hpp index 1462d6530dc..0acd1faf8bb 100644 --- a/hotspot/src/share/vm/logging/logConfiguration.hpp +++ b/hotspot/src/share/vm/logging/logConfiguration.hpp @@ -43,7 +43,7 @@ class LogConfiguration : public AllStatic { static bool _post_initialized; // Create a new output. Returns NULL if failed. - static LogOutput* new_output(char* name, const char* options = NULL); + static LogOutput* new_output(char* name, const char* options, outputStream* errstream); // Add an output to the list of configured outputs. Returns the assigned index. static size_t add_output(LogOutput* out); diff --git a/hotspot/test/serviceability/logging/TestQuotedLogOutputs.java b/hotspot/test/serviceability/logging/TestQuotedLogOutputs.java new file mode 100644 index 00000000000..be2e76d9c51 --- /dev/null +++ b/hotspot/test/serviceability/logging/TestQuotedLogOutputs.java @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test TestQuotedLogOutputs + * @summary Ensure proper parsing of quoted output names for -Xlog arguments. + * @library /testlibrary + */ + +import java.io.File; +import java.nio.file.Path; +import java.nio.file.Paths; + +import jdk.test.lib.Asserts; +import jdk.test.lib.ProcessTools; +import jdk.test.lib.OutputAnalyzer; + +public class TestQuotedLogOutputs { + + public static void main(String[] args) throws Exception { + // Ensure log files can be specified with full path. + // On windows, this means that the file name will contain + // a colon ('C:\log.txt' for example), which is used to + // separate -Xlog: options (-Xlog:tags:filename:decorators). + // Try to log to a file in our current directory, using its absolute path. + String baseName = "test file.log"; + Path filePath = Paths.get(baseName).toAbsolutePath(); + String fileName = filePath.toString(); + File file = filePath.toFile(); + + // In case the file already exists, attempt to delete it before running the test + file.delete(); + + // Depending on if we're on Windows or not the quotation marks must be escaped, + // otherwise they will be stripped from the command line arguments. + String quote; + if (System.getProperty("os.name").toLowerCase().contains("windows")) { + quote = "\\\""; // quote should be \" (escaped quote) + } else { + quote = "\""; // quote should be " (no escape needed) + } + + // Test a few variations with valid log output specifiers + String[] validOutputs = new String[] { + quote + fileName + quote, + "file=" + quote + fileName + quote, + quote + fileName + quote + ":", + quote + fileName + quote + "::" + }; + for (String logOutput : validOutputs) { + // Run with logging=trace on stdout so that we can verify the log configuration afterwards. + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:logging=trace", + "-Xlog:all=trace:" + logOutput, + "-version"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldHaveExitValue(0); + Asserts.assertTrue(file.exists()); + file.deleteOnExit(); // Clean up after test + output.shouldMatch("\\[logging *\\].*" + baseName); // Expect to see the log output listed + } + + // Test a bunch of invalid output specifications and ensure the VM fails with these + String[] invalidOutputs = new String[] { + quote, + quote + quote, // should fail because the VM will try to create a file without a name + quote + quote + quote, + quote + quote + quote + quote, + quote + quote + quote + quote + quote, + "prefix" + quote + quote + "suffix", + "prefix" + quote + quote, + quote + quote + "suffix", + quote + "A" + quote + quote + "B" + quote, + quote + "A" + quote + "B" + quote + "C" + quote, + "A" + quote + quote + "B" + }; + for (String logOutput : invalidOutputs) { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:logging=trace", + "-Xlog:all=trace:" + logOutput, + "-version"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldHaveExitValue(1); + // Ensure error message was logged + output.shouldMatch("([Mm]issing terminating quote)" + + "|(Could not open log file '')" + + "|(Output name can not be partially quoted)"); + } + } +} + From cc9cd893acf7d5253e27cbb8439703a91a426cbf Mon Sep 17 00:00:00 2001 From: Marcus Larsson Date: Mon, 4 Jan 2016 11:38:42 +0100 Subject: [PATCH 142/146] 8145294: TestLogRotation.java triggers a race in the UL framework Reviewed-by: sla, mgronlun --- .../src/share/vm/logging/logConfiguration.cpp | 10 ++----- .../src/share/vm/logging/logConfiguration.hpp | 5 ---- .../src/share/vm/logging/logFileOutput.cpp | 30 +++++++++++++------ .../src/share/vm/logging/logFileOutput.hpp | 19 +++++------- hotspot/src/share/vm/logging/logOutput.hpp | 14 ++++----- 5 files changed, 38 insertions(+), 40 deletions(-) diff --git a/hotspot/src/share/vm/logging/logConfiguration.cpp b/hotspot/src/share/vm/logging/logConfiguration.cpp index dd0d0133ef5..2ff86004cce 100644 --- a/hotspot/src/share/vm/logging/logConfiguration.cpp +++ b/hotspot/src/share/vm/logging/logConfiguration.cpp @@ -39,7 +39,6 @@ LogOutput** LogConfiguration::_outputs = NULL; size_t LogConfiguration::_n_outputs = 0; -bool LogConfiguration::_post_initialized = false; // Stack object to take the lock for configuring the logging. // Should only be held during the critical parts of the configuration @@ -79,8 +78,6 @@ void LogConfiguration::post_initialize() { ResourceMark rm; describe(log.trace_stream()); } - - _post_initialized = true; } void LogConfiguration::initialize(jlong vm_start_time) { @@ -469,10 +466,9 @@ void LogConfiguration::print_command_line_help(FILE* out) { } void LogConfiguration::rotate_all_outputs() { - for (size_t idx = 0; idx < _n_outputs; idx++) { - if (_outputs[idx]->is_rotatable()) { - _outputs[idx]->rotate(true); - } + // Start from index 2 since neither stdout nor stderr can be rotated. + for (size_t idx = 2; idx < _n_outputs; idx++) { + _outputs[idx]->force_rotate(); } } diff --git a/hotspot/src/share/vm/logging/logConfiguration.hpp b/hotspot/src/share/vm/logging/logConfiguration.hpp index 0acd1faf8bb..409c8b05ef5 100644 --- a/hotspot/src/share/vm/logging/logConfiguration.hpp +++ b/hotspot/src/share/vm/logging/logConfiguration.hpp @@ -40,7 +40,6 @@ class LogConfiguration : public AllStatic { private: static LogOutput** _outputs; static size_t _n_outputs; - static bool _post_initialized; // Create a new output. Returns NULL if failed. static LogOutput* new_output(char* name, const char* options, outputStream* errstream); @@ -96,10 +95,6 @@ class LogConfiguration : public AllStatic { // Prints usage help for command line log configuration. static void print_command_line_help(FILE* out); - static bool is_post_initialized() { - return _post_initialized; - } - // Rotates all LogOutput static void rotate_all_outputs(); }; diff --git a/hotspot/src/share/vm/logging/logFileOutput.cpp b/hotspot/src/share/vm/logging/logFileOutput.cpp index b5a99c6f051..730a90190bd 100644 --- a/hotspot/src/share/vm/logging/logFileOutput.cpp +++ b/hotspot/src/share/vm/logging/logFileOutput.cpp @@ -26,7 +26,6 @@ #include "logging/logConfiguration.hpp" #include "logging/logFileOutput.hpp" #include "memory/allocation.inline.hpp" -#include "runtime/mutexLocker.hpp" #include "runtime/os.inline.hpp" #include "utilities/globalDefinitions.hpp" #include "utilities/defaultStream.hpp" @@ -43,8 +42,7 @@ char LogFileOutput::_vm_start_time_str[StartTimeBufferSize]; LogFileOutput::LogFileOutput(const char* name) : LogFileStreamOutput(NULL), _name(os::strdup_check_oom(name, mtLogging)), _file_name(NULL), _archive_name(NULL), _archive_name_len(0), _current_size(0), - _rotate_size(0), _current_file(1), _file_count(0), - _rotation_lock(Mutex::leaf, "LogFileOutput rotation lock", true, Mutex::_safepoint_check_sometimes) { + _rotate_size(0), _current_file(1), _file_count(0), _rotation_semaphore(1) { _file_name = make_file_name(name, _pid_str, _vm_start_time_str); } @@ -152,10 +150,15 @@ int LogFileOutput::write(const LogDecorations& decorations, const char* msg) { // An error has occurred with this output, avoid writing to it. return 0; } + + _rotation_semaphore.wait(); int written = LogFileStreamOutput::write(decorations, msg); _current_size += written; - rotate(false); + if (should_rotate()) { + rotate(); + } + _rotation_semaphore.signal(); return written; } @@ -177,19 +180,28 @@ void LogFileOutput::archive() { } } -void LogFileOutput::rotate(bool force) { - - if (!should_rotate(force)) { +void LogFileOutput::force_rotate() { + if (_file_count == 0) { + // Rotation not possible return; } + _rotation_semaphore.wait(); + rotate(); + _rotation_semaphore.signal(); +} - MutexLockerEx ml(&_rotation_lock, true /* no safepoint check */); +void LogFileOutput::rotate() { + + if (fclose(_stream)) { + jio_fprintf(defaultStream::error_stream(), "Error closing file '%s' during log rotation (%s).\n", + _file_name, strerror(errno)); + } // Archive the current log file archive(); // Open the active log file using the same stream as before - _stream = freopen(_file_name, FileOpenMode, _stream); + _stream = fopen(_file_name, FileOpenMode); if (_stream == NULL) { jio_fprintf(defaultStream::error_stream(), "Could not reopen file '%s' during log rotation (%s).\n", _file_name, strerror(errno)); diff --git a/hotspot/src/share/vm/logging/logFileOutput.hpp b/hotspot/src/share/vm/logging/logFileOutput.hpp index 4fe633eb971..935a176a5e3 100644 --- a/hotspot/src/share/vm/logging/logFileOutput.hpp +++ b/hotspot/src/share/vm/logging/logFileOutput.hpp @@ -25,7 +25,7 @@ #define SHARE_VM_LOGGING_LOGFILEOUTPUT_HPP #include "logging/logFileStreamOutput.hpp" -#include "runtime/mutex.hpp" +#include "runtime/semaphore.hpp" #include "utilities/globalDefinitions.hpp" class LogDecorations; @@ -44,7 +44,6 @@ class LogFileOutput : public LogFileStreamOutput { static char _pid_str[PidBufferSize]; static char _vm_start_time_str[StartTimeBufferSize]; - Mutex _rotation_lock; const char* _name; char* _file_name; char* _archive_name; @@ -57,14 +56,17 @@ class LogFileOutput : public LogFileStreamOutput { size_t _rotate_size; size_t _current_size; + // Semaphore used for synchronizing file rotations and writes + Semaphore _rotation_semaphore; + void archive(); + void rotate(); bool configure_rotation(const char* options); char *make_file_name(const char* file_name, const char* pid_string, const char* timestamp_string); static size_t parse_value(const char* value_str); - bool should_rotate(bool force) { - return is_rotatable() && - (force || (_rotate_size > 0 && _current_size >= _rotate_size)); + bool should_rotate() { + return _file_count > 0 && _rotate_size > 0 && _current_size >= _rotate_size; } public: @@ -72,12 +74,7 @@ class LogFileOutput : public LogFileStreamOutput { virtual ~LogFileOutput(); virtual bool initialize(const char* options); virtual int write(const LogDecorations& decorations, const char* msg); - - virtual bool is_rotatable() { - return LogConfiguration::is_post_initialized() && (_file_count > 0); - } - - virtual void rotate(bool force); + virtual void force_rotate(); virtual const char* name() const { return _name; diff --git a/hotspot/src/share/vm/logging/logOutput.hpp b/hotspot/src/share/vm/logging/logOutput.hpp index 3850a62f939..1ca598c357f 100644 --- a/hotspot/src/share/vm/logging/logOutput.hpp +++ b/hotspot/src/share/vm/logging/logOutput.hpp @@ -75,17 +75,15 @@ class LogOutput : public CHeapObj { virtual ~LogOutput(); + // If the output can be rotated, trigger a forced rotation, otherwise do nothing. + // Log outputs with rotation capabilities should override this. + virtual void force_rotate() { + // Do nothing by default. + } + virtual const char* name() const = 0; virtual bool initialize(const char* options) = 0; virtual int write(const LogDecorations &decorations, const char* msg) = 0; - - virtual bool is_rotatable() { - return false; - } - - virtual void rotate(bool force) { - // Do nothing by default. - } }; #endif // SHARE_VM_LOGGING_LOGOUTPUT_HPP From 4e9dd68311456a5260292bc232c0dc80416ecf2f Mon Sep 17 00:00:00 2001 From: Ioi Lam Date: Mon, 4 Jan 2016 13:57:34 -0800 Subject: [PATCH 143/146] 8145593: Clean up metaspaceShared.cpp Reviewed-by: jiangli --- hotspot/src/share/vm/memory/filemap.hpp | 3 + hotspot/src/share/vm/memory/metaspace.cpp | 2 +- .../src/share/vm/memory/metaspaceShared.cpp | 165 ++++++++---------- .../src/share/vm/memory/metaspaceShared.hpp | 42 ++++- 4 files changed, 113 insertions(+), 99 deletions(-) diff --git a/hotspot/src/share/vm/memory/filemap.hpp b/hotspot/src/share/vm/memory/filemap.hpp index 8c725cdac02..9752e5ddf75 100644 --- a/hotspot/src/share/vm/memory/filemap.hpp +++ b/hotspot/src/share/vm/memory/filemap.hpp @@ -100,6 +100,7 @@ public: Universe::NARROW_OOP_MODE _narrow_oop_mode; // compressed oop encoding mode int _narrow_klass_shift; // save narrow klass base and shift address _narrow_klass_base; + char* _misc_data_patching_start; struct space_info { int _crc; // crc checksum of the current space @@ -185,6 +186,8 @@ public: int narrow_klass_shift() const { return _header->_narrow_klass_shift; } size_t space_capacity(int i) { return _header->_space[i]._capacity; } struct FileMapHeader* header() { return _header; } + char* misc_data_patching_start() { return _header->_misc_data_patching_start; } + void set_misc_data_patching_start(char* p) { _header->_misc_data_patching_start = p; } static FileMapInfo* current_info() { CDS_ONLY(return _current_info;) diff --git a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp index a59bf063d51..f430b446c04 100644 --- a/hotspot/src/share/vm/memory/metaspace.cpp +++ b/hotspot/src/share/vm/memory/metaspace.cpp @@ -421,7 +421,7 @@ VirtualSpaceNode::VirtualSpaceNode(size_t bytes) : _top(NULL), _next(NULL), _rs( // Get a mmap region anywhere if the SharedBaseAddress fails. _rs = ReservedSpace(bytes, Metaspace::reserve_alignment(), large_pages); } - MetaspaceShared::set_shared_rs(&_rs); + MetaspaceShared::initialize_shared_rs(&_rs); } else #endif { diff --git a/hotspot/src/share/vm/memory/metaspaceShared.cpp b/hotspot/src/share/vm/memory/metaspaceShared.cpp index a703ad4e607..d71f9292511 100644 --- a/hotspot/src/share/vm/memory/metaspaceShared.cpp +++ b/hotspot/src/share/vm/memory/metaspaceShared.cpp @@ -57,6 +57,48 @@ bool MetaspaceShared::_link_classes_made_progress; bool MetaspaceShared::_check_classes_made_progress; bool MetaspaceShared::_has_error_classes; bool MetaspaceShared::_archive_loading_failed = false; +SharedMiscRegion MetaspaceShared::_mc; +SharedMiscRegion MetaspaceShared::_md; + +void SharedMiscRegion::initialize(ReservedSpace rs, size_t committed_byte_size, SharedSpaceType space_type) { + _vs.initialize(rs, committed_byte_size); + _alloc_top = _vs.low(); + _space_type = space_type; +} + +// NOT thread-safe, but this is called during dump time in single-threaded mode. +char* SharedMiscRegion::alloc(size_t num_bytes) { + assert(DumpSharedSpaces, "dump time only"); + size_t alignment = sizeof(char*); + num_bytes = align_size_up(num_bytes, alignment); + _alloc_top = (char*)align_ptr_up(_alloc_top, alignment); + if (_alloc_top + num_bytes > _vs.high()) { + report_out_of_shared_space(_space_type); + } + + char* p = _alloc_top; + _alloc_top += num_bytes; + + memset(p, 0, num_bytes); + return p; +} + +void MetaspaceShared::initialize_shared_rs(ReservedSpace* rs) { + assert(DumpSharedSpaces, "dump time only"); + _shared_rs = rs; + + // Split up and initialize the misc code and data spaces + size_t metadata_size = SharedReadOnlySize + SharedReadWriteSize; + ReservedSpace shared_ro_rw = _shared_rs->first_part(metadata_size); + ReservedSpace misc_section = _shared_rs->last_part(metadata_size); + + // Now split into misc sections. + ReservedSpace md_rs = misc_section.first_part(SharedMiscDataSize); + ReservedSpace mc_rs = misc_section.last_part(SharedMiscDataSize); + _md.initialize(md_rs, SharedMiscDataSize, SharedMiscData); + _mc.initialize(mc_rs, SharedMiscCodeSize, SharedMiscData); +} + // Read/write a data stream for restoring/preserving metadata pointers and // miscellaneous data from/to the shared archive file. @@ -429,64 +471,17 @@ private: VirtualSpace _mc_vs; CompactHashtableWriter* _string_cht; GrowableArray *_string_regions; - char* _md_alloc_low; - char* _md_alloc_top; - char* _md_alloc_max; - static VM_PopulateDumpSharedSpace* _instance; public: VM_PopulateDumpSharedSpace(ClassLoaderData* loader_data, GrowableArray *class_promote_order) : _loader_data(loader_data) { - // Split up and initialize the misc code and data spaces - ReservedSpace* shared_rs = MetaspaceShared::shared_rs(); - size_t metadata_size = SharedReadOnlySize + SharedReadWriteSize; - ReservedSpace shared_ro_rw = shared_rs->first_part(metadata_size); - ReservedSpace misc_section = shared_rs->last_part(metadata_size); - - // Now split into misc sections. - ReservedSpace md_rs = misc_section.first_part(SharedMiscDataSize); - ReservedSpace mc_rs = misc_section.last_part(SharedMiscDataSize); - _md_vs.initialize(md_rs, SharedMiscDataSize); - _mc_vs.initialize(mc_rs, SharedMiscCodeSize); _class_promote_order = class_promote_order; - - _md_alloc_low = _md_vs.low(); - _md_alloc_top = _md_alloc_low + sizeof(char*); - _md_alloc_max = _md_vs.low() + SharedMiscDataSize; - - assert(_instance == NULL, "must be singleton"); - _instance = this; - } - - ~VM_PopulateDumpSharedSpace() { - assert(_instance == this, "must be singleton"); - _instance = NULL; - } - - static VM_PopulateDumpSharedSpace* instance() { - assert(_instance != NULL, "sanity"); - return _instance; } VMOp_Type type() const { return VMOp_PopulateDumpSharedSpace; } void doit(); // outline because gdb sucks - char* misc_data_space_alloc(size_t num_bytes) { - size_t alignment = sizeof(char*); - num_bytes = align_size_up(num_bytes, alignment); - _md_alloc_top = (char*)align_ptr_up(_md_alloc_top, alignment); - if (_md_alloc_top + num_bytes > _md_alloc_max) { - report_out_of_shared_space(SharedMiscData); - } - - char* p = _md_alloc_top; - _md_alloc_top += num_bytes; - - memset(p, 0, num_bytes); - return p; - } - private: void handle_misc_data_space_failure(bool success) { if (!success) { @@ -495,8 +490,6 @@ private: } }; // class VM_PopulateDumpSharedSpace -VM_PopulateDumpSharedSpace* VM_PopulateDumpSharedSpace::_instance; - void VM_PopulateDumpSharedSpace::doit() { Thread* THREAD = VMThread::vm_thread(); NOT_PRODUCT(SystemDictionary::verify();) @@ -555,17 +548,15 @@ void VM_PopulateDumpSharedSpace::doit() { tty->print_cr("done. "); // Set up the share data and shared code segments. + _md_vs = *MetaspaceShared::misc_data_region()->virtual_space(); + _mc_vs = *MetaspaceShared::misc_code_region()->virtual_space(); char* md_low = _md_vs.low(); - char* md_top = md_low; + char* md_top = MetaspaceShared::misc_data_region()->alloc_top(); char* md_end = _md_vs.high(); char* mc_low = _mc_vs.low(); - char* mc_top = mc_low; + char* mc_top = MetaspaceShared::misc_code_region()->alloc_top(); char* mc_end = _mc_vs.high(); - assert(_md_alloc_top != NULL, "sanity"); - *(char**)_md_alloc_low = _md_alloc_top; - md_top = _md_alloc_top; - // Reserve space for the list of Klass*s whose vtables are used // for patching others as needed. @@ -681,36 +672,32 @@ void VM_PopulateDumpSharedSpace::doit() { FileMapInfo* mapinfo = new FileMapInfo(); mapinfo->populate_header(MetaspaceShared::max_alignment()); + mapinfo->set_misc_data_patching_start((char*)vtbl_list); - // Pass 1 - update file offsets in header. - mapinfo->write_header(); - mapinfo->write_space(MetaspaceShared::ro, _loader_data->ro_metaspace(), true); - mapinfo->write_space(MetaspaceShared::rw, _loader_data->rw_metaspace(), false); - mapinfo->write_region(MetaspaceShared::md, _md_vs.low(), - pointer_delta(md_top, _md_vs.low(), sizeof(char)), - SharedMiscDataSize, - false, false); - mapinfo->write_region(MetaspaceShared::mc, _mc_vs.low(), - pointer_delta(mc_top, _mc_vs.low(), sizeof(char)), - SharedMiscCodeSize, - true, true); - mapinfo->write_string_regions(_string_regions); - - // Pass 2 - write data. - mapinfo->open_for_write(); - mapinfo->set_header_crc(mapinfo->compute_header_crc()); - mapinfo->write_header(); - mapinfo->write_space(MetaspaceShared::ro, _loader_data->ro_metaspace(), true); - mapinfo->write_space(MetaspaceShared::rw, _loader_data->rw_metaspace(), false); - mapinfo->write_region(MetaspaceShared::md, _md_vs.low(), - pointer_delta(md_top, _md_vs.low(), sizeof(char)), - SharedMiscDataSize, - false, false); - mapinfo->write_region(MetaspaceShared::mc, _mc_vs.low(), - pointer_delta(mc_top, _mc_vs.low(), sizeof(char)), - SharedMiscCodeSize, - true, true); - mapinfo->write_string_regions(_string_regions); + for (int pass=1; pass<=2; pass++) { + if (pass == 1) { + // The first pass doesn't actually write the data to disk. All it + // does is to update the fields in the mapinfo->_header. + } else { + // After the first pass, the contents of mapinfo->_header are finalized, + // so we can compute the header's CRC, and write the contents of the header + // and the regions into disk. + mapinfo->open_for_write(); + mapinfo->set_header_crc(mapinfo->compute_header_crc()); + } + mapinfo->write_header(); + mapinfo->write_space(MetaspaceShared::ro, _loader_data->ro_metaspace(), true); + mapinfo->write_space(MetaspaceShared::rw, _loader_data->rw_metaspace(), false); + mapinfo->write_region(MetaspaceShared::md, _md_vs.low(), + pointer_delta(md_top, _md_vs.low(), sizeof(char)), + SharedMiscDataSize, + false, false); + mapinfo->write_region(MetaspaceShared::mc, _mc_vs.low(), + pointer_delta(mc_top, _mc_vs.low(), sizeof(char)), + SharedMiscCodeSize, + true, true); + mapinfo->write_string_regions(_string_regions); + } mapinfo->close(); @@ -938,11 +925,6 @@ bool MetaspaceShared::try_link_class(InstanceKlass* ik, TRAPS) { } } -// Allocate misc data blocks during dumping. -char* MetaspaceShared::misc_data_space_alloc(size_t num_bytes) { - return VM_PopulateDumpSharedSpace::instance()->misc_data_space_alloc(num_bytes); -} - // Closure for serializing initialization data in from a data area // (ptr_array) read from the shared file. @@ -1065,10 +1047,7 @@ bool MetaspaceShared::map_shared_spaces(FileMapInfo* mapinfo) { void MetaspaceShared::initialize_shared_spaces() { FileMapInfo *mapinfo = FileMapInfo::current_info(); - - char* buffer = mapinfo->header()->region_addr(md); - - buffer = *((char**)buffer); // skip over the md_alloc'ed blocks + char* buffer = mapinfo->misc_data_patching_start(); // Skip over (reserve space for) a list of addresses of C++ vtables // for Klass objects. They get filled in later. diff --git a/hotspot/src/share/vm/memory/metaspaceShared.hpp b/hotspot/src/share/vm/memory/metaspaceShared.hpp index bfefce6396a..dac447c9e05 100644 --- a/hotspot/src/share/vm/memory/metaspaceShared.hpp +++ b/hotspot/src/share/vm/memory/metaspaceShared.hpp @@ -97,6 +97,26 @@ public: CompactHashtableStats string; }; +class SharedMiscRegion VALUE_OBJ_CLASS_SPEC { +private: + VirtualSpace _vs; + char* _alloc_top; + SharedSpaceType _space_type; + +public: + void initialize(ReservedSpace rs, size_t committed_byte_size, SharedSpaceType space_type); + VirtualSpace* virtual_space() { + return &_vs; + } + char* low() const { + return _vs.low(); + } + char* alloc_top() const { + return _alloc_top; + } + char* alloc(size_t num_bytes) NOT_CDS_RETURN_(NULL); +}; + // Class Data Sharing Support class MetaspaceShared : AllStatic { @@ -108,6 +128,10 @@ class MetaspaceShared : AllStatic { static bool _check_classes_made_progress; static bool _has_error_classes; static bool _archive_loading_failed; + + // Used only during dumping. + static SharedMiscRegion _md; + static SharedMiscRegion _mc; public: enum { vtbl_list_size = DEFAULT_VTBL_LIST_SIZE, @@ -149,9 +173,7 @@ class MetaspaceShared : AllStatic { NOT_CDS(return NULL); } - static void set_shared_rs(ReservedSpace* rs) { - CDS_ONLY(_shared_rs = rs;) - } + static void initialize_shared_rs(ReservedSpace* rs) NOT_CDS_RETURN; static void set_archive_loading_failed() { _archive_loading_failed = true; @@ -191,7 +213,17 @@ class MetaspaceShared : AllStatic { static int count_class(const char* classlist_file); static void estimate_regions_size() NOT_CDS_RETURN; - // Allocate a block of memory from the "md" region. - static char* misc_data_space_alloc(size_t num_bytes); + // Allocate a block of memory from the "mc" or "md" regions. + static char* misc_code_space_alloc(size_t num_bytes) { return _mc.alloc(num_bytes); } + static char* misc_data_space_alloc(size_t num_bytes) { return _md.alloc(num_bytes); } + + static SharedMiscRegion* misc_code_region() { + assert(DumpSharedSpaces, "used during dumping only"); + return &_mc; + } + static SharedMiscRegion* misc_data_region() { + assert(DumpSharedSpaces, "used during dumping only"); + return &_md; + } }; #endif // SHARE_VM_MEMORY_METASPACESHARED_HPP From 9ab99c633d8fca25edb11b65be746a4904645ec5 Mon Sep 17 00:00:00 2001 From: Rachel Protacio Date: Tue, 5 Jan 2016 18:23:14 +0000 Subject: [PATCH 144/146] 8146481: Disable runtime/logging/DefaultMethodsTest.java @ignore'd DefaultMethodsTest.java Reviewed-by: gtriantafill, coleenp, hseigel --- hotspot/test/runtime/logging/DefaultMethodsTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/test/runtime/logging/DefaultMethodsTest.java b/hotspot/test/runtime/logging/DefaultMethodsTest.java index 007da7bf8fb..4b422580895 100644 --- a/hotspot/test/runtime/logging/DefaultMethodsTest.java +++ b/hotspot/test/runtime/logging/DefaultMethodsTest.java @@ -26,6 +26,7 @@ * @bug 8139564 * @summary defaultmethods=debug should have logging from each of the statements in the code * @library /testlibrary + * @ignore 8146435 * @modules java.base/sun.misc * java.management * @run driver DefaultMethodsTest From c1d5c540ac473ca0c38d3c4dfd2e4e41a9cb9783 Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Tue, 5 Jan 2016 10:57:15 -1000 Subject: [PATCH 145/146] 8146001: Remove support for command line options from JVMCI Reviewed-by: twisti --- hotspot/.mx.jvmci/mx_jvmci.py | 21 - hotspot/.mx.jvmci/suite.py | 56 +- hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk | 21 +- .../HotSpotConstantReflectionProvider.java | 44 +- .../vm/ci/hotspot/HotSpotJVMCIRuntime.java | 17 + .../hotspot/HotSpotResolvedJavaFieldImpl.java | 15 +- .../ci/hotspot/HotSpotResolvedJavaMethod.java | 10 - .../HotSpotResolvedJavaMethodImpl.java | 3 +- .../ci/meta/ConstantReflectionProvider.java | 18 +- .../javax.annotation.processing.Processor | 1 - .../ci/options/processor/OptionProcessor.java | 369 ------------- .../jdk/vm/ci/options/DerivedOptionValue.java | 59 --- .../ci/options/NestedBooleanOptionValue.java | 58 --- .../src/jdk/vm/ci/options/Option.java | 55 -- .../jdk/vm/ci/options/OptionDescriptor.java | 102 ---- .../jdk/vm/ci/options/OptionDescriptors.java | 34 -- .../src/jdk/vm/ci/options/OptionType.java | 44 -- .../src/jdk/vm/ci/options/OptionValue.java | 484 ------------------ .../src/jdk/vm/ci/options/OptionsLoader.java | 47 -- .../src/jdk/vm/ci/options/OptionsParser.java | 382 -------------- .../jdk/vm/ci/options/StableOptionValue.java | 75 --- hotspot/src/share/vm/jvmci/jvmciRuntime.cpp | 81 --- hotspot/src/share/vm/jvmci/jvmciRuntime.hpp | 16 - hotspot/src/share/vm/runtime/arguments.cpp | 6 - hotspot/src/share/vm/runtime/thread.cpp | 1 - .../test/NestedBooleanOptionValueTest.java | 143 ------ .../vm/ci/options/test/TestOptionValue.java | 141 ----- .../jdk/vm/ci/runtime/test/TypeUniverse.java | 4 +- 28 files changed, 49 insertions(+), 2258 deletions(-) delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options.processor/src/META-INF/services/javax.annotation.processing.Processor delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options.processor/src/jdk/vm/ci/options/processor/OptionProcessor.java delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/DerivedOptionValue.java delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/NestedBooleanOptionValue.java delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/Option.java delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionDescriptor.java delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionDescriptors.java delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionType.java delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionValue.java delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionsLoader.java delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionsParser.java delete mode 100644 hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/StableOptionValue.java delete mode 100644 hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/NestedBooleanOptionValueTest.java delete mode 100644 hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/TestOptionValue.java diff --git a/hotspot/.mx.jvmci/mx_jvmci.py b/hotspot/.mx.jvmci/mx_jvmci.py index 0e3ac639bb3..d1069e6284c 100644 --- a/hotspot/.mx.jvmci/mx_jvmci.py +++ b/hotspot/.mx.jvmci/mx_jvmci.py @@ -677,12 +677,6 @@ class JVMCIArchiveParticipant: assert service self.services.setdefault(service, []).append(provider) return True - elif arcname.endswith('_OptionDescriptors.class'): - # Need to create service files for the providers of the - # jdk.vm.ci.options.Options service created by - # jdk.vm.ci.options.processor.OptionProcessor. - provider = arcname[:-len('.class'):].replace('/', '.') - self.services.setdefault('jdk.vm.ci.options.OptionDescriptors', []).append(provider) return False def __addsrc__(self, arcname, contents): @@ -761,21 +755,6 @@ class JVMCI9JDKConfig(mx.JDKConfig): if jacocoArgs: args = jacocoArgs + args - # Support for -G: options - def translateGOption(arg): - if arg.startswith('-G:+'): - if '=' in arg: - mx.abort('Mixing + and = in -G: option specification: ' + arg) - arg = '-Djvmci.option.' + arg[len('-G:+'):] + '=true' - elif arg.startswith('-G:-'): - if '=' in arg: - mx.abort('Mixing - and = in -G: option specification: ' + arg) - arg = '-Djvmci.option.' + arg[len('-G:+'):] + '=false' - elif arg.startswith('-G:'): - arg = '-Djvmci.option.' + arg[len('-G:'):] - return arg - args = map(translateGOption, args) - args = ['-Xbootclasspath/p:' + dep.classpath_repr() for dep in _jvmci_bootclasspath_prepends] + args jvmciModeArgs = _jvmciModes[_vm.jvmciMode] diff --git a/hotspot/.mx.jvmci/suite.py b/hotspot/.mx.jvmci/suite.py index cd6eac41bd1..05d0027a8bb 100644 --- a/hotspot/.mx.jvmci/suite.py +++ b/hotspot/.mx.jvmci/suite.py @@ -109,7 +109,6 @@ suite = { "jdk.vm.ci.code", ], "checkstyle" : "jdk.vm.ci.service", - "annotationProcessors" : ["JVMCI_OPTIONS_PROCESSOR"], "javaCompliance" : "1.8", "workingSets" : "API,JVMCI", }, @@ -135,38 +134,6 @@ suite = { "workingSets" : "JVMCI", }, - "jdk.vm.ci.options" : { - "subDir" : "src/jdk.vm.ci/share/classes", - "sourceDirs" : ["src"], - "checkstyle" : "jdk.vm.ci.service", - "dependencies" : ["jdk.vm.ci.inittimer"], - "javaCompliance" : "1.8", - "workingSets" : "JVMCI", - }, - - "jdk.vm.ci.options.processor" : { - "subDir" : "src/jdk.vm.ci/share/classes", - "sourceDirs" : ["src"], - "dependencies" : [ - "jdk.vm.ci.options", - ], - "checkstyle" : "jdk.vm.ci.service", - "javaCompliance" : "1.8", - "workingSets" : "JVMCI,Codegen", - }, - - "jdk.vm.ci.options.test" : { - "subDir" : "test/compiler/jvmci", - "sourceDirs" : ["src"], - "dependencies" : [ - "jdk.vm.ci.options", - "mx:JUNIT", - ], - "checkstyle" : "jdk.vm.ci.service", - "javaCompliance" : "1.8", - "workingSets" : "JVMCI", - }, - # ------------- JVMCI:HotSpot ------------- "jdk.vm.ci.aarch64" : { @@ -200,15 +167,12 @@ suite = { "subDir" : "src/jdk.vm.ci/share/classes", "sourceDirs" : ["src"], "dependencies" : [ - "jdk.vm.ci.options", "jdk.vm.ci.hotspotvmconfig", "jdk.vm.ci.common", + "jdk.vm.ci.inittimer", "jdk.vm.ci.runtime", "jdk.vm.ci.service", ], - "annotationProcessors" : [ - "JVMCI_OPTIONS_PROCESSOR", - ], "checkstyle" : "jdk.vm.ci.service", "javaCompliance" : "1.8", "workingSets" : "JVMCI", @@ -282,11 +246,6 @@ suite = { "dependencies" : ["jdk.vm.ci.service"], }, - "JVMCI_OPTIONS" : { - "subDir" : "src/jdk.vm.ci/share/classes", - "dependencies" : ["jdk.vm.ci.options"], - }, - "JVMCI_API" : { "subDir" : "src/jdk.vm.ci/share/classes", "dependencies" : [ @@ -298,7 +257,6 @@ suite = { "jdk.vm.ci.sparc", ], "distDependencies" : [ - "JVMCI_OPTIONS", "JVMCI_SERVICE", ], }, @@ -327,7 +285,6 @@ suite = { "JVMCI_TEST" : { "subDir" : "test/compiler/jvmci", "dependencies" : [ - "jdk.vm.ci.options.test", "jdk.vm.ci.runtime.test", ], "distDependencies" : [ @@ -336,13 +293,6 @@ suite = { "exclude" : ["mx:JUNIT"], }, - "JVMCI_OPTIONS_PROCESSOR" : { - "subDir" : "src/jdk.vm.ci/share/classes", - "dependencies" : ["jdk.vm.ci.options.processor"], - "distDependencies" : [ - "JVMCI_OPTIONS", - ], - }, "JVMCI_SERVICE_PROCESSOR" : { "subDir" : "src/jdk.vm.ci/share/classes", @@ -358,15 +308,12 @@ suite = { "subDir" : "src/jdk.vm.ci/share/classes", "overlaps" : [ "JVMCI_API", - "JVMCI_OPTIONS", "JVMCI_SERVICE", "JVMCI_HOTSPOT", "JVMCI_HOTSPOTVMCONFIG", "JVMCI_SERVICE_PROCESSOR", - "JVMCI_OPTIONS_PROCESSOR" ], "dependencies" : [ - "jdk.vm.ci.options", "jdk.vm.ci.service", "jdk.vm.ci.inittimer", "jdk.vm.ci.runtime", @@ -378,7 +325,6 @@ suite = { "jdk.vm.ci.hotspot.aarch64", "jdk.vm.ci.hotspot.amd64", "jdk.vm.ci.hotspot.sparc", - "jdk.vm.ci.options.processor", "jdk.vm.ci.service.processor" ], }, diff --git a/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk b/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk index 1d9fd149467..969330eec19 100644 --- a/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk +++ b/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk @@ -36,15 +36,6 @@ SRC_DIR := $(HOTSPOT_TOPDIR)/src/jdk.vm.ci/share/classes ################################################################################ # Compile the annotation processor -$(eval $(call SetupJavaCompilation, BUILD_JVMCI_OPTIONS, \ - SETUP := GENERATE_OLDBYTECODE, \ - SRC := $(SRC_DIR)/jdk.vm.ci.options/src \ - $(SRC_DIR)/jdk.vm.ci.options.processor/src \ - $(SRC_DIR)/jdk.vm.ci.inittimer/src, \ - BIN := $(BUILDTOOLS_OUTPUTDIR)/jvmci_options, \ - JAR := $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.ci.options.jar, \ -)) - $(eval $(call SetupJavaCompilation, BUILD_JVMCI_SERVICE, \ SETUP := GENERATE_OLDBYTECODE, \ SRC := $(SRC_DIR)/jdk.vm.ci.service/src \ @@ -70,11 +61,10 @@ PROC_SRCS := $(filter %.java, $(call CacheFind, $(PROC_SRC_DIRS))) ALL_SRC_DIRS := $(wildcard $(SRC_DIR)/*/src) SOURCEPATH := $(call PathList, $(ALL_SRC_DIRS)) PROCESSOR_PATH := $(call PathList, \ - $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.ci.options.jar \ $(BUILDTOOLS_OUTPUTDIR)/jdk.vm.ci.service.jar) $(GENSRC_DIR)/_gensrc_proc_done: $(PROC_SRCS) \ - $(BUILD_JVMCI_OPTIONS) $(BUILD_JVMCI_SERVICE) + $(BUILD_JVMCI_SERVICE) $(MKDIR) -p $(@D) $(eval $(call ListPathsSafely,PROC_SRCS,$(@D)/_gensrc_proc_files)) $(JAVA_SMALL) $(NEW_JAVAC) \ @@ -92,15 +82,6 @@ TARGETS += $(GENSRC_DIR)/_gensrc_proc_done ################################################################################ -$(GENSRC_DIR)/META-INF/services/jdk.vm.ci.options.OptionDescriptors: \ - $(GENSRC_DIR)/_gensrc_proc_done - $(MKDIR) -p $(@D) - $(FIND) $(GENSRC_DIR) -name '*_OptionDescriptors.java' | $(SED) 's:.*/jdk\.vm\.ci/\(.*\)\.java:\1:' | $(TR) '/' '.' > $@ - -TARGETS += $(GENSRC_DIR)/META-INF/services/jdk.vm.ci.options.OptionDescriptors - -################################################################################ - $(GENSRC_DIR)/_providers_converted: $(GENSRC_DIR)/_gensrc_proc_done $(MKDIR) -p $(GENSRC_DIR)/META-INF/services ($(CD) $(GENSRC_DIR)/META-INF/jvmci.providers && \ diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java index ef2261de039..ffe53825947 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java @@ -30,28 +30,22 @@ import java.lang.reflect.Array; import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.ConstantReflectionProvider; import jdk.vm.ci.meta.JavaConstant; -import jdk.vm.ci.meta.JavaField; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.JavaType; import jdk.vm.ci.meta.MemoryAccessProvider; import jdk.vm.ci.meta.MethodHandleAccessProvider; +import jdk.vm.ci.meta.ResolvedJavaField; import jdk.vm.ci.meta.ResolvedJavaType; -import jdk.vm.ci.options.Option; -import jdk.vm.ci.options.OptionType; -import jdk.vm.ci.options.OptionValue; -import jdk.vm.ci.options.StableOptionValue; /** * HotSpot implementation of {@link ConstantReflectionProvider}. */ public class HotSpotConstantReflectionProvider implements ConstantReflectionProvider, HotSpotProxified { - static class Options { - //@formatter:off - @Option(help = "Constant fold final fields with default values.", type = OptionType.Debug) - public static final OptionValue TrustFinalDefaultFields = new OptionValue<>(true); - //@formatter:on - } + /** + * Determines whether to treat {@code final} fields with default values as constant. + */ + private static final boolean TrustFinalDefaultFields = HotSpotJVMCIRuntime.getBooleanProperty("TrustFinalDefaultFields", true); protected final HotSpotJVMCIRuntimeProvider runtime; protected final HotSpotMethodHandleAccessProvider methodHandleAccess; @@ -239,7 +233,7 @@ public class HotSpotConstantReflectionProvider implements ConstantReflectionProv /** * Determines if a static field is constant for the purpose of - * {@link #readConstantFieldValue(JavaField, JavaConstant)}. + * {@link #readConstantFieldValue(ResolvedJavaField, JavaConstant)}. */ protected boolean isStaticFieldConstant(HotSpotResolvedJavaField staticField) { if (staticField.isFinal() || (staticField.isStable() && runtime.getConfig().foldStableValues)) { @@ -255,14 +249,14 @@ public class HotSpotConstantReflectionProvider implements ConstantReflectionProv * Determines if a value read from a {@code final} instance field is considered constant. The * implementation in {@link HotSpotConstantReflectionProvider} returns true if {@code value} is * not the {@link JavaConstant#isDefaultForKind default value} for its kind or if - * {@link Options#TrustFinalDefaultFields} is true. + * {@link #TrustFinalDefaultFields} is true. * * @param value a value read from a {@code final} instance field * @param receiverClass the {@link Object#getClass() class} of object from which the * {@code value} was read */ protected boolean isFinalInstanceFieldValueConstant(JavaConstant value, Class receiverClass) { - return !value.isDefaultForKind() || Options.TrustFinalDefaultFields.getValue(); + return !value.isDefaultForKind() || TrustFinalDefaultFields; } /** @@ -278,13 +272,7 @@ public class HotSpotConstantReflectionProvider implements ConstantReflectionProv return !value.isDefaultForKind(); } - /** - * {@inheritDoc} - *

- * The {@code value} field in {@link OptionValue} is considered constant if the type of - * {@code receiver} is (assignable to) {@link StableOptionValue}. - */ - public JavaConstant readConstantFieldValue(JavaField field, JavaConstant receiver) { + public JavaConstant readConstantFieldValue(ResolvedJavaField field, JavaConstant receiver) { HotSpotResolvedJavaField hotspotField = (HotSpotResolvedJavaField) field; if (hotspotField.isStatic()) { @@ -319,21 +307,13 @@ public class HotSpotConstantReflectionProvider implements ConstantReflectionProv return value; } } - } else { - Class clazz = object.getClass(); - if (StableOptionValue.class.isAssignableFrom(clazz)) { - if (hotspotField.isInObject(object) && hotspotField.getName().equals("value")) { - StableOptionValue option = (StableOptionValue) object; - return HotSpotObjectConstantImpl.forObject(option.getValue()); - } - } } } } return null; } - public JavaConstant readFieldValue(JavaField field, JavaConstant receiver) { + public JavaConstant readFieldValue(ResolvedJavaField field, JavaConstant receiver) { HotSpotResolvedJavaField hotspotField = (HotSpotResolvedJavaField) field; if (!hotspotField.isStable()) { return readNonStableFieldValue(field, receiver); @@ -344,7 +324,7 @@ public class HotSpotConstantReflectionProvider implements ConstantReflectionProv } } - private JavaConstant readNonStableFieldValue(JavaField field, JavaConstant receiver) { + private JavaConstant readNonStableFieldValue(ResolvedJavaField field, JavaConstant receiver) { HotSpotResolvedJavaField hotspotField = (HotSpotResolvedJavaField) field; if (hotspotField.isStatic()) { HotSpotResolvedJavaType holder = (HotSpotResolvedJavaType) hotspotField.getDeclaringClass(); @@ -359,7 +339,7 @@ public class HotSpotConstantReflectionProvider implements ConstantReflectionProv return null; } - public JavaConstant readStableFieldValue(JavaField field, JavaConstant receiver, boolean isDefaultStable) { + public JavaConstant readStableFieldValue(ResolvedJavaField field, JavaConstant receiver, boolean isDefaultStable) { JavaConstant fieldValue = readNonStableFieldValue(field, receiver); if (fieldValue.isNonNull()) { JavaType declaredType = field.getType(); diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java index 7ea4ebf407d..bf7f255d4db 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java @@ -49,6 +49,7 @@ import jdk.vm.ci.runtime.JVMCI; import jdk.vm.ci.runtime.JVMCIBackend; import jdk.vm.ci.runtime.JVMCICompiler; import jdk.vm.ci.service.Services; +import sun.misc.VM; //JaCoCo Exclude @@ -83,6 +84,22 @@ public final class HotSpotJVMCIRuntime implements HotSpotJVMCIRuntimeProvider, H return DelayedInit.instance; } + /** + * Gets a boolean value based on a system property {@linkplain VM#getSavedProperty(String) + * saved} at system initialization time. The property name is prefixed with "{@code jvmci.}". + * + * @param name the name of the system property to derive a boolean value from using + * {@link Boolean#parseBoolean(String)} + * @param def the value to return if there is no system property corresponding to {@code name} + */ + public static boolean getBooleanProperty(String name, boolean def) { + String value = VM.getSavedProperty("jvmci." + name); + if (value == null) { + return def; + } + return Boolean.parseBoolean(value); + } + public static HotSpotJVMCIBackendFactory findFactory(String architecture) { for (HotSpotJVMCIBackendFactory factory : Services.load(HotSpotJVMCIBackendFactory.class)) { if (factory.getArchitecture().equalsIgnoreCase(architecture)) { diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java index d565dfe4d39..c6f4dabc0fb 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java @@ -35,21 +35,16 @@ import jdk.vm.ci.meta.MetaAccessProvider; import jdk.vm.ci.meta.ModifiersProvider; import jdk.vm.ci.meta.ResolvedJavaField; import jdk.vm.ci.meta.ResolvedJavaType; -import jdk.vm.ci.options.Option; -import jdk.vm.ci.options.OptionType; -import jdk.vm.ci.options.OptionValue; /** * Represents a field in a HotSpot type. */ class HotSpotResolvedJavaFieldImpl implements HotSpotResolvedJavaField, HotSpotProxified { - static class Options { - //@formatter:off - @Option(help = "Mark well-known stable fields as such.", type = OptionType.Debug) - public static final OptionValue ImplicitStableValues = new OptionValue<>(true); - //@formatter:on - } + /** + * Mark well-known stable fields as such. + */ + private static final boolean ImplicitStableValues = HotSpotJVMCIRuntime.getBooleanProperty("ImplicitStableValues", true); private final HotSpotResolvedObjectTypeImpl holder; private final String name; @@ -203,7 +198,7 @@ class HotSpotResolvedJavaFieldImpl implements HotSpotResolvedJavaField, HotSpotP return true; } assert getAnnotation(Stable.class) == null; - if (Options.ImplicitStableValues.getValue() && isImplicitStableField()) { + if (ImplicitStableValues && isImplicitStableField()) { return true; } return false; diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java index d1ecdac098d..80635caa7c7 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java @@ -27,22 +27,12 @@ import java.lang.reflect.Modifier; import jdk.vm.ci.meta.JavaMethod; import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.ResolvedJavaType; -import jdk.vm.ci.options.Option; -import jdk.vm.ci.options.OptionType; -import jdk.vm.ci.options.OptionValue; /** * Implementation of {@link JavaMethod} for resolved HotSpot methods. */ public interface HotSpotResolvedJavaMethod extends ResolvedJavaMethod { - public static class Options { - // @formatter:off - @Option(help = "", type = OptionType.Debug) - public static final OptionValue UseProfilingInformation = new OptionValue<>(true); - // @formatter:on - } - /** * Returns true if this method has a {@code CallerSensitive} annotation. * diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java index 34647ae886c..5999d8c204f 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java @@ -24,7 +24,6 @@ package jdk.vm.ci.hotspot; import static jdk.vm.ci.hotspot.CompilerToVM.compilerToVM; import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime; -import static jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod.Options.UseProfilingInformation; import static jdk.vm.ci.hotspot.HotSpotVMConfig.config; import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE; @@ -424,7 +423,7 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp public ProfilingInfo getProfilingInfo(boolean includeNormal, boolean includeOSR) { ProfilingInfo info; - if (UseProfilingInformation.getValue() && methodData == null) { + if (methodData == null) { long metaspaceMethodData = UNSAFE.getAddress(metaspaceMethod + config().methodDataOffset); if (metaspaceMethodData != 0) { methodData = new HotSpotMethodData(metaspaceMethodData, this); diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java index 1db2b98c7ea..33cc2a27ebc 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java @@ -80,29 +80,31 @@ public interface ConstantReflectionProvider { * @return the constant value of this field or {@code null} if this field is not considered * constant by the runtime */ - JavaConstant readConstantFieldValue(JavaField field, JavaConstant receiver); + JavaConstant readConstantFieldValue(ResolvedJavaField field, JavaConstant receiver); /** * Gets the current value of this field for a given object, if available. * * There is no guarantee that the same value will be returned by this method for a field unless - * the field is considered to be {@linkplain #readConstantFieldValue(JavaField, JavaConstant) - * constant} by the runtime. + * the field is considered to be + * {@linkplain #readConstantFieldValue(ResolvedJavaField, JavaConstant) constant} by the + * runtime. * * @param receiver object from which this field's value is to be read. This value is ignored if * this field is static. * @return the value of this field or {@code null} if the value is not available (e.g., because * the field holder is not yet initialized). */ - JavaConstant readFieldValue(JavaField field, JavaConstant receiver); + JavaConstant readFieldValue(ResolvedJavaField field, JavaConstant receiver); /** * Gets the current value of this field for a given object, if available. Like - * {@link #readFieldValue(JavaField, JavaConstant)} but treats array fields as stable. + * {@link #readFieldValue(ResolvedJavaField, JavaConstant)} but treats array fields as stable. * * There is no guarantee that the same value will be returned by this method for a field unless - * the field is considered to be {@linkplain #readConstantFieldValue(JavaField, JavaConstant) - * constant} by the runtime. + * the field is considered to be + * {@linkplain #readConstantFieldValue(ResolvedJavaField, JavaConstant) constant} by the + * runtime. * * @param receiver object from which this field's value is to be read. This value is ignored if * this field is static. @@ -110,7 +112,7 @@ public interface ConstantReflectionProvider { * @return the value of this field or {@code null} if the value is not available (e.g., because * the field holder is not yet initialized). */ - JavaConstant readStableFieldValue(JavaField field, JavaConstant receiver, boolean isDefaultStable); + JavaConstant readStableFieldValue(ResolvedJavaField field, JavaConstant receiver, boolean isDefaultStable); /** * Converts the given {@link JavaKind#isPrimitive() primitive} constant to a boxed diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options.processor/src/META-INF/services/javax.annotation.processing.Processor b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options.processor/src/META-INF/services/javax.annotation.processing.Processor deleted file mode 100644 index 3aab30fa3c7..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options.processor/src/META-INF/services/javax.annotation.processing.Processor +++ /dev/null @@ -1 +0,0 @@ -jdk.vm.ci.options.processor.OptionProcessor diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options.processor/src/jdk/vm/ci/options/processor/OptionProcessor.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options.processor/src/jdk/vm/ci/options/processor/OptionProcessor.java deleted file mode 100644 index 95422c24135..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options.processor/src/jdk/vm/ci/options/processor/OptionProcessor.java +++ /dev/null @@ -1,369 +0,0 @@ -/* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.vm.ci.options.processor; - -import java.io.IOException; -import java.io.PrintWriter; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.annotation.processing.AbstractProcessor; -import javax.annotation.processing.Filer; -import javax.annotation.processing.RoundEnvironment; -import javax.annotation.processing.SupportedAnnotationTypes; -import javax.lang.model.SourceVersion; -import javax.lang.model.element.Element; -import javax.lang.model.element.ElementKind; -import javax.lang.model.element.Modifier; -import javax.lang.model.element.Name; -import javax.lang.model.element.PackageElement; -import javax.lang.model.element.TypeElement; -import javax.lang.model.element.VariableElement; -import javax.lang.model.type.DeclaredType; -import javax.lang.model.type.TypeKind; -import javax.lang.model.type.TypeMirror; -import javax.lang.model.util.Elements; -import javax.lang.model.util.Types; -import javax.tools.Diagnostic.Kind; -import javax.tools.JavaFileObject; - -import jdk.vm.ci.options.Option; -import jdk.vm.ci.options.OptionDescriptor; -import jdk.vm.ci.options.OptionDescriptors; -import jdk.vm.ci.options.OptionValue; - -/** - * Processes static fields annotated with {@link Option}. An {@link OptionDescriptors} - * implementation is generated for each top level class containing at least one such field. The name - * of the generated class for top level class {@code com.foo.Bar} is - * {@code com.foo.Bar_OptionDescriptors}. - */ -@SupportedAnnotationTypes({"jdk.vm.ci.options.Option"}) -public class OptionProcessor extends AbstractProcessor { - - @Override - public SourceVersion getSupportedSourceVersion() { - return SourceVersion.latest(); - } - - private final Set processed = new HashSet<>(); - - private void processElement(Element element, OptionsInfo info) { - - if (!element.getModifiers().contains(Modifier.STATIC)) { - processingEnv.getMessager().printMessage(Kind.ERROR, "Option field must be static", element); - return; - } - - Option annotation = element.getAnnotation(Option.class); - assert annotation != null; - assert element instanceof VariableElement; - assert element.getKind() == ElementKind.FIELD; - VariableElement field = (VariableElement) element; - String fieldName = field.getSimpleName().toString(); - - Elements elements = processingEnv.getElementUtils(); - Types types = processingEnv.getTypeUtils(); - - TypeMirror fieldType = field.asType(); - if (fieldType.getKind() != TypeKind.DECLARED) { - processingEnv.getMessager().printMessage(Kind.ERROR, "Option field must be of type " + OptionValue.class.getName(), element); - return; - } - DeclaredType declaredFieldType = (DeclaredType) fieldType; - - TypeMirror optionValueType = elements.getTypeElement(OptionValue.class.getName()).asType(); - if (!types.isSubtype(fieldType, types.erasure(optionValueType))) { - String msg = String.format("Option field type %s is not a subclass of %s", fieldType, optionValueType); - processingEnv.getMessager().printMessage(Kind.ERROR, msg, element); - return; - } - - if (!field.getModifiers().contains(Modifier.STATIC)) { - processingEnv.getMessager().printMessage(Kind.ERROR, "Option field must be static", element); - return; - } - - String help = annotation.help(); - if (help.length() != 0) { - char firstChar = help.charAt(0); - if (!Character.isUpperCase(firstChar)) { - processingEnv.getMessager().printMessage(Kind.ERROR, "Option help text must start with upper case letter", element); - return; - } - } - - String optionName = annotation.name(); - if (optionName.equals("")) { - optionName = fieldName; - } - - DeclaredType declaredOptionValueType = declaredFieldType; - while (!types.isSameType(types.erasure(declaredOptionValueType), types.erasure(optionValueType))) { - List directSupertypes = types.directSupertypes(declaredFieldType); - assert !directSupertypes.isEmpty(); - declaredOptionValueType = (DeclaredType) directSupertypes.get(0); - } - - assert !declaredOptionValueType.getTypeArguments().isEmpty(); - String optionType = declaredOptionValueType.getTypeArguments().get(0).toString(); - if (optionType.startsWith("java.lang.")) { - optionType = optionType.substring("java.lang.".length()); - } - - Element enclosing = element.getEnclosingElement(); - String declaringClass = ""; - String separator = ""; - Set originatingElementsList = info.originatingElements; - originatingElementsList.add(field); - while (enclosing != null) { - if (enclosing.getKind() == ElementKind.CLASS || enclosing.getKind() == ElementKind.INTERFACE) { - if (enclosing.getModifiers().contains(Modifier.PRIVATE)) { - String msg = String.format("Option field cannot be declared in a private %s %s", enclosing.getKind().name().toLowerCase(), enclosing); - processingEnv.getMessager().printMessage(Kind.ERROR, msg, element); - return; - } - originatingElementsList.add(enclosing); - declaringClass = enclosing.getSimpleName() + separator + declaringClass; - separator = "."; - } else { - assert enclosing.getKind() == ElementKind.PACKAGE; - } - enclosing = enclosing.getEnclosingElement(); - } - - info.options.add(new OptionInfo(optionName, help, optionType, declaringClass, field)); - } - - private void createFiles(OptionsInfo info) { - String pkg = ((PackageElement) info.topDeclaringType.getEnclosingElement()).getQualifiedName().toString(); - Name topDeclaringClass = info.topDeclaringType.getSimpleName(); - Element[] originatingElements = info.originatingElements.toArray(new Element[info.originatingElements.size()]); - - createOptionsDescriptorsFile(info, pkg, topDeclaringClass, originatingElements); - } - - private void createOptionsDescriptorsFile(OptionsInfo info, String pkg, Name topDeclaringClass, Element[] originatingElements) { - String optionsClassName = topDeclaringClass + "_" + OptionDescriptors.class.getSimpleName(); - - Filer filer = processingEnv.getFiler(); - try (PrintWriter out = createSourceFile(pkg, optionsClassName, filer, originatingElements)) { - - out.println("// CheckStyle: stop header check"); - out.println("// CheckStyle: stop line length check"); - out.println("// GENERATED CONTENT - DO NOT EDIT"); - out.println("// Source: " + topDeclaringClass + ".java"); - out.println("package " + pkg + ";"); - out.println(""); - out.println("import java.util.*;"); - out.println("import " + OptionDescriptors.class.getPackage().getName() + ".*;"); - out.println(""); - out.println("public class " + optionsClassName + " implements " + OptionDescriptors.class.getSimpleName() + " {"); - - String desc = OptionDescriptor.class.getSimpleName(); - - boolean needPrivateFieldAccessor = false; - int i = 0; - Collections.sort(info.options); - - out.println(" @Override"); - out.println(" public OptionDescriptor get(String value) {"); - out.println(" // CheckStyle: stop line length check"); - if (info.options.size() == 1) { - out.println(" if (value.equals(\"" + info.options.get(0).name + "\")) {"); - } else { - out.println(" switch (value) {"); - } - for (OptionInfo option : info.options) { - String name = option.name; - String optionValue; - if (option.field.getModifiers().contains(Modifier.PRIVATE)) { - needPrivateFieldAccessor = true; - optionValue = "field(" + option.declaringClass + ".class, \"" + option.field.getSimpleName() + "\")"; - } else { - optionValue = option.declaringClass + "." + option.field.getSimpleName(); - } - String type = option.type; - String help = option.help; - String declaringClass = option.declaringClass; - Name fieldName = option.field.getSimpleName(); - if (info.options.size() == 1) { - out.printf(" return %s.create(\"%s\", %s.class, \"%s\", %s.class, \"%s\", %s);\n", desc, name, type, help, declaringClass, fieldName, optionValue); - } else { - out.printf(" case \"" + name + "\": return %s.create(\"%s\", %s.class, \"%s\", %s.class, \"%s\", %s);\n", desc, name, type, help, declaringClass, fieldName, optionValue); - } - } - out.println(" }"); - out.println(" // CheckStyle: resume line length check"); - out.println(" return null;"); - out.println(" }"); - out.println(); - out.println(" @Override"); - out.println(" public Iterator<" + desc + "> iterator() {"); - out.println(" // CheckStyle: stop line length check"); - out.println(" List<" + desc + "> options = Arrays.asList("); - for (OptionInfo option : info.options) { - String optionValue; - if (option.field.getModifiers().contains(Modifier.PRIVATE)) { - needPrivateFieldAccessor = true; - optionValue = "field(" + option.declaringClass + ".class, \"" + option.field.getSimpleName() + "\")"; - } else { - optionValue = option.declaringClass + "." + option.field.getSimpleName(); - } - String name = option.name; - String type = option.type; - String help = option.help; - String declaringClass = option.declaringClass; - Name fieldName = option.field.getSimpleName(); - String comma = i == info.options.size() - 1 ? "" : ","; - out.printf(" %s.create(\"%s\", %s.class, \"%s\", %s.class, \"%s\", %s)%s\n", desc, name, type, help, declaringClass, fieldName, optionValue, comma); - i++; - } - out.println(" );"); - out.println(" // CheckStyle: resume line length check"); - out.println(" return options.iterator();"); - out.println(" }"); - if (needPrivateFieldAccessor) { - out.println(" private static " + OptionValue.class.getSimpleName() + " field(Class declaringClass, String fieldName) {"); - out.println(" try {"); - out.println(" java.lang.reflect.Field field = declaringClass.getDeclaredField(fieldName);"); - out.println(" field.setAccessible(true);"); - out.println(" return (" + OptionValue.class.getSimpleName() + ") field.get(null);"); - out.println(" } catch (Exception e) {"); - out.println(" throw (InternalError) new InternalError().initCause(e);"); - out.println(" }"); - out.println(" }"); - } - out.println("}"); - } - } - - protected PrintWriter createSourceFile(String pkg, String relativeName, Filer filer, Element... originatingElements) { - try { - // Ensure Unix line endings to comply with code style guide checked by Checkstyle - JavaFileObject sourceFile = filer.createSourceFile(pkg + "." + relativeName, originatingElements); - return new PrintWriter(sourceFile.openWriter()) { - - @Override - public void println() { - print("\n"); - } - }; - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - static class OptionInfo implements Comparable { - - final String name; - final String help; - final String type; - final String declaringClass; - final VariableElement field; - - public OptionInfo(String name, String help, String type, String declaringClass, VariableElement field) { - this.name = name; - this.help = help; - this.type = type; - this.declaringClass = declaringClass; - this.field = field; - } - - @Override - public int compareTo(OptionInfo other) { - return name.compareTo(other.name); - } - - @Override - public String toString() { - return declaringClass + "." + field; - } - } - - static class OptionsInfo { - - final Element topDeclaringType; - final List options = new ArrayList<>(); - final Set originatingElements = new HashSet<>(); - - public OptionsInfo(Element topDeclaringType) { - this.topDeclaringType = topDeclaringType; - } - } - - private static Element topDeclaringType(Element element) { - Element enclosing = element.getEnclosingElement(); - if (enclosing == null || enclosing.getKind() == ElementKind.PACKAGE) { - assert element.getKind() == ElementKind.CLASS || element.getKind() == ElementKind.INTERFACE; - return element; - } - return topDeclaringType(enclosing); - } - - @Override - public boolean process(Set annotations, RoundEnvironment roundEnv) { - if (roundEnv.processingOver()) { - return true; - } - - Map map = new HashMap<>(); - for (Element element : roundEnv.getElementsAnnotatedWith(Option.class)) { - if (!processed.contains(element)) { - processed.add(element); - Element topDeclaringType = topDeclaringType(element); - OptionsInfo options = map.get(topDeclaringType); - if (options == null) { - options = new OptionsInfo(topDeclaringType); - map.put(topDeclaringType, options); - } - processElement(element, options); - } - } - - boolean ok = true; - Map uniqueness = new HashMap<>(); - for (OptionsInfo info : map.values()) { - for (OptionInfo option : info.options) { - OptionInfo conflict = uniqueness.put(option.name, option); - if (conflict != null) { - processingEnv.getMessager().printMessage(Kind.ERROR, "Duplicate option names for " + option + " and " + conflict, option.field); - ok = false; - } - } - } - - if (ok) { - for (OptionsInfo info : map.values()) { - createFiles(info); - } - } - - return true; - } -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/DerivedOptionValue.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/DerivedOptionValue.java deleted file mode 100644 index e6149955c77..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/DerivedOptionValue.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.vm.ci.options; - -import java.io.Serializable; -import java.util.function.Supplier; - -import jdk.vm.ci.options.OptionValue.OverrideScope; - -/** - * A cached value that needs to be recomputed when an option changes. - */ -public class DerivedOptionValue { - - public interface OptionSupplier extends Supplier, Serializable { - } - - private final T initialValue; - private final OptionSupplier supplier; - - public DerivedOptionValue(OptionSupplier supplier) { - this.supplier = supplier; - assert OptionValue.getOverrideScope() == null : "derived option value should be initialized outside any override scope"; - this.initialValue = createValue(); - } - - public T getValue() { - OverrideScope overrideScope = OptionValue.getOverrideScope(); - if (overrideScope != null) { - return overrideScope.getDerived(this); - } else { - return initialValue; - } - } - - T createValue() { - return supplier.get(); - } -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/NestedBooleanOptionValue.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/NestedBooleanOptionValue.java deleted file mode 100644 index 804603814f1..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/NestedBooleanOptionValue.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.vm.ci.options; - -/** - * A nested Boolean {@link OptionValue} that can be overridden by a {@link #masterOption master - * option}. - *

- *

  • If the option is present on the command line the specified value is used. - *
  • Otherwise {@link #getValue()} depends on the {@link #masterOption} and evaluates as follows: - *
      - *
    • If {@link #masterOption} is set, this value equals to {@link #initialValue}. - *
    • Otherwise, if {@link #masterOption} is {@code false}, this option is {@code false}. - */ -public class NestedBooleanOptionValue extends OptionValue { - private final OptionValue masterOption; - private final Boolean initialValue; - - public NestedBooleanOptionValue(OptionValue masterOption, Boolean initialValue) { - super(null); - this.masterOption = masterOption; - this.initialValue = initialValue; - } - - public OptionValue getMasterOption() { - return masterOption; - } - - @Override - public Boolean getValue() { - Boolean v = super.getValue(); - if (v == null) { - return initialValue && masterOption.getValue(); - } - return v; - } - -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/Option.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/Option.java deleted file mode 100644 index 3e0537335d3..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/Option.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.vm.ci.options; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Describes the attributes of an option whose {@link OptionValue value} is in a static field - * annotated by this annotation type. - * - * @see OptionDescriptor - */ -@Retention(RetentionPolicy.CLASS) -@Target(ElementType.FIELD) -public @interface Option { - - /** - * Gets a help message for the option. New lines can be embedded in the message with - * {@code "%n"}. - */ - String help(); - - /** - * The name of the option. By default, the name of the annotated field should be used. - */ - String name() default ""; - - /** - * Specifies the type of the option. - */ - OptionType type() default OptionType.Debug; -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionDescriptor.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionDescriptor.java deleted file mode 100644 index b0bde8a71e0..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionDescriptor.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.vm.ci.options; - -/** - * Describes the attributes of a static field {@linkplain Option option} and provides access to its - * {@linkplain OptionValue value}. - */ -public final class OptionDescriptor { - - protected final String name; - protected final Class type; - protected final String help; - protected final OptionValue option; - protected final Class declaringClass; - protected final String fieldName; - - public static OptionDescriptor create(String name, Class type, String help, Class declaringClass, String fieldName, OptionValue option) { - OptionDescriptor result = option.getDescriptor(); - if (result == null) { - result = new OptionDescriptor(name, type, help, declaringClass, fieldName, option); - option.setDescriptor(result); - } - assert result.name.equals(name) && result.type == type && result.declaringClass == declaringClass && result.fieldName.equals(fieldName) && result.option == option; - return result; - } - - private OptionDescriptor(String name, Class type, String help, Class declaringClass, String fieldName, OptionValue option) { - this.name = name; - this.type = type; - this.help = help; - this.option = option; - this.declaringClass = declaringClass; - this.fieldName = fieldName; - assert !type.isPrimitive() : "must used boxed type instead of " + type; - } - - /** - * Gets the type of values stored in the option. This will be the boxed type for a primitive - * option. - */ - public Class getType() { - return type; - } - - /** - * Gets a descriptive help message for the option. - */ - public String getHelp() { - return help; - } - - /** - * Gets the name of the option. It's up to the client of this object how to use the name to get - * a user specified value for the option from the environment. - */ - public String getName() { - return name; - } - - /** - * Gets the boxed option value. - */ - public OptionValue getOptionValue() { - return option; - } - - public Class getDeclaringClass() { - return declaringClass; - } - - public String getFieldName() { - return fieldName; - } - - /** - * Gets a description of the location where this option is stored. - */ - public String getLocation() { - return getDeclaringClass().getName() + "." + getFieldName(); - } -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionDescriptors.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionDescriptors.java deleted file mode 100644 index a2aef68e95e..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionDescriptors.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.vm.ci.options; - -/** - * An interface to a set of {@link OptionDescriptor}s. - */ -public interface OptionDescriptors extends Iterable { - /** - * Gets the {@link OptionDescriptor} matching a given option name or {@code null} if this option - * descriptor set doesn't contain a matching option. - */ - OptionDescriptor get(String value); -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionType.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionType.java deleted file mode 100644 index d30ac8db430..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionType.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.vm.ci.options; - -/** - * Classifies JVMCI options in several categories depending on who this option is relevant for. - * - */ -public enum OptionType { - /** - * An option common for users to apply. - */ - User, - - /** - * An option only relevant in corner cases and for fine-tuning. - */ - Expert, - - /** - * An option only relevant when debugging the compiler. - */ - Debug -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionValue.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionValue.java deleted file mode 100644 index 6abcc91d936..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionValue.java +++ /dev/null @@ -1,484 +0,0 @@ -/* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.vm.ci.options; - -import java.io.PrintStream; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Objects; - -/** - * An option value. - */ -public class OptionValue { - /** - * Temporarily changes the value for an option. The {@linkplain OptionValue#getValue() value} of - * {@code option} is set to {@code value} until {@link OverrideScope#close()} is called on the - * object returned by this method. - *

      - * Since the returned object is {@link AutoCloseable} the try-with-resource construct can be - * used: - * - *

      -     * try (OverrideScope s = OptionValue.override(myOption, myValue) {
      -     *     // code that depends on myOption == myValue
      -     * }
      -     * 
      - */ - public static OverrideScope override(OptionValue option, Object value) { - OverrideScope current = getOverrideScope(); - if (current == null) { - if (!value.equals(option.getValue())) { - return new SingleOverrideScope(option, value); - } - Map, Object> overrides = Collections.emptyMap(); - return new MultipleOverridesScope(current, overrides); - } - return new MultipleOverridesScope(current, option, value); - } - - /** - * Temporarily changes the values for a set of options. The {@linkplain OptionValue#getValue() - * value} of each {@code option} in {@code overrides} is set to the corresponding {@code value} - * in {@code overrides} until {@link OverrideScope#close()} is called on the object returned by - * this method. - *

      - * Since the returned object is {@link AutoCloseable} the try-with-resource construct can be - * used: - * - *

      -     * Map<OptionValue, Object> overrides = new HashMap<>();
      -     * overrides.put(myOption1, myValue1);
      -     * overrides.put(myOption2, myValue2);
      -     * try (OverrideScope s = OptionValue.override(overrides) {
      -     *     // code that depends on myOption == myValue
      -     * }
      -     * 
      - */ - public static OverrideScope override(Map, Object> overrides) { - OverrideScope current = getOverrideScope(); - if (current == null && overrides.size() == 1) { - Entry, Object> single = overrides.entrySet().iterator().next(); - OptionValue option = single.getKey(); - Object overrideValue = single.getValue(); - if (!overrideValue.equals(option.getValue())) { - return new SingleOverrideScope(option, overrideValue); - } - } - return new MultipleOverridesScope(current, overrides); - } - - /** - * Temporarily changes the values for a set of options. The {@linkplain OptionValue#getValue() - * value} of each {@code option} in {@code overrides} is set to the corresponding {@code value} - * in {@code overrides} until {@link OverrideScope#close()} is called on the object returned by - * this method. - *

      - * Since the returned object is {@link AutoCloseable} the try-with-resource construct can be - * used: - * - *

      -     * try (OverrideScope s = OptionValue.override(myOption1, myValue1, myOption2, myValue2) {
      -     *     // code that depends on myOption == myValue
      -     * }
      -     * 
      - * - * @param overrides overrides in the form {@code [option1, override1, option2, override2, ...]} - */ - public static OverrideScope override(Object... overrides) { - OverrideScope current = getOverrideScope(); - if (current == null && overrides.length == 2) { - OptionValue option = (OptionValue) overrides[0]; - Object overrideValue = overrides[1]; - if (!overrideValue.equals(option.getValue())) { - return new SingleOverrideScope(option, overrideValue); - } - } - Map, Object> map = Collections.emptyMap(); - for (int i = 0; i < overrides.length; i += 2) { - OptionValue option = (OptionValue) overrides[i]; - Object overrideValue = overrides[i + 1]; - if (!overrideValue.equals(option.getValue())) { - if (map.isEmpty()) { - map = new HashMap<>(); - } - map.put(option, overrideValue); - } - } - return new MultipleOverridesScope(current, map); - } - - private static final ThreadLocal overrideScopeTL = new ThreadLocal<>(); - - protected static OverrideScope getOverrideScope() { - return overrideScopeTL.get(); - } - - protected static void setOverrideScope(OverrideScope overrideScope) { - overrideScopeTL.set(overrideScope); - } - - private T defaultValue; - - /** - * The raw option value. - */ - protected T value; - - private OptionDescriptor descriptor; - - private long reads; - private OptionValue next; - private static OptionValue head; - - private static final boolean ShowReadsHistogram = Boolean.getBoolean("jvmci.showOptionValueReadsHistogram"); - - private static void addToHistogram(OptionValue option) { - if (ShowReadsHistogram) { - synchronized (OptionValue.class) { - option.next = head; - head = option; - } - } - } - - @SuppressWarnings("unchecked") - public OptionValue(T value) { - this.defaultValue = value; - this.value = (T) DEFAULT; - addToHistogram(this); - } - - private static final Object DEFAULT = "DEFAULT"; - private static final Object UNINITIALIZED = "UNINITIALIZED"; - - /** - * Creates an uninitialized option value for a subclass that initializes itself - * {@link #defaultValue() lazily}. - */ - @SuppressWarnings("unchecked") - protected OptionValue() { - this.defaultValue = (T) UNINITIALIZED; - this.value = (T) DEFAULT; - addToHistogram(this); - } - - /** - * Lazy initialization of default value. - */ - protected T defaultValue() { - throw new InternalError("Option without a default value value must override defaultValue()"); - } - - /** - * Sets the descriptor for this option. - */ - public void setDescriptor(OptionDescriptor descriptor) { - assert this.descriptor == null : "Overwriting existing descriptor"; - this.descriptor = descriptor; - } - - /** - * Returns the descriptor for this option, if it has been set by - * {@link #setDescriptor(OptionDescriptor)}. - */ - public OptionDescriptor getDescriptor() { - return descriptor; - } - - /** - * Gets the name of this option. The name for an option value with a null - * {@linkplain #setDescriptor(OptionDescriptor) descriptor} is the value of - * {@link Object#toString()}. - */ - public String getName() { - return descriptor == null ? super.toString() : (descriptor.getDeclaringClass().getName() + "." + descriptor.getName()); - } - - @Override - public String toString() { - return getName() + "=" + getValue(); - } - - /** - * The initial value specified in source code. The returned value is not affected by calls to - * {@link #setValue(Object)} or registering {@link OverrideScope}s. Therefore, it is also not - * affected by options set on the command line. - */ - public T getDefaultValue() { - if (defaultValue == UNINITIALIZED) { - defaultValue = defaultValue(); - } - return defaultValue; - } - - /** - * Returns true if the option has the same value that was set in the source code. - */ - public boolean hasDefaultValue() { - if (!(this instanceof StableOptionValue)) { - getValue(); // ensure initialized - } - return value == DEFAULT || Objects.equals(value, getDefaultValue()); - } - - /** - * Gets the value of this option. - */ - public T getValue() { - if (ShowReadsHistogram) { - reads++; - } - if (!(this instanceof StableOptionValue)) { - OverrideScope overrideScope = getOverrideScope(); - if (overrideScope != null) { - T override = overrideScope.getOverride(this); - if (override != null) { - return override; - } - } - } - if (value != DEFAULT) { - return value; - } else { - return getDefaultValue(); - } - } - - /** - * Gets the values of this option including overridden values. - * - * @param c the collection to which the values are added. If null, one is allocated. - * @return the collection to which the values were added in order from most overridden to - * current value - */ - @SuppressWarnings("unchecked") - public Collection getValues(Collection c) { - Collection values = c == null ? new ArrayList<>() : c; - if (!(this instanceof StableOptionValue)) { - OverrideScope overrideScope = getOverrideScope(); - if (overrideScope != null) { - overrideScope.getOverrides(this, (Collection) values); - } - } - if (value != DEFAULT) { - values.add(value); - } else { - values.add(getDefaultValue()); - } - return values; - } - - /** - * Sets the value of this option. - */ - @SuppressWarnings("unchecked") - public void setValue(Object v) { - this.value = (T) v; - } - - /** - * An object whose {@link #close()} method reverts the option value overriding initiated by - * {@link OptionValue#override(OptionValue, Object)} or {@link OptionValue#override(Map)}. - */ - public abstract static class OverrideScope implements AutoCloseable { - - private Map, Object> derivedCache = null; - - public T getDerived(DerivedOptionValue key) { - if (derivedCache == null) { - derivedCache = new HashMap<>(); - } - @SuppressWarnings("unchecked") - T ret = (T) derivedCache.get(key); - if (ret == null) { - ret = key.createValue(); - derivedCache.put(key, ret); - } - return ret; - } - - abstract void addToInherited(Map, Object> inherited); - - abstract T getOverride(OptionValue option); - - abstract void getOverrides(OptionValue option, Collection c); - - public abstract void close(); - } - - static class SingleOverrideScope extends OverrideScope { - - private final OptionValue option; - private final Object value; - - public SingleOverrideScope(OptionValue option, Object value) { - if (option instanceof StableOptionValue) { - throw new IllegalArgumentException("Cannot override stable option " + option); - } - this.option = option; - this.value = value; - setOverrideScope(this); - } - - @Override - void addToInherited(Map, Object> inherited) { - inherited.put(option, value); - } - - @SuppressWarnings("unchecked") - @Override - T getOverride(OptionValue key) { - if (key == this.option) { - return (T) value; - } - return null; - } - - @Override - void getOverrides(OptionValue key, Collection c) { - if (key == this.option) { - c.add(value); - } - } - - @Override - public void close() { - setOverrideScope(null); - } - } - - static class MultipleOverridesScope extends OverrideScope { - final OverrideScope parent; - final Map, Object> overrides; - - public MultipleOverridesScope(OverrideScope parent, OptionValue option, Object value) { - this.parent = parent; - this.overrides = new HashMap<>(); - if (parent != null) { - parent.addToInherited(overrides); - } - if (option instanceof StableOptionValue) { - throw new IllegalArgumentException("Cannot override stable option " + option); - } - if (!value.equals(option.getValue())) { - this.overrides.put(option, value); - } - if (!overrides.isEmpty()) { - setOverrideScope(this); - } - } - - MultipleOverridesScope(OverrideScope parent, Map, Object> overrides) { - this.parent = parent; - if (overrides.isEmpty() && parent == null) { - this.overrides = Collections.emptyMap(); - return; - } - this.overrides = new HashMap<>(); - if (parent != null) { - parent.addToInherited(this.overrides); - } - for (Map.Entry, Object> e : overrides.entrySet()) { - OptionValue option = e.getKey(); - if (option instanceof StableOptionValue) { - throw new IllegalArgumentException("Cannot override stable option " + option); - } - if (!e.getValue().equals(option.getValue())) { - this.overrides.put(option, e.getValue()); - } - } - if (!this.overrides.isEmpty()) { - setOverrideScope(this); - } - } - - @Override - void addToInherited(Map, Object> inherited) { - if (parent != null) { - parent.addToInherited(inherited); - } - inherited.putAll(overrides); - } - - @SuppressWarnings("unchecked") - @Override - T getOverride(OptionValue option) { - return (T) overrides.get(option); - } - - @Override - void getOverrides(OptionValue option, Collection c) { - Object v = overrides.get(option); - if (v != null) { - c.add(v); - } - if (parent != null) { - parent.getOverrides(option, c); - } - } - - @Override - public void close() { - if (!overrides.isEmpty()) { - setOverrideScope(parent); - } - } - } - - static { - if (ShowReadsHistogram) { - Runtime.getRuntime().addShutdownHook(new Thread() { - @Override - public void run() { - ArrayList> options = new ArrayList<>(); - for (OptionValue option = head; option != null; option = option.next) { - options.add(option); - } - Collections.sort(options, new Comparator>() { - - public int compare(OptionValue o1, OptionValue o2) { - if (o1.reads < o2.reads) { - return -1; - } else if (o1.reads > o2.reads) { - return 1; - } else { - return o1.getName().compareTo(o2.getName()); - } - } - }); - PrintStream out = System.out; - out.println("=== OptionValue reads histogram ==="); - for (OptionValue option : options) { - out.println(option.reads + "\t" + option); - } - } - }); - } - } -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionsLoader.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionsLoader.java deleted file mode 100644 index a01a05d040e..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionsLoader.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.vm.ci.options; - -import java.util.ServiceLoader; -import java.util.SortedMap; -import java.util.TreeMap; - -/** - * Helper class used to load option descriptors. Only to be used in the slow-path. - */ -public class OptionsLoader { - public static final SortedMap options = new TreeMap<>(); - - /** - * Initializes {@link #options} from {@link Options} services. - */ - static { - for (OptionDescriptors opts : ServiceLoader.load(OptionDescriptors.class, OptionsLoader.class.getClassLoader())) { - for (OptionDescriptor desc : opts) { - String name = desc.getName(); - OptionDescriptor existing = options.put(name, desc); - assert existing == null : "Option named \"" + name + "\" has multiple definitions: " + existing.getLocation() + " and " + desc.getLocation(); - } - } - } -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionsParser.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionsParser.java deleted file mode 100644 index 0b8a6411181..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/OptionsParser.java +++ /dev/null @@ -1,382 +0,0 @@ -/* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.vm.ci.options; - -import static jdk.vm.ci.inittimer.InitTimer.timer; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.io.PrintStream; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Formatter; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.ServiceLoader; -import java.util.Set; -import java.util.SortedMap; - -import jdk.vm.ci.inittimer.InitTimer; - -/** - * This class contains methods for parsing JVMCI options and matching them against a set of - * {@link OptionDescriptors}. The {@link OptionDescriptors} are loaded via a {@link ServiceLoader}. - */ -public class OptionsParser { - - private static final OptionValue PrintFlags = new OptionValue<>(false); - private static final OptionValue ShowFlags = new OptionValue<>(false); - - /** - * A service for looking up {@link OptionDescriptor}s. - */ - public interface OptionDescriptorsProvider { - /** - * Gets the {@link OptionDescriptor} matching a given option {@linkplain Option#name() name} - * or null if no option of that name is provided by this object. - */ - OptionDescriptor get(String name); - } - - public interface OptionConsumer { - void set(OptionDescriptor desc, Object value); - } - - /** - * Parses the options in {@code /lib/jvmci.options} if {@code parseOptionsFile == true} and - * the file exists followed by the JVMCI options in {@code options} if {@code options != null}. - * - * Called from VM. This method has an object return type to allow it to be called with a VM - * utility function used to call other static initialization methods. - * - * @param options JVMCI options as serialized (name, value) pairs - * @param parseOptionsFile specifies whether to look for and parse - * {@code /lib/jvmci.options} - */ - @SuppressWarnings("try") - public static Boolean parseOptionsFromVM(String[] options, boolean parseOptionsFile) { - - try (InitTimer t = timer("ParseOptions")) { - - if (parseOptionsFile) { - File javaHome = new File(System.getProperty("java.home")); - File lib = new File(javaHome, "lib"); - File jvmciOptions = new File(lib, "jvmci.options"); - if (jvmciOptions.exists()) { - try (BufferedReader br = new BufferedReader(new FileReader(jvmciOptions))) { - String optionSetting = null; - int lineNo = 1; - List optionSettings = new ArrayList<>(); - while ((optionSetting = br.readLine()) != null) { - if (!optionSetting.isEmpty() && optionSetting.charAt(0) != '#') { - try { - parseOptionSettingTo(optionSetting, optionSettings); - } catch (Throwable e) { - throw new InternalError("Error parsing " + jvmciOptions + ", line " + lineNo, e); - } - } - lineNo++; - } - try { - parseOptions(optionSettings.toArray(new String[optionSettings.size()]), null, null, null); - } catch (Throwable e) { - throw new InternalError("Error parsing an option from " + jvmciOptions, e); - } - } catch (IOException e) { - throw new InternalError("Error reading " + jvmciOptions, e); - } - } - } - - parseOptions(options, null, null, null); - } - return Boolean.TRUE; - } - - /** - * Parses an ordered list of (name, value) pairs assigning values to JVMCI options. - * - * @param optionSettings JVMCI options as serialized (name, value) pairs - * @param setter the object to notify of the parsed option and value - * @param odp if non-null, the service to use for looking up {@link OptionDescriptor}s - * @param options the options database to use if {@code odp == null}. If - * {@code options == null && odp == null}, {@link OptionsLoader#options} is used. - * @throws IllegalArgumentException if there's a problem parsing {@code option} - */ - public static void parseOptions(String[] optionSettings, OptionConsumer setter, OptionDescriptorsProvider odp, SortedMap options) { - if (optionSettings != null && optionSettings.length != 0) { - assert optionSettings.length % 2 == 0; - - moveHelpFlagsToTail(optionSettings); - - for (int i = 0; i < optionSettings.length / 2; i++) { - String name = optionSettings[i * 2]; - String value = optionSettings[i * 2 + 1]; - parseOption(name, value, setter, odp, options); - } - if (PrintFlags.getValue() || ShowFlags.getValue()) { - Set explicitlyAssigned = new HashSet<>(optionSettings.length / 2); - for (int i = 0; i < optionSettings.length / 2; i++) { - String name = optionSettings[i * 2]; - explicitlyAssigned.add(name); - } - printFlags(resolveOptions(options), "JVMCI", System.out, explicitlyAssigned); - if (PrintFlags.getValue()) { - System.exit(0); - } - } - } - } - - /** - * Moves all {@code PrintFlags} and {@code ShowFlags} option settings to the back of - * {@code optionSettings}. This allows the help message to show which options had their value - * explicitly set (even if to their default value). - */ - private static void moveHelpFlagsToTail(String[] optionSettings) { - List tail = null; - int insert = 0; - for (int i = 0; i < optionSettings.length / 2; i++) { - String name = optionSettings[i * 2]; - String value = optionSettings[i * 2 + 1]; - if (name.equals("ShowFlags") || name.equals("PrintFlags")) { - if (tail == null) { - tail = new ArrayList<>(4); - insert = i * 2; - } - tail.add(name); - tail.add(value); - } else if (tail != null) { - optionSettings[insert++] = name; - optionSettings[insert++] = value; - } - } - if (tail != null) { - assert tail.size() + insert == optionSettings.length; - String[] tailArr = tail.toArray(new String[tail.size()]); - System.arraycopy(tailArr, 0, optionSettings, insert, tailArr.length); - } - } - - /** - * Parses a given option setting string to a list of (name, value) pairs. - * - * @param optionSetting a string matching the pattern {@code =} - */ - public static void parseOptionSettingTo(String optionSetting, List dst) { - int eqIndex = optionSetting.indexOf('='); - if (eqIndex == -1) { - throw new InternalError("Option setting has does not match the pattern =: " + optionSetting); - } - dst.add(optionSetting.substring(0, eqIndex)); - dst.add(optionSetting.substring(eqIndex + 1)); - } - - /** - * Resolves {@code options} to a non-null value. This ensures {@link OptionsLoader#options} is - * only loaded if necessary. - */ - private static SortedMap resolveOptions(SortedMap options) { - return options != null ? options : OptionsLoader.options; - } - - /** - * Parses a given option name and value. - * - * @param name the option name - * @param valueString the option value as a string - * @param setter the object to notify of the parsed option and value - * @param odp if non-null, the service to use for looking up {@link OptionDescriptor}s - * @param options the options database to use if {@code odp == null}. If - * {@code options == null && odp == null}, {@link OptionsLoader#options} is used. - * @throws IllegalArgumentException if there's a problem parsing {@code option} - */ - private static void parseOption(String name, String valueString, OptionConsumer setter, OptionDescriptorsProvider odp, SortedMap options) { - - OptionDescriptor desc = odp != null ? odp.get(name) : resolveOptions(options).get(name); - if (desc == null) { - if (name.equals("PrintFlags")) { - desc = OptionDescriptor.create("PrintFlags", Boolean.class, "Prints all JVMCI flags and exits", OptionsParser.class, "PrintFlags", PrintFlags); - } else if (name.equals("ShowFlags")) { - desc = OptionDescriptor.create("ShowFlags", Boolean.class, "Prints all JVMCI flags and continues", OptionsParser.class, "ShowFlags", ShowFlags); - } - } - if (desc == null) { - List matches = fuzzyMatch(resolveOptions(options), name); - Formatter msg = new Formatter(); - msg.format("Could not find option %s", name); - if (!matches.isEmpty()) { - msg.format("%nDid you mean one of the following?"); - for (OptionDescriptor match : matches) { - msg.format("%n %s=", match.getName()); - } - } - throw new IllegalArgumentException(msg.toString()); - } - - Class optionType = desc.getType(); - Object value; - if (optionType == Boolean.class) { - if ("true".equals(valueString)) { - value = Boolean.TRUE; - } else if ("false".equals(valueString)) { - value = Boolean.FALSE; - } else { - throw new IllegalArgumentException("Boolean option '" + name + "' must have value \"true\" or \"false\", not \"" + valueString + "\""); - } - } else if (optionType == Float.class) { - value = Float.parseFloat(valueString); - } else if (optionType == Double.class) { - value = Double.parseDouble(valueString); - } else if (optionType == Integer.class) { - value = Integer.valueOf((int) parseLong(valueString)); - } else if (optionType == Long.class) { - value = Long.valueOf(parseLong(valueString)); - } else if (optionType == String.class) { - value = valueString; - } else { - throw new IllegalArgumentException("Wrong value for option '" + name + "'"); - } - if (setter == null) { - desc.getOptionValue().setValue(value); - } else { - setter.set(desc, value); - } - } - - private static long parseLong(String v) { - String valueString = v.toLowerCase(); - long scale = 1; - if (valueString.endsWith("k")) { - scale = 1024L; - } else if (valueString.endsWith("m")) { - scale = 1024L * 1024L; - } else if (valueString.endsWith("g")) { - scale = 1024L * 1024L * 1024L; - } else if (valueString.endsWith("t")) { - scale = 1024L * 1024L * 1024L * 1024L; - } - - if (scale != 1) { - /* Remove trailing scale character. */ - valueString = valueString.substring(0, valueString.length() - 1); - } - - return Long.parseLong(valueString) * scale; - } - - /** - * Wraps some given text to one or more lines of a given maximum width. - * - * @param text text to wrap - * @param width maximum width of an output line, exception for words in {@code text} longer than - * this value - * @return {@code text} broken into lines - */ - private static List wrap(String text, int width) { - List lines = Collections.singletonList(text); - if (text.length() > width) { - String[] chunks = text.split("\\s+"); - lines = new ArrayList<>(); - StringBuilder line = new StringBuilder(); - for (String chunk : chunks) { - if (line.length() + chunk.length() > width) { - lines.add(line.toString()); - line.setLength(0); - } - if (line.length() != 0) { - line.append(' '); - } - String[] embeddedLines = chunk.split("%n", -2); - if (embeddedLines.length == 1) { - line.append(chunk); - } else { - for (int i = 0; i < embeddedLines.length; i++) { - line.append(embeddedLines[i]); - if (i < embeddedLines.length - 1) { - lines.add(line.toString()); - line.setLength(0); - } - } - } - } - if (line.length() != 0) { - lines.add(line.toString()); - } - } - return lines; - } - - private static void printFlags(SortedMap sortedOptions, String prefix, PrintStream out, Set explicitlyAssigned) { - out.println("[List of " + prefix + " options]"); - for (Map.Entry e : sortedOptions.entrySet()) { - e.getKey(); - OptionDescriptor desc = e.getValue(); - Object value = desc.getOptionValue().getValue(); - List helpLines = wrap(desc.getHelp(), 70); - String name = e.getKey(); - String assign = explicitlyAssigned.contains(name) ? ":=" : " ="; - out.printf("%9s %-40s %s %-14s %s%n", desc.getType().getSimpleName(), name, assign, value, helpLines.get(0)); - for (int i = 1; i < helpLines.size(); i++) { - out.printf("%67s %s%n", " ", helpLines.get(i)); - } - } - } - - /** - * Compute string similarity based on Dice's coefficient. - * - * Ported from str_similar() in globals.cpp. - */ - static float stringSimiliarity(String str1, String str2) { - int hit = 0; - for (int i = 0; i < str1.length() - 1; ++i) { - for (int j = 0; j < str2.length() - 1; ++j) { - if ((str1.charAt(i) == str2.charAt(j)) && (str1.charAt(i + 1) == str2.charAt(j + 1))) { - ++hit; - break; - } - } - } - return 2.0f * hit / (str1.length() + str2.length()); - } - - private static final float FUZZY_MATCH_THRESHOLD = 0.7F; - - /** - * Returns the set of options that fuzzy match a given option name. - */ - private static List fuzzyMatch(SortedMap options, String optionName) { - List matches = new ArrayList<>(); - for (Map.Entry e : options.entrySet()) { - float score = stringSimiliarity(e.getKey(), optionName); - if (score >= FUZZY_MATCH_THRESHOLD) { - matches.add(e.getValue()); - } - } - return matches; - } -} diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/StableOptionValue.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/StableOptionValue.java deleted file mode 100644 index 533e5002b47..00000000000 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.options/src/jdk/vm/ci/options/StableOptionValue.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.vm.ci.options; - -/** - * An option that always returns the same {@linkplain #getValue() value}. - */ -public class StableOptionValue extends OptionValue { - - /** - * Creates a stable option value. - */ - public StableOptionValue(T value) { - super(value); - } - - /** - * Used to assert the invariant for stability. Without using locks, this check is not safe - * against races and so it's only an assertion. - */ - private boolean getValueCalled; - - /** - * Creates an uninitialized stable option value for a subclass that initializes itself - * {@link #defaultValue() lazily}. - */ - public StableOptionValue() { - } - - /** - * Gets the value of this option. - */ - @Override - public final T getValue() { - T result = super.getValue(); - assert initGetValueCalled(); - return result; - } - - private boolean initGetValueCalled() { - getValueCalled = true; - return true; - } - - /** - * {@inheritDoc} - *

      - * This must only be called if {@link #getValue()} has never been called. - */ - @Override - public final void setValue(Object v) { - assert !getValueCalled; - super.setValue(v); - } -} diff --git a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp index 54b2e75697a..52e517324a0 100644 --- a/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp +++ b/hotspot/src/share/vm/jvmci/jvmciRuntime.cpp @@ -50,15 +50,10 @@ jobject JVMCIRuntime::_HotSpotJVMCIRuntime_instance = NULL; bool JVMCIRuntime::_HotSpotJVMCIRuntime_initialized = false; bool JVMCIRuntime::_well_known_classes_initialized = false; const char* JVMCIRuntime::_compiler = NULL; -int JVMCIRuntime::_options_count = 0; -SystemProperty** JVMCIRuntime::_options = NULL; int JVMCIRuntime::_trivial_prefixes_count = 0; char** JVMCIRuntime::_trivial_prefixes = NULL; bool JVMCIRuntime::_shutdown_called = false; -static const char* OPTION_PREFIX = "jvmci.option."; -static const size_t OPTION_PREFIX_LEN = strlen(OPTION_PREFIX); - BasicType JVMCIRuntime::kindToBasicType(Handle kind, TRAPS) { if (kind.is_null()) { THROW_(vmSymbols::java_lang_NullPointerException(), T_ILLEGAL); @@ -631,16 +626,6 @@ Handle JVMCIRuntime::callStatic(const char* className, const char* methodName, c return Handle((oop)result.get_jobject()); } -static bool jvmci_options_file_exists() { - const char* home = Arguments::get_java_home(); - size_t path_len = strlen(home) + strlen("/lib/jvmci.options") + 1; - char path[JVM_MAXPATHLEN]; - char sep = os::file_separator()[0]; - jio_snprintf(path, JVM_MAXPATHLEN, "%s%clib%cjvmci.options", home, sep, sep); - struct stat st; - return os::stat(path, &st) == 0; -} - void JVMCIRuntime::initialize_HotSpotJVMCIRuntime(TRAPS) { if (JNIHandles::resolve(_HotSpotJVMCIRuntime_instance) == NULL) { #ifdef ASSERT @@ -652,30 +637,6 @@ void JVMCIRuntime::initialize_HotSpotJVMCIRuntime(TRAPS) { "HotSpotJVMCIRuntime initialization should only be triggered through JVMCI initialization"); #endif - bool parseOptionsFile = jvmci_options_file_exists(); - if (_options != NULL || parseOptionsFile) { - JavaCallArguments args; - objArrayOop options; - if (_options != NULL) { - options = oopFactory::new_objArray(SystemDictionary::String_klass(), _options_count * 2, CHECK); - for (int i = 0; i < _options_count; i++) { - SystemProperty* prop = _options[i]; - oop name = java_lang_String::create_oop_from_str(prop->key() + OPTION_PREFIX_LEN, CHECK); - const char* prop_value = prop->value() != NULL ? prop->value() : ""; - oop value = java_lang_String::create_oop_from_str(prop_value, CHECK); - options->obj_at_put(i * 2, name); - options->obj_at_put((i * 2) + 1, value); - } - } else { - options = NULL; - } - args.push_oop(options); - args.push_int(parseOptionsFile); - callStatic("jdk/vm/ci/options/OptionsParser", - "parseOptionsFromVM", - "([Ljava/lang/String;Z)Ljava/lang/Boolean;", &args, CHECK); - } - if (_compiler != NULL) { JavaCallArguments args; oop compiler = java_lang_String::create_oop_from_str(_compiler, CHECK); @@ -893,48 +854,6 @@ void JVMCIRuntime::save_compiler(const char* compiler) { _compiler = compiler; } -void JVMCIRuntime::maybe_print_flags(TRAPS) { - if (_options != NULL) { - for (int i = 0; i < _options_count; i++) { - SystemProperty* p = _options[i]; - const char* name = p->key() + OPTION_PREFIX_LEN; - if (strcmp(name, "PrintFlags") == 0 || strcmp(name, "ShowFlags") == 0) { - JVMCIRuntime::initialize_well_known_classes(CHECK); - HandleMark hm; - ResourceMark rm; - JVMCIRuntime::get_HotSpotJVMCIRuntime(CHECK); - return; - } - } - } -} - -void JVMCIRuntime::save_options(SystemProperty* props) { - int count = 0; - SystemProperty* first = NULL; - for (SystemProperty* p = props; p != NULL; p = p->next()) { - if (strncmp(p->key(), OPTION_PREFIX, OPTION_PREFIX_LEN) == 0) { - if (first == NULL) { - first = p; - } - count++; - } - } - if (count != 0) { - _options_count = count; - _options = NEW_C_HEAP_ARRAY(SystemProperty*, count, mtCompiler); - _options[0] = first; - SystemProperty** insert_pos = _options + 1; - for (SystemProperty* p = first->next(); p != NULL; p = p->next()) { - if (strncmp(p->key(), OPTION_PREFIX, OPTION_PREFIX_LEN) == 0) { - *insert_pos = p; - insert_pos++; - } - } - assert (insert_pos - _options == count, "must be"); - } -} - void JVMCIRuntime::shutdown(TRAPS) { if (_HotSpotJVMCIRuntime_instance != NULL) { _shutdown_called = true; diff --git a/hotspot/src/share/vm/jvmci/jvmciRuntime.hpp b/hotspot/src/share/vm/jvmci/jvmciRuntime.hpp index 43ee0ad72a8..17476d65af9 100644 --- a/hotspot/src/share/vm/jvmci/jvmciRuntime.hpp +++ b/hotspot/src/share/vm/jvmci/jvmciRuntime.hpp @@ -71,8 +71,6 @@ class JVMCIRuntime: public AllStatic { static bool _HotSpotJVMCIRuntime_initialized; static bool _well_known_classes_initialized; static const char* _compiler; - static int _options_count; - static SystemProperty** _options; static int _trivial_prefixes_count; static char** _trivial_prefixes; @@ -99,20 +97,6 @@ class JVMCIRuntime: public AllStatic { */ static void save_compiler(const char* compiler); - /** - * Saves the value of the system properties starting with "jvmci.option." for processing - * when JVMCI is initialized. - * - * @param props the head of the system property list - */ - static void save_options(SystemProperty* props); - - /** - * If either the PrintFlags or ShowFlags JVMCI option is present, - * then JVMCI is initialized to show the help message. - */ - static void maybe_print_flags(TRAPS); - static bool is_HotSpotJVMCIRuntime_initialized() { return _HotSpotJVMCIRuntime_initialized; } /** diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index 285e9e228e7..f6acf542974 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -3344,12 +3344,6 @@ jint Arguments::finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_req const char* fileSep = os::file_separator(); sprintf(path, "%s%slib%sendorsed", Arguments::get_java_home(), fileSep, fileSep); -#if INCLUDE_JVMCI - if (EnableJVMCI) { - JVMCIRuntime::save_options(_system_properties); - } -#endif // INCLUDE_JVMCI - if (CheckEndorsedAndExtDirs) { int nonEmptyDirs = 0; // check endorsed directory diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index 93d964c9bf0..77df406818a 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -3657,7 +3657,6 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) { if (jvmciCompiler != NULL) { JVMCIRuntime::save_compiler(jvmciCompiler); } - JVMCIRuntime::maybe_print_flags(CHECK_JNI_ERR); } #endif // INCLUDE_JVMCI diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/NestedBooleanOptionValueTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/NestedBooleanOptionValueTest.java deleted file mode 100644 index 2da9725c0ae..00000000000 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/NestedBooleanOptionValueTest.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/** - * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") - * @run junit jdk.vm.ci.options.test.NestedBooleanOptionValueTest - */ - -package jdk.vm.ci.options.test; - -import static jdk.vm.ci.options.test.NestedBooleanOptionValueTest.Options.Master0; -import static jdk.vm.ci.options.test.NestedBooleanOptionValueTest.Options.Master1; -import static jdk.vm.ci.options.test.NestedBooleanOptionValueTest.Options.Master2; -import static jdk.vm.ci.options.test.NestedBooleanOptionValueTest.Options.NestedOption0; -import static jdk.vm.ci.options.test.NestedBooleanOptionValueTest.Options.NestedOption1; -import static jdk.vm.ci.options.test.NestedBooleanOptionValueTest.Options.NestedOption2; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import jdk.vm.ci.options.NestedBooleanOptionValue; -import jdk.vm.ci.options.OptionDescriptor; -import jdk.vm.ci.options.OptionValue; -import jdk.vm.ci.options.OptionValue.OverrideScope; - -import org.junit.Test; - -public class NestedBooleanOptionValueTest { - - public static class Options { - public static final OptionValue Master0 = new OptionValue<>(true); - public static final OptionValue NestedOption0 = new NestedBooleanOptionValue(Master0, true); - public static final OptionValue Master1 = new OptionValue<>(true); - public static final OptionValue NestedOption1 = new NestedBooleanOptionValue(Master1, true); - public static final OptionValue Master2 = new OptionValue<>(true); - public static final OptionValue NestedOption2 = new NestedBooleanOptionValue(Master2, false); - } - - static final OptionDescriptor master0 = OptionDescriptor.create("Master0", Boolean.class, "", Options.class, "Master0", Master0); - static final OptionDescriptor nestedOption0 = OptionDescriptor.create("NestedOption0", Boolean.class, "", Options.class, "NestedOption0", NestedOption0); - static final OptionDescriptor master1 = OptionDescriptor.create("Master1", Boolean.class, "", Options.class, "Master1", Master1); - static final OptionDescriptor nestedOption1 = OptionDescriptor.create("NestedOption1", Boolean.class, "", Options.class, "NestedOption1", NestedOption1); - static final OptionDescriptor master2 = OptionDescriptor.create("Master2", Boolean.class, "", Options.class, "Master2", Master2); - static final OptionDescriptor nestedOption2 = OptionDescriptor.create("NestedOption2", Boolean.class, "", Options.class, "NestedOption2", NestedOption2); - - @SuppressWarnings("try") - @Test - public void runOverrides() { - assertTrue(Master0.getValue()); - assertTrue(NestedOption0.getValue()); - try (OverrideScope s1 = OptionValue.override(Master0, false)) { - assertFalse(Master0.getValue()); - assertFalse(NestedOption0.getValue()); - try (OverrideScope s2 = OptionValue.override(NestedOption0, false)) { - assertFalse(NestedOption0.getValue()); - } - try (OverrideScope s2 = OptionValue.override(NestedOption0, true)) { - assertTrue(NestedOption0.getValue()); - } - } - assertTrue(Master0.getValue()); - try (OverrideScope s1 = OptionValue.override(NestedOption0, false)) { - assertFalse(NestedOption0.getValue()); - } - try (OverrideScope s1 = OptionValue.override(NestedOption0, true)) { - assertTrue(NestedOption0.getValue()); - } - } - - @Test - public void runDefaultTrue() { - Master1.setValue(true); - assertTrue(Master1.getValue()); - assertTrue(NestedOption1.getValue()); - // nested value unset - Master1.setValue(false); - assertFalse(Master1.getValue()); - assertFalse(NestedOption1.getValue()); - // set false - Master1.setValue(false); - NestedOption1.setValue(false); - assertFalse(Master1.getValue()); - assertFalse(NestedOption1.getValue()); - Master1.setValue(true); - assertTrue(Master1.getValue()); - assertFalse(NestedOption1.getValue()); - // set true - Master1.setValue(false); - NestedOption1.setValue(true); - assertFalse(Master1.getValue()); - assertTrue(NestedOption1.getValue()); - Master1.setValue(true); - assertTrue(Master1.getValue()); - assertTrue(NestedOption1.getValue()); - } - - @Test - public void runDefaultFalse() { - Master2.setValue(true); - assertTrue(Master2.getValue()); - assertFalse(NestedOption2.getValue()); - // nested value unset - Master2.setValue(false); - assertFalse(Master2.getValue()); - assertFalse(NestedOption2.getValue()); - // set false - Master2.setValue(false); - NestedOption2.setValue(false); - assertFalse(Master2.getValue()); - assertFalse(NestedOption2.getValue()); - Master2.setValue(true); - assertTrue(Master2.getValue()); - assertFalse(NestedOption2.getValue()); - // set true - Master2.setValue(false); - NestedOption2.setValue(true); - assertFalse(Master2.getValue()); - assertTrue(NestedOption2.getValue()); - Master2.setValue(true); - assertTrue(Master2.getValue()); - assertTrue(NestedOption2.getValue()); - } - -} diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/TestOptionValue.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/TestOptionValue.java deleted file mode 100644 index 0f9d23d5a50..00000000000 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.options.test/src/jdk/vm/ci/options/test/TestOptionValue.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/** - * @test - * @requires (os.simpleArch == "x64" | os.simpleArch == "sparcv9" | os.simpleArch == "aarch64") - * @run junit jdk.vm.ci.options.test.TestOptionValue - */ - -package jdk.vm.ci.options.test; - -import static jdk.vm.ci.options.test.TestOptionValue.Options.Mutable; -import static jdk.vm.ci.options.test.TestOptionValue.Options.SecondMutable; -import static jdk.vm.ci.options.test.TestOptionValue.Options.Stable; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - -import java.util.Arrays; - -import jdk.vm.ci.options.OptionDescriptor; -import jdk.vm.ci.options.OptionValue; -import jdk.vm.ci.options.OptionValue.OverrideScope; -import jdk.vm.ci.options.StableOptionValue; - -import org.junit.Test; - -@SuppressWarnings("try") -public class TestOptionValue { - - public static class Options { - public static final OptionValue Stable = new StableOptionValue<>(true); - public static final OptionValue Mutable = new OptionValue<>("original"); - public static final OptionValue SecondMutable = new OptionValue<>("second"); - } - - static final OptionDescriptor stable = OptionDescriptor.create("Stable", Boolean.class, "", Options.class, "Stable", Stable); - static final OptionDescriptor mutable = OptionDescriptor.create("Mutable", String.class, "", Options.class, "Mutable", Mutable); - static final OptionDescriptor secondMutable = OptionDescriptor.create("SecondMutable", String.class, "", Options.class, "SecondMutable", SecondMutable); - - @Test - public void testMutable() { - assertEquals("original", Mutable.getValue()); - try (OverrideScope s1 = OptionValue.override(Mutable, "override1")) { - assertEquals("override1", Mutable.getValue()); - try (OverrideScope s2 = OptionValue.override(Mutable, "override2")) { - assertEquals("override2", Mutable.getValue()); - } - assertEquals("override1", Mutable.getValue()); - try (OverrideScope s3 = OptionValue.override(Mutable, "override3")) { - assertEquals("override3", Mutable.getValue()); - } - assertEquals("override1", Mutable.getValue()); - } - assertEquals("original", Mutable.getValue()); - try (OverrideScope s1 = OptionValue.override(Mutable, "original")) { - assertEquals("original", Mutable.getValue()); - } - } - - @Test - public void testMultiple() { - assertEquals("original", Mutable.getValue()); - assertEquals("second", SecondMutable.getValue()); - try (OverrideScope s1 = OptionValue.override(Mutable, "override1", SecondMutable, "secondOverride1")) { - assertEquals("override1", Mutable.getValue()); - assertEquals("secondOverride1", SecondMutable.getValue()); - try (OverrideScope s2 = OptionValue.override(Mutable, "override2", SecondMutable, "secondOverride2")) { - assertEquals("override2", Mutable.getValue()); - assertEquals("secondOverride2", SecondMutable.getValue()); - } - assertEquals("override1", Mutable.getValue()); - assertEquals("secondOverride1", SecondMutable.getValue()); - try (OverrideScope s3 = OptionValue.override(Mutable, "override3", SecondMutable, "secondOverride3")) { - assertEquals("override3", Mutable.getValue()); - assertEquals("secondOverride3", SecondMutable.getValue()); - } - assertEquals("override1", Mutable.getValue()); - assertEquals("secondOverride1", SecondMutable.getValue()); - } - assertEquals("original", Mutable.getValue()); - assertEquals("second", SecondMutable.getValue()); - try (OverrideScope s1 = OptionValue.override(Mutable, "original", SecondMutable, "second")) { - assertEquals("original", Mutable.getValue()); - assertEquals("second", SecondMutable.getValue()); - } - } - - @Test - public void testStable() { - assertTrue(Stable.getValue()); - try (OverrideScope s = OptionValue.override(Stable, false)) { - fail("cannot override stable option"); - } catch (IllegalArgumentException e) { - // expected - } - } - - @Test - public void toStringTest() { - assertEquals("jdk.vm.ci.options.test.TestOptionValue$Options.Mutable=original", Mutable.toString()); - try (OverrideScope s1 = OptionValue.override(Mutable, "override1")) { - assertEquals("jdk.vm.ci.options.test.TestOptionValue$Options.Mutable=override1", Mutable.toString()); - try (OverrideScope s2 = OptionValue.override(Mutable, "override2")) { - assertEquals("jdk.vm.ci.options.test.TestOptionValue$Options.Mutable=override2", Mutable.toString()); - } - } - } - - @Test - public void getValuesTest() { - assertEquals(Arrays.asList("original"), Mutable.getValues(null)); - assertEquals(Arrays.asList(true), Stable.getValues(null)); - try (OverrideScope s1 = OptionValue.override(Mutable, "override1")) { - assertEquals(Arrays.asList("override1", "original"), Mutable.getValues(null)); - try (OverrideScope s2 = OptionValue.override(Mutable, "override2")) { - assertEquals(Arrays.asList("override2", "override1", "original"), Mutable.getValues(null)); - } - } - } -} diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TypeUniverse.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TypeUniverse.java index f2a187effa8..c66068988da 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TypeUniverse.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TypeUniverse.java @@ -49,8 +49,8 @@ import java.util.stream.Collectors; import jdk.vm.ci.meta.ConstantReflectionProvider; import jdk.vm.ci.meta.JavaConstant; -import jdk.vm.ci.meta.JavaField; import jdk.vm.ci.meta.MetaAccessProvider; +import jdk.vm.ci.meta.ResolvedJavaField; import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.meta.TrustedInterface; import jdk.vm.ci.runtime.JVMCI; @@ -179,7 +179,7 @@ public class TypeUniverse { List res = new ArrayList<>(); for (Field field : fromClass.getDeclaredFields()) { if (isStatic(field.getModifiers()) && isFinal(field.getModifiers())) { - JavaField javaField = metaAccess.lookupJavaField(field); + ResolvedJavaField javaField = metaAccess.lookupJavaField(field); Object boxed = field.get(null); if (boxed instanceof JavaConstant) { res.add(new ConstantValue(javaField.format("%H.%n"), (JavaConstant) boxed, boxed)); From d1460d5224833ed365c38a04bcd04e740fcc15b6 Mon Sep 17 00:00:00 2001 From: Alejandro Murillo Date: Wed, 13 Jan 2016 12:45:36 -0800 Subject: [PATCH 146/146] 8146660: Resolve merge issue in resulting from sun.misc.VM move to jdk.internal.misc Reviewed-by: twisti, erikj, chegar --- hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk | 1 + .../src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk b/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk index 969330eec19..cfcf9329a3d 100644 --- a/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk +++ b/hotspot/make/gensrc/Gensrc-jdk.vm.ci.gmk @@ -69,6 +69,7 @@ $(GENSRC_DIR)/_gensrc_proc_done: $(PROC_SRCS) \ $(eval $(call ListPathsSafely,PROC_SRCS,$(@D)/_gensrc_proc_files)) $(JAVA_SMALL) $(NEW_JAVAC) \ -XDignore.symbol.file \ + -bootclasspath $(JDK_OUTPUTDIR)/modules/java.base \ -sourcepath $(SOURCEPATH) \ -implicit:none \ -proc:only \ diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java index bf7f255d4db..4077c0f40f4 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java +++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java @@ -49,7 +49,7 @@ import jdk.vm.ci.runtime.JVMCI; import jdk.vm.ci.runtime.JVMCIBackend; import jdk.vm.ci.runtime.JVMCICompiler; import jdk.vm.ci.service.Services; -import sun.misc.VM; +import jdk.internal.misc.VM; //JaCoCo Exclude